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

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

Issue 1570443004: [heap] Enfoce tighter allocation limit for large object allocations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « src/heap/heap.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 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 heap()->isolate()->memory_allocator()->Free(page); 3093 heap()->isolate()->memory_allocator()->Free(page);
3094 } 3094 }
3095 SetUp(); 3095 SetUp();
3096 } 3096 }
3097 3097
3098 3098
3099 AllocationResult LargeObjectSpace::AllocateRaw(int object_size, 3099 AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
3100 Executability executable) { 3100 Executability executable) {
3101 // Check if we want to force a GC before growing the old space further. 3101 // Check if we want to force a GC before growing the old space further.
3102 // If so, fail the allocation. 3102 // If so, fail the allocation.
3103 if (!heap()->always_allocate() && 3103 if (!heap()->CanExpandOldGeneration(object_size)) {
3104 !heap()->CanExpandOldGeneration(object_size)) {
3105 return AllocationResult::Retry(identity()); 3104 return AllocationResult::Retry(identity());
3106 } 3105 }
3107 3106
3108 LargePage* page = heap()->isolate()->memory_allocator()->AllocateLargePage( 3107 LargePage* page = heap()->isolate()->memory_allocator()->AllocateLargePage(
3109 object_size, this, executable); 3108 object_size, this, executable);
3110 if (page == NULL) return AllocationResult::Retry(identity()); 3109 if (page == NULL) return AllocationResult::Retry(identity());
3111 DCHECK(page->area_size() >= object_size); 3110 DCHECK(page->area_size() >= object_size);
3112 3111
3113 size_ += static_cast<int>(page->size()); 3112 size_ += static_cast<int>(page->size());
3114 AccountCommitted(static_cast<intptr_t>(page->size())); 3113 AccountCommitted(static_cast<intptr_t>(page->size()));
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
3365 object->ShortPrint(); 3364 object->ShortPrint();
3366 PrintF("\n"); 3365 PrintF("\n");
3367 } 3366 }
3368 printf(" --------------------------------------\n"); 3367 printf(" --------------------------------------\n");
3369 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3368 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3370 } 3369 }
3371 3370
3372 #endif // DEBUG 3371 #endif // DEBUG
3373 } // namespace internal 3372 } // namespace internal
3374 } // namespace v8 3373 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698