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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1069763002: Check mark bit of the found object in MarkCompactCollector::IsSlotInBlackObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698