IonMonkey: Implement TestVAndBranch

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dvander, Assigned: dvander)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
We're failing a bunch of tests because of this and it shouldn't be hard to implement.
(Assignee)

Comment 1

6 years ago
Created attachment 555670 [details] [diff] [review]
patch
Attachment #555670 - Flags: review?(sstangl)
Comment on attachment 555670 [details] [diff] [review]
patch

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

::: js/src/ion/shared/MacroAssembler-x86-shared.h
@@ +78,5 @@
>          jmp(label);
>      }
>  
> +    // cond: NonZero = truthy, Zero = falsey
> +    Condition testDoubleTruthy(Condition cond, const FloatRegister &reg) {

JS_ASSERT(cond == Assembler::NonZero || cond == Assembler::Zero);

Or even better:

Condition testDoubleTruthinessIs(bool truthiness, const FloatRegister &reg) {

::: js/src/ion/x64/CodeGenerator-x64.cpp
@@ +176,5 @@
> +    return ScratchReg;
> +}
> +
> +Assembler::Condition
> +CodeGeneratorX64::testStringTruthy(Assembler::Condition cond, const ValueOperand &value)

bool

::: js/src/ion/x64/MacroAssembler-x64.h
@@ +232,5 @@
>          loadDouble(*dp, dest);
>      }
> +
> +    // Equal = true, NotEqual = false
> +    Condition testInt32Truthy(Condition cond, const ValueOperand &operand) {

bool truthiness,

@@ +237,5 @@
> +        JS_ASSERT(cond == Zero || cond == NonZero);
> +        testl(operand.valueReg(), operand.valueReg());
> +        return cond;
> +    }
> +    Condition testBooleanTruthy(Condition cond, const ValueOperand &operand) {

bool truthiness,

::: js/src/ion/x86/CodeGenerator-x86.cpp
@@ +234,5 @@
> +    return value.typeReg();
> +}
> +
> +Assembler::Condition
> +CodeGeneratorX86::testStringTruthy(Assembler::Condition cond, const ValueOperand &value)

testStringTruthiness(bool truthiness, const ValueOperand &value) {

::: js/src/ion/x86/MacroAssembler-x86.h
@@ +190,5 @@
>          movsd(dp, dest);
>      }
> +
> +    // cond: NonZero = truthy, Zero = falsey
> +    Condition testInt32Truthy(Condition cond, const ValueOperand &operand) {

bool

@@ +195,5 @@
> +        JS_ASSERT(cond == Zero || cond == NonZero);
> +        testl(operand.payloadReg(), operand.payloadReg());
> +        return cond;
> +    }
> +    Condition testBooleanTruthy(Condition cond, const ValueOperand &operand) {

bool
Attachment #555670 - Flags: review?(sstangl) → review+
(Assignee)

Comment 3

6 years ago
http://hg.mozilla.org/projects/ionmonkey/rev/c9779aee0822 w/ nits
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.