| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index b3f23e65e3d2998a43dbd04b21213dde5ebf2e4e..2ad03eb9a8a7b8df4e6990919e661522e5591a81 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -2218,12 +2218,18 @@ bool FixedDoubleArray::is_the_hole(int index) {
|
| }
|
|
|
|
|
| -SMI_ACCESSORS(
|
| - ConstantPoolArray, first_code_ptr_index, kFirstCodePointerIndexOffset)
|
| -SMI_ACCESSORS(
|
| - ConstantPoolArray, first_heap_ptr_index, kFirstHeapPointerIndexOffset)
|
| -SMI_ACCESSORS(
|
| - ConstantPoolArray, first_int32_index, kFirstInt32IndexOffset)
|
| +void ConstantPoolArray::set_weak_object_state(
|
| + ConstantPoolArray::WeakObjectState state) {
|
| + int old_layout_field = READ_INT_FIELD(this, kArrayLayoutOffset);
|
| + int new_layout_field = WeakObjectStateField::update(old_layout_field, state);
|
| + WRITE_INT_FIELD(this, kArrayLayoutOffset, new_layout_field);
|
| +}
|
| +
|
| +
|
| +ConstantPoolArray::WeakObjectState ConstantPoolArray::get_weak_object_state() {
|
| + int layout_field = READ_INT_FIELD(this, kArrayLayoutOffset);
|
| + return WeakObjectStateField::decode(layout_field);
|
| +}
|
|
|
|
|
| int ConstantPoolArray::first_int64_index() {
|
| @@ -2231,6 +2237,27 @@ int ConstantPoolArray::first_int64_index() {
|
| }
|
|
|
|
|
| +int ConstantPoolArray::first_code_ptr_index() {
|
| + int layout_field = READ_INT_FIELD(this, kArrayLayoutOffset);
|
| + return first_int64_index() +
|
| + NumberOfInt64EntriesField::decode(layout_field);
|
| +}
|
| +
|
| +
|
| +int ConstantPoolArray::first_heap_ptr_index() {
|
| + int layout_field = READ_INT_FIELD(this, kArrayLayoutOffset);
|
| + return first_code_ptr_index() +
|
| + NumberOfCodePtrEntriesField::decode(layout_field);
|
| +}
|
| +
|
| +
|
| +int ConstantPoolArray::first_int32_index() {
|
| + int layout_field = READ_INT_FIELD(this, kArrayLayoutOffset);
|
| + return first_heap_ptr_index() +
|
| + NumberOfHeapPtrEntriesField::decode(layout_field);
|
| +}
|
| +
|
| +
|
| int ConstantPoolArray::count_of_int64_entries() {
|
| return first_code_ptr_index();
|
| }
|
| @@ -2251,18 +2278,20 @@ int ConstantPoolArray::count_of_int32_entries() {
|
| }
|
|
|
|
|
| -void ConstantPoolArray::SetEntryCounts(int number_of_int64_entries,
|
| - int number_of_code_ptr_entries,
|
| - int number_of_heap_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_int32_index(current_index);
|
| - current_index += number_of_int32_entries;
|
| - set_length(current_index);
|
| +void ConstantPoolArray::Init(int number_of_int64_entries,
|
| + int number_of_code_ptr_entries,
|
| + int number_of_heap_ptr_entries,
|
| + int number_of_int32_entries) {
|
| + set_length(number_of_int64_entries +
|
| + number_of_code_ptr_entries +
|
| + number_of_heap_ptr_entries +
|
| + number_of_int32_entries);
|
| + int layout_field =
|
| + NumberOfInt64EntriesField::encode(number_of_int64_entries) |
|
| + NumberOfCodePtrEntriesField::encode(number_of_code_ptr_entries) |
|
| + NumberOfHeapPtrEntriesField::encode(number_of_heap_ptr_entries) |
|
| + WeakObjectStateField::encode(NO_WEAK_OBJECTS);
|
| + WRITE_INT_FIELD(this, kArrayLayoutOffset, layout_field);
|
| }
|
|
|
|
|
| @@ -4598,7 +4627,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 &&
|
|
|