| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 Node* function_id = __ BytecodeOperandIdx16(0); | 530 Node* function_id = __ BytecodeOperandIdx16(0); |
| 531 Node* first_arg_reg = __ BytecodeOperandReg8(1); | 531 Node* first_arg_reg = __ BytecodeOperandReg8(1); |
| 532 Node* first_arg = __ RegisterLocation(first_arg_reg); | 532 Node* first_arg = __ RegisterLocation(first_arg_reg); |
| 533 Node* args_count = __ BytecodeOperandCount8(2); | 533 Node* args_count = __ BytecodeOperandCount8(2); |
| 534 Node* result = __ CallRuntime(function_id, first_arg, args_count); | 534 Node* result = __ CallRuntime(function_id, first_arg, args_count); |
| 535 __ SetAccumulator(result); | 535 __ SetAccumulator(result); |
| 536 __ Dispatch(); | 536 __ Dispatch(); |
| 537 } | 537 } |
| 538 | 538 |
| 539 | 539 |
| 540 // New <constructor> <arg_count> | |
| 541 // | |
| 542 // Call operator new with |constructor| and the first argument in | |
| 543 // register |first_arg| and |arg_count| arguments in subsequent | |
| 544 // | |
| 545 void Interpreter::DoNew(compiler::InterpreterAssembler* assembler) { | |
| 546 Callable ic = CodeFactory::InterpreterPushArgsAndConstruct(isolate_); | |
| 547 Node* constructor_index = __ BytecodeOperandReg8(0); | |
| 548 Node* constructor = __ LoadRegister(constructor_index); | |
| 549 Node* first_arg_reg = __ BytecodeOperandReg8(1); | |
| 550 Node* first_arg = __ RegisterLocation(first_arg_reg); | |
| 551 Node* args_count = __ BytecodeOperandCount8(2); | |
| 552 Node* result = | |
| 553 __ CallConstruct(constructor, constructor, first_arg, args_count); | |
| 554 __ SetAccumulator(result); | |
| 555 __ Dispatch(); | |
| 556 } | |
| 557 | |
| 558 | |
| 559 // TestEqual <src> | 540 // TestEqual <src> |
| 560 // | 541 // |
| 561 // Test if the value in the <src> register equals the accumulator. | 542 // Test if the value in the <src> register equals the accumulator. |
| 562 void Interpreter::DoTestEqual(compiler::InterpreterAssembler* assembler) { | 543 void Interpreter::DoTestEqual(compiler::InterpreterAssembler* assembler) { |
| 563 DoBinaryOp(Runtime::kInterpreterEquals, assembler); | 544 DoBinaryOp(Runtime::kInterpreterEquals, assembler); |
| 564 } | 545 } |
| 565 | 546 |
| 566 | 547 |
| 567 // TestNotEqual <src> | 548 // TestNotEqual <src> |
| 568 // | 549 // |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 // | 845 // |
| 865 // Return the value in the accumulator. | 846 // Return the value in the accumulator. |
| 866 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 847 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
| 867 __ Return(); | 848 __ Return(); |
| 868 } | 849 } |
| 869 | 850 |
| 870 | 851 |
| 871 } // namespace interpreter | 852 } // namespace interpreter |
| 872 } // namespace internal | 853 } // namespace internal |
| 873 } // namespace v8 | 854 } // namespace v8 |
| OLD | NEW |