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/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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 if (FitsInIdx8Operand(arg_count)) { | 592 if (FitsInIdx8Operand(arg_count)) { |
593 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(), | 593 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(), |
594 static_cast<uint8_t>(arg_count)); | 594 static_cast<uint8_t>(arg_count)); |
595 } else { | 595 } else { |
596 UNIMPLEMENTED(); | 596 UNIMPLEMENTED(); |
597 } | 597 } |
598 return *this; | 598 return *this; |
599 } | 599 } |
600 | 600 |
601 | 601 |
| 602 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, |
| 603 Register first_arg, |
| 604 size_t arg_count) { |
| 605 DCHECK(FitsInIdx8Operand(arg_count)); |
| 606 Output(Bytecode::kNew, constructor.ToOperand(), first_arg.ToOperand(), |
| 607 static_cast<uint8_t>(arg_count)); |
| 608 return *this; |
| 609 } |
| 610 |
| 611 |
602 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( | 612 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
603 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { | 613 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { |
604 DCHECK(FitsInIdx16Operand(function_id)); | 614 DCHECK(FitsInIdx16Operand(function_id)); |
605 DCHECK(FitsInIdx8Operand(arg_count)); | 615 DCHECK(FitsInIdx8Operand(arg_count)); |
606 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), | 616 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), |
607 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); | 617 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); |
608 return *this; | 618 return *this; |
609 } | 619 } |
610 | 620 |
611 | 621 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 | 855 |
846 Register TemporaryRegisterScope::NewRegister() { | 856 Register TemporaryRegisterScope::NewRegister() { |
847 count_++; | 857 count_++; |
848 last_register_index_ = builder_->BorrowTemporaryRegister(); | 858 last_register_index_ = builder_->BorrowTemporaryRegister(); |
849 return Register(last_register_index_); | 859 return Register(last_register_index_); |
850 } | 860 } |
851 | 861 |
852 } // namespace interpreter | 862 } // namespace interpreter |
853 } // namespace internal | 863 } // namespace internal |
854 } // namespace v8 | 864 } // namespace v8 |
OLD | NEW |