Chromium Code Reviews| Index: src/compiler/js-typed-lowering.cc |
| diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc |
| index 4c1c272b808c4c32744a4b0f77c458a9a83325cf..32eca2a9e7dafb137a0ebb3cd1a796aa6feb8657 100644 |
| --- a/src/compiler/js-typed-lowering.cc |
| +++ b/src/compiler/js-typed-lowering.cc |
| @@ -211,7 +211,7 @@ class JSBinopReduction final { |
| } |
| Node* CreateFrameStateForLeftInput(Node* frame_state) { |
| - if (!FLAG_turbo_deoptimization) return nullptr; |
| + // TODO(bmeurer): if (!FLAG_turbo_deoptimization) return nullptr; |
|
Jarin
2015/04/23 08:33:08
Remove the TODO and perhaps consider short-circuit
Benedikt Meurer
2015/04/23 08:35:34
Done.
|
| FrameStateCallInfo state_info = |
| OpParameter<FrameStateCallInfo>(frame_state); |
| @@ -234,7 +234,7 @@ class JSBinopReduction final { |
| } |
| Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) { |
| - if (!FLAG_turbo_deoptimization) return nullptr; |
| + // TODO(bmeurer): if (!FLAG_turbo_deoptimization) return nullptr; |
|
Jarin
2015/04/23 08:33:08
Remove the TODO.
Benedikt Meurer
2015/04/23 08:35:35
Done.
|
| FrameStateCallInfo state_info = |
| OpParameter<FrameStateCallInfo>(frame_state); |
| @@ -279,13 +279,6 @@ class JSBinopReduction final { |
| Node* ConvertToNumber(Node* node, Node* frame_state) { |
| if (NodeProperties::GetBounds(node).upper->Is(Type::PlainPrimitive())) { |
| return ConvertPrimitiveToNumber(node); |
| - } else if (!FLAG_turbo_deoptimization) { |
| - // We cannot use ConvertToPrimitiveNumber here because we need context |
| - // for converting general values. |
| - Node* const n = graph()->NewNode(javascript()->ToNumber(), node, |
| - context(), effect(), control()); |
| - update_effect(n); |
| - return n; |
| } else { |
| Node* const n = |
| graph()->NewNode(javascript()->ToNumber(), node, context(), |
| @@ -325,9 +318,7 @@ Reduction JSTypedLowering::ReduceJSAdd(Node* node) { |
| } |
| if (r.NeitherInputCanBe(Type::StringOrReceiver())) { |
| // JSAdd(x:-string, y:-string) => NumberAdd(ToNumber(x), ToNumber(y)) |
| - Node* frame_state = FLAG_turbo_deoptimization |
| - ? NodeProperties::GetFrameStateInput(node, 1) |
| - : nullptr; |
| + Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| r.ConvertInputsToNumber(frame_state); |
| return r.ChangeToPureOperator(simplified()->NumberAdd(), Type::Number()); |
| } |
| @@ -351,9 +342,7 @@ Reduction JSTypedLowering::ReduceJSAdd(Node* node) { |
| Reduction JSTypedLowering::ReduceNumberBinop(Node* node, |
| const Operator* numberOp) { |
| JSBinopReduction r(this, node); |
| - Node* frame_state = FLAG_turbo_deoptimization |
| - ? NodeProperties::GetFrameStateInput(node, 1) |
| - : nullptr; |
| + Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| r.ConvertInputsToNumber(frame_state); |
| return r.ChangeToPureOperator(numberOp, Type::Number()); |
| } |
| @@ -361,9 +350,7 @@ Reduction JSTypedLowering::ReduceNumberBinop(Node* node, |
| Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { |
| JSBinopReduction r(this, node); |
| - Node* frame_state = FLAG_turbo_deoptimization |
| - ? NodeProperties::GetFrameStateInput(node, 1) |
| - : nullptr; |
| + Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| r.ConvertInputsToNumber(frame_state); |
| r.ConvertInputsToUI32(kSigned, kSigned); |
| return r.ChangeToPureOperator(intOp, Type::Integral32()); |
| @@ -700,11 +687,9 @@ Reduction JSTypedLowering::ReduceJSToNumber(Node* node) { |
| NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant()); |
| NodeProperties::ReplaceControlInput(node, graph()->start()); |
| NodeProperties::ReplaceEffectInput(node, graph()->start()); |
| - if (FLAG_turbo_deoptimization) { |
| - DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op())); |
| - NodeProperties::ReplaceFrameStateInput(node, 0, |
| - jsgraph()->EmptyFrameState()); |
| - } |
| + DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op())); |
| + NodeProperties::ReplaceFrameStateInput(node, 0, |
| + jsgraph()->EmptyFrameState()); |
| return Changed(node); |
| } |
| } |
| @@ -841,19 +826,11 @@ Reduction JSTypedLowering::ReduceJSStoreProperty(Node* node) { |
| if (number_reduction.Changed()) { |
| value = number_reduction.replacement(); |
| } else { |
| - DCHECK(FLAG_turbo_deoptimization == |
| - (OperatorProperties::GetFrameStateInputCount( |
| - javascript()->ToNumber()) == 1)); |
| - if (FLAG_turbo_deoptimization) { |
| - Node* frame_state_for_to_number = |
| - NodeProperties::GetFrameStateInput(node, 1); |
| - value = effect = |
| - graph()->NewNode(javascript()->ToNumber(), value, context, |
| - frame_state_for_to_number, effect, control); |
| - } else { |
| - value = effect = graph()->NewNode(javascript()->ToNumber(), value, |
| - context, effect, control); |
| - } |
| + Node* frame_state_for_to_number = |
| + NodeProperties::GetFrameStateInput(node, 1); |
| + value = effect = |
| + graph()->NewNode(javascript()->ToNumber(), value, context, |
| + frame_state_for_to_number, effect, control); |
| } |
| } |
| // For integer-typed arrays, convert to the integer type. |
| @@ -1036,15 +1013,9 @@ Node* JSTypedLowering::ConvertPrimitiveToNumber(Node* input) { |
| Reduction const reduction = ReduceJSToNumberInput(input); |
| if (reduction.Changed()) return reduction.replacement(); |
| // TODO(jarin) Use PlainPrimitiveToNumber once we have it. |
| - Node* const conversion = |
| - FLAG_turbo_deoptimization |
| - ? graph()->NewNode(javascript()->ToNumber(), input, |
| - jsgraph()->NoContextConstant(), |
| - jsgraph()->EmptyFrameState(), graph()->start(), |
| - graph()->start()) |
| - : graph()->NewNode(javascript()->ToNumber(), input, |
| - jsgraph()->NoContextConstant(), graph()->start(), |
| - graph()->start()); |
| + Node* const conversion = graph()->NewNode( |
| + javascript()->ToNumber(), input, jsgraph()->NoContextConstant(), |
| + jsgraph()->EmptyFrameState(), graph()->start(), graph()->start()); |
| InsertConversion(conversion); |
| return conversion; |
| } |