| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 void Interpreter::DoLdaContextSlot(compiler::InterpreterAssembler* assembler) { | 426 void Interpreter::DoLdaContextSlot(compiler::InterpreterAssembler* assembler) { |
| 427 Node* reg_index = __ BytecodeOperandReg(0); | 427 Node* reg_index = __ BytecodeOperandReg(0); |
| 428 Node* context = __ LoadRegister(reg_index); | 428 Node* context = __ LoadRegister(reg_index); |
| 429 Node* slot_index = __ BytecodeOperandIdx(1); | 429 Node* slot_index = __ BytecodeOperandIdx(1); |
| 430 Node* result = __ LoadContextSlot(context, slot_index); | 430 Node* result = __ LoadContextSlot(context, slot_index); |
| 431 __ SetAccumulator(result); | 431 __ SetAccumulator(result); |
| 432 __ Dispatch(); | 432 __ Dispatch(); |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 // LdaContextSlotWide <context> <slot_index> |
| 437 // |
| 438 // Load the object in |slot_index| of |context| into the accumulator. |
| 439 void Interpreter::DoLdaContextSlotWide( |
| 440 compiler::InterpreterAssembler* assembler) { |
| 441 DoLdaContextSlot(assembler); |
| 442 } |
| 443 |
| 444 |
| 436 // StaContextSlot <context> <slot_index> | 445 // StaContextSlot <context> <slot_index> |
| 437 // | 446 // |
| 438 // Stores the object in the accumulator into |slot_index| of |context|. | 447 // Stores the object in the accumulator into |slot_index| of |context|. |
| 439 void Interpreter::DoStaContextSlot(compiler::InterpreterAssembler* assembler) { | 448 void Interpreter::DoStaContextSlot(compiler::InterpreterAssembler* assembler) { |
| 440 Node* value = __ GetAccumulator(); | 449 Node* value = __ GetAccumulator(); |
| 441 Node* reg_index = __ BytecodeOperandReg(0); | 450 Node* reg_index = __ BytecodeOperandReg(0); |
| 442 Node* context = __ LoadRegister(reg_index); | 451 Node* context = __ LoadRegister(reg_index); |
| 443 Node* slot_index = __ BytecodeOperandIdx(1); | 452 Node* slot_index = __ BytecodeOperandIdx(1); |
| 444 __ StoreContextSlot(context, slot_index, value); | 453 __ StoreContextSlot(context, slot_index, value); |
| 445 __ Dispatch(); | 454 __ Dispatch(); |
| 446 } | 455 } |
| 447 | 456 |
| 448 | 457 |
| 458 // StaContextSlot <context> <slot_index> |
| 459 // |
| 460 // Stores the object in the accumulator into |slot_index| of |context|. |
| 461 void Interpreter::DoStaContextSlotWide( |
| 462 compiler::InterpreterAssembler* assembler) { |
| 463 DoStaContextSlot(assembler); |
| 464 } |
| 465 |
| 466 |
| 449 void Interpreter::DoLoadLookupSlot(Runtime::FunctionId function_id, | 467 void Interpreter::DoLoadLookupSlot(Runtime::FunctionId function_id, |
| 450 compiler::InterpreterAssembler* assembler) { | 468 compiler::InterpreterAssembler* assembler) { |
| 451 Node* index = __ BytecodeOperandIdx(0); | 469 Node* index = __ BytecodeOperandIdx(0); |
| 452 Node* name = __ LoadConstantPoolEntry(index); | 470 Node* name = __ LoadConstantPoolEntry(index); |
| 453 Node* context = __ GetContext(); | 471 Node* context = __ GetContext(); |
| 454 Node* result_pair = __ CallRuntime(function_id, context, name); | 472 Node* result_pair = __ CallRuntime(function_id, context, name); |
| 455 Node* result = __ Projection(0, result_pair); | 473 Node* result = __ Projection(0, result_pair); |
| 456 __ SetAccumulator(result); | 474 __ SetAccumulator(result); |
| 457 __ Dispatch(); | 475 __ Dispatch(); |
| 458 } | 476 } |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1753 Node* index_reg = __ BytecodeOperandReg(0); | 1771 Node* index_reg = __ BytecodeOperandReg(0); |
| 1754 Node* index = __ LoadRegister(index_reg); | 1772 Node* index = __ LoadRegister(index_reg); |
| 1755 Node* result = __ CallRuntime(Runtime::kForInStep, index); | 1773 Node* result = __ CallRuntime(Runtime::kForInStep, index); |
| 1756 __ SetAccumulator(result); | 1774 __ SetAccumulator(result); |
| 1757 __ Dispatch(); | 1775 __ Dispatch(); |
| 1758 } | 1776 } |
| 1759 | 1777 |
| 1760 } // namespace interpreter | 1778 } // namespace interpreter |
| 1761 } // namespace internal | 1779 } // namespace internal |
| 1762 } // namespace v8 | 1780 } // namespace v8 |
| OLD | NEW |