From 63dd16849f5cf2b7c9c21dc073d6d470273b016c Mon Sep 17 00:00:00 2001 From: bmeurer Date: Thu, 11 Aug 2016 22:08:19 -0700 Subject: [PATCH] [turbofan] The PlainPrimitiveToNumber operator cannot have side effects. An invocation of the ToNumber builtin resulting from lowering the PlainPrimitiveToNumber cannot have any observable side effects and thus the builtin call itself is eliminatable. R=yangguo@chromium.org Review-Url: https://codereview.chromium.org/2239923004 Cr-Commit-Position: refs/heads/master@{#38593} --- src/compiler/effect-control-linearizer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc index 3a8d78829e..a7eb49a7f8 100644 --- a/src/compiler/effect-control-linearizer.cc +++ b/src/compiler/effect-control-linearizer.cc @@ -2524,7 +2524,7 @@ EffectControlLinearizer::LowerPlainPrimitiveToNumber(Node* node, Node* effect, Node* value = node->InputAt(0); Node* result = effect = graph()->NewNode(ToNumberOperator(), jsgraph()->ToNumberBuiltinConstant(), - value, jsgraph()->NoContextConstant(), effect, control); + value, jsgraph()->NoContextConstant(), effect); return ValueEffectControl(result, effect, control); } @@ -2547,7 +2547,7 @@ EffectControlLinearizer::LowerPlainPrimitiveToWord32(Node* node, Node* effect, { vfalse0 = efalse0 = graph()->NewNode( ToNumberOperator(), jsgraph()->ToNumberBuiltinConstant(), value, - jsgraph()->NoContextConstant(), efalse0, if_false0); + jsgraph()->NoContextConstant(), efalse0); Node* check1 = ObjectIsSmi(vfalse0); Node* branch1 = graph()->NewNode(common()->Branch(), check1, if_false0); @@ -2603,7 +2603,7 @@ EffectControlLinearizer::LowerPlainPrimitiveToFloat64(Node* node, Node* effect, { vfalse0 = efalse0 = graph()->NewNode( ToNumberOperator(), jsgraph()->ToNumberBuiltinConstant(), value, - jsgraph()->NoContextConstant(), efalse0, if_false0); + jsgraph()->NoContextConstant(), efalse0); Node* check1 = ObjectIsSmi(vfalse0); Node* branch1 = graph()->NewNode(common()->Branch(), check1, if_false0); @@ -3307,7 +3307,7 @@ Operator const* EffectControlLinearizer::ToNumberOperator() { CallDescriptor::Flags flags = CallDescriptor::kNoFlags; CallDescriptor* desc = Linkage::GetStubCallDescriptor( isolate(), graph()->zone(), callable.descriptor(), 0, flags, - Operator::kNoThrow); + Operator::kEliminatable); to_number_operator_.set(common()->Call(desc)); } return to_number_operator_.get();