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 // TODO(danno) Share the actual code object rather creating a duplicate one. |
| 565 DoLdaContextSlot(assembler); |
| 566 } |
| 567 |
559 // LdaCurrentContextSlot <slot_index> | 568 // LdaCurrentContextSlot <slot_index> |
560 // | 569 // |
561 // Load the object in |slot_index| of the current context into the accumulator. | 570 // Load the object in |slot_index| of the current context into the accumulator. |
562 void Interpreter::DoLdaCurrentContextSlot(InterpreterAssembler* assembler) { | 571 void Interpreter::DoLdaCurrentContextSlot(InterpreterAssembler* assembler) { |
563 Node* slot_index = __ BytecodeOperandIdx(0); | 572 Node* slot_index = __ BytecodeOperandIdx(0); |
564 Node* slot_context = __ GetContext(); | 573 Node* slot_context = __ GetContext(); |
565 Node* result = __ LoadContextElement(slot_context, slot_index); | 574 Node* result = __ LoadContextElement(slot_context, slot_index); |
566 __ SetAccumulator(result); | 575 __ SetAccumulator(result); |
567 __ Dispatch(); | 576 __ Dispatch(); |
568 } | 577 } |
569 | 578 |
| 579 // LdaImmutableCurrentContextSlot <slot_index> |
| 580 // |
| 581 // Load the object in |slot_index| of the current context into the accumulator. |
| 582 void Interpreter::DoLdaImmutableCurrentContextSlot( |
| 583 InterpreterAssembler* assembler) { |
| 584 // TODO(danno) Share the actual code object rather creating a duplicate one. |
| 585 DoLdaCurrentContextSlot(assembler); |
| 586 } |
| 587 |
570 // StaContextSlot <context> <slot_index> <depth> | 588 // StaContextSlot <context> <slot_index> <depth> |
571 // | 589 // |
572 // Stores the object in the accumulator into |slot_index| of the context at | 590 // Stores the object in the accumulator into |slot_index| of the context at |
573 // |depth| in the context chain starting at |context|. | 591 // |depth| in the context chain starting at |context|. |
574 void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) { | 592 void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) { |
575 Node* value = __ GetAccumulator(); | 593 Node* value = __ GetAccumulator(); |
576 Node* reg_index = __ BytecodeOperandReg(0); | 594 Node* reg_index = __ BytecodeOperandReg(0); |
577 Node* context = __ LoadRegister(reg_index); | 595 Node* context = __ LoadRegister(reg_index); |
578 Node* slot_index = __ BytecodeOperandIdx(1); | 596 Node* slot_index = __ BytecodeOperandIdx(1); |
579 Node* depth = __ BytecodeOperandUImm(2); | 597 Node* depth = __ BytecodeOperandUImm(2); |
(...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3311 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3329 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3312 __ SmiTag(new_state)); | 3330 __ SmiTag(new_state)); |
3313 __ SetAccumulator(old_state); | 3331 __ SetAccumulator(old_state); |
3314 | 3332 |
3315 __ Dispatch(); | 3333 __ Dispatch(); |
3316 } | 3334 } |
3317 | 3335 |
3318 } // namespace interpreter | 3336 } // namespace interpreter |
3319 } // namespace internal | 3337 } // namespace internal |
3320 } // namespace v8 | 3338 } // namespace v8 |
OLD | NEW |