| 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-inlining.h" | 5 #include "src/compiler/js-inlining.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 // Insert argument adaptor frame if required. The callees formal parameter | 414 // Insert argument adaptor frame if required. The callees formal parameter |
| 415 // count (i.e. value outputs of start node minus target, receiver & context) | 415 // count (i.e. value outputs of start node minus target, receiver & context) |
| 416 // have to match the number of arguments passed to the call. | 416 // have to match the number of arguments passed to the call. |
| 417 DCHECK_EQ(static_cast<int>(parameter_count), | 417 DCHECK_EQ(static_cast<int>(parameter_count), |
| 418 start->op()->ValueOutputCount() - 3); | 418 start->op()->ValueOutputCount() - 3); |
| 419 if (call.formal_arguments() != parameter_count) { | 419 if (call.formal_arguments() != parameter_count) { |
| 420 frame_state = CreateArgumentsAdaptorFrameState(&call, info.shared_info()); | 420 frame_state = CreateArgumentsAdaptorFrameState(&call, info.shared_info()); |
| 421 } | 421 } |
| 422 | 422 |
| 423 // Insert a JSConvertReceiver node for sloppy callees. Note that the context |
| 424 // passed into this node has to be the callees context (loaded above). |
| 425 if (is_sloppy(info.language_mode()) && !function->shared()->native()) { |
| 426 const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); |
| 427 Node* effect = NodeProperties::GetEffectInput(node); |
| 428 Node* convert = jsgraph_->graph()->NewNode( |
| 429 jsgraph_->javascript()->ConvertReceiver(p.convert_mode()), |
| 430 call.receiver(), context, frame_state, effect, start); |
| 431 NodeProperties::ReplaceValueInput(node, convert, 1); |
| 432 NodeProperties::ReplaceEffectInput(node, convert); |
| 433 } |
| 434 |
| 423 return InlineCall(node, context, frame_state, start, end); | 435 return InlineCall(node, context, frame_state, start, end); |
| 424 } | 436 } |
| 425 | 437 |
| 426 } // namespace compiler | 438 } // namespace compiler |
| 427 } // namespace internal | 439 } // namespace internal |
| 428 } // namespace v8 | 440 } // namespace v8 |
| OLD | NEW |