| 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/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
| 6 | 6 |
| 7 #include <fstream> | 7 #include <fstream> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 Label if_export(assembler), if_import(assembler), end(assembler); | 877 Label if_export(assembler), if_import(assembler), end(assembler); |
| 878 __ Branch(__ IntPtrGreaterThan(cell_index, __ IntPtrConstant(0)), &if_export, | 878 __ Branch(__ IntPtrGreaterThan(cell_index, __ IntPtrConstant(0)), &if_export, |
| 879 &if_import); | 879 &if_import); |
| 880 | 880 |
| 881 __ Bind(&if_export); | 881 __ Bind(&if_export); |
| 882 { | 882 { |
| 883 Node* regular_exports = | 883 Node* regular_exports = |
| 884 __ LoadObjectField(module, Module::kRegularExportsOffset); | 884 __ LoadObjectField(module, Module::kRegularExportsOffset); |
| 885 // The actual array index is (cell_index - 1). | 885 // The actual array index is (cell_index - 1). |
| 886 Node* export_index = __ IntPtrSub(cell_index, __ IntPtrConstant(1)); | 886 Node* export_index = __ IntPtrSub(cell_index, __ IntPtrConstant(1)); |
| 887 Node* cell = __ LoadFixedArrayElement(regular_exports, export_index, 0, | 887 Node* cell = __ LoadFixedArrayElement(regular_exports, export_index); |
| 888 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 889 __ SetAccumulator(__ LoadObjectField(cell, Cell::kValueOffset)); | 888 __ SetAccumulator(__ LoadObjectField(cell, Cell::kValueOffset)); |
| 890 __ Goto(&end); | 889 __ Goto(&end); |
| 891 } | 890 } |
| 892 | 891 |
| 893 __ Bind(&if_import); | 892 __ Bind(&if_import); |
| 894 { | 893 { |
| 895 Node* regular_imports = | 894 Node* regular_imports = |
| 896 __ LoadObjectField(module, Module::kRegularImportsOffset); | 895 __ LoadObjectField(module, Module::kRegularImportsOffset); |
| 897 // The actual array index is (-cell_index - 1). | 896 // The actual array index is (-cell_index - 1). |
| 898 Node* import_index = __ IntPtrSub(__ IntPtrConstant(-1), cell_index); | 897 Node* import_index = __ IntPtrSub(__ IntPtrConstant(-1), cell_index); |
| 899 Node* cell = __ LoadFixedArrayElement(regular_imports, import_index, 0, | 898 Node* cell = __ LoadFixedArrayElement(regular_imports, import_index); |
| 900 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 901 __ SetAccumulator(__ LoadObjectField(cell, Cell::kValueOffset)); | 899 __ SetAccumulator(__ LoadObjectField(cell, Cell::kValueOffset)); |
| 902 __ Goto(&end); | 900 __ Goto(&end); |
| 903 } | 901 } |
| 904 | 902 |
| 905 __ Bind(&end); | 903 __ Bind(&end); |
| 906 __ Dispatch(); | 904 __ Dispatch(); |
| 907 } | 905 } |
| 908 | 906 |
| 909 // StaModuleVariable <cell_index> <depth> | 907 // StaModuleVariable <cell_index> <depth> |
| 910 // | 908 // |
| (...skipping 11 matching lines...) Expand all Loading... |
| 922 Label if_export(assembler), if_import(assembler), end(assembler); | 920 Label if_export(assembler), if_import(assembler), end(assembler); |
| 923 __ Branch(__ IntPtrGreaterThan(cell_index, __ IntPtrConstant(0)), &if_export, | 921 __ Branch(__ IntPtrGreaterThan(cell_index, __ IntPtrConstant(0)), &if_export, |
| 924 &if_import); | 922 &if_import); |
| 925 | 923 |
| 926 __ Bind(&if_export); | 924 __ Bind(&if_export); |
| 927 { | 925 { |
| 928 Node* regular_exports = | 926 Node* regular_exports = |
| 929 __ LoadObjectField(module, Module::kRegularExportsOffset); | 927 __ LoadObjectField(module, Module::kRegularExportsOffset); |
| 930 // The actual array index is (cell_index - 1). | 928 // The actual array index is (cell_index - 1). |
| 931 Node* export_index = __ IntPtrSub(cell_index, __ IntPtrConstant(1)); | 929 Node* export_index = __ IntPtrSub(cell_index, __ IntPtrConstant(1)); |
| 932 Node* cell = __ LoadFixedArrayElement(regular_exports, export_index, 0, | 930 Node* cell = __ LoadFixedArrayElement(regular_exports, export_index); |
| 933 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 934 __ StoreObjectField(cell, Cell::kValueOffset, value); | 931 __ StoreObjectField(cell, Cell::kValueOffset, value); |
| 935 __ Goto(&end); | 932 __ Goto(&end); |
| 936 } | 933 } |
| 937 | 934 |
| 938 __ Bind(&if_import); | 935 __ Bind(&if_import); |
| 939 { | 936 { |
| 940 // Not supported (probably never). | 937 // Not supported (probably never). |
| 941 __ Abort(kUnsupportedModuleOperation); | 938 __ Abort(kUnsupportedModuleOperation); |
| 942 __ Goto(&end); | 939 __ Goto(&end); |
| 943 } | 940 } |
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 __ Dispatch(); | 2708 __ Dispatch(); |
| 2712 } | 2709 } |
| 2713 __ Bind(&if_slow); | 2710 __ Bind(&if_slow); |
| 2714 { | 2711 { |
| 2715 // Record the fact that we hit the for-in slow path. | 2712 // Record the fact that we hit the for-in slow path. |
| 2716 Node* vector_index = __ BytecodeOperandIdx(3); | 2713 Node* vector_index = __ BytecodeOperandIdx(3); |
| 2717 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); | 2714 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
| 2718 Node* megamorphic_sentinel = | 2715 Node* megamorphic_sentinel = |
| 2719 __ HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate_)); | 2716 __ HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate_)); |
| 2720 __ StoreFixedArrayElement(type_feedback_vector, vector_index, | 2717 __ StoreFixedArrayElement(type_feedback_vector, vector_index, |
| 2721 megamorphic_sentinel, SKIP_WRITE_BARRIER, 0, | 2718 megamorphic_sentinel, SKIP_WRITE_BARRIER); |
| 2722 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 2723 | 2719 |
| 2724 // Need to filter the {key} for the {receiver}. | 2720 // Need to filter the {key} for the {receiver}. |
| 2725 Node* context = __ GetContext(); | 2721 Node* context = __ GetContext(); |
| 2726 Callable callable = CodeFactory::ForInFilter(assembler->isolate()); | 2722 Callable callable = CodeFactory::ForInFilter(assembler->isolate()); |
| 2727 Node* result = __ CallStub(callable, context, key, receiver); | 2723 Node* result = __ CallStub(callable, context, key, receiver); |
| 2728 __ SetAccumulator(result); | 2724 __ SetAccumulator(result); |
| 2729 __ Dispatch(); | 2725 __ Dispatch(); |
| 2730 } | 2726 } |
| 2731 } | 2727 } |
| 2732 | 2728 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2852 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 2857 __ SmiTag(new_state)); | 2853 __ SmiTag(new_state)); |
| 2858 __ SetAccumulator(old_state); | 2854 __ SetAccumulator(old_state); |
| 2859 | 2855 |
| 2860 __ Dispatch(); | 2856 __ Dispatch(); |
| 2861 } | 2857 } |
| 2862 | 2858 |
| 2863 } // namespace interpreter | 2859 } // namespace interpreter |
| 2864 } // namespace internal | 2860 } // namespace internal |
| 2865 } // namespace v8 | 2861 } // namespace v8 |
| OLD | NEW |