Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing receiver slot. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
540 // TestEqual <src> 559 // TestEqual <src>
541 // 560 //
542 // Test if the value in the <src> register equals the accumulator. 561 // Test if the value in the <src> register equals the accumulator.
543 void Interpreter::DoTestEqual(compiler::InterpreterAssembler* assembler) { 562 void Interpreter::DoTestEqual(compiler::InterpreterAssembler* assembler) {
544 DoBinaryOp(Runtime::kInterpreterEquals, assembler); 563 DoBinaryOp(Runtime::kInterpreterEquals, assembler);
545 } 564 }
546 565
547 566
548 // TestNotEqual <src> 567 // TestNotEqual <src>
549 // 568 //
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 // 864 //
846 // Return the value in the accumulator. 865 // Return the value in the accumulator.
847 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 866 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
848 __ Return(); 867 __ Return();
849 } 868 }
850 869
851 870
852 } // namespace interpreter 871 } // namespace interpreter
853 } // namespace internal 872 } // namespace internal
854 } // namespace v8 873 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698