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

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

Issue 2109473004: [heap] Eagerly unlink empty kHuge category from free list (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months 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 | « no previous file | 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/base/platform/semaphore.h" 9 #include "src/base/platform/semaphore.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 FreeSpace* node = nullptr; 2354 FreeSpace* node = nullptr;
2355 while (it.HasNext()) { 2355 while (it.HasNext()) {
2356 FreeListCategory* current = it.Next(); 2356 FreeListCategory* current = it.Next();
2357 node = current->SearchForNodeInList(minimum_size, node_size); 2357 node = current->SearchForNodeInList(minimum_size, node_size);
2358 if (node != nullptr) { 2358 if (node != nullptr) {
2359 Page::FromAddress(node->address()) 2359 Page::FromAddress(node->address())
2360 ->add_available_in_free_list(-(*node_size)); 2360 ->add_available_in_free_list(-(*node_size));
2361 DCHECK(IsVeryLong() || Available() == SumFreeLists()); 2361 DCHECK(IsVeryLong() || Available() == SumFreeLists());
2362 return node; 2362 return node;
2363 } 2363 }
2364 if (current->is_empty()) {
2365 RemoveCategory(current);
2366 }
2364 } 2367 }
2365 return node; 2368 return node;
2366 } 2369 }
2367 2370
2368 FreeSpace* FreeList::FindNodeFor(int size_in_bytes, int* node_size) { 2371 FreeSpace* FreeList::FindNodeFor(int size_in_bytes, int* node_size) {
2369 FreeSpace* node = nullptr; 2372 FreeSpace* node = nullptr;
2370 2373
2371 // First try the allocation fast path: try to allocate the minimum element 2374 // First try the allocation fast path: try to allocate the minimum element
2372 // size of a free list category. This operation is constant time. 2375 // size of a free list category. This operation is constant time.
2373 FreeListCategoryType type = 2376 FreeListCategoryType type =
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 object->ShortPrint(); 3223 object->ShortPrint();
3221 PrintF("\n"); 3224 PrintF("\n");
3222 } 3225 }
3223 printf(" --------------------------------------\n"); 3226 printf(" --------------------------------------\n");
3224 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3227 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3225 } 3228 }
3226 3229
3227 #endif // DEBUG 3230 #endif // DEBUG
3228 } // namespace internal 3231 } // namespace internal
3229 } // namespace v8 3232 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698