OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 3530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3541 bind(&after_pool); | 3541 bind(&after_pool); |
3542 } | 3542 } |
3543 } | 3543 } |
3544 | 3544 |
3545 // Since a constant pool was just emitted, move the check offset forward by | 3545 // Since a constant pool was just emitted, move the check offset forward by |
3546 // the standard interval. | 3546 // the standard interval. |
3547 next_buffer_check_ = pc_offset() + kCheckPoolInterval; | 3547 next_buffer_check_ = pc_offset() + kCheckPoolInterval; |
3548 } | 3548 } |
3549 | 3549 |
3550 | 3550 |
3551 MaybeObject* Assembler::AllocateConstantPool(Heap* heap) { | 3551 Handle<ConstantPoolArray> Assembler::NewConstantPool(Isolate* isolate) { |
3552 ASSERT(FLAG_enable_ool_constant_pool); | 3552 if (!FLAG_enable_ool_constant_pool) { |
3553 return constant_pool_builder_.Allocate(heap); | 3553 return isolate->factory()->empty_constant_pool_array(); |
| 3554 } |
| 3555 return constant_pool_builder_.New(isolate); |
3554 } | 3556 } |
3555 | 3557 |
3556 | 3558 |
3557 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { | 3559 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { |
3558 ASSERT(FLAG_enable_ool_constant_pool); | |
3559 constant_pool_builder_.Populate(this, constant_pool); | 3560 constant_pool_builder_.Populate(this, constant_pool); |
3560 } | 3561 } |
3561 | 3562 |
3562 | 3563 |
3563 ConstantPoolBuilder::ConstantPoolBuilder() | 3564 ConstantPoolBuilder::ConstantPoolBuilder() |
3564 : entries_(), | 3565 : entries_(), |
3565 merged_indexes_(), | 3566 merged_indexes_(), |
3566 count_of_64bit_(0), | 3567 count_of_64bit_(0), |
3567 count_of_code_ptr_(0), | 3568 count_of_code_ptr_(0), |
3568 count_of_heap_ptr_(0), | 3569 count_of_heap_ptr_(0), |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3648 | 3649 |
3649 void ConstantPoolBuilder::Relocate(int pc_delta) { | 3650 void ConstantPoolBuilder::Relocate(int pc_delta) { |
3650 for (std::vector<RelocInfo>::iterator rinfo = entries_.begin(); | 3651 for (std::vector<RelocInfo>::iterator rinfo = entries_.begin(); |
3651 rinfo != entries_.end(); rinfo++) { | 3652 rinfo != entries_.end(); rinfo++) { |
3652 ASSERT(rinfo->rmode() != RelocInfo::JS_RETURN); | 3653 ASSERT(rinfo->rmode() != RelocInfo::JS_RETURN); |
3653 rinfo->set_pc(rinfo->pc() + pc_delta); | 3654 rinfo->set_pc(rinfo->pc() + pc_delta); |
3654 } | 3655 } |
3655 } | 3656 } |
3656 | 3657 |
3657 | 3658 |
3658 MaybeObject* ConstantPoolBuilder::Allocate(Heap* heap) { | 3659 Handle<ConstantPoolArray> ConstantPoolBuilder::New(Isolate* isolate) { |
3659 if (IsEmpty()) { | 3660 if (IsEmpty()) { |
3660 return heap->empty_constant_pool_array(); | 3661 return isolate->factory()->empty_constant_pool_array(); |
3661 } else { | 3662 } else { |
3662 return heap->AllocateConstantPoolArray(count_of_64bit_, count_of_code_ptr_, | 3663 return isolate->factory()->NewConstantPoolArray(count_of_64bit_, |
3663 count_of_heap_ptr_, count_of_32bit_); | 3664 count_of_code_ptr_, |
| 3665 count_of_heap_ptr_, |
| 3666 count_of_32bit_); |
3664 } | 3667 } |
3665 } | 3668 } |
3666 | 3669 |
3667 | 3670 |
3668 void ConstantPoolBuilder::Populate(Assembler* assm, | 3671 void ConstantPoolBuilder::Populate(Assembler* assm, |
3669 ConstantPoolArray* constant_pool) { | 3672 ConstantPoolArray* constant_pool) { |
3670 ASSERT(constant_pool->count_of_int64_entries() == count_of_64bit_); | 3673 ASSERT(constant_pool->count_of_int64_entries() == count_of_64bit_); |
3671 ASSERT(constant_pool->count_of_code_ptr_entries() == count_of_code_ptr_); | 3674 ASSERT(constant_pool->count_of_code_ptr_entries() == count_of_code_ptr_); |
3672 ASSERT(constant_pool->count_of_heap_ptr_entries() == count_of_heap_ptr_); | 3675 ASSERT(constant_pool->count_of_heap_ptr_entries() == count_of_heap_ptr_); |
3673 ASSERT(constant_pool->count_of_int32_entries() == count_of_32bit_); | 3676 ASSERT(constant_pool->count_of_int32_entries() == count_of_32bit_); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3733 ASSERT((index_64bit == count_of_64bit_) && | 3736 ASSERT((index_64bit == count_of_64bit_) && |
3734 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && | 3737 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && |
3735 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && | 3738 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && |
3736 (index_32bit == (index_heap_ptr + count_of_32bit_))); | 3739 (index_32bit == (index_heap_ptr + count_of_32bit_))); |
3737 } | 3740 } |
3738 | 3741 |
3739 | 3742 |
3740 } } // namespace v8::internal | 3743 } } // namespace v8::internal |
3741 | 3744 |
3742 #endif // V8_TARGET_ARCH_ARM | 3745 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |