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

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: Incorporate review comments on patch sets 2 and 3. 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 if (FitsInIdx8Operand(arg_count)) { 511 if (FitsInIdx8Operand(arg_count)) {
512 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(), 512 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(),
513 static_cast<uint8_t>(arg_count)); 513 static_cast<uint8_t>(arg_count));
514 } else { 514 } else {
515 UNIMPLEMENTED(); 515 UNIMPLEMENTED();
516 } 516 }
517 return *this; 517 return *this;
518 } 518 }
519 519
520 520
521 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor,
522 Register first_arg,
523 size_t arg_count) {
524 DCHECK(FitsInIdx8Operand(arg_count));
525 Output(Bytecode::kNew, constructor.ToOperand(), first_arg.ToOperand(),
526 static_cast<uint8_t>(arg_count));
527 return *this;
528 }
529
530
521 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( 531 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
522 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { 532 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) {
523 DCHECK(FitsInIdx16Operand(function_id)); 533 DCHECK(FitsInIdx16Operand(function_id));
524 DCHECK(FitsInIdx8Operand(arg_count)); 534 DCHECK(FitsInIdx8Operand(arg_count));
525 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), 535 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id),
526 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); 536 first_arg.ToOperand(), static_cast<uint8_t>(arg_count));
527 return *this; 537 return *this;
528 } 538 }
529 539
530 540
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 774
765 Register TemporaryRegisterScope::NewRegister() { 775 Register TemporaryRegisterScope::NewRegister() {
766 count_++; 776 count_++;
767 last_register_index_ = builder_->BorrowTemporaryRegister(); 777 last_register_index_ = builder_->BorrowTemporaryRegister();
768 return Register(last_register_index_); 778 return Register(last_register_index_);
769 } 779 }
770 780
771 } // namespace interpreter 781 } // namespace interpreter
772 } // namespace internal 782 } // namespace internal
773 } // namespace v8 783 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698