| 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 #ifndef V8_INTERPRETER_INTERPRETER_H_ | 5 #ifndef V8_INTERPRETER_INTERPRETER_H_ |
| 6 #define V8_INTERPRETER_INTERPRETER_H_ | 6 #define V8_INTERPRETER_INTERPRETER_H_ |
| 7 | 7 |
| 8 // Clients of this interface shouldn't depend on lots of interpreter internals. | 8 // Clients of this interface shouldn't depend on lots of interpreter internals. |
| 9 // Do not include anything from src/interpreter other than | 9 // Do not include anything from src/interpreter other than |
| 10 // src/interpreter/bytecodes.h here! | 10 // src/interpreter/bytecodes.h here! |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void DoBinaryOp(InterpreterAssembler* assembler); | 82 void DoBinaryOp(InterpreterAssembler* assembler); |
| 83 | 83 |
| 84 // Generates code to perform the unary operation via |Generator|. | 84 // Generates code to perform the unary operation via |Generator|. |
| 85 template <class Generator> | 85 template <class Generator> |
| 86 void DoUnaryOp(InterpreterAssembler* assembler); | 86 void DoUnaryOp(InterpreterAssembler* assembler); |
| 87 | 87 |
| 88 // Generates code to perform the comparison operation associated with | 88 // Generates code to perform the comparison operation associated with |
| 89 // |compare_op|. | 89 // |compare_op|. |
| 90 void DoCompareOp(Token::Value compare_op, InterpreterAssembler* assembler); | 90 void DoCompareOp(Token::Value compare_op, InterpreterAssembler* assembler); |
| 91 | 91 |
| 92 // Generates code to load a constant from the constant pool. | 92 // Generates code to perform a global store via |ic|. |
| 93 void DoLoadConstant(InterpreterAssembler* assembler); | 93 void DoStaGlobal(Callable ic, InterpreterAssembler* assembler); |
| 94 | 94 |
| 95 // Generates code to perform a global load via |ic|. | 95 // Generates code to perform a named property store via |ic|. |
| 96 void DoLoadGlobal(Callable ic, InterpreterAssembler* assembler); | |
| 97 | |
| 98 // Generates code to perform a global store via |ic|. | |
| 99 void DoStoreGlobal(Callable ic, InterpreterAssembler* assembler); | |
| 100 | |
| 101 // Generates code to perform a named property load via |ic|. | |
| 102 void DoLoadIC(Callable ic, InterpreterAssembler* assembler); | |
| 103 | |
| 104 // Generates code to perform a keyed property load via |ic|. | |
| 105 void DoKeyedLoadIC(Callable ic, InterpreterAssembler* assembler); | |
| 106 | |
| 107 // Generates code to perform a namedproperty store via |ic|. | |
| 108 void DoStoreIC(Callable ic, InterpreterAssembler* assembler); | 96 void DoStoreIC(Callable ic, InterpreterAssembler* assembler); |
| 109 | 97 |
| 110 // Generates code to perform a keyed property store via |ic|. | 98 // Generates code to perform a keyed property store via |ic|. |
| 111 void DoKeyedStoreIC(Callable ic, InterpreterAssembler* assembler); | 99 void DoKeyedStoreIC(Callable ic, InterpreterAssembler* assembler); |
| 112 | 100 |
| 113 // Generates code to perform a JS call. | 101 // Generates code to perform a JS call. |
| 114 void DoJSCall(InterpreterAssembler* assembler, TailCallMode tail_call_mode); | 102 void DoJSCall(InterpreterAssembler* assembler, TailCallMode tail_call_mode); |
| 115 | 103 |
| 116 // Generates code to perform a runtime call. | 104 // Generates code to perform a runtime call. |
| 117 void DoCallRuntimeCommon(InterpreterAssembler* assembler); | 105 void DoCallRuntimeCommon(InterpreterAssembler* assembler); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 129 void DoTypeConversionOp(Callable callable, InterpreterAssembler* assembler); | 117 void DoTypeConversionOp(Callable callable, InterpreterAssembler* assembler); |
| 130 | 118 |
| 131 // Generates code to perform logical-not on boolean |value|. | 119 // Generates code to perform logical-not on boolean |value|. |
| 132 void DoLogicalNotOp(compiler::Node* value, InterpreterAssembler* assembler); | 120 void DoLogicalNotOp(compiler::Node* value, InterpreterAssembler* assembler); |
| 133 | 121 |
| 134 // Generates code to perform delete via function_id. | 122 // Generates code to perform delete via function_id. |
| 135 void DoDelete(Runtime::FunctionId function_id, | 123 void DoDelete(Runtime::FunctionId function_id, |
| 136 InterpreterAssembler* assembler); | 124 InterpreterAssembler* assembler); |
| 137 | 125 |
| 138 // Generates code to perform a lookup slot load via |function_id|. | 126 // Generates code to perform a lookup slot load via |function_id|. |
| 139 void DoLoadLookupSlot(Runtime::FunctionId function_id, | 127 void DoLdaLookupSlot(Runtime::FunctionId function_id, |
| 140 InterpreterAssembler* assembler); | 128 InterpreterAssembler* assembler); |
| 141 | 129 |
| 142 // Generates code to perform a lookup slot store depending on |language_mode|. | 130 // Generates code to perform a lookup slot store depending on |language_mode|. |
| 143 void DoStoreLookupSlot(LanguageMode language_mode, | 131 void DoStaLookupSlot(LanguageMode language_mode, |
| 144 InterpreterAssembler* assembler); | 132 InterpreterAssembler* assembler); |
| 133 |
| 134 // Generates a node with the undefined constant. |
| 135 compiler::Node* BuildLoadUndefined(InterpreterAssembler* assembler); |
| 136 |
| 137 // Generates code to load a context slot. |
| 138 compiler::Node* BuildLoadContextSlot(InterpreterAssembler* assembler); |
| 139 |
| 140 // Generates code to load a global. |
| 141 compiler::Node* BuildLoadGlobal(Callable ic, InterpreterAssembler* assembler); |
| 142 |
| 143 // Generates code to load a named property. |
| 144 compiler::Node* BuildLoadNamedProperty(Callable ic, |
| 145 InterpreterAssembler* assembler); |
| 146 |
| 147 // Generates code to load a keyed property. |
| 148 compiler::Node* BuildLoadKeyedProperty(Callable ic, |
| 149 InterpreterAssembler* assembler); |
| 145 | 150 |
| 146 uintptr_t GetDispatchCounter(Bytecode from, Bytecode to) const; | 151 uintptr_t GetDispatchCounter(Bytecode from, Bytecode to) const; |
| 147 | 152 |
| 148 // Get dispatch table index of bytecode. | 153 // Get dispatch table index of bytecode. |
| 149 static size_t GetDispatchTableIndex(Bytecode bytecode, | 154 static size_t GetDispatchTableIndex(Bytecode bytecode, |
| 150 OperandScale operand_scale); | 155 OperandScale operand_scale); |
| 151 | 156 |
| 152 bool IsDispatchTableInitialized(); | 157 bool IsDispatchTableInitialized(); |
| 153 | 158 |
| 154 static const int kNumberOfWideVariants = 3; | 159 static const int kNumberOfWideVariants = 3; |
| 155 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); | 160 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); |
| 156 static const int kNumberOfBytecodes = static_cast<int>(Bytecode::kLast) + 1; | 161 static const int kNumberOfBytecodes = static_cast<int>(Bytecode::kLast) + 1; |
| 157 | 162 |
| 158 Isolate* isolate_; | 163 Isolate* isolate_; |
| 159 Address dispatch_table_[kDispatchTableSize]; | 164 Address dispatch_table_[kDispatchTableSize]; |
| 160 v8::base::SmartArrayPointer<uintptr_t> bytecode_dispatch_counters_table_; | 165 v8::base::SmartArrayPointer<uintptr_t> bytecode_dispatch_counters_table_; |
| 161 | 166 |
| 162 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 167 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
| 163 }; | 168 }; |
| 164 | 169 |
| 165 } // namespace interpreter | 170 } // namespace interpreter |
| 166 } // namespace internal | 171 } // namespace internal |
| 167 } // namespace v8 | 172 } // namespace v8 |
| 168 | 173 |
| 169 #endif // V8_INTERPRETER_INTERPRETER_H_ | 174 #endif // V8_INTERPRETER_INTERPRETER_H_ |
| OLD | NEW |