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

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

Issue 1899813003: [crankshaft] Fragmentation-free allocation folding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
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/slot-set.h" 10 #include "src/heap/slot-set.h"
(...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 owner_->heap()->incremental_marking()->IsMarkingIncomplete() && 2383 owner_->heap()->incremental_marking()->IsMarkingIncomplete() &&
2384 FLAG_incremental_marking) { 2384 FLAG_incremental_marking) {
2385 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold); 2385 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold);
2386 // We don't want to give too large linear areas to the allocator while 2386 // We don't want to give too large linear areas to the allocator while
2387 // incremental marking is going on, because we won't check again whether 2387 // incremental marking is going on, because we won't check again whether
2388 // we want to do another increment until the linear area is used up. 2388 // we want to do another increment until the linear area is used up.
2389 owner_->Free(new_node->address() + size_in_bytes + linear_size, 2389 owner_->Free(new_node->address() + size_in_bytes + linear_size,
2390 new_node_size - size_in_bytes - linear_size); 2390 new_node_size - size_in_bytes - linear_size);
2391 owner_->SetTopAndLimit(new_node->address() + size_in_bytes, 2391 owner_->SetTopAndLimit(new_node->address() + size_in_bytes,
2392 new_node->address() + size_in_bytes + linear_size); 2392 new_node->address() + size_in_bytes + linear_size);
2393 } else if (bytes_left > 0) { 2393 } else if (bytes_left >= 0) {
Michael Lippautz 2016/04/19 10:49:50 nit: can we do this as "else" to make clear that t
Hannes Payer (out of office) 2016/04/19 11:03:56 Also would also mean that this value could be nega
2394 // Normally we give the rest of the node to the allocator as its new 2394 // Normally we give the rest of the node to the allocator as its new
2395 // linear allocation area. 2395 // linear allocation area.
2396 owner_->SetTopAndLimit(new_node->address() + size_in_bytes, 2396 owner_->SetTopAndLimit(new_node->address() + size_in_bytes,
2397 new_node->address() + new_node_size); 2397 new_node->address() + new_node_size);
2398 } 2398 }
2399 2399
2400 return new_node; 2400 return new_node;
2401 } 2401 }
2402 2402
2403 intptr_t FreeList::EvictFreeListItems(Page* page) { 2403 intptr_t FreeList::EvictFreeListItems(Page* page) {
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
3127 object->ShortPrint(); 3127 object->ShortPrint();
3128 PrintF("\n"); 3128 PrintF("\n");
3129 } 3129 }
3130 printf(" --------------------------------------\n"); 3130 printf(" --------------------------------------\n");
3131 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3131 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3132 } 3132 }
3133 3133
3134 #endif // DEBUG 3134 #endif // DEBUG
3135 } // namespace internal 3135 } // namespace internal
3136 } // namespace v8 3136 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698