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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more test. 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
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/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 if (FitsInIdx8Operand(arg_count)) { 576 if (FitsInIdx8Operand(arg_count)) {
577 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(), 577 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(),
578 static_cast<uint8_t>(arg_count)); 578 static_cast<uint8_t>(arg_count));
579 } else { 579 } else {
580 UNIMPLEMENTED(); 580 UNIMPLEMENTED();
581 } 581 }
582 return *this; 582 return *this;
583 } 583 }
584 584
585 585
586 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor,
587 Register first_arg,
588 size_t arg_count) {
589 DCHECK(FitsInIdx8Operand(arg_count));
590 Output(Bytecode::kNew, constructor.ToOperand(), first_arg.ToOperand(),
591 static_cast<uint8_t>(arg_count));
592 return *this;
593 }
594
595
586 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( 596 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
587 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { 597 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) {
588 DCHECK(FitsInIdx16Operand(function_id)); 598 DCHECK(FitsInIdx16Operand(function_id));
589 DCHECK(FitsInIdx8Operand(arg_count)); 599 DCHECK(FitsInIdx8Operand(arg_count));
590 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), 600 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id),
591 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); 601 first_arg.ToOperand(), static_cast<uint8_t>(arg_count));
592 return *this; 602 return *this;
593 } 603 }
594 604
595 605
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 839
830 Register TemporaryRegisterScope::NewRegister() { 840 Register TemporaryRegisterScope::NewRegister() {
831 count_++; 841 count_++;
832 last_register_index_ = builder_->BorrowTemporaryRegister(); 842 last_register_index_ = builder_->BorrowTemporaryRegister();
833 return Register(last_register_index_); 843 return Register(last_register_index_);
834 } 844 }
835 845
836 } // namespace interpreter 846 } // namespace interpreter
837 } // namespace internal 847 } // namespace internal
838 } // namespace v8 848 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698