| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 75ff8393e06c3dcb02608c1e2c35ff1e39f00454..d616ff406c5e08939bed8389fb01a6018d4ed767 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -2203,6 +2203,8 @@ SMI_ACCESSORS(
|
| SMI_ACCESSORS(
|
| ConstantPoolArray, first_heap_ptr_index, kFirstHeapPointerIndexOffset)
|
| SMI_ACCESSORS(
|
| + ConstantPoolArray, first_weak_ptr_index, kFirstWeakPointerIndexOffset)
|
| +SMI_ACCESSORS(
|
| ConstantPoolArray, first_int32_index, kFirstInt32IndexOffset)
|
|
|
|
|
| @@ -2211,6 +2213,11 @@ int ConstantPoolArray::first_int64_index() {
|
| }
|
|
|
|
|
| +int ConstantPoolArray::first_ptr_index() {
|
| + return first_code_ptr_index();
|
| +}
|
| +
|
| +
|
| int ConstantPoolArray::count_of_int64_entries() {
|
| return first_code_ptr_index();
|
| }
|
| @@ -2222,7 +2229,12 @@ int ConstantPoolArray::count_of_code_ptr_entries() {
|
|
|
|
|
| int ConstantPoolArray::count_of_heap_ptr_entries() {
|
| - return first_int32_index() - first_heap_ptr_index();
|
| + return first_weak_ptr_index() - first_heap_ptr_index();
|
| +}
|
| +
|
| +
|
| +int ConstantPoolArray::count_of_weak_ptr_entries() {
|
| + return first_int32_index() - first_weak_ptr_index();
|
| }
|
|
|
|
|
| @@ -2231,15 +2243,24 @@ int ConstantPoolArray::count_of_int32_entries() {
|
| }
|
|
|
|
|
| +int ConstantPoolArray::count_of_ptr_entries() {
|
| + return count_of_code_ptr_entries() + count_of_heap_ptr_entries() +
|
| + count_of_weak_ptr_entries();
|
| +}
|
| +
|
| +
|
| void ConstantPoolArray::SetEntryCounts(int number_of_int64_entries,
|
| int number_of_code_ptr_entries,
|
| int number_of_heap_ptr_entries,
|
| + int number_of_weak_ptr_entries,
|
| int number_of_int32_entries) {
|
| int current_index = number_of_int64_entries;
|
| set_first_code_ptr_index(current_index);
|
| current_index += number_of_code_ptr_entries;
|
| set_first_heap_ptr_index(current_index);
|
| current_index += number_of_heap_ptr_entries;
|
| + set_first_weak_ptr_index(current_index);
|
| + current_index += number_of_weak_ptr_entries;
|
| set_first_int32_index(current_index);
|
| current_index += number_of_int32_entries;
|
| set_length(current_index);
|
| @@ -2269,7 +2290,14 @@ Address ConstantPoolArray::get_code_ptr_entry(int index) {
|
|
|
| Object* ConstantPoolArray::get_heap_ptr_entry(int index) {
|
| ASSERT(map() == GetHeap()->constant_pool_array_map());
|
| - ASSERT(index >= first_heap_ptr_index() && index < first_int32_index());
|
| + ASSERT(index >= first_heap_ptr_index() && index < first_weak_ptr_index());
|
| + return READ_FIELD(this, OffsetOfElementAt(index));
|
| +}
|
| +
|
| +
|
| +Object* ConstantPoolArray::get_weak_ptr_entry(int index) {
|
| + ASSERT(map() == GetHeap()->constant_pool_array_map());
|
| + ASSERT(index >= first_weak_ptr_index() && index < first_int32_index());
|
| return READ_FIELD(this, OffsetOfElementAt(index));
|
| }
|
|
|
| @@ -2290,7 +2318,7 @@ void ConstantPoolArray::set(int index, Address value) {
|
|
|
| void ConstantPoolArray::set(int index, Object* value) {
|
| ASSERT(map() == GetHeap()->constant_pool_array_map());
|
| - ASSERT(index >= first_code_ptr_index() && index < first_int32_index());
|
| + ASSERT(index >= first_heap_ptr_index() && index < first_int32_index());
|
| WRITE_FIELD(this, OffsetOfElementAt(index), value);
|
| WRITE_BARRIER(GetHeap(), this, OffsetOfElementAt(index), value);
|
| }
|
| @@ -3874,8 +3902,7 @@ int HeapObject::SizeFromMap(Map* map) {
|
| if (instance_type == CONSTANT_POOL_ARRAY_TYPE) {
|
| return ConstantPoolArray::SizeFor(
|
| reinterpret_cast<ConstantPoolArray*>(this)->count_of_int64_entries(),
|
| - reinterpret_cast<ConstantPoolArray*>(this)->count_of_code_ptr_entries(),
|
| - reinterpret_cast<ConstantPoolArray*>(this)->count_of_heap_ptr_entries(),
|
| + reinterpret_cast<ConstantPoolArray*>(this)->count_of_ptr_entries(),
|
| reinterpret_cast<ConstantPoolArray*>(this)->count_of_int32_entries());
|
| }
|
| if (instance_type >= FIRST_FIXED_TYPED_ARRAY_TYPE &&
|
| @@ -4577,7 +4604,6 @@ Object* Code::GetObjectFromEntryAddress(Address location_of_address) {
|
|
|
|
|
| bool Code::IsWeakObjectInOptimizedCode(Object* object) {
|
| - ASSERT(is_optimized_code());
|
| if (object->IsMap()) {
|
| return Map::cast(object)->CanTransition() &&
|
| FLAG_collect_maps &&
|
|
|