| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/heap/store-buffer.h" | 5 #include "src/heap/store-buffer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/counters.h" | 9 #include "src/counters.h" |
| 10 #include "src/heap/incremental-marking.h" | 10 #include "src/heap/incremental-marking.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 Compact(); | 372 Compact(); |
| 373 Address* new_top = old_start_; | 373 Address* new_top = old_start_; |
| 374 for (Address* current = old_start_; current < old_top_; current++) { | 374 for (Address* current = old_start_; current < old_top_; current++) { |
| 375 Address addr = *current; | 375 Address addr = *current; |
| 376 Object** slot = reinterpret_cast<Object**>(addr); | 376 Object** slot = reinterpret_cast<Object**>(addr); |
| 377 Object* object = *slot; | 377 Object* object = *slot; |
| 378 if (heap_->InNewSpace(object) && object->IsHeapObject()) { | 378 if (heap_->InNewSpace(object) && object->IsHeapObject()) { |
| 379 // If the target object is not black, the source slot must be part | 379 // If the target object is not black, the source slot must be part |
| 380 // of a non-black (dead) object. | 380 // of a non-black (dead) object. |
| 381 HeapObject* heap_object = HeapObject::cast(object); | 381 HeapObject* heap_object = HeapObject::cast(object); |
| 382 if (Marking::IsBlack(Marking::MarkBitFrom(heap_object)) && | 382 Page* heap_object_page = Page::FromAddress(heap_object->address()); |
| 383 heap_->mark_compact_collector()->IsSlotInLiveObject(addr)) { | 383 if (heap_object_page->IsFlagSet(Page::BLACK_PAGE) || |
| 384 (Marking::IsBlack(Marking::MarkBitFrom(heap_object)) && |
| 385 heap_->mark_compact_collector()->IsSlotInLiveObject(addr))) { |
| 384 *new_top++ = addr; | 386 *new_top++ = addr; |
| 385 } | 387 } |
| 386 } | 388 } |
| 387 } | 389 } |
| 388 old_top_ = new_top; | 390 old_top_ = new_top; |
| 389 ClearFilteringHashSets(); | 391 ClearFilteringHashSets(); |
| 390 | 392 |
| 391 // Don't scan on scavenge dead large objects. | 393 // Don't scan on scavenge dead large objects. |
| 392 LargeObjectIterator it(heap_->lo_space()); | 394 LargeObjectIterator it(heap_->lo_space()); |
| 393 for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) { | 395 for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 DCHECK(start_of_current_page_ != store_buffer_->Top()); | 617 DCHECK(start_of_current_page_ != store_buffer_->Top()); |
| 616 store_buffer_->SetTop(start_of_current_page_); | 618 store_buffer_->SetTop(start_of_current_page_); |
| 617 } | 619 } |
| 618 } else { | 620 } else { |
| 619 UNREACHABLE(); | 621 UNREACHABLE(); |
| 620 } | 622 } |
| 621 } | 623 } |
| 622 | 624 |
| 623 } // namespace internal | 625 } // namespace internal |
| 624 } // namespace v8 | 626 } // namespace v8 |
| OLD | NEW |