Commit 3c251ec9 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix valgrind warnings.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11418138

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5593b956
......@@ -293,6 +293,8 @@ class CompilationInfo {
// 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()),
......
......@@ -127,8 +127,9 @@ Handle<SharedFunctionInfo>
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;
}
......
......@@ -44,6 +44,9 @@ 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)),
......@@ -81,12 +84,16 @@ class OptimizingCompilerThread : public Thread {
#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_;
......@@ -97,10 +104,6 @@ class OptimizingCompilerThread : public Thread {
volatile Atomic32 queue_length_;
int64_t time_spent_compiling_;
int64_t time_spent_total_;
#ifdef DEBUG
int thread_id_;
#endif
};
} } // namespace v8::internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment