Chromium Code Reviews| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 515 | 515 |
| 516 void MarkCompactCollector::WaitUntilSweepingCompleted() { | 516 void MarkCompactCollector::WaitUntilSweepingCompleted() { |
| 517 if (SweeperThread::sweeping_pending()) { | 517 if (SweeperThread::sweeping_pending()) { |
| 518 for (int i = 0; i < FLAG_sweeper_threads; i++) { | 518 for (int i = 0; i < FLAG_sweeper_threads; i++) { |
| 519 heap()->isolate()->sweeper_threads()[i]->WaitForSweeperThread(); | 519 heap()->isolate()->sweeper_threads()[i]->WaitForSweeperThread(); |
| 520 } | 520 } |
| 521 SweeperThread::set_sweeping_pending(false); | 521 SweeperThread::set_sweeping_pending(false); |
| 522 StealMemoryFromSweeperThreads(heap()->paged_space(OLD_DATA_SPACE)); | 522 StealMemoryFromSweeperThreads(heap()->paged_space(OLD_DATA_SPACE)); |
| 523 StealMemoryFromSweeperThreads(heap()->paged_space(OLD_POINTER_SPACE)); | 523 StealMemoryFromSweeperThreads(heap()->paged_space(OLD_POINTER_SPACE)); |
| 524 heap()->FreeQueuedChunks(); | 524 heap()->FreeQueuedChunks(); |
| 525 heap()->paged_space(OLD_DATA_SPACE)->ResetUnsweptFreeBytes(); | |
| 526 heap()->paged_space(OLD_POINTER_SPACE)->ResetUnsweptFreeBytes(); | |
|
Michael Starzinger
2013/02/28 13:09:52
This requires rebasing, but I agree that WaitUntil
Hannes Payer (out of office)
2013/02/28 14:42:34
Done.
| |
| 525 } | 527 } |
| 526 } | 528 } |
| 527 | 529 |
| 528 | 530 |
| 529 intptr_t MarkCompactCollector:: | 531 intptr_t MarkCompactCollector:: |
| 530 StealMemoryFromSweeperThreads(PagedSpace* space) { | 532 StealMemoryFromSweeperThreads(PagedSpace* space) { |
| 531 intptr_t freed_bytes = 0; | 533 intptr_t freed_bytes = 0; |
| 532 for (int i = 0; i < FLAG_sweeper_threads; i++) { | 534 for (int i = 0; i < FLAG_sweeper_threads; i++) { |
| 533 freed_bytes += heap()->isolate()->sweeper_threads()[i]->StealMemory(space); | 535 freed_bytes += heap()->isolate()->sweeper_threads()[i]->StealMemory(space); |
| 534 } | 536 } |
| (...skipping 3237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3772 space->SetPagesToSweep(p->next_page()); | 3774 space->SetPagesToSweep(p->next_page()); |
| 3773 lazy_sweeping_active = true; | 3775 lazy_sweeping_active = true; |
| 3774 break; | 3776 break; |
| 3775 } | 3777 } |
| 3776 case PARALLEL_CONSERVATIVE: { | 3778 case PARALLEL_CONSERVATIVE: { |
| 3777 if (FLAG_gc_verbose) { | 3779 if (FLAG_gc_verbose) { |
| 3778 PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n", | 3780 PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n", |
| 3779 reinterpret_cast<intptr_t>(p)); | 3781 reinterpret_cast<intptr_t>(p)); |
| 3780 } | 3782 } |
| 3781 p->set_parallel_sweeping(1); | 3783 p->set_parallel_sweeping(1); |
| 3784 space->IncreaseUnsweptFreeBytes(p); | |
| 3782 break; | 3785 break; |
| 3783 } | 3786 } |
| 3784 case PRECISE: { | 3787 case PRECISE: { |
| 3785 if (FLAG_gc_verbose) { | 3788 if (FLAG_gc_verbose) { |
| 3786 PrintF("Sweeping 0x%" V8PRIxPTR " precisely.\n", | 3789 PrintF("Sweeping 0x%" V8PRIxPTR " precisely.\n", |
| 3787 reinterpret_cast<intptr_t>(p)); | 3790 reinterpret_cast<intptr_t>(p)); |
| 3788 } | 3791 } |
| 3789 if (space->identity() == CODE_SPACE) { | 3792 if (space->identity() == CODE_SPACE) { |
| 3790 SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL); | 3793 SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL); |
| 3791 } else { | 3794 } else { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4046 while (buffer != NULL) { | 4049 while (buffer != NULL) { |
| 4047 SlotsBuffer* next_buffer = buffer->next(); | 4050 SlotsBuffer* next_buffer = buffer->next(); |
| 4048 DeallocateBuffer(buffer); | 4051 DeallocateBuffer(buffer); |
| 4049 buffer = next_buffer; | 4052 buffer = next_buffer; |
| 4050 } | 4053 } |
| 4051 *buffer_address = NULL; | 4054 *buffer_address = NULL; |
| 4052 } | 4055 } |
| 4053 | 4056 |
| 4054 | 4057 |
| 4055 } } // namespace v8::internal | 4058 } } // namespace v8::internal |
| OLD | NEW |