OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3666 } | 3666 } |
3667 | 3667 |
3668 | 3668 |
3669 void MarkCompactCollector::SweepSpaces() { | 3669 void MarkCompactCollector::SweepSpaces() { |
3670 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP); | 3670 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP); |
3671 #ifdef DEBUG | 3671 #ifdef DEBUG |
3672 state_ = SWEEP_SPACES; | 3672 state_ = SWEEP_SPACES; |
3673 #endif | 3673 #endif |
3674 SweeperType how_to_sweep = | 3674 SweeperType how_to_sweep = |
3675 FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE; | 3675 FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE; |
| 3676 if (FLAG_expose_gc) how_to_sweep = CONSERVATIVE; |
3676 if (sweep_precisely_) how_to_sweep = PRECISE; | 3677 if (sweep_precisely_) how_to_sweep = PRECISE; |
3677 // Noncompacting collections simply sweep the spaces to clear the mark | 3678 // Noncompacting collections simply sweep the spaces to clear the mark |
3678 // bits and free the nonlive blocks (for old and map spaces). We sweep | 3679 // bits and free the nonlive blocks (for old and map spaces). We sweep |
3679 // the map space last because freeing non-live maps overwrites them and | 3680 // the map space last because freeing non-live maps overwrites them and |
3680 // the other spaces rely on possibly non-live maps to get the sizes for | 3681 // the other spaces rely on possibly non-live maps to get the sizes for |
3681 // non-live objects. | 3682 // non-live objects. |
3682 SweepSpace(heap()->old_pointer_space(), how_to_sweep); | 3683 SweepSpace(heap()->old_pointer_space(), how_to_sweep); |
3683 SweepSpace(heap()->old_data_space(), how_to_sweep); | 3684 SweepSpace(heap()->old_data_space(), how_to_sweep); |
3684 | 3685 |
3685 RemoveDeadInvalidatedCode(); | 3686 RemoveDeadInvalidatedCode(); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3866 while (buffer != NULL) { | 3867 while (buffer != NULL) { |
3867 SlotsBuffer* next_buffer = buffer->next(); | 3868 SlotsBuffer* next_buffer = buffer->next(); |
3868 DeallocateBuffer(buffer); | 3869 DeallocateBuffer(buffer); |
3869 buffer = next_buffer; | 3870 buffer = next_buffer; |
3870 } | 3871 } |
3871 *buffer_address = NULL; | 3872 *buffer_address = NULL; |
3872 } | 3873 } |
3873 | 3874 |
3874 | 3875 |
3875 } } // namespace v8::internal | 3876 } } // namespace v8::internal |
OLD | NEW |