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

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

Issue 1025643002: Respect old space allocation limit in PagedSpace::AllocateRaw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Allow nested AlwaysAllocateScopes Created 5 years, 9 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-inl.h ('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/v8.h" 5 #include "src/v8.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.h" 9 #include "src/full-codegen.h"
10 #include "src/heap/mark-compact.h" 10 #include "src/heap/mark-compact.h"
(...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 } 2611 }
2612 2612
2613 // Free list allocation failed and there is no next page. Fail if we have 2613 // Free list allocation failed and there is no next page. Fail if we have
2614 // hit the old generation size limit that should cause a garbage 2614 // hit the old generation size limit that should cause a garbage
2615 // collection. 2615 // collection.
2616 if (!heap()->always_allocate() && 2616 if (!heap()->always_allocate() &&
2617 heap()->OldGenerationAllocationLimitReached()) { 2617 heap()->OldGenerationAllocationLimitReached()) {
2618 // If sweeper threads are active, wait for them at that point and steal 2618 // If sweeper threads are active, wait for them at that point and steal
2619 // elements form their free-lists. 2619 // elements form their free-lists.
2620 HeapObject* object = WaitForSweeperThreadsAndRetryAllocation(size_in_bytes); 2620 HeapObject* object = WaitForSweeperThreadsAndRetryAllocation(size_in_bytes);
2621 if (object != NULL) return object; 2621 return object;
2622 } 2622 }
2623 2623
2624 // Try to expand the space and allocate in the new next page. 2624 // Try to expand the space and allocate in the new next page.
2625 if (Expand()) { 2625 if (Expand()) {
2626 DCHECK(CountTotalPages() > 1 || size_in_bytes <= free_list_.available()); 2626 DCHECK(CountTotalPages() > 1 || size_in_bytes <= free_list_.available());
2627 return free_list_.Allocate(size_in_bytes); 2627 return free_list_.Allocate(size_in_bytes);
2628 } 2628 }
2629 2629
2630 // If sweeper threads are active, wait for them at that point and steal 2630 // If sweeper threads are active, wait for them at that point and steal
2631 // elements form their free-lists. Allocation may still fail their which 2631 // elements form their free-lists. Allocation may still fail their which
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
3131 object->ShortPrint(); 3131 object->ShortPrint();
3132 PrintF("\n"); 3132 PrintF("\n");
3133 } 3133 }
3134 printf(" --------------------------------------\n"); 3134 printf(" --------------------------------------\n");
3135 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3135 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3136 } 3136 }
3137 3137
3138 #endif // DEBUG 3138 #endif // DEBUG
3139 } 3139 }
3140 } // namespace v8::internal 3140 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698