OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 chunk->heap_ = heap; | 441 chunk->heap_ = heap; |
442 chunk->size_ = size; | 442 chunk->size_ = size; |
443 chunk->area_start_ = area_start; | 443 chunk->area_start_ = area_start; |
444 chunk->area_end_ = area_end; | 444 chunk->area_end_ = area_end; |
445 chunk->flags_ = 0; | 445 chunk->flags_ = 0; |
446 chunk->set_owner(owner); | 446 chunk->set_owner(owner); |
447 chunk->InitializeReservedMemory(); | 447 chunk->InitializeReservedMemory(); |
448 chunk->slots_buffer_ = NULL; | 448 chunk->slots_buffer_ = NULL; |
449 chunk->skip_list_ = NULL; | 449 chunk->skip_list_ = NULL; |
450 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity; | 450 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity; |
| 451 chunk->progress_bar_ = 0; |
451 chunk->high_water_mark_ = static_cast<int>(area_start - base); | 452 chunk->high_water_mark_ = static_cast<int>(area_start - base); |
452 chunk->ResetLiveBytes(); | 453 chunk->ResetLiveBytes(); |
453 Bitmap::Clear(chunk); | 454 Bitmap::Clear(chunk); |
454 chunk->initialize_scan_on_scavenge(false); | 455 chunk->initialize_scan_on_scavenge(false); |
455 chunk->SetFlag(WAS_SWEPT_PRECISELY); | 456 chunk->SetFlag(WAS_SWEPT_PRECISELY); |
456 | 457 |
457 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); | 458 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); |
458 ASSERT(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); | 459 ASSERT(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); |
459 | 460 |
460 if (executable == EXECUTABLE) { | 461 if (executable == EXECUTABLE) { |
(...skipping 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2777 LargePage* previous = NULL; | 2778 LargePage* previous = NULL; |
2778 LargePage* current = first_page_; | 2779 LargePage* current = first_page_; |
2779 while (current != NULL) { | 2780 while (current != NULL) { |
2780 HeapObject* object = current->GetObject(); | 2781 HeapObject* object = current->GetObject(); |
2781 // Can this large page contain pointers to non-trivial objects. No other | 2782 // Can this large page contain pointers to non-trivial objects. No other |
2782 // pointer object is this big. | 2783 // pointer object is this big. |
2783 bool is_pointer_object = object->IsFixedArray(); | 2784 bool is_pointer_object = object->IsFixedArray(); |
2784 MarkBit mark_bit = Marking::MarkBitFrom(object); | 2785 MarkBit mark_bit = Marking::MarkBitFrom(object); |
2785 if (mark_bit.Get()) { | 2786 if (mark_bit.Get()) { |
2786 mark_bit.Clear(); | 2787 mark_bit.Clear(); |
2787 MemoryChunk::IncrementLiveBytesFromGC(object->address(), -object->Size()); | 2788 Page::FromAddress(object->address())->ResetProgressBar(); |
| 2789 Page::FromAddress(object->address())->ResetLiveBytes(); |
2788 previous = current; | 2790 previous = current; |
2789 current = current->next_page(); | 2791 current = current->next_page(); |
2790 } else { | 2792 } else { |
2791 LargePage* page = current; | 2793 LargePage* page = current; |
2792 // Cut the chunk out from the chunk list. | 2794 // Cut the chunk out from the chunk list. |
2793 current = current->next_page(); | 2795 current = current->next_page(); |
2794 if (previous == NULL) { | 2796 if (previous == NULL) { |
2795 first_page_ = current; | 2797 first_page_ = current; |
2796 } else { | 2798 } else { |
2797 previous->set_next_page(current); | 2799 previous->set_next_page(current); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2945 object->ShortPrint(); | 2947 object->ShortPrint(); |
2946 PrintF("\n"); | 2948 PrintF("\n"); |
2947 } | 2949 } |
2948 printf(" --------------------------------------\n"); | 2950 printf(" --------------------------------------\n"); |
2949 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 2951 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
2950 } | 2952 } |
2951 | 2953 |
2952 #endif // DEBUG | 2954 #endif // DEBUG |
2953 | 2955 |
2954 } } // namespace v8::internal | 2956 } } // namespace v8::internal |
OLD | NEW |