// Zone on construction and deallocates it on exit.
class CompilationInfoWithZone: public CompilationInfo {
public:
+ INLINE(void* operator new(size_t size)) { return Malloced::New(size); }
+
explicit CompilationInfoWithZone(Handle<Script> script)
: CompilationInfo(script, &zone_),
zone_(script->GetIsolate()),
output_queue_semaphore_->Wait();
OptimizingCompiler* compiler = NULL;
output_queue_.Dequeue(&compiler);
+ Handle<SharedFunctionInfo> shared = compiler->info()->shared_info();
Compiler::InstallOptimizedCode(compiler);
- return compiler->info()->shared_info();
+ return shared;
}
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)),
#endif
~OptimizingCompilerThread() {
- delete input_queue_semaphore_;
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_;
volatile Atomic32 queue_length_;
int64_t time_spent_compiling_;
int64_t time_spent_total_;
-
-#ifdef DEBUG
- int thread_id_;
-#endif
};
} } // namespace v8::internal