| 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/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-typed-lowering.h" | 8 #include "src/compiler/js-typed-lowering.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return frame_state; | 280 return frame_state; |
| 281 } | 281 } |
| 282 | 282 |
| 283 // Here, we smash the result of the conversion into the slot just below | 283 // Here, we smash the result of the conversion into the slot just below |
| 284 // the stack top. This is the slot that full code uses to store the | 284 // the stack top. This is the slot that full code uses to store the |
| 285 // left operand. | 285 // left operand. |
| 286 const Operator* op = jsgraph()->common()->FrameState( | 286 const Operator* op = jsgraph()->common()->FrameState( |
| 287 state_info.type(), state_info.bailout_id(), | 287 state_info.type(), state_info.bailout_id(), |
| 288 OutputFrameStateCombine::PokeAt(1)); | 288 OutputFrameStateCombine::PokeAt(1)); |
| 289 | 289 |
| 290 return graph()->NewNode(op, frame_state->InputAt(0), | 290 return graph()->NewNode(op, |
| 291 frame_state->InputAt(1), frame_state->InputAt(2), | 291 frame_state->InputAt(kFrameStateParametersInput), |
| 292 frame_state->InputAt(3), frame_state->InputAt(4), | 292 frame_state->InputAt(kFrameStateLocalsInput), |
| 293 frame_state->InputAt(5)); | 293 frame_state->InputAt(kFrameStateStackInput), |
| 294 frame_state->InputAt(kFrameStateContextInput), |
| 295 frame_state->InputAt(kFrameStateFunctionInput), |
| 296 frame_state->InputAt(kFrameStateOuterStateInput)); |
| 294 } | 297 } |
| 295 | 298 |
| 296 Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) { | 299 Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) { |
| 297 FrameStateCallInfo state_info = | 300 FrameStateCallInfo state_info = |
| 298 OpParameter<FrameStateCallInfo>(frame_state); | 301 OpParameter<FrameStateCallInfo>(frame_state); |
| 299 | 302 |
| 300 if (state_info.bailout_id() == BailoutId::None()) { | 303 if (state_info.bailout_id() == BailoutId::None()) { |
| 301 // Dummy frame state => just leave it as is. | 304 // Dummy frame state => just leave it as is. |
| 302 return frame_state; | 305 return frame_state; |
| 303 } | 306 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 318 for (int i = 0; i < stack->InputCount(); i++) { | 321 for (int i = 0; i < stack->InputCount(); i++) { |
| 319 if (i == stack->InputCount() - 2) { | 322 if (i == stack->InputCount() - 2) { |
| 320 new_values[i] = converted_left; | 323 new_values[i] = converted_left; |
| 321 } else { | 324 } else { |
| 322 new_values[i] = stack->InputAt(i); | 325 new_values[i] = stack->InputAt(i); |
| 323 } | 326 } |
| 324 } | 327 } |
| 325 Node* new_stack = | 328 Node* new_stack = |
| 326 graph()->NewNode(stack->op(), stack->InputCount(), &new_values.front()); | 329 graph()->NewNode(stack->op(), stack->InputCount(), &new_values.front()); |
| 327 | 330 |
| 328 return graph()->NewNode(op, frame_state->InputAt(0), | 331 return graph()->NewNode( |
| 329 frame_state->InputAt(1), new_stack, | 332 op, frame_state->InputAt(kFrameStateParametersInput), |
| 330 frame_state->InputAt(3), frame_state->InputAt(4), | 333 frame_state->InputAt(kFrameStateLocalsInput), new_stack, |
| 331 frame_state->InputAt(5)); | 334 frame_state->InputAt(kFrameStateContextInput), |
| 335 frame_state->InputAt(kFrameStateFunctionInput), |
| 336 frame_state->InputAt(kFrameStateOuterStateInput)); |
| 332 } | 337 } |
| 333 | 338 |
| 334 Node* ConvertPlainPrimitiveToNumber(Node* node) { | 339 Node* ConvertPlainPrimitiveToNumber(Node* node) { |
| 335 DCHECK(NodeProperties::GetBounds(node).upper->Is(Type::PlainPrimitive())); | 340 DCHECK(NodeProperties::GetBounds(node).upper->Is(Type::PlainPrimitive())); |
| 336 // Avoid inserting too many eager ToNumber() operations. | 341 // Avoid inserting too many eager ToNumber() operations. |
| 337 Reduction const reduction = lowering_->ReduceJSToNumberInput(node); | 342 Reduction const reduction = lowering_->ReduceJSToNumberInput(node); |
| 338 if (reduction.Changed()) return reduction.replacement(); | 343 if (reduction.Changed()) return reduction.replacement(); |
| 339 // TODO(jarin) Use PlainPrimitiveToNumber once we have it. | 344 // TODO(jarin) Use PlainPrimitiveToNumber once we have it. |
| 340 return graph()->NewNode( | 345 return graph()->NewNode( |
| 341 javascript()->ToNumber(), node, jsgraph()->NoContextConstant(), | 346 javascript()->ToNumber(), node, jsgraph()->NoContextConstant(), |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 } | 1220 } |
| 1216 | 1221 |
| 1217 | 1222 |
| 1218 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1223 MachineOperatorBuilder* JSTypedLowering::machine() const { |
| 1219 return jsgraph()->machine(); | 1224 return jsgraph()->machine(); |
| 1220 } | 1225 } |
| 1221 | 1226 |
| 1222 } // namespace compiler | 1227 } // namespace compiler |
| 1223 } // namespace internal | 1228 } // namespace internal |
| 1224 } // namespace v8 | 1229 } // namespace v8 |
| OLD | NEW |