[heap] Flip between large object and new large object allocation mode based on --young_generation_large_objects.
Bug: chromium:852420 Change-Id: I5bb03c6ab14b4e42988e917f7ca7d449d53723d8 Reviewed-on: https://chromium-review.googlesource.com/c/1350995 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Hannes Payer <hpayer@chromium.org> Cr-Commit-Position: refs/heads/master@{#57849}
This commit is contained in:
parent
a86739187c
commit
8930ad2bb9
@ -177,21 +177,16 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
|
||||
IncrementObjectCounters();
|
||||
#endif
|
||||
|
||||
bool large_object = !FLAG_young_generation_large_objects &&
|
||||
size_in_bytes > kMaxRegularHeapObjectSize;
|
||||
bool new_large_object = FLAG_young_generation_large_objects &&
|
||||
size_in_bytes > kMaxRegularHeapObjectSize;
|
||||
bool large_object = size_in_bytes > kMaxRegularHeapObjectSize;
|
||||
|
||||
HeapObject* object = nullptr;
|
||||
AllocationResult allocation;
|
||||
if (NEW_SPACE == space) {
|
||||
if (large_object) {
|
||||
space = LO_SPACE;
|
||||
// TODO(hpayer): Implement a LO tenuring strategy.
|
||||
space = FLAG_young_generation_large_objects ? NEW_LO_SPACE : LO_SPACE;
|
||||
} else {
|
||||
if (new_large_object) {
|
||||
allocation = new_lo_space_->AllocateRaw(size_in_bytes);
|
||||
} else {
|
||||
allocation = new_space_->AllocateRaw(size_in_bytes, alignment);
|
||||
}
|
||||
allocation = new_space_->AllocateRaw(size_in_bytes, alignment);
|
||||
if (allocation.To(&object)) {
|
||||
OnAllocationEvent(object, size_in_bytes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user