V8 Project
sweeper-thread.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_HEAP_SWEEPER_THREAD_H_
6 #define V8_HEAP_SWEEPER_THREAD_H_
7 
8 #include "src/base/atomicops.h"
10 #include "src/flags.h"
11 #include "src/utils.h"
12 
13 #include "src/heap/spaces.h"
14 
15 #include "src/heap/heap.h"
16 
17 namespace v8 {
18 namespace internal {
19 
20 class SweeperThread : public base::Thread {
21  public:
22  explicit SweeperThread(Isolate* isolate);
24 
25  void Run();
26  void Stop();
27  void StartSweeping();
28  void WaitForSweeperThread();
29  bool SweepingCompleted();
30 
31  static int NumberOfThreads(int max_available);
32 
33  private:
37  base::Semaphore start_sweeping_semaphore_;
38  base::Semaphore end_sweeping_semaphore_;
39  base::Semaphore stop_semaphore_;
41 };
42 }
43 } // namespace v8::internal
44 
45 #endif // V8_HEAP_SWEEPER_THREAD_H_
volatile base::AtomicWord stop_thread_
base::Semaphore start_sweeping_semaphore_
base::Semaphore end_sweeping_semaphore_
SweeperThread(Isolate *isolate)
base::Semaphore stop_semaphore_
static int NumberOfThreads(int max_available)
MarkCompactCollector * collector_
intptr_t AtomicWord
Definition: atomicops.h:57
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20