BaselineCompiler: Add optimized stubs for ToBool(double) and ToBool(object)

RESOLVED FIXED

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: djvj, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Bunch of octane tests hit this.
(Reporter)

Comment 1

6 years ago
Created attachment 719693 [details] [diff] [review]
Patch

Some refactoring of the testObjectTruthy code found in ion's CodeGenerator.cpp is involved.  If you think it's appropriate, I can check that in separately to inbound, and push the baseline-specific changes after that gets merged back.
Attachment #719693 - Flags: review?(jdemooij)
Comment on attachment 719693 [details] [diff] [review]
Patch

Review of attachment 719693 [details] [diff] [review]:
-----------------------------------------------------------------

(In reply to Kannan Vijayan [:djvj] from comment #1)
> Some refactoring of the testObjectTruthy code found in ion's
> CodeGenerator.cpp is involved.  If you think it's appropriate, I can check
> that in separately to inbound, and push the baseline-specific changes after
> that gets merged back.

Should be fine to land on IonMonkey. I don't expect changes to this code in the coming weeks, and even if there are it should be easy to merge them.

::: js/src/ion/BaselineIC.cpp
@@ +1909,5 @@
> +    Register objReg = masm.extractObject(R0, ExtractTemp0);
> +    Register scratch = R1.scratchReg();
> +    masm.branchTestObjectTruthy(Assembler::NotEqual, objReg, scratch, &ifFalse, &slowPath);
> +
> +    // If object doesn't emulate undefined, it evaulates to true.

Nit: typo, evaluates
Attachment #719693 - Flags: review?(jdemooij) → review+
(Reporter)

Comment 3

6 years ago
Pushed with a minor fix to ToBool(Object) - wasn't notting the result of the EmulatesUndefined ABI call before boxing:
https://hg.mozilla.org/projects/ionmonkey/rev/80642ec465bf
Waiting for tbpl before closing
(Reporter)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.