| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3055 DCHECK(LargePage::IsValid(page)); | 3055 DCHECK(LargePage::IsValid(page)); |
| 3056 if (page->Contains(a)) { | 3056 if (page->Contains(a)) { |
| 3057 return page; | 3057 return page; |
| 3058 } | 3058 } |
| 3059 } | 3059 } |
| 3060 return NULL; | 3060 return NULL; |
| 3061 } | 3061 } |
| 3062 | 3062 |
| 3063 | 3063 |
| 3064 void LargeObjectSpace::ClearMarkingStateOfLiveObjects() { | 3064 void LargeObjectSpace::ClearMarkingStateOfLiveObjects() { |
| 3065 LargePage* current = first_page_; | 3065 LargeObjectIterator it(this); |
| 3066 while (current != NULL) { | 3066 for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { |
| 3067 HeapObject* object = current->GetObject(); | 3067 if (ObjectMarking::IsBlackOrGrey(obj)) { |
| 3068 DCHECK(ObjectMarking::IsBlack(object)); | 3068 ObjectMarking::ClearMarkBit(obj); |
| 3069 ObjectMarking::ClearMarkBit(object); | 3069 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); |
| 3070 Page::FromAddress(object->address())->ResetProgressBar(); | 3070 chunk->ResetProgressBar(); |
| 3071 Page::FromAddress(object->address())->ResetLiveBytes(); | 3071 chunk->ResetLiveBytes(); |
| 3072 current = current->next_page(); | 3072 } |
| 3073 DCHECK(ObjectMarking::IsWhite(obj)); |
| 3073 } | 3074 } |
| 3074 } | 3075 } |
| 3075 | 3076 |
| 3076 void LargeObjectSpace::InsertChunkMapEntries(LargePage* page) { | 3077 void LargeObjectSpace::InsertChunkMapEntries(LargePage* page) { |
| 3077 // Register all MemoryChunk::kAlignment-aligned chunks covered by | 3078 // Register all MemoryChunk::kAlignment-aligned chunks covered by |
| 3078 // this large page in the chunk map. | 3079 // this large page in the chunk map. |
| 3079 uintptr_t start = reinterpret_cast<uintptr_t>(page) / MemoryChunk::kAlignment; | 3080 uintptr_t start = reinterpret_cast<uintptr_t>(page) / MemoryChunk::kAlignment; |
| 3080 uintptr_t limit = (reinterpret_cast<uintptr_t>(page) + (page->size() - 1)) / | 3081 uintptr_t limit = (reinterpret_cast<uintptr_t>(page) + (page->size() - 1)) / |
| 3081 MemoryChunk::kAlignment; | 3082 MemoryChunk::kAlignment; |
| 3082 // There may be concurrent access on the chunk map. We have to take the lock | 3083 // There may be concurrent access on the chunk map. We have to take the lock |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3255 object->ShortPrint(); | 3256 object->ShortPrint(); |
| 3256 PrintF("\n"); | 3257 PrintF("\n"); |
| 3257 } | 3258 } |
| 3258 printf(" --------------------------------------\n"); | 3259 printf(" --------------------------------------\n"); |
| 3259 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3260 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3260 } | 3261 } |
| 3261 | 3262 |
| 3262 #endif // DEBUG | 3263 #endif // DEBUG |
| 3263 } // namespace internal | 3264 } // namespace internal |
| 3264 } // namespace v8 | 3265 } // namespace v8 |
| OLD | NEW |