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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (FitsInIdxOperand(arg_count)) { | 449 if (FitsInIdxOperand(arg_count)) { |
450 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(), | 450 Output(Bytecode::kCall, callable.ToOperand(), receiver.ToOperand(), |
451 static_cast<uint8_t>(arg_count)); | 451 static_cast<uint8_t>(arg_count)); |
452 } else { | 452 } else { |
453 UNIMPLEMENTED(); | 453 UNIMPLEMENTED(); |
454 } | 454 } |
455 return *this; | 455 return *this; |
456 } | 456 } |
457 | 457 |
458 | 458 |
| 459 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
| 460 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { |
| 461 if (FitsInIdxOperand(function_id) && FitsInIdxOperand(arg_count)) { |
| 462 Output(Bytecode::kCallRuntime, static_cast<uint8_t>(function_id), |
| 463 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); |
| 464 } else { |
| 465 UNIMPLEMENTED(); |
| 466 } |
| 467 return *this; |
| 468 } |
| 469 |
| 470 |
459 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { | 471 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { |
460 // These constants shouldn't be added to the constant pool, the should use | 472 // These constants shouldn't be added to the constant pool, the should use |
461 // specialzed bytecodes instead. | 473 // specialzed bytecodes instead. |
462 DCHECK(!object.is_identical_to(isolate_->factory()->undefined_value())); | 474 DCHECK(!object.is_identical_to(isolate_->factory()->undefined_value())); |
463 DCHECK(!object.is_identical_to(isolate_->factory()->null_value())); | 475 DCHECK(!object.is_identical_to(isolate_->factory()->null_value())); |
464 DCHECK(!object.is_identical_to(isolate_->factory()->the_hole_value())); | 476 DCHECK(!object.is_identical_to(isolate_->factory()->the_hole_value())); |
465 DCHECK(!object.is_identical_to(isolate_->factory()->true_value())); | 477 DCHECK(!object.is_identical_to(isolate_->factory()->true_value())); |
466 DCHECK(!object.is_identical_to(isolate_->factory()->false_value())); | 478 DCHECK(!object.is_identical_to(isolate_->factory()->false_value())); |
467 | 479 |
468 size_t* entry = constants_map_.Find(object); | 480 size_t* entry = constants_map_.Find(object); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 616 |
605 Register TemporaryRegisterScope::NewRegister() { | 617 Register TemporaryRegisterScope::NewRegister() { |
606 count_++; | 618 count_++; |
607 last_register_index_ = builder_->BorrowTemporaryRegister(); | 619 last_register_index_ = builder_->BorrowTemporaryRegister(); |
608 return Register(last_register_index_); | 620 return Register(last_register_index_); |
609 } | 621 } |
610 | 622 |
611 } // namespace interpreter | 623 } // namespace interpreter |
612 } // namespace internal | 624 } // namespace internal |
613 } // namespace v8 | 625 } // namespace v8 |
OLD | NEW |