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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 3446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3457 abandoned_pages, num_pages); | 3457 abandoned_pages, num_pages); |
3458 } else { | 3458 } else { |
3459 PrintF(" Compacted %d pages\n", num_pages); | 3459 PrintF(" Compacted %d pages\n", num_pages); |
3460 } | 3460 } |
3461 } | 3461 } |
3462 } | 3462 } |
3463 } | 3463 } |
3464 | 3464 |
3465 | 3465 |
3466 void MarkCompactCollector::WaitUntilCompactionCompleted() { | 3466 void MarkCompactCollector::WaitUntilCompactionCompleted() { |
3467 while (concurrent_compaction_tasks_active_-- > 0) { | 3467 while (concurrent_compaction_tasks_active_ > 0) { |
3468 pending_compaction_tasks_semaphore_.Wait(); | 3468 pending_compaction_tasks_semaphore_.Wait(); |
| 3469 concurrent_compaction_tasks_active_--; |
3469 } | 3470 } |
3470 parallel_compaction_in_progress_ = false; | 3471 parallel_compaction_in_progress_ = false; |
3471 } | 3472 } |
3472 | 3473 |
3473 | 3474 |
3474 void MarkCompactCollector::EvacuatePages( | 3475 void MarkCompactCollector::EvacuatePages( |
3475 CompactionSpaceCollection* compaction_spaces) { | 3476 CompactionSpaceCollection* compaction_spaces) { |
3476 for (int i = 0; i < evacuation_candidates_.length(); i++) { | 3477 for (int i = 0; i < evacuation_candidates_.length(); i++) { |
3477 Page* p = evacuation_candidates_[i]; | 3478 Page* p = evacuation_candidates_[i]; |
3478 DCHECK(p->IsEvacuationCandidate() || | 3479 DCHECK(p->IsEvacuationCandidate() || |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4569 MarkBit mark_bit = Marking::MarkBitFrom(host); | 4570 MarkBit mark_bit = Marking::MarkBitFrom(host); |
4570 if (Marking::IsBlack(mark_bit)) { | 4571 if (Marking::IsBlack(mark_bit)) { |
4571 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); | 4572 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); |
4572 RecordRelocSlot(&rinfo, target); | 4573 RecordRelocSlot(&rinfo, target); |
4573 } | 4574 } |
4574 } | 4575 } |
4575 } | 4576 } |
4576 | 4577 |
4577 } // namespace internal | 4578 } // namespace internal |
4578 } // namespace v8 | 4579 } // namespace v8 |
OLD | NEW |