| 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/js-typed-lowering.h" | 5 #include "src/compiler/js-typed-lowering.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
| 9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
| 10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 if (!value_type->Is(Type::Number())) { | 1116 if (!value_type->Is(Type::Number())) { |
| 1117 Reduction number_reduction = ReduceJSToNumberInput(value); | 1117 Reduction number_reduction = ReduceJSToNumberInput(value); |
| 1118 if (number_reduction.Changed()) { | 1118 if (number_reduction.Changed()) { |
| 1119 value = number_reduction.replacement(); | 1119 value = number_reduction.replacement(); |
| 1120 } else { | 1120 } else { |
| 1121 Node* frame_state_for_to_number = | 1121 Node* frame_state_for_to_number = |
| 1122 NodeProperties::FindFrameStateBefore(node); | 1122 NodeProperties::FindFrameStateBefore(node); |
| 1123 value = effect = | 1123 value = effect = |
| 1124 graph()->NewNode(javascript()->ToNumber(), value, context, | 1124 graph()->NewNode(javascript()->ToNumber(), value, context, |
| 1125 frame_state_for_to_number, effect, control); | 1125 frame_state_for_to_number, effect, control); |
| 1126 control = graph()->NewNode(common()->IfSuccess(), value); |
| 1126 } | 1127 } |
| 1127 } | 1128 } |
| 1128 // Check if we can avoid the bounds check. | 1129 // Check if we can avoid the bounds check. |
| 1129 if (key_type->Min() >= 0 && key_type->Max() < array->length_value()) { | 1130 if (key_type->Min() >= 0 && key_type->Max() < array->length_value()) { |
| 1130 RelaxControls(node); | 1131 RelaxControls(node); |
| 1131 node->ReplaceInput(0, buffer); | 1132 node->ReplaceInput(0, buffer); |
| 1132 DCHECK_EQ(key, node->InputAt(1)); | 1133 DCHECK_EQ(key, node->InputAt(1)); |
| 1133 node->ReplaceInput(2, value); | 1134 node->ReplaceInput(2, value); |
| 1134 node->ReplaceInput(3, effect); | 1135 node->ReplaceInput(3, effect); |
| 1135 node->ReplaceInput(4, control); | 1136 node->ReplaceInput(4, control); |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2157 } | 2158 } |
| 2158 | 2159 |
| 2159 | 2160 |
| 2160 CompilationDependencies* JSTypedLowering::dependencies() const { | 2161 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 2161 return dependencies_; | 2162 return dependencies_; |
| 2162 } | 2163 } |
| 2163 | 2164 |
| 2164 } // namespace compiler | 2165 } // namespace compiler |
| 2165 } // namespace internal | 2166 } // namespace internal |
| 2166 } // namespace v8 | 2167 } // namespace v8 |
| OLD | NEW |