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/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 3560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3571 } | 3571 } |
3572 } | 3572 } |
3573 UNREACHABLE(); | 3573 UNREACHABLE(); |
3574 return nullptr; | 3574 return nullptr; |
3575 } | 3575 } |
3576 | 3576 |
3577 | 3577 |
3578 Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key, | 3578 Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key, |
3579 const VectorSlotPair& feedback) { | 3579 const VectorSlotPair& feedback) { |
3580 const Operator* op = javascript()->LoadProperty(language_mode(), feedback); | 3580 const Operator* op = javascript()->LoadProperty(language_mode(), feedback); |
3581 Node* node = NewNode(op, object, key, BuildLoadFeedbackVector()); | 3581 Node* node = NewNode(op, object, key, GetFunctionClosure()); |
3582 return node; | 3582 return node; |
3583 } | 3583 } |
3584 | 3584 |
3585 | 3585 |
3586 Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name, | 3586 Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name, |
3587 const VectorSlotPair& feedback) { | 3587 const VectorSlotPair& feedback) { |
3588 const Operator* op = javascript()->LoadNamed(language_mode(), name, feedback); | 3588 const Operator* op = javascript()->LoadNamed(language_mode(), name, feedback); |
3589 Node* node = NewNode(op, object, BuildLoadFeedbackVector()); | 3589 Node* node = NewNode(op, object, GetFunctionClosure()); |
3590 return node; | 3590 return node; |
3591 } | 3591 } |
3592 | 3592 |
3593 | 3593 |
3594 Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, | 3594 Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, |
3595 const VectorSlotPair& feedback) { | 3595 const VectorSlotPair& feedback) { |
3596 const Operator* op = javascript()->StoreProperty(language_mode(), feedback); | 3596 const Operator* op = javascript()->StoreProperty(language_mode(), feedback); |
3597 Node* node = NewNode(op, object, key, value, BuildLoadFeedbackVector()); | 3597 Node* node = NewNode(op, object, key, value, GetFunctionClosure()); |
3598 return node; | 3598 return node; |
3599 } | 3599 } |
3600 | 3600 |
3601 | 3601 |
3602 Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, | 3602 Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, |
3603 Node* value, | 3603 Node* value, |
3604 const VectorSlotPair& feedback) { | 3604 const VectorSlotPair& feedback) { |
3605 const Operator* op = | 3605 const Operator* op = |
3606 javascript()->StoreNamed(language_mode(), name, feedback); | 3606 javascript()->StoreNamed(language_mode(), name, feedback); |
3607 Node* node = NewNode(op, object, value, BuildLoadFeedbackVector()); | 3607 Node* node = NewNode(op, object, value, GetFunctionClosure()); |
3608 return node; | 3608 return node; |
3609 } | 3609 } |
3610 | 3610 |
3611 | 3611 |
3612 Node* AstGraphBuilder::BuildNamedSuperLoad(Node* receiver, Node* home_object, | 3612 Node* AstGraphBuilder::BuildNamedSuperLoad(Node* receiver, Node* home_object, |
3613 Handle<Name> name, | 3613 Handle<Name> name, |
3614 const VectorSlotPair& feedback) { | 3614 const VectorSlotPair& feedback) { |
3615 Node* name_node = jsgraph()->Constant(name); | 3615 Node* name_node = jsgraph()->Constant(name); |
3616 Node* language = jsgraph()->Constant(language_mode()); | 3616 Node* language = jsgraph()->Constant(language_mode()); |
3617 const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper); | 3617 const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3650 const Operator* op = javascript()->CallRuntime(function_id, 4); | 3650 const Operator* op = javascript()->CallRuntime(function_id, 4); |
3651 Node* node = NewNode(op, receiver, home_object, name_node, value); | 3651 Node* node = NewNode(op, receiver, home_object, name_node, value); |
3652 return node; | 3652 return node; |
3653 } | 3653 } |
3654 | 3654 |
3655 | 3655 |
3656 Node* AstGraphBuilder::BuildGlobalLoad(Handle<Name> name, | 3656 Node* AstGraphBuilder::BuildGlobalLoad(Handle<Name> name, |
3657 const VectorSlotPair& feedback, | 3657 const VectorSlotPair& feedback, |
3658 TypeofMode typeof_mode) { | 3658 TypeofMode typeof_mode) { |
3659 const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode); | 3659 const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode); |
3660 Node* node = NewNode(op, BuildLoadFeedbackVector()); | 3660 Node* node = NewNode(op, GetFunctionClosure()); |
3661 return node; | 3661 return node; |
3662 } | 3662 } |
3663 | 3663 |
3664 | 3664 |
3665 Node* AstGraphBuilder::BuildGlobalStore(Handle<Name> name, Node* value, | 3665 Node* AstGraphBuilder::BuildGlobalStore(Handle<Name> name, Node* value, |
3666 const VectorSlotPair& feedback) { | 3666 const VectorSlotPair& feedback) { |
3667 const Operator* op = | 3667 const Operator* op = |
3668 javascript()->StoreGlobal(language_mode(), name, feedback); | 3668 javascript()->StoreGlobal(language_mode(), name, feedback); |
3669 Node* node = NewNode(op, value, BuildLoadFeedbackVector()); | 3669 Node* node = NewNode(op, value, GetFunctionClosure()); |
3670 return node; | 3670 return node; |
3671 } | 3671 } |
3672 | 3672 |
3673 | 3673 |
3674 Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) { | 3674 Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) { |
3675 return graph()->NewNode(jsgraph()->machine()->Load(MachineType::AnyTagged()), | 3675 return graph()->NewNode(jsgraph()->machine()->Load(MachineType::AnyTagged()), |
3676 object, | 3676 object, |
3677 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), | 3677 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), |
3678 graph()->start(), graph()->start()); | 3678 graph()->start(), graph()->start()); |
3679 } | 3679 } |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4355 // Phi does not exist yet, introduce one. | 4355 // Phi does not exist yet, introduce one. |
4356 value = NewPhi(inputs, value, control); | 4356 value = NewPhi(inputs, value, control); |
4357 value->ReplaceInput(inputs - 1, other); | 4357 value->ReplaceInput(inputs - 1, other); |
4358 } | 4358 } |
4359 return value; | 4359 return value; |
4360 } | 4360 } |
4361 | 4361 |
4362 } // namespace compiler | 4362 } // namespace compiler |
4363 } // namespace internal | 4363 } // namespace internal |
4364 } // namespace v8 | 4364 } // namespace v8 |
OLD | NEW |