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

Unified Diff: src/spaces.cc

Issue 12177017: Fixed IsSweepingComplete and EnsureSweeperProgress helper functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/spaces.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 711cde1c662c0c6c59d7148c2e6dec21f8f878f4..01e1e300875ff7af6ca5b63a4bad161caa709655 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -2525,7 +2525,7 @@ bool LargeObjectSpace::ReserveSpace(int bytes) {
bool PagedSpace::AdvanceSweeper(intptr_t bytes_to_sweep) {
- if (IsSweepingComplete()) return true;
+ if (IsLazySweepingComplete()) return true;
intptr_t freed_bytes = 0;
Page* p = first_unswept_page_;
@@ -2553,7 +2553,7 @@ bool PagedSpace::AdvanceSweeper(intptr_t bytes_to_sweep) {
heap()->FreeQueuedChunks();
- return IsSweepingComplete();
+ return IsLazySweepingComplete();
}
@@ -2575,12 +2575,14 @@ void PagedSpace::EvictEvacuationCandidatesFromFreeLists() {
bool PagedSpace::EnsureSweeperProgress(intptr_t size_in_bytes) {
MarkCompactCollector* collector = heap()->mark_compact_collector();
if (collector->AreSweeperThreadsActivated()) {
- if (FLAG_concurrent_sweeping &&
- collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) {
- collector->WaitUntilSweepingCompleted();
- return true;
+ if (FLAG_concurrent_sweeping) {
+ if (collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) {
+ collector->WaitUntilSweepingCompleted();
+ return true;
+ }
+ return false;
}
- return false;
+ return true;
} else {
return AdvanceSweeper(size_in_bytes);
}
@@ -2618,7 +2620,7 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
// Last ditch, sweep all the remaining pages to try to find space. This may
// cause a pause.
- if (!IsSweepingComplete()) {
+ if (!IsLazySweepingComplete()) {
EnsureSweeperProgress(kMaxInt);
// Retry the free list allocation.
« no previous file with comments | « src/spaces.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698