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 3847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3858 Heap::ShouldZapGarbage() ? ZAP_FREE_SPACE : IGNORE_FREE_SPACE; | 3858 Heap::ShouldZapGarbage() ? ZAP_FREE_SPACE : IGNORE_FREE_SPACE; |
3859 if (identity == NEW_SPACE) { | 3859 if (identity == NEW_SPACE) { |
3860 RawSweep(page, IGNORE_FREE_LIST, free_space_mode); | 3860 RawSweep(page, IGNORE_FREE_LIST, free_space_mode); |
3861 } else if (identity == OLD_SPACE) { | 3861 } else if (identity == OLD_SPACE) { |
3862 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode); | 3862 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode); |
3863 } else if (identity == CODE_SPACE) { | 3863 } else if (identity == CODE_SPACE) { |
3864 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode); | 3864 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode); |
3865 } else { | 3865 } else { |
3866 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode); | 3866 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode); |
3867 } | 3867 } |
| 3868 |
| 3869 // After finishing sweeping of a page we clean up its remembered set. |
| 3870 if (page->typed_old_to_new_slots()) { |
| 3871 page->typed_old_to_new_slots()->FreeToBeFreedChunks(); |
| 3872 } |
| 3873 |
3868 { | 3874 { |
3869 base::LockGuard<base::Mutex> guard(&mutex_); | 3875 base::LockGuard<base::Mutex> guard(&mutex_); |
3870 swept_list_[identity].Add(page); | 3876 swept_list_[identity].Add(page); |
3871 } | 3877 } |
3872 page->concurrent_sweeping_state().SetValue(Page::kSweepingDone); | 3878 page->concurrent_sweeping_state().SetValue(Page::kSweepingDone); |
3873 page->mutex()->Unlock(); | 3879 page->mutex()->Unlock(); |
3874 } | 3880 } |
3875 return max_freed; | 3881 return max_freed; |
3876 } | 3882 } |
3877 | 3883 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4042 // The target is always in old space, we don't have to record the slot in | 4048 // The target is always in old space, we don't have to record the slot in |
4043 // the old-to-new remembered set. | 4049 // the old-to-new remembered set. |
4044 DCHECK(!heap()->InNewSpace(target)); | 4050 DCHECK(!heap()->InNewSpace(target)); |
4045 RecordRelocSlot(host, &rinfo, target); | 4051 RecordRelocSlot(host, &rinfo, target); |
4046 } | 4052 } |
4047 } | 4053 } |
4048 } | 4054 } |
4049 | 4055 |
4050 } // namespace internal | 4056 } // namespace internal |
4051 } // namespace v8 | 4057 } // namespace v8 |
OLD | NEW |