| 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 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3626 continue; | 3626 continue; |
| 3627 } | 3627 } |
| 3628 | 3628 |
| 3629 // One unused page is kept, all further are released before sweeping them. | 3629 // One unused page is kept, all further are released before sweeping them. |
| 3630 if (p->LiveBytes() == 0) { | 3630 if (p->LiveBytes() == 0) { |
| 3631 if (unused_page_present) { | 3631 if (unused_page_present) { |
| 3632 if (FLAG_gc_verbose) { | 3632 if (FLAG_gc_verbose) { |
| 3633 PrintF("Sweeping 0x%" V8PRIxPTR " released page.\n", | 3633 PrintF("Sweeping 0x%" V8PRIxPTR " released page.\n", |
| 3634 reinterpret_cast<intptr_t>(p)); | 3634 reinterpret_cast<intptr_t>(p)); |
| 3635 } | 3635 } |
| 3636 // Adjust unswept free bytes because releasing a page expects said |
| 3637 // counter to be accurate for unswept pages. |
| 3638 space->IncreaseUnsweptFreeBytes(p); |
| 3636 space->ReleasePage(p); | 3639 space->ReleasePage(p); |
| 3637 continue; | 3640 continue; |
| 3638 } | 3641 } |
| 3639 unused_page_present = true; | 3642 unused_page_present = true; |
| 3640 } | 3643 } |
| 3641 | 3644 |
| 3642 if (lazy_sweeping_active) { | 3645 if (lazy_sweeping_active) { |
| 3643 if (FLAG_gc_verbose) { | 3646 if (FLAG_gc_verbose) { |
| 3644 PrintF("Sweeping 0x%" V8PRIxPTR " lazily postponed.\n", | 3647 PrintF("Sweeping 0x%" V8PRIxPTR " lazily postponed.\n", |
| 3645 reinterpret_cast<intptr_t>(p)); | 3648 reinterpret_cast<intptr_t>(p)); |
| 3646 } | 3649 } |
| 3647 space->MarkPageForLazySweeping(p); | 3650 space->IncreaseUnsweptFreeBytes(p); |
| 3648 continue; | 3651 continue; |
| 3649 } | 3652 } |
| 3650 | 3653 |
| 3651 switch (sweeper) { | 3654 switch (sweeper) { |
| 3652 case CONSERVATIVE: { | 3655 case CONSERVATIVE: { |
| 3653 if (FLAG_gc_verbose) { | 3656 if (FLAG_gc_verbose) { |
| 3654 PrintF("Sweeping 0x%" V8PRIxPTR " conservatively.\n", | 3657 PrintF("Sweeping 0x%" V8PRIxPTR " conservatively.\n", |
| 3655 reinterpret_cast<intptr_t>(p)); | 3658 reinterpret_cast<intptr_t>(p)); |
| 3656 } | 3659 } |
| 3657 SweepConservatively(space, p); | 3660 SweepConservatively(space, p); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3907 while (buffer != NULL) { | 3910 while (buffer != NULL) { |
| 3908 SlotsBuffer* next_buffer = buffer->next(); | 3911 SlotsBuffer* next_buffer = buffer->next(); |
| 3909 DeallocateBuffer(buffer); | 3912 DeallocateBuffer(buffer); |
| 3910 buffer = next_buffer; | 3913 buffer = next_buffer; |
| 3911 } | 3914 } |
| 3912 *buffer_address = NULL; | 3915 *buffer_address = NULL; |
| 3913 } | 3916 } |
| 3914 | 3917 |
| 3915 | 3918 |
| 3916 } } // namespace v8::internal | 3919 } } // namespace v8::internal |
| OLD | NEW |