Chromium Code Reviews| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 Node* reg_index = __ BytecodeOperandReg(0); | 549 Node* reg_index = __ BytecodeOperandReg(0); |
| 550 Node* context = __ LoadRegister(reg_index); | 550 Node* context = __ LoadRegister(reg_index); |
| 551 Node* slot_index = __ BytecodeOperandIdx(1); | 551 Node* slot_index = __ BytecodeOperandIdx(1); |
| 552 Node* depth = __ BytecodeOperandUImm(2); | 552 Node* depth = __ BytecodeOperandUImm(2); |
| 553 Node* slot_context = __ GetContextAtDepth(context, depth); | 553 Node* slot_context = __ GetContextAtDepth(context, depth); |
| 554 Node* result = __ LoadContextElement(slot_context, slot_index); | 554 Node* result = __ LoadContextElement(slot_context, slot_index); |
| 555 __ SetAccumulator(result); | 555 __ SetAccumulator(result); |
| 556 __ Dispatch(); | 556 __ Dispatch(); |
| 557 } | 557 } |
| 558 | 558 |
| 559 // LdaImmutableContextSlot <context> <slot_index> <depth> | |
| 560 // | |
| 561 // Load the object in |slot_index| of the context at |depth| in the context | |
| 562 // chain starting at |context| into the accumulator. | |
| 563 void Interpreter::DoLdaImmutableContextSlot(InterpreterAssembler* assembler) { | |
| 564 DoLdaContextSlot(assembler); | |
|
rmcilroy
2017/02/07 14:02:14
Could you add a TODO for Danno to share the machin
Jarin
2017/02/07 14:31:05
Done.
| |
| 565 } | |
| 566 | |
| 559 // LdaCurrentContextSlot <slot_index> | 567 // LdaCurrentContextSlot <slot_index> |
| 560 // | 568 // |
| 561 // Load the object in |slot_index| of the current context into the accumulator. | 569 // Load the object in |slot_index| of the current context into the accumulator. |
| 562 void Interpreter::DoLdaCurrentContextSlot(InterpreterAssembler* assembler) { | 570 void Interpreter::DoLdaCurrentContextSlot(InterpreterAssembler* assembler) { |
| 563 Node* slot_index = __ BytecodeOperandIdx(0); | 571 Node* slot_index = __ BytecodeOperandIdx(0); |
| 564 Node* slot_context = __ GetContext(); | 572 Node* slot_context = __ GetContext(); |
| 565 Node* result = __ LoadContextElement(slot_context, slot_index); | 573 Node* result = __ LoadContextElement(slot_context, slot_index); |
| 566 __ SetAccumulator(result); | 574 __ SetAccumulator(result); |
| 567 __ Dispatch(); | 575 __ Dispatch(); |
| 568 } | 576 } |
| 569 | 577 |
| 578 // LdaImmutableCurrentContextSlot <slot_index> | |
| 579 // | |
| 580 // Load the object in |slot_index| of the current context into the accumulator. | |
| 581 void Interpreter::DoLdaImmutableCurrentContextSlot( | |
| 582 InterpreterAssembler* assembler) { | |
| 583 DoLdaCurrentContextSlot(assembler); | |
| 584 } | |
| 585 | |
| 570 // StaContextSlot <context> <slot_index> <depth> | 586 // StaContextSlot <context> <slot_index> <depth> |
| 571 // | 587 // |
| 572 // Stores the object in the accumulator into |slot_index| of the context at | 588 // Stores the object in the accumulator into |slot_index| of the context at |
| 573 // |depth| in the context chain starting at |context|. | 589 // |depth| in the context chain starting at |context|. |
| 574 void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) { | 590 void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) { |
| 575 Node* value = __ GetAccumulator(); | 591 Node* value = __ GetAccumulator(); |
| 576 Node* reg_index = __ BytecodeOperandReg(0); | 592 Node* reg_index = __ BytecodeOperandReg(0); |
| 577 Node* context = __ LoadRegister(reg_index); | 593 Node* context = __ LoadRegister(reg_index); |
| 578 Node* slot_index = __ BytecodeOperandIdx(1); | 594 Node* slot_index = __ BytecodeOperandIdx(1); |
| 579 Node* depth = __ BytecodeOperandUImm(2); | 595 Node* depth = __ BytecodeOperandUImm(2); |
| (...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3311 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3327 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 3312 __ SmiTag(new_state)); | 3328 __ SmiTag(new_state)); |
| 3313 __ SetAccumulator(old_state); | 3329 __ SetAccumulator(old_state); |
| 3314 | 3330 |
| 3315 __ Dispatch(); | 3331 __ Dispatch(); |
| 3316 } | 3332 } |
| 3317 | 3333 |
| 3318 } // namespace interpreter | 3334 } // namespace interpreter |
| 3319 } // namespace internal | 3335 } // namespace internal |
| 3320 } // namespace v8 | 3336 } // namespace v8 |
| OLD | NEW |