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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 // Load the accumulator with the string representating type of the | 637 // Load the accumulator with the string representating type of the |
638 // object in the accumulator. | 638 // object in the accumulator. |
639 void Interpreter::DoTypeOf(compiler::InterpreterAssembler* assembler) { | 639 void Interpreter::DoTypeOf(compiler::InterpreterAssembler* assembler) { |
640 Node* accumulator = __ GetAccumulator(); | 640 Node* accumulator = __ GetAccumulator(); |
641 Node* result = __ CallRuntime(Runtime::kInterpreterTypeOf, accumulator); | 641 Node* result = __ CallRuntime(Runtime::kInterpreterTypeOf, accumulator); |
642 __ SetAccumulator(result); | 642 __ SetAccumulator(result); |
643 __ Dispatch(); | 643 __ Dispatch(); |
644 } | 644 } |
645 | 645 |
646 | 646 |
| 647 void Interpreter::DoDelete(Runtime::FunctionId function_id, |
| 648 compiler::InterpreterAssembler* assembler) { |
| 649 Node* reg_index = __ BytecodeOperandReg8(0); |
| 650 Node* object = __ LoadRegister(reg_index); |
| 651 Node* key = __ GetAccumulator(); |
| 652 Node* result = __ CallRuntime(function_id, object, key); |
| 653 __ SetAccumulator(result); |
| 654 __ Dispatch(); |
| 655 } |
| 656 |
| 657 |
| 658 // DeletePropertyStrict |
| 659 // |
| 660 // Delete the property specified in the accumulator from the object |
| 661 // referenced by the register operand following strict mode semantics. |
| 662 void Interpreter::DoDeletePropertyStrict( |
| 663 compiler::InterpreterAssembler* assembler) { |
| 664 DoDelete(Runtime::kDeleteProperty_Strict, assembler); |
| 665 } |
| 666 |
| 667 |
| 668 // DeletePropertySloppy |
| 669 // |
| 670 // Delete the property specified in the accumulator from the object |
| 671 // referenced by the register operand following sloppy mode semantics. |
| 672 void Interpreter::DoDeletePropertySloppy( |
| 673 compiler::InterpreterAssembler* assembler) { |
| 674 DoDelete(Runtime::kDeleteProperty_Sloppy, assembler); |
| 675 } |
| 676 |
| 677 |
647 // Call <callable> <receiver> <arg_count> | 678 // Call <callable> <receiver> <arg_count> |
648 // | 679 // |
649 // Call a JSfunction or Callable in |callable| with the |receiver| and | 680 // Call a JSfunction or Callable in |callable| with the |receiver| and |
650 // |arg_count| arguments in subsequent registers. | 681 // |arg_count| arguments in subsequent registers. |
651 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) { | 682 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) { |
652 Node* function_reg = __ BytecodeOperandReg8(0); | 683 Node* function_reg = __ BytecodeOperandReg8(0); |
653 Node* function = __ LoadRegister(function_reg); | 684 Node* function = __ LoadRegister(function_reg); |
654 Node* receiver_reg = __ BytecodeOperandReg8(1); | 685 Node* receiver_reg = __ BytecodeOperandReg8(1); |
655 Node* first_arg = __ RegisterLocation(receiver_reg); | 686 Node* first_arg = __ RegisterLocation(receiver_reg); |
656 Node* args_count = __ BytecodeOperandCount8(2); | 687 Node* args_count = __ BytecodeOperandCount8(2); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // | 1101 // |
1071 // Return the value in the accumulator. | 1102 // Return the value in the accumulator. |
1072 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 1103 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
1073 __ Return(); | 1104 __ Return(); |
1074 } | 1105 } |
1075 | 1106 |
1076 | 1107 |
1077 } // namespace interpreter | 1108 } // namespace interpreter |
1078 } // namespace internal | 1109 } // namespace internal |
1079 } // namespace v8 | 1110 } // namespace v8 |
OLD | NEW |