| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 free_list_old_pointer_space_(heap_->paged_space(OLD_POINTER_SPACE)), | 49 free_list_old_pointer_space_(heap_->paged_space(OLD_POINTER_SPACE)), |
| 50 private_free_list_old_data_space_(heap_->paged_space(OLD_DATA_SPACE)), | 50 private_free_list_old_data_space_(heap_->paged_space(OLD_DATA_SPACE)), |
| 51 private_free_list_old_pointer_space_( | 51 private_free_list_old_pointer_space_( |
| 52 heap_->paged_space(OLD_POINTER_SPACE)) { | 52 heap_->paged_space(OLD_POINTER_SPACE)) { |
| 53 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); | 53 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 void SweeperThread::Run() { | 57 void SweeperThread::Run() { |
| 58 Isolate::SetIsolateThreadLocals(isolate_, NULL); | 58 Isolate::SetIsolateThreadLocals(isolate_, NULL); |
| 59 DisallowHeapAllocation no_allocation; |
| 60 DisallowHandleAllocation no_handles; |
| 61 DisallowHandleDereference no_deref; |
| 62 |
| 59 while (true) { | 63 while (true) { |
| 60 start_sweeping_semaphore_->Wait(); | 64 start_sweeping_semaphore_->Wait(); |
| 61 | 65 |
| 62 if (Acquire_Load(&stop_thread_)) { | 66 if (Acquire_Load(&stop_thread_)) { |
| 63 stop_semaphore_->Signal(); | 67 stop_semaphore_->Signal(); |
| 64 return; | 68 return; |
| 65 } | 69 } |
| 66 | 70 |
| 67 collector_->SweepInParallel(heap_->old_data_space(), | 71 collector_->SweepInParallel(heap_->old_data_space(), |
| 68 &private_free_list_old_data_space_, | 72 &private_free_list_old_data_space_, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 94 | 98 |
| 95 void SweeperThread::StartSweeping() { | 99 void SweeperThread::StartSweeping() { |
| 96 start_sweeping_semaphore_->Signal(); | 100 start_sweeping_semaphore_->Signal(); |
| 97 } | 101 } |
| 98 | 102 |
| 99 | 103 |
| 100 void SweeperThread::WaitForSweeperThread() { | 104 void SweeperThread::WaitForSweeperThread() { |
| 101 end_sweeping_semaphore_->Wait(); | 105 end_sweeping_semaphore_->Wait(); |
| 102 } | 106 } |
| 103 } } // namespace v8::internal | 107 } } // namespace v8::internal |
| OLD | NEW |