| 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 3541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3552 } | 3552 } |
| 3553 | 3553 |
| 3554 // Handle the free space at the end of the page. | 3554 // Handle the free space at the end of the page. |
| 3555 if (block_address - free_start > 32 * kPointerSize) { | 3555 if (block_address - free_start > 32 * kPointerSize) { |
| 3556 free_start = DigestFreeStart(free_start, free_start_cell); | 3556 free_start = DigestFreeStart(free_start, free_start_cell); |
| 3557 freed_bytes += space->Free(free_start, | 3557 freed_bytes += space->Free(free_start, |
| 3558 static_cast<int>(block_address - free_start)); | 3558 static_cast<int>(block_address - free_start)); |
| 3559 } | 3559 } |
| 3560 | 3560 |
| 3561 p->ResetLiveBytes(); | 3561 p->ResetLiveBytes(); |
| 3562 p->heap()->UpdateVisualizers(p); |
| 3562 return freed_bytes; | 3563 return freed_bytes; |
| 3563 } | 3564 } |
| 3564 | 3565 |
| 3565 | 3566 |
| 3566 void MarkCompactCollector::SweepSpace(PagedSpace* space, | 3567 void MarkCompactCollector::SweepSpace(PagedSpace* space, |
| 3567 SweeperType sweeper) { | 3568 SweeperType sweeper) { |
| 3568 space->set_was_swept_conservatively(sweeper == CONSERVATIVE || | 3569 space->set_was_swept_conservatively(sweeper == CONSERVATIVE || |
| 3569 sweeper == LAZY_CONSERVATIVE); | 3570 sweeper == LAZY_CONSERVATIVE); |
| 3570 | 3571 |
| 3571 space->ClearStats(); | 3572 space->ClearStats(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3625 SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL); | 3626 SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL); |
| 3626 } else { | 3627 } else { |
| 3627 SweepPrecisely<SWEEP_ONLY, IGNORE_SKIP_LIST>(space, p, NULL); | 3628 SweepPrecisely<SWEEP_ONLY, IGNORE_SKIP_LIST>(space, p, NULL); |
| 3628 } | 3629 } |
| 3629 break; | 3630 break; |
| 3630 } | 3631 } |
| 3631 default: { | 3632 default: { |
| 3632 UNREACHABLE(); | 3633 UNREACHABLE(); |
| 3633 } | 3634 } |
| 3634 } | 3635 } |
| 3636 space->heap()->UpdateVisualizers(p); |
| 3635 } | 3637 } |
| 3636 } | 3638 } |
| 3637 | 3639 |
| 3638 | 3640 |
| 3639 void MarkCompactCollector::SweepSpaces() { | 3641 void MarkCompactCollector::SweepSpaces() { |
| 3640 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP); | 3642 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP); |
| 3641 #ifdef DEBUG | 3643 #ifdef DEBUG |
| 3642 state_ = SWEEP_SPACES; | 3644 state_ = SWEEP_SPACES; |
| 3643 #endif | 3645 #endif |
| 3644 SweeperType how_to_sweep = | 3646 SweeperType how_to_sweep = |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3840 while (buffer != NULL) { | 3842 while (buffer != NULL) { |
| 3841 SlotsBuffer* next_buffer = buffer->next(); | 3843 SlotsBuffer* next_buffer = buffer->next(); |
| 3842 DeallocateBuffer(buffer); | 3844 DeallocateBuffer(buffer); |
| 3843 buffer = next_buffer; | 3845 buffer = next_buffer; |
| 3844 } | 3846 } |
| 3845 *buffer_address = NULL; | 3847 *buffer_address = NULL; |
| 3846 } | 3848 } |
| 3847 | 3849 |
| 3848 | 3850 |
| 3849 } } // namespace v8::internal | 3851 } } // namespace v8::internal |
| OLD | NEW |