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

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

Issue 2097453002: [heap] Fix bad-cast in Sweeper (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 AllocationSpace space_to_start) { 509 AllocationSpace space_to_start) {
510 num_sweeping_tasks_.Increment(1); 510 num_sweeping_tasks_.Increment(1);
511 V8::GetCurrentPlatform()->CallOnBackgroundThread( 511 V8::GetCurrentPlatform()->CallOnBackgroundThread(
512 new SweeperTask(this, &pending_sweeper_tasks_semaphore_, space_to_start), 512 new SweeperTask(this, &pending_sweeper_tasks_semaphore_, space_to_start),
513 v8::Platform::kShortRunningTask); 513 v8::Platform::kShortRunningTask);
514 } 514 }
515 515
516 void MarkCompactCollector::Sweeper::SweepOrWaitUntilSweepingCompleted( 516 void MarkCompactCollector::Sweeper::SweepOrWaitUntilSweepingCompleted(
517 Page* page) { 517 Page* page) {
518 if (!page->SweepingDone()) { 518 if (!page->SweepingDone()) {
519 PagedSpace* owner = reinterpret_cast<PagedSpace*>(page->owner()); 519 ParallelSweepPage(page, page->owner()->identity());
520 ParallelSweepPage(page, owner->identity());
521 if (!page->SweepingDone()) { 520 if (!page->SweepingDone()) {
522 // We were not able to sweep that page, i.e., a concurrent 521 // We were not able to sweep that page, i.e., a concurrent
523 // sweeper thread currently owns this page. Wait for the sweeper 522 // sweeper thread currently owns this page. Wait for the sweeper
524 // thread to be done with this page. 523 // thread to be done with this page.
525 page->WaitUntilSweepingCompleted(); 524 page->WaitUntilSweepingCompleted();
526 } 525 }
527 } 526 }
528 } 527 }
529 528
530 void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) { 529 void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) {
(...skipping 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
4093 MarkBit mark_bit = Marking::MarkBitFrom(host); 4092 MarkBit mark_bit = Marking::MarkBitFrom(host);
4094 if (Marking::IsBlack(mark_bit)) { 4093 if (Marking::IsBlack(mark_bit)) {
4095 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); 4094 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
4096 RecordRelocSlot(host, &rinfo, target); 4095 RecordRelocSlot(host, &rinfo, target);
4097 } 4096 }
4098 } 4097 }
4099 } 4098 }
4100 4099
4101 } // namespace internal 4100 } // namespace internal
4102 } // namespace v8 4101 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698