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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 for (int i = 0; i < isolate()->num_sweeper_threads(); i++) { | 620 for (int i = 0; i < isolate()->num_sweeper_threads(); i++) { |
621 isolate()->sweeper_threads()[i]->WaitForSweeperThread(); | 621 isolate()->sweeper_threads()[i]->WaitForSweeperThread(); |
622 } | 622 } |
623 if (FLAG_job_based_sweeping) { | 623 if (FLAG_job_based_sweeping) { |
624 // Wait twice for both jobs. | 624 // Wait twice for both jobs. |
625 pending_sweeper_jobs_semaphore_.Wait(); | 625 pending_sweeper_jobs_semaphore_.Wait(); |
626 pending_sweeper_jobs_semaphore_.Wait(); | 626 pending_sweeper_jobs_semaphore_.Wait(); |
627 } | 627 } |
628 ParallelSweepSpacesComplete(); | 628 ParallelSweepSpacesComplete(); |
629 sweeping_pending_ = false; | 629 sweeping_pending_ = false; |
630 RefillFreeLists(heap()->paged_space(OLD_DATA_SPACE)); | 630 RefillFreeList(heap()->paged_space(OLD_DATA_SPACE)); |
631 RefillFreeLists(heap()->paged_space(OLD_POINTER_SPACE)); | 631 RefillFreeList(heap()->paged_space(OLD_POINTER_SPACE)); |
632 heap()->paged_space(OLD_DATA_SPACE)->ResetUnsweptFreeBytes(); | 632 heap()->paged_space(OLD_DATA_SPACE)->ResetUnsweptFreeBytes(); |
633 heap()->paged_space(OLD_POINTER_SPACE)->ResetUnsweptFreeBytes(); | 633 heap()->paged_space(OLD_POINTER_SPACE)->ResetUnsweptFreeBytes(); |
634 } | 634 } |
635 | 635 |
636 | 636 |
637 intptr_t MarkCompactCollector::RefillFreeLists(PagedSpace* space) { | 637 void MarkCompactCollector::RefillFreeList(PagedSpace* space) { |
638 FreeList* free_list; | 638 FreeList* free_list; |
639 | 639 |
640 if (space == heap()->old_pointer_space()) { | 640 if (space == heap()->old_pointer_space()) { |
641 free_list = free_list_old_pointer_space_.get(); | 641 free_list = free_list_old_pointer_space_.get(); |
642 } else if (space == heap()->old_data_space()) { | 642 } else if (space == heap()->old_data_space()) { |
643 free_list = free_list_old_data_space_.get(); | 643 free_list = free_list_old_data_space_.get(); |
644 } else { | 644 } else { |
645 // Any PagedSpace might invoke RefillFreeLists, so we need to make sure | 645 // Any PagedSpace might invoke RefillFreeLists, so we need to make sure |
646 // to only refill them for old data and pointer spaces. | 646 // to only refill them for old data and pointer spaces. |
647 return 0; | 647 return; |
648 } | 648 } |
649 | 649 |
650 intptr_t freed_bytes = space->free_list()->Concatenate(free_list); | 650 intptr_t freed_bytes = space->free_list()->Concatenate(free_list); |
651 space->AddToAccountingStats(freed_bytes); | 651 space->AddToAccountingStats(freed_bytes); |
652 space->DecrementUnsweptFreeBytes(freed_bytes); | 652 space->DecrementUnsweptFreeBytes(freed_bytes); |
653 return freed_bytes; | |
654 } | 653 } |
655 | 654 |
656 | 655 |
657 bool MarkCompactCollector::AreSweeperThreadsActivated() { | 656 bool MarkCompactCollector::AreSweeperThreadsActivated() { |
658 return isolate()->sweeper_threads() != NULL || FLAG_job_based_sweeping; | 657 return isolate()->sweeper_threads() != NULL || FLAG_job_based_sweeping; |
659 } | 658 } |
660 | 659 |
661 | 660 |
662 bool MarkCompactCollector::IsConcurrentSweepingInProgress() { | 661 bool MarkCompactCollector::IsConcurrentSweepingInProgress() { |
663 return sweeping_pending_; | 662 return sweeping_pending_; |
(...skipping 3890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4554 while (buffer != NULL) { | 4553 while (buffer != NULL) { |
4555 SlotsBuffer* next_buffer = buffer->next(); | 4554 SlotsBuffer* next_buffer = buffer->next(); |
4556 DeallocateBuffer(buffer); | 4555 DeallocateBuffer(buffer); |
4557 buffer = next_buffer; | 4556 buffer = next_buffer; |
4558 } | 4557 } |
4559 *buffer_address = NULL; | 4558 *buffer_address = NULL; |
4560 } | 4559 } |
4561 | 4560 |
4562 | 4561 |
4563 } } // namespace v8::internal | 4562 } } // namespace v8::internal |
OLD | NEW |