| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 // We skip free space objects. | 483 // We skip free space objects. |
| 484 if (!heap_object->IsFiller()) { | 484 if (!heap_object->IsFiller()) { |
| 485 DCHECK(heap_object->IsMap()); | 485 DCHECK(heap_object->IsMap()); |
| 486 FindPointersToNewSpaceInRegion( | 486 FindPointersToNewSpaceInRegion( |
| 487 heap_object->address() + Map::kPointerFieldsBeginOffset, | 487 heap_object->address() + Map::kPointerFieldsBeginOffset, |
| 488 heap_object->address() + Map::kPointerFieldsEndOffset, | 488 heap_object->address() + Map::kPointerFieldsEndOffset, |
| 489 slot_callback); | 489 slot_callback); |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 } else { | 492 } else { |
| 493 heap_->mark_compact_collector()->SweepOrWaitUntilSweepingCompleted( | 493 if (page->IsFlagSet(Page::COMPACTION_WAS_ABORTED)) { |
| 494 page); | 494 // Aborted pages require iterating using mark bits because they |
| 495 HeapObjectIterator iterator(page); | 495 // don't have an iterable object layout before sweeping (which can |
| 496 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; | 496 // only happen later). Note that we can never reach an |
| 497 heap_object = iterator.Next()) { | 497 // aborted page through the scavenger. |
| 498 // We iterate over objects that contain new space pointers only. | 498 DCHECK_EQ(heap_->gc_state(), Heap::MARK_COMPACT); |
| 499 heap_object->IterateBody(&visitor); | 499 heap_->mark_compact_collector()->VisitLiveObjects(page, &visitor); |
| 500 } else { |
| 501 heap_->mark_compact_collector() |
| 502 ->SweepOrWaitUntilSweepingCompleted(page); |
| 503 HeapObjectIterator iterator(page); |
| 504 for (HeapObject* heap_object = iterator.Next(); |
| 505 heap_object != nullptr; heap_object = iterator.Next()) { |
| 506 // We iterate over objects that contain new space pointers only. |
| 507 heap_object->IterateBody(&visitor); |
| 508 } |
| 500 } | 509 } |
| 501 } | 510 } |
| 502 } | 511 } |
| 503 } | 512 } |
| 504 } | 513 } |
| 505 if (callback_ != NULL) { | 514 if (callback_ != NULL) { |
| 506 (*callback_)(heap_, NULL, kStoreBufferScanningPageEvent); | 515 (*callback_)(heap_, NULL, kStoreBufferScanningPageEvent); |
| 507 } | 516 } |
| 508 } | 517 } |
| 509 } | 518 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 DCHECK(start_of_current_page_ != store_buffer_->Top()); | 614 DCHECK(start_of_current_page_ != store_buffer_->Top()); |
| 606 store_buffer_->SetTop(start_of_current_page_); | 615 store_buffer_->SetTop(start_of_current_page_); |
| 607 } | 616 } |
| 608 } else { | 617 } else { |
| 609 UNREACHABLE(); | 618 UNREACHABLE(); |
| 610 } | 619 } |
| 611 } | 620 } |
| 612 | 621 |
| 613 } // namespace internal | 622 } // namespace internal |
| 614 } // namespace v8 | 623 } // namespace v8 |
| OLD | NEW |