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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/counters.h" | 9 #include "src/counters.h" |
10 #include "src/heap/store-buffer-inl.h" | 10 #include "src/heap/store-buffer-inl.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 HeapObject* array = large_page->GetObject(); | 448 HeapObject* array = large_page->GetObject(); |
449 DCHECK(array->IsFixedArray()); | 449 DCHECK(array->IsFixedArray()); |
450 Address start = array->address(); | 450 Address start = array->address(); |
451 Address end = start + array->Size(); | 451 Address end = start + array->Size(); |
452 FindPointersToNewSpaceInRegion(start, end, slot_callback); | 452 FindPointersToNewSpaceInRegion(start, end, slot_callback); |
453 } else { | 453 } else { |
454 Page* page = reinterpret_cast<Page*>(chunk); | 454 Page* page = reinterpret_cast<Page*>(chunk); |
455 PagedSpace* owner = reinterpret_cast<PagedSpace*>(page->owner()); | 455 PagedSpace* owner = reinterpret_cast<PagedSpace*>(page->owner()); |
456 if (owner == heap_->map_space()) { | 456 if (owner == heap_->map_space()) { |
457 DCHECK(page->WasSwept()); | 457 DCHECK(page->WasSwept()); |
458 HeapObjectIterator iterator(page, NULL); | 458 HeapObjectIterator iterator(page); |
459 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; | 459 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; |
460 heap_object = iterator.Next()) { | 460 heap_object = iterator.Next()) { |
461 // We skip free space objects. | 461 // We skip free space objects. |
462 if (!heap_object->IsFiller()) { | 462 if (!heap_object->IsFiller()) { |
463 DCHECK(heap_object->IsMap()); | 463 DCHECK(heap_object->IsMap()); |
464 FindPointersToNewSpaceInRegion( | 464 FindPointersToNewSpaceInRegion( |
465 heap_object->address() + Map::kPointerFieldsBeginOffset, | 465 heap_object->address() + Map::kPointerFieldsBeginOffset, |
466 heap_object->address() + Map::kPointerFieldsEndOffset, | 466 heap_object->address() + Map::kPointerFieldsEndOffset, |
467 slot_callback); | 467 slot_callback); |
468 } | 468 } |
469 } | 469 } |
470 } else { | 470 } else { |
471 heap_->mark_compact_collector()->SweepOrWaitUntilSweepingCompleted( | 471 heap_->mark_compact_collector()->SweepOrWaitUntilSweepingCompleted( |
472 page); | 472 page); |
473 HeapObjectIterator iterator(page, NULL); | 473 HeapObjectIterator iterator(page); |
474 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; | 474 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; |
475 heap_object = iterator.Next()) { | 475 heap_object = iterator.Next()) { |
476 // We iterate over objects that contain new space pointers only. | 476 // We iterate over objects that contain new space pointers only. |
477 Address obj_address = heap_object->address(); | 477 Address obj_address = heap_object->address(); |
478 const int start_offset = HeapObject::kHeaderSize; | 478 const int start_offset = HeapObject::kHeaderSize; |
479 const int end_offset = heap_object->Size(); | 479 const int end_offset = heap_object->Size(); |
480 | 480 |
481 switch (heap_object->ContentType()) { | 481 switch (heap_object->ContentType()) { |
482 case HeapObjectContents::kTaggedValues: { | 482 case HeapObjectContents::kTaggedValues: { |
483 Address start_address = obj_address + start_offset; | 483 Address start_address = obj_address + start_offset; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 } | 576 } |
577 old_buffer_is_sorted_ = false; | 577 old_buffer_is_sorted_ = false; |
578 old_buffer_is_filtered_ = false; | 578 old_buffer_is_filtered_ = false; |
579 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 579 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
580 DCHECK(old_top_ <= old_limit_); | 580 DCHECK(old_top_ <= old_limit_); |
581 } | 581 } |
582 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 582 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
583 } | 583 } |
584 } // namespace internal | 584 } // namespace internal |
585 } // namespace v8 | 585 } // namespace v8 |
OLD | NEW |