OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 34 matching lines...) Loading... |
45 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); | 45 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); |
46 id_ = NoBarrier_AtomicIncrement(&id_counter_, 1); | 46 id_ = NoBarrier_AtomicIncrement(&id_counter_, 1); |
47 } | 47 } |
48 | 48 |
49 | 49 |
50 Atomic32 MarkingThread::id_counter_ = -1; | 50 Atomic32 MarkingThread::id_counter_ = -1; |
51 | 51 |
52 | 52 |
53 void MarkingThread::Run() { | 53 void MarkingThread::Run() { |
54 Isolate::SetIsolateThreadLocals(isolate_, NULL); | 54 Isolate::SetIsolateThreadLocals(isolate_, NULL); |
| 55 DisallowHeapAllocation no_allocation; |
| 56 DisallowHandleAllocation no_handles; |
| 57 DisallowHandleDereference no_deref; |
55 | 58 |
56 while (true) { | 59 while (true) { |
57 start_marking_semaphore_->Wait(); | 60 start_marking_semaphore_->Wait(); |
58 | 61 |
59 if (Acquire_Load(&stop_thread_)) { | 62 if (Acquire_Load(&stop_thread_)) { |
60 stop_semaphore_->Signal(); | 63 stop_semaphore_->Signal(); |
61 return; | 64 return; |
62 } | 65 } |
63 | 66 |
64 end_marking_semaphore_->Signal(); | 67 end_marking_semaphore_->Signal(); |
(...skipping 11 matching lines...) Loading... |
76 void MarkingThread::StartMarking() { | 79 void MarkingThread::StartMarking() { |
77 start_marking_semaphore_->Signal(); | 80 start_marking_semaphore_->Signal(); |
78 } | 81 } |
79 | 82 |
80 | 83 |
81 void MarkingThread::WaitForMarkingThread() { | 84 void MarkingThread::WaitForMarkingThread() { |
82 end_marking_semaphore_->Wait(); | 85 end_marking_semaphore_->Wait(); |
83 } | 86 } |
84 | 87 |
85 } } // namespace v8::internal | 88 } } // namespace v8::internal |
OLD | NEW |