| 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 "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/interpreter-assembler.h" | 9 #include "src/compiler/interpreter-assembler.h" |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // | 177 // |
| 178 // Store accumulator to register <dst>. | 178 // Store accumulator to register <dst>. |
| 179 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { | 179 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { |
| 180 Node* reg_index = __ BytecodeOperandReg8(0); | 180 Node* reg_index = __ BytecodeOperandReg8(0); |
| 181 Node* accumulator = __ GetAccumulator(); | 181 Node* accumulator = __ GetAccumulator(); |
| 182 __ StoreRegister(accumulator, reg_index); | 182 __ StoreRegister(accumulator, reg_index); |
| 183 __ Dispatch(); | 183 __ Dispatch(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 | 186 |
| 187 // LdaGlobal <slot_index> | |
| 188 // | |
| 189 // Load the global at |slot_index| into the accumulator. | |
| 190 void Interpreter::DoLdaGlobal(compiler::InterpreterAssembler* assembler) { | |
| 191 Node* slot_index = __ BytecodeOperandIdx8(0); | |
| 192 Node* smi_slot_index = __ SmiTag(slot_index); | |
| 193 Node* result = __ CallRuntime(Runtime::kLoadGlobalViaContext, smi_slot_index); | |
| 194 __ SetAccumulator(result); | |
| 195 __ Dispatch(); | |
| 196 } | |
| 197 | |
| 198 | |
| 199 // StaGlobalSloppy <slot_index> | |
| 200 // | |
| 201 // Store the global at |slot_index| with the value in the the accumulator in | |
| 202 // sloppy mode. | |
| 203 void Interpreter::DoStaGlobalSloppy(compiler::InterpreterAssembler* assembler) { | |
| 204 Node* slot_index = __ BytecodeOperandIdx8(0); | |
| 205 Node* smi_slot_index = __ SmiTag(slot_index); | |
| 206 Node* value = __ GetAccumulator(); | |
| 207 __ CallRuntime(Runtime::kStoreGlobalViaContext_Sloppy, smi_slot_index, value); | |
| 208 __ Dispatch(); | |
| 209 } | |
| 210 | |
| 211 | |
| 212 // StaGlobalStrict <slot_index> | |
| 213 // | |
| 214 // Store the global at |slot_index| with the value in the the accumulator in | |
| 215 // strict mode. | |
| 216 void Interpreter::DoStaGlobalStrict(compiler::InterpreterAssembler* assembler) { | |
| 217 Node* slot_index = __ BytecodeOperandIdx8(0); | |
| 218 Node* smi_slot_index = __ SmiTag(slot_index); | |
| 219 Node* value = __ GetAccumulator(); | |
| 220 __ CallRuntime(Runtime::kStoreGlobalViaContext_Strict, smi_slot_index, value); | |
| 221 __ Dispatch(); | |
| 222 } | |
| 223 | |
| 224 | |
| 225 // LdaContextSlot <context> <slot_index> | 187 // LdaContextSlot <context> <slot_index> |
| 226 // | 188 // |
| 227 // Load the object in |slot_index| of |context| into the accumulator. | 189 // Load the object in |slot_index| of |context| into the accumulator. |
| 228 void Interpreter::DoLdaContextSlot(compiler::InterpreterAssembler* assembler) { | 190 void Interpreter::DoLdaContextSlot(compiler::InterpreterAssembler* assembler) { |
| 229 Node* reg_index = __ BytecodeOperandReg8(0); | 191 Node* reg_index = __ BytecodeOperandReg8(0); |
| 230 Node* context = __ LoadRegister(reg_index); | 192 Node* context = __ LoadRegister(reg_index); |
| 231 Node* slot_index = __ BytecodeOperandIdx8(1); | 193 Node* slot_index = __ BytecodeOperandIdx8(1); |
| 232 Node* result = __ LoadContextSlot(context, slot_index); | 194 Node* result = __ LoadContextSlot(context, slot_index); |
| 233 __ SetAccumulator(result); | 195 __ SetAccumulator(result); |
| 234 __ Dispatch(); | 196 __ Dispatch(); |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 // | 885 // |
| 924 // Return the value in the accumulator. | 886 // Return the value in the accumulator. |
| 925 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 887 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
| 926 __ Return(); | 888 __ Return(); |
| 927 } | 889 } |
| 928 | 890 |
| 929 | 891 |
| 930 } // namespace interpreter | 892 } // namespace interpreter |
| 931 } // namespace internal | 893 } // namespace internal |
| 932 } // namespace v8 | 894 } // namespace v8 |
| OLD | NEW |