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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 Node* context = NodeProperties::GetContextInput(node); | 1099 Node* context = NodeProperties::GetContextInput(node); |
1100 Node* effect = NodeProperties::GetEffectInput(node); | 1100 Node* effect = NodeProperties::GetEffectInput(node); |
1101 Node* control = NodeProperties::GetControlInput(node); | 1101 Node* control = NodeProperties::GetControlInput(node); |
1102 // Convert to a number first. | 1102 // Convert to a number first. |
1103 if (!value_type->Is(Type::NumberOrUndefined())) { | 1103 if (!value_type->Is(Type::NumberOrUndefined())) { |
1104 Reduction number_reduction = ReduceJSToNumberInput(value); | 1104 Reduction number_reduction = ReduceJSToNumberInput(value); |
1105 if (number_reduction.Changed()) { | 1105 if (number_reduction.Changed()) { |
1106 value = number_reduction.replacement(); | 1106 value = number_reduction.replacement(); |
1107 } else { | 1107 } else { |
1108 Node* frame_state_for_to_number = | 1108 Node* frame_state_for_to_number = |
1109 NodeProperties::GetFrameStateInput(node, 1); | 1109 NodeProperties::FindFrameStateBefore(node); |
1110 value = effect = | 1110 value = effect = |
1111 graph()->NewNode(javascript()->ToNumber(), value, context, | 1111 graph()->NewNode(javascript()->ToNumber(), value, context, |
1112 frame_state_for_to_number, effect, control); | 1112 frame_state_for_to_number, effect, control); |
1113 } | 1113 } |
1114 } | 1114 } |
1115 // Check if we can avoid the bounds check. | 1115 // Check if we can avoid the bounds check. |
1116 if (key_type->Min() >= 0 && key_type->Max() < array->length_value()) { | 1116 if (key_type->Min() >= 0 && key_type->Max() < array->length_value()) { |
1117 RelaxControls(node); | 1117 RelaxControls(node); |
1118 node->ReplaceInput(0, buffer); | 1118 node->ReplaceInput(0, buffer); |
1119 DCHECK_EQ(key, node->InputAt(1)); | 1119 DCHECK_EQ(key, node->InputAt(1)); |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 } | 1973 } |
1974 | 1974 |
1975 | 1975 |
1976 CompilationDependencies* JSTypedLowering::dependencies() const { | 1976 CompilationDependencies* JSTypedLowering::dependencies() const { |
1977 return dependencies_; | 1977 return dependencies_; |
1978 } | 1978 } |
1979 | 1979 |
1980 } // namespace compiler | 1980 } // namespace compiler |
1981 } // namespace internal | 1981 } // namespace internal |
1982 } // namespace v8 | 1982 } // namespace v8 |
OLD | NEW |