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
This commit is contained in:
yangguo@chromium.org 2013-10-16 16:27:17 +00:00
parent b8dd056fa2
commit e0508615a9
2 changed files with 19 additions and 12 deletions

View File

@ -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

View File

@ -63,20 +63,14 @@ class OptimizingCompilerThread : public Thread {
blocked_jobs_(0) {
NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE));
input_queue_ = NewArray<RecompileJob*>(input_queue_capacity_);
if (FLAG_concurrent_osr) {
// Allocate and mark OSR buffer slots as empty.
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]);
}
#endif
DeleteArray(osr_buffer_);
}
~OptimizingCompilerThread();
void Run();
void Stop();