OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3847 if (sweep_precisely_) how_to_sweep = PRECISE; | 3847 if (sweep_precisely_) how_to_sweep = PRECISE; |
3848 // Noncompacting collections simply sweep the spaces to clear the mark | 3848 // Noncompacting collections simply sweep the spaces to clear the mark |
3849 // bits and free the nonlive blocks (for old and map spaces). We sweep | 3849 // bits and free the nonlive blocks (for old and map spaces). We sweep |
3850 // the map space last because freeing non-live maps overwrites them and | 3850 // the map space last because freeing non-live maps overwrites them and |
3851 // the other spaces rely on possibly non-live maps to get the sizes for | 3851 // the other spaces rely on possibly non-live maps to get the sizes for |
3852 // non-live objects. | 3852 // non-live objects. |
3853 | 3853 |
3854 SweepSpace(heap()->old_pointer_space(), how_to_sweep); | 3854 SweepSpace(heap()->old_pointer_space(), how_to_sweep); |
3855 SweepSpace(heap()->old_data_space(), how_to_sweep); | 3855 SweepSpace(heap()->old_data_space(), how_to_sweep); |
3856 | 3856 |
| 3857 if (how_to_sweep == PARALLEL_CONSERVATIVE) { |
| 3858 // TODO(hpayer): fix race with concurrent sweeper |
| 3859 StartSweeperThreads(); |
| 3860 if (FLAG_parallel_sweeping && !FLAG_concurrent_sweeping) { |
| 3861 WaitUntilSweepingCompleted(); |
| 3862 } |
| 3863 } |
| 3864 |
3857 RemoveDeadInvalidatedCode(); | 3865 RemoveDeadInvalidatedCode(); |
3858 SweepSpace(heap()->code_space(), PRECISE); | 3866 SweepSpace(heap()->code_space(), PRECISE); |
3859 | 3867 |
3860 SweepSpace(heap()->cell_space(), PRECISE); | 3868 SweepSpace(heap()->cell_space(), PRECISE); |
3861 | 3869 |
3862 EvacuateNewSpaceAndCandidates(); | 3870 EvacuateNewSpaceAndCandidates(); |
3863 | 3871 |
3864 if (how_to_sweep == PARALLEL_CONSERVATIVE) { | |
3865 // TODO(hpayer): The starting of the sweeper threads should be after | |
3866 // SweepSpace old data space. | |
3867 StartSweeperThreads(); | |
3868 if (FLAG_parallel_sweeping && !FLAG_concurrent_sweeping) { | |
3869 WaitUntilSweepingCompleted(); | |
3870 } | |
3871 } | |
3872 | |
3873 // ClearNonLiveTransitions depends on precise sweeping of map space to | 3872 // ClearNonLiveTransitions depends on precise sweeping of map space to |
3874 // detect whether unmarked map became dead in this collection or in one | 3873 // detect whether unmarked map became dead in this collection or in one |
3875 // of the previous ones. | 3874 // of the previous ones. |
3876 SweepSpace(heap()->map_space(), PRECISE); | 3875 SweepSpace(heap()->map_space(), PRECISE); |
3877 | 3876 |
3878 // Deallocate unmarked objects and clear marked bits for marked objects. | 3877 // Deallocate unmarked objects and clear marked bits for marked objects. |
3879 heap_->lo_space()->FreeUnmarkedObjects(); | 3878 heap_->lo_space()->FreeUnmarkedObjects(); |
3880 } | 3879 } |
3881 | 3880 |
3882 | 3881 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4070 while (buffer != NULL) { | 4069 while (buffer != NULL) { |
4071 SlotsBuffer* next_buffer = buffer->next(); | 4070 SlotsBuffer* next_buffer = buffer->next(); |
4072 DeallocateBuffer(buffer); | 4071 DeallocateBuffer(buffer); |
4073 buffer = next_buffer; | 4072 buffer = next_buffer; |
4074 } | 4073 } |
4075 *buffer_address = NULL; | 4074 *buffer_address = NULL; |
4076 } | 4075 } |
4077 | 4076 |
4078 | 4077 |
4079 } } // namespace v8::internal | 4078 } } // namespace v8::internal |
OLD | NEW |