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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 834 |
835 // StaKeyedPropertyStrict <object> <key> <slot> | 835 // StaKeyedPropertyStrict <object> <key> <slot> |
836 // | 836 // |
837 // Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object> | 837 // Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object> |
838 // and the key <key> with the value in the accumulator. | 838 // and the key <key> with the value in the accumulator. |
839 void Interpreter::DoStaKeyedPropertyStrict(InterpreterAssembler* assembler) { | 839 void Interpreter::DoStaKeyedPropertyStrict(InterpreterAssembler* assembler) { |
840 Callable ic = CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT); | 840 Callable ic = CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT); |
841 DoKeyedStoreIC(ic, assembler); | 841 DoKeyedStoreIC(ic, assembler); |
842 } | 842 } |
843 | 843 |
| 844 // StaDataPropertyInLiteral <object> <name> <value> <attrs> |
| 845 // |
| 846 // Define a property <name> with value <value> in <object>. Use property |
| 847 // attributes <attrs> in the definition and set the name property of <value> |
| 848 // according to the flag in the accumulator. |
| 849 // |
| 850 // This definition is not observable and is used only for definitions |
| 851 // in object or class literals. |
| 852 void Interpreter::DoStaDataPropertyInLiteral(InterpreterAssembler* assembler) { |
| 853 Node* object_reg_index = __ BytecodeOperandReg(0); |
| 854 Node* object = __ LoadRegister(object_reg_index); |
| 855 Node* name_reg_index = __ BytecodeOperandReg(1); |
| 856 Node* name = __ LoadRegister(name_reg_index); |
| 857 Node* value_reg_index = __ BytecodeOperandReg(2); |
| 858 Node* value = __ LoadRegister(value_reg_index); |
| 859 Node* attrs_reg_index = __ BytecodeOperandReg(3); |
| 860 Node* attrs = __ LoadRegister(attrs_reg_index); |
| 861 |
| 862 Node* set_function_name = __ GetAccumulator(); |
| 863 |
| 864 Node* context = __ GetContext(); |
| 865 |
| 866 __ CallRuntime(Runtime::kDefineDataPropertyInLiteral, context, object, name, |
| 867 value, attrs, set_function_name); |
| 868 __ Dispatch(); |
| 869 } |
| 870 |
844 // LdaModuleVariable <cell_index> <depth> | 871 // LdaModuleVariable <cell_index> <depth> |
845 // | 872 // |
846 // Load the contents of a module variable into the accumulator. The variable is | 873 // Load the contents of a module variable into the accumulator. The variable is |
847 // identified by <cell_index>. <depth> is the depth of the current context | 874 // identified by <cell_index>. <depth> is the depth of the current context |
848 // relative to the module context. | 875 // relative to the module context. |
849 void Interpreter::DoLdaModuleVariable(InterpreterAssembler* assembler) { | 876 void Interpreter::DoLdaModuleVariable(InterpreterAssembler* assembler) { |
850 Node* cell_index = __ BytecodeOperandImm(0); | 877 Node* cell_index = __ BytecodeOperandImm(0); |
851 Node* depth = __ BytecodeOperandUImm(1); | 878 Node* depth = __ BytecodeOperandUImm(1); |
852 | 879 |
853 Node* module_context = __ GetContextAtDepth(__ GetContext(), depth); | 880 Node* module_context = __ GetContextAtDepth(__ GetContext(), depth); |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2732 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2706 __ SmiTag(new_state)); | 2733 __ SmiTag(new_state)); |
2707 __ SetAccumulator(old_state); | 2734 __ SetAccumulator(old_state); |
2708 | 2735 |
2709 __ Dispatch(); | 2736 __ Dispatch(); |
2710 } | 2737 } |
2711 | 2738 |
2712 } // namespace interpreter | 2739 } // namespace interpreter |
2713 } // namespace internal | 2740 } // namespace internal |
2714 } // namespace v8 | 2741 } // namespace v8 |
OLD | NEW |