| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, frame_state->InputAt(0), |
| 291 frame_state->InputAt(1), frame_state->InputAt(2), | 291 frame_state->InputAt(1), frame_state->InputAt(2), |
| 292 frame_state->InputAt(3), frame_state->InputAt(4)); | 292 frame_state->InputAt(3), frame_state->InputAt(4), |
| 293 frame_state->InputAt(5)); |
| 293 } | 294 } |
| 294 | 295 |
| 295 Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) { | 296 Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) { |
| 296 FrameStateCallInfo state_info = | 297 FrameStateCallInfo state_info = |
| 297 OpParameter<FrameStateCallInfo>(frame_state); | 298 OpParameter<FrameStateCallInfo>(frame_state); |
| 298 | 299 |
| 299 if (state_info.bailout_id() == BailoutId::None()) { | 300 if (state_info.bailout_id() == BailoutId::None()) { |
| 300 // Dummy frame state => just leave it as is. | 301 // Dummy frame state => just leave it as is. |
| 301 return frame_state; | 302 return frame_state; |
| 302 } | 303 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 319 new_values[i] = converted_left; | 320 new_values[i] = converted_left; |
| 320 } else { | 321 } else { |
| 321 new_values[i] = stack->InputAt(i); | 322 new_values[i] = stack->InputAt(i); |
| 322 } | 323 } |
| 323 } | 324 } |
| 324 Node* new_stack = | 325 Node* new_stack = |
| 325 graph()->NewNode(stack->op(), stack->InputCount(), &new_values.front()); | 326 graph()->NewNode(stack->op(), stack->InputCount(), &new_values.front()); |
| 326 | 327 |
| 327 return graph()->NewNode(op, frame_state->InputAt(0), | 328 return graph()->NewNode(op, frame_state->InputAt(0), |
| 328 frame_state->InputAt(1), new_stack, | 329 frame_state->InputAt(1), new_stack, |
| 329 frame_state->InputAt(3), frame_state->InputAt(4)); | 330 frame_state->InputAt(3), frame_state->InputAt(4), |
| 331 frame_state->InputAt(5)); |
| 330 } | 332 } |
| 331 | 333 |
| 332 Node* ConvertPlainPrimitiveToNumber(Node* node) { | 334 Node* ConvertPlainPrimitiveToNumber(Node* node) { |
| 333 DCHECK(NodeProperties::GetBounds(node).upper->Is(Type::PlainPrimitive())); | 335 DCHECK(NodeProperties::GetBounds(node).upper->Is(Type::PlainPrimitive())); |
| 334 // Avoid inserting too many eager ToNumber() operations. | 336 // Avoid inserting too many eager ToNumber() operations. |
| 335 Reduction const reduction = lowering_->ReduceJSToNumberInput(node); | 337 Reduction const reduction = lowering_->ReduceJSToNumberInput(node); |
| 336 if (reduction.Changed()) return reduction.replacement(); | 338 if (reduction.Changed()) return reduction.replacement(); |
| 337 // TODO(jarin) Use PlainPrimitiveToNumber once we have it. | 339 // TODO(jarin) Use PlainPrimitiveToNumber once we have it. |
| 338 return graph()->NewNode( | 340 return graph()->NewNode( |
| 339 javascript()->ToNumber(), node, jsgraph()->NoContextConstant(), | 341 javascript()->ToNumber(), node, jsgraph()->NoContextConstant(), |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 } | 1215 } |
| 1214 | 1216 |
| 1215 | 1217 |
| 1216 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1218 MachineOperatorBuilder* JSTypedLowering::machine() const { |
| 1217 return jsgraph()->machine(); | 1219 return jsgraph()->machine(); |
| 1218 } | 1220 } |
| 1219 | 1221 |
| 1220 } // namespace compiler | 1222 } // namespace compiler |
| 1221 } // namespace internal | 1223 } // namespace internal |
| 1222 } // namespace v8 | 1224 } // namespace v8 |
| OLD | NEW |