Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: src/arm/assembler-arm.cc

Issue 304143002: Add support for extended constant pool arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/assembler-arm.cc
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc
index a71bfca82865255eb789ed30e2b2fe39e205beb3..ee4def9076600b36cefdd585a1c001b3ae148ce7 100644
--- a/src/arm/assembler-arm.cc
+++ b/src/arm/assembler-arm.cc
@@ -3554,11 +3554,15 @@ void ConstantPoolBuilder::AddEntry(Assembler* assm,
// Check if we still have room for another entry given Arm's ldr and vldr
// immediate offset range.
- if (!(is_uint12(ConstantPoolArray::SizeFor(count_of_64bit_,
- count_of_code_ptr_,
- count_of_heap_ptr_,
- count_of_32bit_))) &&
- is_uint10(ConstantPoolArray::SizeFor(count_of_64bit_, 0, 0, 0))) {
+ // TODO(rmcilroy): Avoid creating a new object here when we support
+ // extended constant pools.
+ ConstantPoolArray::NumberOfEntries total(count_of_64bit_,
+ count_of_code_ptr_,
+ count_of_heap_ptr_,
+ count_of_32bit_);
+ ConstantPoolArray::NumberOfEntries int64_counts(count_of_64bit_, 0, 0, 0);
+ if (!(is_uint12(ConstantPoolArray::SizeFor(total)) &&
+ is_uint10(ConstantPoolArray::SizeFor(int64_counts)))) {
assm->set_constant_pool_full();
}
}
@@ -3577,20 +3581,26 @@ Handle<ConstantPoolArray> ConstantPoolBuilder::New(Isolate* isolate) {
if (IsEmpty()) {
return isolate->factory()->empty_constant_pool_array();
} else {
- return isolate->factory()->NewConstantPoolArray(count_of_64bit_,
- count_of_code_ptr_,
- count_of_heap_ptr_,
- count_of_32bit_);
+ ConstantPoolArray::NumberOfEntries small(count_of_64bit_,
+ count_of_code_ptr_,
+ count_of_heap_ptr_,
+ count_of_32bit_);
+ return isolate->factory()->NewConstantPoolArray(small);
}
}
void ConstantPoolBuilder::Populate(Assembler* assm,
ConstantPoolArray* constant_pool) {
- ASSERT(constant_pool->count_of_int64_entries() == count_of_64bit_);
- ASSERT(constant_pool->count_of_code_ptr_entries() == count_of_code_ptr_);
- ASSERT(constant_pool->count_of_heap_ptr_entries() == count_of_heap_ptr_);
- ASSERT(constant_pool->count_of_int32_entries() == count_of_32bit_);
+ ConstantPoolArray::LayoutSection section = ConstantPoolArray::SMALL_SECTION;
+ ASSERT(count_of_64bit_ ==
+ constant_pool->number_of_entries(ConstantPoolArray::INT64, section));
+ ASSERT(count_of_code_ptr_ ==
+ constant_pool->number_of_entries(ConstantPoolArray::CODE_PTR, section));
+ ASSERT(count_of_heap_ptr_ ==
+ constant_pool->number_of_entries(ConstantPoolArray::HEAP_PTR, section));
+ ASSERT(count_of_32bit_ ==
+ constant_pool->number_of_entries(ConstantPoolArray::INT32, section));
ASSERT(entries_.size() == merged_indexes_.size());
int index_64bit = 0;
@@ -3616,7 +3626,7 @@ void ConstantPoolBuilder::Populate(Assembler* assm,
offset = constant_pool->OffsetOfElementAt(index_code_ptr) -
kHeapObjectTag;
constant_pool->set(index_code_ptr++,
- reinterpret_cast<Object *>(rinfo->data()));
+ reinterpret_cast<Address>(rinfo->data()));
} else {
ASSERT(IsHeapPtrEntry(rmode));
offset = constant_pool->OffsetOfElementAt(index_heap_ptr) -
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698