Commit e0508615 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix leak in optimizing compiler thread.

R=mvstanton@chromium.org
BUG=

Review URL: https://codereview.chromium.org/27473006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17247 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b8dd056f
......@@ -37,6 +37,19 @@
namespace v8 {
namespace internal {
OptimizingCompilerThread::~OptimizingCompilerThread() {
ASSERT_EQ(0, input_queue_length_);
DeleteArray(input_queue_);
if (FLAG_concurrent_osr) {
#ifdef DEBUG
for (int i = 0; i < osr_buffer_capacity_; i++) {
CHECK_EQ(NULL, osr_buffer_[i]);
}
#endif
DeleteArray(osr_buffer_);
}
}
void OptimizingCompilerThread::Run() {
#ifdef DEBUG
......
......@@ -63,21 +63,15 @@ class OptimizingCompilerThread : public Thread {
blocked_jobs_(0) {
NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE));
input_queue_ = NewArray<RecompileJob*>(input_queue_capacity_);
osr_buffer_ = NewArray<RecompileJob*>(osr_buffer_capacity_);
// Mark OSR buffer slots as empty.
for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL;
}
~OptimizingCompilerThread() {
ASSERT_EQ(0, input_queue_length_);
#ifdef DEBUG
for (int i = 0; i < osr_buffer_capacity_; i++) {
CHECK_EQ(NULL, osr_buffer_[i]);
if (FLAG_concurrent_osr) {
// Allocate and mark OSR buffer slots as empty.
osr_buffer_ = NewArray<RecompileJob*>(osr_buffer_capacity_);
for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL;
}
#endif
DeleteArray(osr_buffer_);
}
~OptimizingCompilerThread();
void Run();
void Stop();
void Flush();
......
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