Chromium Code Reviews| Index: src/marking-thread.h |
| diff --git a/src/vm-state.h b/src/marking-thread.h |
| similarity index 68% |
| copy from src/vm-state.h |
| copy to src/marking-thread.h |
| index 831e2d396b28df16f5aec105220d4e301ae77994..9efa3af13262165972abf179defac6f83fed4ac9 100644 |
| --- a/src/vm-state.h |
| +++ b/src/marking-thread.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright 2010 the V8 project authors. All rights reserved. |
| +// Copyright 2013 the V8 project authors. All rights reserved. |
| // Redistribution and use in source and binary forms, with or without |
| // modification, are permitted provided that the following conditions are |
| // met: |
| @@ -25,36 +25,47 @@ |
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| -#ifndef V8_VM_STATE_H_ |
| -#define V8_VM_STATE_H_ |
| +#ifndef V8_MARKING_THREAD_H_ |
| +#define V8_MARKING_THREAD_H_ |
| -#include "allocation.h" |
| -#include "isolate.h" |
| +#include "atomicops.h" |
| +#include "flags.h" |
| +#include "platform.h" |
| +#include "v8utils.h" |
| + |
| +#include "spaces.h" |
| + |
| +#include "heap.h" |
| namespace v8 { |
| namespace internal { |
| -class VMState BASE_EMBEDDED { |
| +class MarkingThread : public Thread { |
| public: |
| - inline VMState(Isolate* isolate, StateTag tag); |
| - inline ~VMState(); |
| + explicit MarkingThread(Isolate* isolate); |
| - private: |
| - Isolate* isolate_; |
| - StateTag previous_tag_; |
| -}; |
| + void Run(); |
| + void Stop(); |
| + void StartMarking(); |
| + void WaitForMarkingThread(); |
| + ~MarkingThread() { |
| + delete start_marking_semaphore_; |
|
tfarina
2013/01/31 21:20:30
isn't there a scoped_ptr type to handle this?
|
| + delete end_marking_semaphore_; |
| + delete stop_semaphore_; |
| + } |
| -class ExternalCallbackScope BASE_EMBEDDED { |
| - public: |
| - inline ExternalCallbackScope(Isolate* isolate, Address callback); |
| - inline ~ExternalCallbackScope(); |
| private: |
| Isolate* isolate_; |
| - Address previous_callback_; |
| + Heap* heap_; |
| + Semaphore* start_marking_semaphore_; |
| + Semaphore* end_marking_semaphore_; |
| + Semaphore* stop_semaphore_; |
| + volatile AtomicWord stop_thread_; |
| + int id_; |
| + static Atomic32 id_counter_; |
| }; |
| } } // namespace v8::internal |
| - |
| -#endif // V8_VM_STATE_H_ |
| +#endif // V8_MARKING_THREAD_H_ |