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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // | 193 // |
194 // Store accumulator to register <dst>. | 194 // Store accumulator to register <dst>. |
195 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { | 195 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { |
196 Node* reg_index = __ BytecodeOperandReg(0); | 196 Node* reg_index = __ BytecodeOperandReg(0); |
197 Node* accumulator = __ GetAccumulator(); | 197 Node* accumulator = __ GetAccumulator(); |
198 __ StoreRegister(accumulator, reg_index); | 198 __ StoreRegister(accumulator, reg_index); |
199 __ Dispatch(); | 199 __ Dispatch(); |
200 } | 200 } |
201 | 201 |
202 | 202 |
| 203 // Mov <src> <dst> |
| 204 // |
| 205 // Stores the value of register <src> to register <dst>. |
| 206 void Interpreter::DoMov(compiler::InterpreterAssembler* assembler) { |
| 207 Node* src_index = __ BytecodeOperandReg(0); |
| 208 Node* src_value = __ LoadRegister(src_index); |
| 209 Node* dst_index = __ BytecodeOperandReg(1); |
| 210 __ StoreRegister(src_value, dst_index); |
| 211 __ Dispatch(); |
| 212 } |
| 213 |
| 214 |
203 void Interpreter::DoLoadGlobal(Callable ic, | 215 void Interpreter::DoLoadGlobal(Callable ic, |
204 compiler::InterpreterAssembler* assembler) { | 216 compiler::InterpreterAssembler* assembler) { |
205 // Get the global object. | 217 // Get the global object. |
206 Node* context = __ GetContext(); | 218 Node* context = __ GetContext(); |
207 Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX); | 219 Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX); |
208 | 220 |
209 // Load the global via the LoadIC. | 221 // Load the global via the LoadIC. |
210 Node* code_target = __ HeapConstant(ic.code()); | 222 Node* code_target = __ HeapConstant(ic.code()); |
211 Node* constant_index = __ BytecodeOperandIdx(0); | 223 Node* constant_index = __ BytecodeOperandIdx(0); |
212 Node* name = __ LoadConstantPoolEntry(constant_index); | 224 Node* name = __ LoadConstantPoolEntry(constant_index); |
213 Node* raw_slot = __ BytecodeOperandIdx(1); | 225 Node* raw_slot = __ BytecodeOperandIdx(1); |
214 Node* smi_slot = __ SmiTag(raw_slot); | 226 Node* smi_slot = __ SmiTag(raw_slot); |
215 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); | 227 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
216 Node* result = __ CallIC(ic.descriptor(), code_target, global, name, smi_slot, | 228 Node* result = __ CallIC(ic.descriptor(), code_target, global, name, smi_slot, |
217 type_feedback_vector); | 229 type_feedback_vector); |
218 __ SetAccumulator(result); | 230 __ SetAccumulator(result); |
219 | |
220 __ Dispatch(); | 231 __ Dispatch(); |
221 } | 232 } |
222 | 233 |
223 | 234 |
224 // LdaGlobalSloppy <name_index> <slot> | 235 // LdaGlobalSloppy <name_index> <slot> |
225 // | 236 // |
226 // Load the global with name in constant pool entry <name_index> into the | 237 // Load the global with name in constant pool entry <name_index> into the |
227 // accumulator using FeedBackVector slot <slot> in sloppy mode. | 238 // accumulator using FeedBackVector slot <slot> in sloppy mode. |
228 void Interpreter::DoLdaGlobalSloppy(compiler::InterpreterAssembler* assembler) { | 239 void Interpreter::DoLdaGlobalSloppy(compiler::InterpreterAssembler* assembler) { |
229 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, | 240 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); | 1461 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); |
1451 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); | 1462 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); |
1452 __ SetAccumulator(result); | 1463 __ SetAccumulator(result); |
1453 __ Dispatch(); | 1464 __ Dispatch(); |
1454 } | 1465 } |
1455 | 1466 |
1456 | 1467 |
1457 } // namespace interpreter | 1468 } // namespace interpreter |
1458 } // namespace internal | 1469 } // namespace internal |
1459 } // namespace v8 | 1470 } // namespace v8 |
OLD | NEW |