Forward white to grey transition only if slot is before the progress bar of a given object.
BUG= Review URL: https://codereview.chromium.org/11415070 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13063 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
ec49191302
commit
865828f37e
@ -44,8 +44,12 @@ bool IncrementalMarking::BaseRecordWrite(HeapObject* obj,
|
||||
if (Marking::IsBlack(obj_bit)) {
|
||||
MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address());
|
||||
if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) {
|
||||
WhiteToGreyAndPush(value_heap_obj, value_bit);
|
||||
RestartIfNotMarking();
|
||||
if (chunk->IsLeftOfProgressBar(slot)) {
|
||||
WhiteToGreyAndPush(value_heap_obj, value_bit);
|
||||
RestartIfNotMarking();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
BlackToGreyAndUnshift(obj, obj_bit);
|
||||
RestartIfNotMarking();
|
||||
|
@ -503,6 +503,12 @@ class MemoryChunk {
|
||||
}
|
||||
}
|
||||
|
||||
bool IsLeftOfProgressBar(Object** slot) {
|
||||
Address slot_address = reinterpret_cast<Address>(slot);
|
||||
ASSERT(slot_address > this->address());
|
||||
return (slot_address - this->address() + kObjectStartOffset) <
|
||||
progress_bar();
|
||||
}
|
||||
|
||||
static void IncrementLiveBytesFromGC(Address address, int by) {
|
||||
MemoryChunk::FromAddress(address)->IncrementLiveBytes(by);
|
||||
|
Loading…
Reference in New Issue
Block a user