Closed Bug 678681 Opened 11 years ago Closed 10 years ago

IonMonkey: Implement TestVAndBranch

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dvander, Assigned: dvander)

References

Details

Attachments

(1 file)

We're failing a bunch of tests because of this and it shouldn't be hard to implement.
Attached patch patchSplinter Review
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+
http://hg.mozilla.org/projects/ionmonkey/rev/c9779aee0822 w/ nits
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.