| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |