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

Side by Side Diff: src/spaces.cc

Issue 12462002: Wait for sweeper threads in EnsureSweeperProgress() only if the main thread finished its sweeping p… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/spaces.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2546 allocation_info_.limit = NULL; 2546 allocation_info_.limit = NULL;
2547 } 2547 }
2548 } 2548 }
2549 2549
2550 2550
2551 bool PagedSpace::EnsureSweeperProgress(intptr_t size_in_bytes) { 2551 bool PagedSpace::EnsureSweeperProgress(intptr_t size_in_bytes) {
2552 MarkCompactCollector* collector = heap()->mark_compact_collector(); 2552 MarkCompactCollector* collector = heap()->mark_compact_collector();
2553 if (collector->AreSweeperThreadsActivated()) { 2553 if (collector->AreSweeperThreadsActivated()) {
2554 if (collector->IsConcurrentSweepingInProgress()) { 2554 if (collector->IsConcurrentSweepingInProgress()) {
2555 if (collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) { 2555 if (collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) {
2556 collector->WaitUntilSweepingCompleted(); 2556 if (!collector->sequential_sweeping()) {
2557 collector->FinalizeSweeping(); 2557 collector->WaitUntilSweepingCompleted();
2558 return true; 2558 collector->FinalizeSweeping();
2559 return true;
2560 }
2559 } 2561 }
2560 return false; 2562 return false;
2561 } 2563 }
2562 return true; 2564 return true;
2563 } else { 2565 } else {
2564 return AdvanceSweeper(size_in_bytes); 2566 return AdvanceSweeper(size_in_bytes);
2565 } 2567 }
2566 } 2568 }
2567 2569
2568 2570
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 object->ShortPrint(); 3130 object->ShortPrint();
3129 PrintF("\n"); 3131 PrintF("\n");
3130 } 3132 }
3131 printf(" --------------------------------------\n"); 3133 printf(" --------------------------------------\n");
3132 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3134 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3133 } 3135 }
3134 3136
3135 #endif // DEBUG 3137 #endif // DEBUG
3136 3138
3137 } } // namespace v8::internal 3139 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698