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/spaces.h" | 5 #include "src/heap/spaces.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
10 #include "src/heap/slots-buffer.h" | 10 #include "src/heap/slots-buffer.h" |
(...skipping 3128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3139 } | 3139 } |
3140 return NULL; | 3140 return NULL; |
3141 } | 3141 } |
3142 | 3142 |
3143 | 3143 |
3144 void LargeObjectSpace::ClearMarkingStateOfLiveObjects() { | 3144 void LargeObjectSpace::ClearMarkingStateOfLiveObjects() { |
3145 LargePage* current = first_page_; | 3145 LargePage* current = first_page_; |
3146 while (current != NULL) { | 3146 while (current != NULL) { |
3147 HeapObject* object = current->GetObject(); | 3147 HeapObject* object = current->GetObject(); |
3148 MarkBit mark_bit = Marking::MarkBitFrom(object); | 3148 MarkBit mark_bit = Marking::MarkBitFrom(object); |
3149 DCHECK(Marking::IsBlackOrGrey(mark_bit)); | 3149 DCHECK(Marking::IsBlack(mark_bit)); |
3150 Marking::BlackToWhite(mark_bit); | 3150 Marking::BlackToWhite(mark_bit); |
3151 Page::FromAddress(object->address())->ResetProgressBar(); | 3151 Page::FromAddress(object->address())->ResetProgressBar(); |
3152 Page::FromAddress(object->address())->ResetLiveBytes(); | 3152 Page::FromAddress(object->address())->ResetLiveBytes(); |
3153 current = current->next_page(); | 3153 current = current->next_page(); |
3154 } | 3154 } |
3155 } | 3155 } |
3156 | 3156 |
3157 | 3157 |
3158 void LargeObjectSpace::FreeUnmarkedObjects() { | 3158 void LargeObjectSpace::FreeUnmarkedObjects() { |
3159 LargePage* previous = NULL; | 3159 LargePage* previous = NULL; |
3160 LargePage* current = first_page_; | 3160 LargePage* current = first_page_; |
3161 while (current != NULL) { | 3161 while (current != NULL) { |
3162 HeapObject* object = current->GetObject(); | 3162 HeapObject* object = current->GetObject(); |
3163 MarkBit mark_bit = Marking::MarkBitFrom(object); | 3163 MarkBit mark_bit = Marking::MarkBitFrom(object); |
3164 if (Marking::IsBlackOrGrey(mark_bit)) { | 3164 DCHECK(!Marking::IsGrey(mark_bit)); |
| 3165 if (Marking::IsBlack(mark_bit)) { |
3165 previous = current; | 3166 previous = current; |
3166 current = current->next_page(); | 3167 current = current->next_page(); |
3167 } else { | 3168 } else { |
3168 LargePage* page = current; | 3169 LargePage* page = current; |
3169 // Cut the chunk out from the chunk list. | 3170 // Cut the chunk out from the chunk list. |
3170 current = current->next_page(); | 3171 current = current->next_page(); |
3171 if (previous == NULL) { | 3172 if (previous == NULL) { |
3172 first_page_ = current; | 3173 first_page_ = current; |
3173 } else { | 3174 } else { |
3174 previous->set_next_page(current); | 3175 previous->set_next_page(current); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3322 object->ShortPrint(); | 3323 object->ShortPrint(); |
3323 PrintF("\n"); | 3324 PrintF("\n"); |
3324 } | 3325 } |
3325 printf(" --------------------------------------\n"); | 3326 printf(" --------------------------------------\n"); |
3326 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3327 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3327 } | 3328 } |
3328 | 3329 |
3329 #endif // DEBUG | 3330 #endif // DEBUG |
3330 } // namespace internal | 3331 } // namespace internal |
3331 } // namespace v8 | 3332 } // namespace v8 |
OLD | NEW |