| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 758 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 759 Handle<Name> name = | 759 Handle<Name> name = |
| 760 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 760 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); |
| 761 VectorSlotPair feedback = | 761 VectorSlotPair feedback = |
| 762 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); | 762 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); |
| 763 | 763 |
| 764 const Operator* op = javascript()->LoadNamed(name, feedback); | 764 const Operator* op = javascript()->LoadNamed(name, feedback); |
| 765 return NewNode(op, object, GetFunctionClosure()); | 765 return NewNode(op, object, GetFunctionClosure()); |
| 766 } | 766 } |
| 767 | 767 |
| 768 void BytecodeGraphBuilder::VisitLoadIC() { | 768 void BytecodeGraphBuilder::VisitLdaNamedProperty() { |
| 769 FrameStateBeforeAndAfter states(this); | 769 FrameStateBeforeAndAfter states(this); |
| 770 Node* node = BuildNamedLoad(); | 770 Node* node = BuildNamedLoad(); |
| 771 environment()->BindAccumulator(node, &states); | 771 environment()->BindAccumulator(node, &states); |
| 772 } | 772 } |
| 773 | 773 |
| 774 void BytecodeGraphBuilder::VisitLdrNamedProperty() { | 774 void BytecodeGraphBuilder::VisitLdrNamedProperty() { |
| 775 FrameStateBeforeAndAfter states(this); | 775 FrameStateBeforeAndAfter states(this); |
| 776 Node* node = BuildNamedLoad(); | 776 Node* node = BuildNamedLoad(); |
| 777 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node, | 777 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node, |
| 778 &states); | 778 &states); |
| 779 } | 779 } |
| 780 | 780 |
| 781 Node* BytecodeGraphBuilder::BuildKeyedLoad() { | 781 Node* BytecodeGraphBuilder::BuildKeyedLoad() { |
| 782 Node* key = environment()->LookupAccumulator(); | 782 Node* key = environment()->LookupAccumulator(); |
| 783 Node* object = | 783 Node* object = |
| 784 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 784 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 785 VectorSlotPair feedback = | 785 VectorSlotPair feedback = |
| 786 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); | 786 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); |
| 787 | 787 |
| 788 const Operator* op = javascript()->LoadProperty(feedback); | 788 const Operator* op = javascript()->LoadProperty(feedback); |
| 789 return NewNode(op, object, key, GetFunctionClosure()); | 789 return NewNode(op, object, key, GetFunctionClosure()); |
| 790 } | 790 } |
| 791 | 791 |
| 792 void BytecodeGraphBuilder::VisitKeyedLoadIC() { | 792 void BytecodeGraphBuilder::VisitLdaKeyedProperty() { |
| 793 FrameStateBeforeAndAfter states(this); | 793 FrameStateBeforeAndAfter states(this); |
| 794 Node* node = BuildKeyedLoad(); | 794 Node* node = BuildKeyedLoad(); |
| 795 environment()->BindAccumulator(node, &states); | 795 environment()->BindAccumulator(node, &states); |
| 796 } | 796 } |
| 797 | 797 |
| 798 void BytecodeGraphBuilder::VisitLdrKeyedProperty() { | 798 void BytecodeGraphBuilder::VisitLdrKeyedProperty() { |
| 799 FrameStateBeforeAndAfter states(this); | 799 FrameStateBeforeAndAfter states(this); |
| 800 Node* node = BuildKeyedLoad(); | 800 Node* node = BuildKeyedLoad(); |
| 801 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, | 801 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, |
| 802 &states); | 802 &states); |
| 803 } | 803 } |
| 804 | 804 |
| 805 void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { | 805 void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { |
| 806 FrameStateBeforeAndAfter states(this); | 806 FrameStateBeforeAndAfter states(this); |
| 807 Node* value = environment()->LookupAccumulator(); | 807 Node* value = environment()->LookupAccumulator(); |
| 808 Node* object = | 808 Node* object = |
| 809 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 809 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 810 Handle<Name> name = | 810 Handle<Name> name = |
| 811 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 811 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); |
| 812 VectorSlotPair feedback = | 812 VectorSlotPair feedback = |
| 813 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); | 813 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); |
| 814 | 814 |
| 815 const Operator* op = javascript()->StoreNamed(language_mode, name, feedback); | 815 const Operator* op = javascript()->StoreNamed(language_mode, name, feedback); |
| 816 Node* node = NewNode(op, object, value, GetFunctionClosure()); | 816 Node* node = NewNode(op, object, value, GetFunctionClosure()); |
| 817 environment()->RecordAfterState(node, &states); | 817 environment()->RecordAfterState(node, &states); |
| 818 } | 818 } |
| 819 | 819 |
| 820 void BytecodeGraphBuilder::VisitStoreICSloppy() { | 820 void BytecodeGraphBuilder::VisitStaNamedPropertySloppy() { |
| 821 BuildNamedStore(LanguageMode::SLOPPY); | 821 BuildNamedStore(LanguageMode::SLOPPY); |
| 822 } | 822 } |
| 823 | 823 |
| 824 void BytecodeGraphBuilder::VisitStoreICStrict() { | 824 void BytecodeGraphBuilder::VisitStaNamedPropertyStrict() { |
| 825 BuildNamedStore(LanguageMode::STRICT); | 825 BuildNamedStore(LanguageMode::STRICT); |
| 826 } | 826 } |
| 827 | 827 |
| 828 void BytecodeGraphBuilder::BuildKeyedStore(LanguageMode language_mode) { | 828 void BytecodeGraphBuilder::BuildKeyedStore(LanguageMode language_mode) { |
| 829 FrameStateBeforeAndAfter states(this); | 829 FrameStateBeforeAndAfter states(this); |
| 830 Node* value = environment()->LookupAccumulator(); | 830 Node* value = environment()->LookupAccumulator(); |
| 831 Node* object = | 831 Node* object = |
| 832 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 832 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 833 Node* key = | 833 Node* key = |
| 834 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(1)); | 834 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(1)); |
| 835 VectorSlotPair feedback = | 835 VectorSlotPair feedback = |
| 836 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); | 836 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); |
| 837 | 837 |
| 838 const Operator* op = javascript()->StoreProperty(language_mode, feedback); | 838 const Operator* op = javascript()->StoreProperty(language_mode, feedback); |
| 839 Node* node = NewNode(op, object, key, value, GetFunctionClosure()); | 839 Node* node = NewNode(op, object, key, value, GetFunctionClosure()); |
| 840 environment()->RecordAfterState(node, &states); | 840 environment()->RecordAfterState(node, &states); |
| 841 } | 841 } |
| 842 | 842 |
| 843 void BytecodeGraphBuilder::VisitKeyedStoreICSloppy() { | 843 void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { |
| 844 BuildKeyedStore(LanguageMode::SLOPPY); | 844 BuildKeyedStore(LanguageMode::SLOPPY); |
| 845 } | 845 } |
| 846 | 846 |
| 847 void BytecodeGraphBuilder::VisitKeyedStoreICStrict() { | 847 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { |
| 848 BuildKeyedStore(LanguageMode::STRICT); | 848 BuildKeyedStore(LanguageMode::STRICT); |
| 849 } | 849 } |
| 850 | 850 |
| 851 void BytecodeGraphBuilder::VisitPushContext() { | 851 void BytecodeGraphBuilder::VisitPushContext() { |
| 852 Node* new_context = environment()->LookupAccumulator(); | 852 Node* new_context = environment()->LookupAccumulator(); |
| 853 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), | 853 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), |
| 854 environment()->Context()); | 854 environment()->Context()); |
| 855 environment()->SetContext(new_context); | 855 environment()->SetContext(new_context); |
| 856 } | 856 } |
| 857 | 857 |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 // Phi does not exist yet, introduce one. | 1732 // Phi does not exist yet, introduce one. |
| 1733 value = NewPhi(inputs, value, control); | 1733 value = NewPhi(inputs, value, control); |
| 1734 value->ReplaceInput(inputs - 1, other); | 1734 value->ReplaceInput(inputs - 1, other); |
| 1735 } | 1735 } |
| 1736 return value; | 1736 return value; |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 } // namespace compiler | 1739 } // namespace compiler |
| 1740 } // namespace internal | 1740 } // namespace internal |
| 1741 } // namespace v8 | 1741 } // namespace v8 |
| OLD | NEW |