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-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 583 |
584 Node* frame_state = call.frame_state(); | 584 Node* frame_state = call.frame_state(); |
585 Node* new_target = jsgraph()->UndefinedConstant(); | 585 Node* new_target = jsgraph()->UndefinedConstant(); |
586 | 586 |
587 // Inline {JSCallConstruct} requires some additional magic. | 587 // Inline {JSCallConstruct} requires some additional magic. |
588 if (node->opcode() == IrOpcode::kJSCallConstruct) { | 588 if (node->opcode() == IrOpcode::kJSCallConstruct) { |
589 // Insert nodes around the call that model the behavior required for a | 589 // Insert nodes around the call that model the behavior required for a |
590 // constructor dispatch (allocate implicit receiver and check return value). | 590 // constructor dispatch (allocate implicit receiver and check return value). |
591 // This models the behavior usually accomplished by our {JSConstructStub}. | 591 // This models the behavior usually accomplished by our {JSConstructStub}. |
592 // Note that the context has to be the callers context (input to call node). | 592 // Note that the context has to be the callers context (input to call node). |
593 Node* receiver = jsgraph()->UndefinedConstant(); // Implicit receiver. | 593 Node* receiver = jsgraph()->TheHoleConstant(); // Implicit receiver. |
594 if (NeedsImplicitReceiver(shared_info)) { | 594 if (NeedsImplicitReceiver(shared_info)) { |
595 Node* frame_state_before = NodeProperties::FindFrameStateBefore(node); | 595 Node* frame_state_before = NodeProperties::FindFrameStateBefore(node); |
596 Node* effect = NodeProperties::GetEffectInput(node); | 596 Node* effect = NodeProperties::GetEffectInput(node); |
597 Node* context = NodeProperties::GetContextInput(node); | 597 Node* context = NodeProperties::GetContextInput(node); |
598 Node* create = graph()->NewNode(javascript()->Create(), call.target(), | 598 Node* create = graph()->NewNode(javascript()->Create(), call.target(), |
599 call.new_target(), context, | 599 call.new_target(), context, |
600 frame_state_before, effect); | 600 frame_state_before, effect); |
601 NodeProperties::ReplaceEffectInput(node, create); | 601 NodeProperties::ReplaceEffectInput(node, create); |
602 // Insert a check of the return value to determine whether the return | 602 // Insert a check of the return value to determine whether the return |
603 // value or the implicit receiver should be selected as a result of the | 603 // value or the implicit receiver should be selected as a result of the |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 691 |
692 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 692 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
693 | 693 |
694 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 694 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
695 return jsgraph()->simplified(); | 695 return jsgraph()->simplified(); |
696 } | 696 } |
697 | 697 |
698 } // namespace compiler | 698 } // namespace compiler |
699 } // namespace internal | 699 } // namespace internal |
700 } // namespace v8 | 700 } // namespace v8 |
OLD | NEW |