Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Side by Side Diff: src/heap/spaces.cc

Issue 1488393003: Reland of [heap] Cleanup mark bit usage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698