Commit 5c43818e authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Improve AstGraphBuilder::BuildToBoolean() for heap constants.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26082}
parent a9d0d234
...@@ -2126,10 +2126,7 @@ Node* AstGraphBuilder::BuildToBoolean(Node* input) { ...@@ -2126,10 +2126,7 @@ Node* AstGraphBuilder::BuildToBoolean(Node* input) {
return jsgraph_->BooleanConstant(!NumberMatcher(input).Is(0)); return jsgraph_->BooleanConstant(!NumberMatcher(input).Is(0));
case IrOpcode::kHeapConstant: { case IrOpcode::kHeapConstant: {
Handle<Object> object = HeapObjectMatcher<Object>(input).Value().handle(); Handle<Object> object = HeapObjectMatcher<Object>(input).Value().handle();
if (object->IsTrue()) return jsgraph_->TrueConstant(); return jsgraph_->BooleanConstant(object->BooleanValue());
if (object->IsFalse()) return jsgraph_->FalseConstant();
// TODO(turbofan): other constants.
break;
} }
default: default:
break; break;
......
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