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 3872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3883 | 3883 |
3884 void MarkCompactCollector::SweepSpaces() { | 3884 void MarkCompactCollector::SweepSpaces() { |
3885 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP); | 3885 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP); |
3886 #ifdef DEBUG | 3886 #ifdef DEBUG |
3887 state_ = SWEEP_SPACES; | 3887 state_ = SWEEP_SPACES; |
3888 #endif | 3888 #endif |
3889 SweeperType how_to_sweep = | 3889 SweeperType how_to_sweep = |
3890 FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE; | 3890 FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE; |
3891 if (FLAG_parallel_sweeping) how_to_sweep = PARALLEL_CONSERVATIVE; | 3891 if (FLAG_parallel_sweeping) how_to_sweep = PARALLEL_CONSERVATIVE; |
3892 if (FLAG_concurrent_sweeping) how_to_sweep = CONCURRENT_CONSERVATIVE; | 3892 if (FLAG_concurrent_sweeping) how_to_sweep = CONCURRENT_CONSERVATIVE; |
3893 if (FLAG_expose_gc) how_to_sweep = CONSERVATIVE; | 3893 if (FLAG_expose_gc || FLAG_expose_gc_as) how_to_sweep = CONSERVATIVE; |
3894 if (sweep_precisely_) how_to_sweep = PRECISE; | 3894 if (sweep_precisely_) how_to_sweep = PRECISE; |
3895 | 3895 |
3896 // Unlink evacuation candidates before sweeper threads access the list of | 3896 // Unlink evacuation candidates before sweeper threads access the list of |
3897 // pages to avoid race condition. | 3897 // pages to avoid race condition. |
3898 UnlinkEvacuationCandidates(); | 3898 UnlinkEvacuationCandidates(); |
3899 | 3899 |
3900 // Noncompacting collections simply sweep the spaces to clear the mark | 3900 // Noncompacting collections simply sweep the spaces to clear the mark |
3901 // bits and free the nonlive blocks (for old and map spaces). We sweep | 3901 // bits and free the nonlive blocks (for old and map spaces). We sweep |
3902 // the map space last because freeing non-live maps overwrites them and | 3902 // the map space last because freeing non-live maps overwrites them and |
3903 // the other spaces rely on possibly non-live maps to get the sizes for | 3903 // the other spaces rely on possibly non-live maps to get the sizes for |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4131 while (buffer != NULL) { | 4131 while (buffer != NULL) { |
4132 SlotsBuffer* next_buffer = buffer->next(); | 4132 SlotsBuffer* next_buffer = buffer->next(); |
4133 DeallocateBuffer(buffer); | 4133 DeallocateBuffer(buffer); |
4134 buffer = next_buffer; | 4134 buffer = next_buffer; |
4135 } | 4135 } |
4136 *buffer_address = NULL; | 4136 *buffer_address = NULL; |
4137 } | 4137 } |
4138 | 4138 |
4139 | 4139 |
4140 } } // namespace v8::internal | 4140 } } // namespace v8::internal |
OLD | NEW |