| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
| 6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
| 7 #include "src/compiler/js-typed-lowering.h" | 7 #include "src/compiler/js-typed-lowering.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 if (NodeProperties::GetContextInput(node) != | 639 if (NodeProperties::GetContextInput(node) != |
| 640 jsgraph()->NoContextConstant() || | 640 jsgraph()->NoContextConstant() || |
| 641 NodeProperties::GetEffectInput(node) != graph()->start() || | 641 NodeProperties::GetEffectInput(node) != graph()->start() || |
| 642 NodeProperties::GetControlInput(node) != graph()->start()) { | 642 NodeProperties::GetControlInput(node) != graph()->start()) { |
| 643 // JSToNumber(x:plain-primitive,context,effect,control) | 643 // JSToNumber(x:plain-primitive,context,effect,control) |
| 644 // => JSToNumber(x,no-context,start,start) | 644 // => JSToNumber(x,no-context,start,start) |
| 645 RelaxEffectsAndControls(node); | 645 RelaxEffectsAndControls(node); |
| 646 NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant()); | 646 NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant()); |
| 647 NodeProperties::ReplaceControlInput(node, graph()->start()); | 647 NodeProperties::ReplaceControlInput(node, graph()->start()); |
| 648 NodeProperties::ReplaceEffectInput(node, graph()->start()); | 648 NodeProperties::ReplaceEffectInput(node, graph()->start()); |
| 649 if (OperatorProperties::HasFrameStateInput(node->op())) { | 649 if (FLAG_turbo_deoptimization) { |
| 650 NodeProperties::ReplaceFrameStateInput(node, | 650 DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op())); |
| 651 NodeProperties::ReplaceFrameStateInput(node, 0, |
| 651 jsgraph()->EmptyFrameState()); | 652 jsgraph()->EmptyFrameState()); |
| 652 } | 653 } |
| 653 return Changed(node); | 654 return Changed(node); |
| 654 } | 655 } |
| 655 } | 656 } |
| 656 return NoChange(); | 657 return NoChange(); |
| 657 } | 658 } |
| 658 | 659 |
| 659 | 660 |
| 660 Reduction JSTypedLowering::ReduceJSToStringInput(Node* input) { | 661 Reduction JSTypedLowering::ReduceJSToStringInput(Node* input) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 Node* length = jsgraph()->Constant(byte_length); | 763 Node* length = jsgraph()->Constant(byte_length); |
| 763 Node* context = NodeProperties::GetContextInput(node); | 764 Node* context = NodeProperties::GetContextInput(node); |
| 764 Node* effect = NodeProperties::GetEffectInput(node); | 765 Node* effect = NodeProperties::GetEffectInput(node); |
| 765 Node* control = NodeProperties::GetControlInput(node); | 766 Node* control = NodeProperties::GetControlInput(node); |
| 766 // Convert to a number first. | 767 // Convert to a number first. |
| 767 if (!value_type->Is(Type::Number())) { | 768 if (!value_type->Is(Type::Number())) { |
| 768 Reduction number_reduction = ReduceJSToNumberInput(value); | 769 Reduction number_reduction = ReduceJSToNumberInput(value); |
| 769 if (number_reduction.Changed()) { | 770 if (number_reduction.Changed()) { |
| 770 value = number_reduction.replacement(); | 771 value = number_reduction.replacement(); |
| 771 } else { | 772 } else { |
| 772 if (OperatorProperties::HasFrameStateInput( | 773 DCHECK(FLAG_turbo_deoptimization == |
| 773 javascript()->ToNumber())) { | 774 (OperatorProperties::GetFrameStateInputCount( |
| 775 javascript()->ToNumber()) == 1)); |
| 776 if (FLAG_turbo_deoptimization) { |
| 774 value = effect = | 777 value = effect = |
| 775 graph()->NewNode(javascript()->ToNumber(), value, context, | 778 graph()->NewNode(javascript()->ToNumber(), value, context, |
| 776 jsgraph()->EmptyFrameState(), effect, control); | 779 jsgraph()->EmptyFrameState(), effect, control); |
| 777 } else { | 780 } else { |
| 778 value = effect = graph()->NewNode(javascript()->ToNumber(), value, | 781 value = effect = graph()->NewNode(javascript()->ToNumber(), value, |
| 779 context, effect, control); | 782 context, effect, control); |
| 780 } | 783 } |
| 781 } | 784 } |
| 782 } | 785 } |
| 783 // For integer-typed arrays, convert to the integer type. | 786 // For integer-typed arrays, convert to the integer type. |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 } | 1021 } |
| 1019 | 1022 |
| 1020 | 1023 |
| 1021 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1024 MachineOperatorBuilder* JSTypedLowering::machine() const { |
| 1022 return jsgraph()->machine(); | 1025 return jsgraph()->machine(); |
| 1023 } | 1026 } |
| 1024 | 1027 |
| 1025 } // namespace compiler | 1028 } // namespace compiler |
| 1026 } // namespace internal | 1029 } // namespace internal |
| 1027 } // namespace v8 | 1030 } // namespace v8 |
| OLD | NEW |