OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3131 | 3131 |
3132 // Find the last live object in the cell. | 3132 // Find the last live object in the cell. |
3133 unsigned int leading_zeros = | 3133 unsigned int leading_zeros = |
3134 base::bits::CountLeadingZeros32(current_cell & slot_mask); | 3134 base::bits::CountLeadingZeros32(current_cell & slot_mask); |
3135 CHECK(leading_zeros != 32); | 3135 CHECK(leading_zeros != 32); |
3136 unsigned int offset = Bitmap::kBitIndexMask - leading_zeros; | 3136 unsigned int offset = Bitmap::kBitIndexMask - leading_zeros; |
3137 | 3137 |
3138 cell_base += (start_index - cell_base_start_index) * 32 * kPointerSize; | 3138 cell_base += (start_index - cell_base_start_index) * 32 * kPointerSize; |
3139 Address address = cell_base + offset * kPointerSize; | 3139 Address address = cell_base + offset * kPointerSize; |
3140 HeapObject* object = HeapObject::FromAddress(address); | 3140 HeapObject* object = HeapObject::FromAddress(address); |
| 3141 CHECK(Marking::IsBlack(Marking::MarkBitFrom(object))); |
3141 CHECK(object->address() < reinterpret_cast<Address>(slot)); | 3142 CHECK(object->address() < reinterpret_cast<Address>(slot)); |
3142 if (object->address() <= slot && | 3143 if (object->address() <= slot && |
3143 (object->address() + object->Size()) > slot) { | 3144 (object->address() + object->Size()) > slot) { |
3144 // If the slot is within the last found object in the cell, the slot is | 3145 // If the slot is within the last found object in the cell, the slot is |
3145 // in a live object. | 3146 // in a live object. |
3146 *out_object = object; | 3147 *out_object = object; |
3147 return true; | 3148 return true; |
3148 } | 3149 } |
3149 return false; | 3150 return false; |
3150 } | 3151 } |
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4750 SlotsBuffer* buffer = *buffer_address; | 4751 SlotsBuffer* buffer = *buffer_address; |
4751 while (buffer != NULL) { | 4752 while (buffer != NULL) { |
4752 SlotsBuffer* next_buffer = buffer->next(); | 4753 SlotsBuffer* next_buffer = buffer->next(); |
4753 DeallocateBuffer(buffer); | 4754 DeallocateBuffer(buffer); |
4754 buffer = next_buffer; | 4755 buffer = next_buffer; |
4755 } | 4756 } |
4756 *buffer_address = NULL; | 4757 *buffer_address = NULL; |
4757 } | 4758 } |
4758 } | 4759 } |
4759 } // namespace v8::internal | 4760 } // namespace v8::internal |
OLD | NEW |