Commit 65d28d70 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] Desugar JSUnaryNot(x) to Select(x, false, true).

Port 411c5b7f

Original commit message:
    Also remove the ResultMode from ToBooleanStub and always return true or
    false and use the same mechanism in fullcodegen.  This is in preparation
    for adding ToBoolean hints to TurboFan.

    Drive-by-fix: We can use the power of the ToBooleanIC in TurboFan now
    that the ResultMode is gone (and the runtime always returns true or
    false from the miss handler).

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4583
LOG=n

Review URL: https://codereview.chromium.org/1490363003

Cr-Commit-Position: refs/heads/master@{#32531}
parent c6323632
...@@ -648,8 +648,8 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* if_true, ...@@ -648,8 +648,8 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* if_true,
Label* if_false, Label* fall_through) { Label* if_false, Label* fall_through) {
Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic, condition->test_id());
__ cmpi(result_register(), Operand::Zero()); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(ne, if_true, if_false, fall_through); Split(eq, if_true, if_false, fall_through);
} }
...@@ -2030,8 +2030,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { ...@@ -2030,8 +2030,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
CallLoadIC(NOT_INSIDE_TYPEOF); // r0=result.done CallLoadIC(NOT_INSIDE_TYPEOF); // r0=result.done
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
CallIC(bool_ic); CallIC(bool_ic);
__ cmpi(r3, Operand::Zero()); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
__ beq(&l_try); __ bne(&l_try);
// result.value // result.value
__ pop(load_receiver); // result __ pop(load_receiver); // result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment