OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 // generating bytecode. Hence the value of depth is always 0. Update this | 695 // generating bytecode. Hence the value of depth is always 0. Update this |
696 // code, when the implementation changes. | 696 // code, when the implementation changes. |
697 const Operator* op = | 697 const Operator* op = |
698 javascript()->StoreContext(0, iterator.GetIndexOperand(1)); | 698 javascript()->StoreContext(0, iterator.GetIndexOperand(1)); |
699 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 699 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
700 Node* value = environment()->LookupAccumulator(); | 700 Node* value = environment()->LookupAccumulator(); |
701 NewNode(op, context, value); | 701 NewNode(op, context, value); |
702 } | 702 } |
703 | 703 |
704 | 704 |
| 705 void BytecodeGraphBuilder::BuildLdaLookupSlot( |
| 706 TypeofMode typeof_mode, |
| 707 const interpreter::BytecodeArrayIterator& iterator) { |
| 708 FrameStateBeforeAndAfter states(this, iterator); |
| 709 Handle<String> name = |
| 710 Handle<String>::cast(iterator.GetConstantForIndexOperand(0)); |
| 711 const Operator* op = javascript()->LoadDynamic(name, typeof_mode); |
| 712 Node* value = |
| 713 NewNode(op, BuildLoadFeedbackVector(), environment()->Context()); |
| 714 environment()->BindAccumulator(value, &states); |
| 715 } |
| 716 |
| 717 |
705 void BytecodeGraphBuilder::VisitLdaLookupSlot( | 718 void BytecodeGraphBuilder::VisitLdaLookupSlot( |
706 const interpreter::BytecodeArrayIterator& iterator) { | 719 const interpreter::BytecodeArrayIterator& iterator) { |
707 UNIMPLEMENTED(); | 720 BuildLdaLookupSlot(TypeofMode::NOT_INSIDE_TYPEOF, iterator); |
708 } | 721 } |
709 | 722 |
710 | 723 |
711 void BytecodeGraphBuilder::VisitLdaLookupSlotInsideTypeof( | 724 void BytecodeGraphBuilder::VisitLdaLookupSlotInsideTypeof( |
712 const interpreter::BytecodeArrayIterator& iterator) { | 725 const interpreter::BytecodeArrayIterator& iterator) { |
713 UNIMPLEMENTED(); | 726 BuildLdaLookupSlot(TypeofMode::INSIDE_TYPEOF, iterator); |
| 727 } |
| 728 |
| 729 |
| 730 void BytecodeGraphBuilder::BuildStaLookupSlot( |
| 731 LanguageMode language_mode, |
| 732 const interpreter::BytecodeArrayIterator& iterator) { |
| 733 FrameStateBeforeAndAfter states(this, iterator); |
| 734 Node* value = environment()->LookupAccumulator(); |
| 735 Node* name = jsgraph()->Constant(iterator.GetConstantForIndexOperand(0)); |
| 736 Node* language = jsgraph()->Constant(language_mode); |
| 737 const Operator* op = javascript()->CallRuntime(Runtime::kStoreLookupSlot, 4); |
| 738 Node* store = NewNode(op, value, environment()->Context(), name, language); |
| 739 environment()->BindAccumulator(store, &states); |
714 } | 740 } |
715 | 741 |
716 | 742 |
717 void BytecodeGraphBuilder::VisitStaLookupSlotSloppy( | 743 void BytecodeGraphBuilder::VisitStaLookupSlotSloppy( |
718 const interpreter::BytecodeArrayIterator& iterator) { | 744 const interpreter::BytecodeArrayIterator& iterator) { |
719 UNIMPLEMENTED(); | 745 BuildStaLookupSlot(LanguageMode::SLOPPY, iterator); |
720 } | 746 } |
721 | 747 |
722 | 748 |
723 void BytecodeGraphBuilder::VisitStaLookupSlotStrict( | 749 void BytecodeGraphBuilder::VisitStaLookupSlotStrict( |
724 const interpreter::BytecodeArrayIterator& iterator) { | 750 const interpreter::BytecodeArrayIterator& iterator) { |
725 UNIMPLEMENTED(); | 751 BuildStaLookupSlot(LanguageMode::STRICT, iterator); |
726 } | 752 } |
727 | 753 |
728 | 754 |
729 void BytecodeGraphBuilder::BuildNamedLoad( | 755 void BytecodeGraphBuilder::BuildNamedLoad( |
730 const interpreter::BytecodeArrayIterator& iterator) { | 756 const interpreter::BytecodeArrayIterator& iterator) { |
731 FrameStateBeforeAndAfter states(this, iterator); | 757 FrameStateBeforeAndAfter states(this, iterator); |
732 Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 758 Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
733 Handle<Name> name = | 759 Handle<Name> name = |
734 Handle<Name>::cast(iterator.GetConstantForIndexOperand(1)); | 760 Handle<Name>::cast(iterator.GetConstantForIndexOperand(1)); |
735 VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(2)); | 761 VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(2)); |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 | 1853 |
1828 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1854 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1829 if (environment()->IsMarkedAsUnreachable()) return; | 1855 if (environment()->IsMarkedAsUnreachable()) return; |
1830 environment()->MarkAsUnreachable(); | 1856 environment()->MarkAsUnreachable(); |
1831 exit_controls_.push_back(exit); | 1857 exit_controls_.push_back(exit); |
1832 } | 1858 } |
1833 | 1859 |
1834 } // namespace compiler | 1860 } // namespace compiler |
1835 } // namespace internal | 1861 } // namespace internal |
1836 } // namespace v8 | 1862 } // namespace v8 |
OLD | NEW |