| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |