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/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/ast-numbering.h" | 8 #include "src/ast/ast-numbering.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 NeedsImplicitReceiver(function, info_->isolate())) { | 445 NeedsImplicitReceiver(function, info_->isolate())) { |
446 Node* effect = NodeProperties::GetEffectInput(node); | 446 Node* effect = NodeProperties::GetEffectInput(node); |
447 Node* context = NodeProperties::GetContextInput(node); | 447 Node* context = NodeProperties::GetContextInput(node); |
448 Node* create = jsgraph_->graph()->NewNode(jsgraph_->javascript()->Create(), | 448 Node* create = jsgraph_->graph()->NewNode(jsgraph_->javascript()->Create(), |
449 call.target(), call.new_target(), | 449 call.target(), call.new_target(), |
450 context, frame_state, effect); | 450 context, frame_state, effect); |
451 NodeProperties::ReplaceEffectInput(node, create); | 451 NodeProperties::ReplaceEffectInput(node, create); |
452 // Insert a check of the return value to determine whether the return value | 452 // Insert a check of the return value to determine whether the return value |
453 // or the implicit receiver should be selected as a result of the call. | 453 // or the implicit receiver should be selected as a result of the call. |
454 Node* check = jsgraph_->graph()->NewNode( | 454 Node* check = jsgraph_->graph()->NewNode( |
455 jsgraph_->javascript()->CallRuntime(Runtime::kInlineIsSpecObject, 1), | 455 jsgraph_->javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1), |
456 node, context, node, start); | 456 node, context, node, start); |
457 Node* select = jsgraph_->graph()->NewNode( | 457 Node* select = jsgraph_->graph()->NewNode( |
458 jsgraph_->common()->Select(kMachAnyTagged), check, node, create); | 458 jsgraph_->common()->Select(kMachAnyTagged), check, node, create); |
459 NodeProperties::ReplaceUses(node, select, check, node, node); | 459 NodeProperties::ReplaceUses(node, select, check, node, node); |
460 NodeProperties::ReplaceValueInput(select, node, 1); | 460 NodeProperties::ReplaceValueInput(select, node, 1); |
461 NodeProperties::ReplaceValueInput(check, node, 0); | 461 NodeProperties::ReplaceValueInput(check, node, 0); |
462 NodeProperties::ReplaceEffectInput(check, node); | 462 NodeProperties::ReplaceEffectInput(check, node); |
463 receiver = create; // The implicit receiver. | 463 receiver = create; // The implicit receiver. |
464 } | 464 } |
465 | 465 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 node, frame_state, call.formal_arguments(), | 510 node, frame_state, call.formal_arguments(), |
511 FrameStateType::kArgumentsAdaptor, info.shared_info()); | 511 FrameStateType::kArgumentsAdaptor, info.shared_info()); |
512 } | 512 } |
513 | 513 |
514 return InlineCall(node, new_target, context, frame_state, start, end); | 514 return InlineCall(node, new_target, context, frame_state, start, end); |
515 } | 515 } |
516 | 516 |
517 } // namespace compiler | 517 } // namespace compiler |
518 } // namespace internal | 518 } // namespace internal |
519 } // namespace v8 | 519 } // namespace v8 |
OLD | NEW |