summaryrefslogtreecommitdiff
path: root/deps/v8/src/optimizing-compiler-thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/optimizing-compiler-thread.h')
-rw-r--r--deps/v8/src/optimizing-compiler-thread.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/deps/v8/src/optimizing-compiler-thread.h b/deps/v8/src/optimizing-compiler-thread.h
index d5627266d0..2d56d1a72b 100644
--- a/deps/v8/src/optimizing-compiler-thread.h
+++ b/deps/v8/src/optimizing-compiler-thread.h
@@ -29,8 +29,8 @@
#define V8_OPTIMIZING_COMPILER_THREAD_H_
#include "atomicops.h"
-#include "platform.h"
#include "flags.h"
+#include "platform.h"
#include "unbound-queue.h"
namespace v8 {
@@ -38,14 +38,19 @@ namespace internal {
class HGraphBuilder;
class OptimizingCompiler;
+class SharedFunctionInfo;
class OptimizingCompilerThread : public Thread {
public:
explicit OptimizingCompilerThread(Isolate *isolate) :
Thread("OptimizingCompilerThread"),
+#ifdef DEBUG
+ thread_id_(0),
+#endif
isolate_(isolate),
stop_semaphore_(OS::CreateSemaphore(0)),
input_queue_semaphore_(OS::CreateSemaphore(0)),
+ output_queue_semaphore_(OS::CreateSemaphore(0)),
time_spent_compiling_(0),
time_spent_total_(0) {
NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false));
@@ -57,6 +62,9 @@ class OptimizingCompilerThread : public Thread {
void QueueForOptimization(OptimizingCompiler* optimizing_compiler);
void InstallOptimizedFunctions();
+ // Wait for the next optimized function and install it.
+ Handle<SharedFunctionInfo> InstallNextOptimizedFunction();
+
inline bool IsQueueAvailable() {
// We don't need a barrier since we have a data dependency right
// after.
@@ -76,24 +84,26 @@ class OptimizingCompilerThread : public Thread {
#endif
~OptimizingCompilerThread() {
+ delete output_queue_semaphore_; // Only used for manual mode.
delete input_queue_semaphore_;
delete stop_semaphore_;
}
private:
+#ifdef DEBUG
+ int thread_id_;
+#endif
+
Isolate* isolate_;
Semaphore* stop_semaphore_;
Semaphore* input_queue_semaphore_;
+ Semaphore* output_queue_semaphore_;
UnboundQueue<OptimizingCompiler*> input_queue_;
UnboundQueue<OptimizingCompiler*> output_queue_;
volatile AtomicWord stop_thread_;
volatile Atomic32 queue_length_;
int64_t time_spent_compiling_;
int64_t time_spent_total_;
-
-#ifdef DEBUG
- int thread_id_;
-#endif
};
} } // namespace v8::internal