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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
521 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( | 521 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
522 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { | 522 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { |
523 DCHECK(FitsInIdx16Operand(function_id)); | 523 DCHECK(FitsInIdx16Operand(function_id)); |
524 DCHECK(FitsInIdx8Operand(arg_count)); | 524 DCHECK(FitsInIdx8Operand(arg_count)); |
525 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), | 525 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), |
526 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); | 526 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); |
527 return *this; | 527 return *this; |
528 } | 528 } |
529 | 529 |
530 | 530 |
531 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, | |
rmcilroy
2015/10/13 14:07:30
nit - move above CallRuntime
oth
2015/10/14 08:40:09
Done.
| |
532 Register first_arg, | |
533 size_t arg_count) { | |
534 DCHECK(FitsInIdx8Operand(arg_count)); | |
535 Output(Bytecode::kNew, constructor.ToOperand(), first_arg.ToOperand(), | |
536 static_cast<uint8_t>(arg_count)); | |
537 return *this; | |
538 } | |
539 | |
540 | |
531 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { | 541 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { |
532 // These constants shouldn't be added to the constant pool, the should use | 542 // These constants shouldn't be added to the constant pool, the should use |
533 // specialzed bytecodes instead. | 543 // specialzed bytecodes instead. |
534 DCHECK(!object.is_identical_to(isolate_->factory()->undefined_value())); | 544 DCHECK(!object.is_identical_to(isolate_->factory()->undefined_value())); |
535 DCHECK(!object.is_identical_to(isolate_->factory()->null_value())); | 545 DCHECK(!object.is_identical_to(isolate_->factory()->null_value())); |
536 DCHECK(!object.is_identical_to(isolate_->factory()->the_hole_value())); | 546 DCHECK(!object.is_identical_to(isolate_->factory()->the_hole_value())); |
537 DCHECK(!object.is_identical_to(isolate_->factory()->true_value())); | 547 DCHECK(!object.is_identical_to(isolate_->factory()->true_value())); |
538 DCHECK(!object.is_identical_to(isolate_->factory()->false_value())); | 548 DCHECK(!object.is_identical_to(isolate_->factory()->false_value())); |
539 | 549 |
540 size_t* entry = constants_map_.Find(object); | 550 size_t* entry = constants_map_.Find(object); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |
OLD | NEW |