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

Side by Side Diff: src/spaces.cc

Issue 12386084: Wait for sweeper threads and finalize sweeping only if parallel/concurrent sweeping was in progress. (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/mark-compact.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 // 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 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after
2538 2538
2539 allocation_info_.top = NULL; 2539 allocation_info_.top = NULL;
2540 allocation_info_.limit = NULL; 2540 allocation_info_.limit = NULL;
2541 } 2541 }
2542 } 2542 }
2543 2543
2544 2544
2545 bool PagedSpace::EnsureSweeperProgress(intptr_t size_in_bytes) { 2545 bool PagedSpace::EnsureSweeperProgress(intptr_t size_in_bytes) {
2546 MarkCompactCollector* collector = heap()->mark_compact_collector(); 2546 MarkCompactCollector* collector = heap()->mark_compact_collector();
2547 if (collector->AreSweeperThreadsActivated()) { 2547 if (collector->AreSweeperThreadsActivated()) {
2548 if (FLAG_concurrent_sweeping) { 2548 if (collector->IsConcurrentSweepingInProgress()) {
2549 if (collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) { 2549 if (collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) {
2550 collector->WaitUntilSweepingCompleted(); 2550 collector->WaitUntilSweepingCompleted();
2551 collector->FinalizeSweeping(); 2551 collector->FinalizeSweeping();
2552 return true; 2552 return true;
2553 } 2553 }
2554 return false; 2554 return false;
2555 } 2555 }
2556 return true; 2556 return true;
2557 } else { 2557 } else {
2558 return AdvanceSweeper(size_in_bytes); 2558 return AdvanceSweeper(size_in_bytes);
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 object->ShortPrint(); 3122 object->ShortPrint();
3123 PrintF("\n"); 3123 PrintF("\n");
3124 } 3124 }
3125 printf(" --------------------------------------\n"); 3125 printf(" --------------------------------------\n");
3126 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3126 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3127 } 3127 }
3128 3128
3129 #endif // DEBUG 3129 #endif // DEBUG
3130 3130
3131 } } // namespace v8::internal 3131 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698