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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1409363003: [heap] Add concurrency-safe refilling to compaction spaces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 2 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/mark-compact.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 if (!page->SweepingCompleted()) { 540 if (!page->SweepingCompleted()) {
541 // We were not able to sweep that page, i.e., a concurrent 541 // We were not able to sweep that page, i.e., a concurrent
542 // sweeper thread currently owns this page. Wait for the sweeper 542 // sweeper thread currently owns this page. Wait for the sweeper
543 // thread to be done with this page. 543 // thread to be done with this page.
544 page->WaitUntilSweepingCompleted(); 544 page->WaitUntilSweepingCompleted();
545 } 545 }
546 } 546 }
547 } 547 }
548 548
549 549
550 void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) {
551 if (heap()->concurrent_sweeping_enabled() && !IsSweepingCompleted()) {
552 SweepInParallel(heap()->paged_space(space->identity()), 0);
553 space->RefillFreeList();
554 }
555 }
556
557
550 void MarkCompactCollector::EnsureSweepingCompleted() { 558 void MarkCompactCollector::EnsureSweepingCompleted() {
551 DCHECK(sweeping_in_progress_ == true); 559 DCHECK(sweeping_in_progress_ == true);
552 560
553 // If sweeping is not completed or not running at all, we try to complete it 561 // If sweeping is not completed or not running at all, we try to complete it
554 // here. 562 // here.
555 if (!heap()->concurrent_sweeping_enabled() || !IsSweepingCompleted()) { 563 if (!heap()->concurrent_sweeping_enabled() || !IsSweepingCompleted()) {
556 SweepInParallel(heap()->paged_space(OLD_SPACE), 0); 564 SweepInParallel(heap()->paged_space(OLD_SPACE), 0);
557 SweepInParallel(heap()->paged_space(CODE_SPACE), 0); 565 SweepInParallel(heap()->paged_space(CODE_SPACE), 0);
558 SweepInParallel(heap()->paged_space(MAP_SPACE), 0); 566 SweepInParallel(heap()->paged_space(MAP_SPACE), 0);
559 } 567 }
(...skipping 4052 matching lines...) Expand 10 before | Expand all | Expand 10 after
4612 MarkBit mark_bit = Marking::MarkBitFrom(host); 4620 MarkBit mark_bit = Marking::MarkBitFrom(host);
4613 if (Marking::IsBlack(mark_bit)) { 4621 if (Marking::IsBlack(mark_bit)) {
4614 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); 4622 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
4615 RecordRelocSlot(&rinfo, target); 4623 RecordRelocSlot(&rinfo, target);
4616 } 4624 }
4617 } 4625 }
4618 } 4626 }
4619 4627
4620 } // namespace internal 4628 } // namespace internal
4621 } // namespace v8 4629 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698