Index: src/optimizing-compiler-thread.cc |
diff --git a/src/optimizing-compiler-thread.cc b/src/optimizing-compiler-thread.cc |
index 966928416abc934d7b1a96ab5bf903cbd9de22bd..0074adbefe1e10a650e76f33ba8711e75bcf5ee6 100644 |
--- a/src/optimizing-compiler-thread.cc |
+++ b/src/optimizing-compiler-thread.cc |
@@ -16,7 +16,7 @@ namespace v8 { |
namespace internal { |
OptimizingCompilerThread::~OptimizingCompilerThread() { |
- ASSERT_EQ(0, input_queue_length_); |
+ DCHECK_EQ(0, input_queue_length_); |
DeleteArray(input_queue_); |
if (FLAG_concurrent_osr) { |
#ifdef DEBUG |
@@ -88,7 +88,7 @@ OptimizedCompileJob* OptimizingCompilerThread::NextInput() { |
base::LockGuard<base::Mutex> access_input_queue_(&input_queue_mutex_); |
if (input_queue_length_ == 0) return NULL; |
OptimizedCompileJob* job = input_queue_[InputQueueIndex(0)]; |
- ASSERT_NE(NULL, job); |
+ DCHECK_NE(NULL, job); |
input_queue_shift_ = InputQueueIndex(1); |
input_queue_length_--; |
return job; |
@@ -97,12 +97,12 @@ OptimizedCompileJob* OptimizingCompilerThread::NextInput() { |
void OptimizingCompilerThread::CompileNext() { |
OptimizedCompileJob* job = NextInput(); |
- ASSERT_NE(NULL, job); |
+ DCHECK_NE(NULL, job); |
// The function may have already been optimized by OSR. Simply continue. |
OptimizedCompileJob::Status status = job->OptimizeGraph(); |
USE(status); // Prevent an unused-variable error in release mode. |
- ASSERT(status != OptimizedCompileJob::FAILED); |
+ DCHECK(status != OptimizedCompileJob::FAILED); |
// The function may have already been optimized by OSR. Simply continue. |
// Use a mutex to make sure that functions marked for install |
@@ -169,7 +169,7 @@ void OptimizingCompilerThread::FlushOsrBuffer(bool restore_function_code) { |
void OptimizingCompilerThread::Flush() { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
base::Release_Store(&stop_thread_, static_cast<base::AtomicWord>(FLUSH)); |
if (FLAG_block_concurrent_recompilation) Unblock(); |
input_queue_semaphore_.Signal(); |
@@ -183,7 +183,7 @@ void OptimizingCompilerThread::Flush() { |
void OptimizingCompilerThread::Stop() { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
base::Release_Store(&stop_thread_, static_cast<base::AtomicWord>(STOP)); |
if (FLAG_block_concurrent_recompilation) Unblock(); |
input_queue_semaphore_.Signal(); |
@@ -216,7 +216,7 @@ void OptimizingCompilerThread::Stop() { |
void OptimizingCompilerThread::InstallOptimizedFunctions() { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
HandleScope handle_scope(isolate_); |
OptimizedCompileJob* job; |
@@ -249,15 +249,15 @@ void OptimizingCompilerThread::InstallOptimizedFunctions() { |
void OptimizingCompilerThread::QueueForOptimization(OptimizedCompileJob* job) { |
- ASSERT(IsQueueAvailable()); |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(IsQueueAvailable()); |
+ DCHECK(!IsOptimizerThread()); |
CompilationInfo* info = job->info(); |
if (info->is_osr()) { |
osr_attempts_++; |
AddToOsrBuffer(job); |
// Add job to the front of the input queue. |
base::LockGuard<base::Mutex> access_input_queue(&input_queue_mutex_); |
- ASSERT_LT(input_queue_length_, input_queue_capacity_); |
+ DCHECK_LT(input_queue_length_, input_queue_capacity_); |
// Move shift_ back by one. |
input_queue_shift_ = InputQueueIndex(input_queue_capacity_ - 1); |
input_queue_[InputQueueIndex(0)] = job; |
@@ -265,7 +265,7 @@ void OptimizingCompilerThread::QueueForOptimization(OptimizedCompileJob* job) { |
} else { |
// Add job to the back of the input queue. |
base::LockGuard<base::Mutex> access_input_queue(&input_queue_mutex_); |
- ASSERT_LT(input_queue_length_, input_queue_capacity_); |
+ DCHECK_LT(input_queue_length_, input_queue_capacity_); |
input_queue_[InputQueueIndex(input_queue_length_)] = job; |
input_queue_length_++; |
} |
@@ -278,7 +278,7 @@ void OptimizingCompilerThread::QueueForOptimization(OptimizedCompileJob* job) { |
void OptimizingCompilerThread::Unblock() { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
while (blocked_jobs_ > 0) { |
input_queue_semaphore_.Signal(); |
blocked_jobs_--; |
@@ -288,7 +288,7 @@ void OptimizingCompilerThread::Unblock() { |
OptimizedCompileJob* OptimizingCompilerThread::FindReadyOSRCandidate( |
Handle<JSFunction> function, BailoutId osr_ast_id) { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
for (int i = 0; i < osr_buffer_capacity_; i++) { |
OptimizedCompileJob* current = osr_buffer_[i]; |
if (current != NULL && |
@@ -305,7 +305,7 @@ OptimizedCompileJob* OptimizingCompilerThread::FindReadyOSRCandidate( |
bool OptimizingCompilerThread::IsQueuedForOSR(Handle<JSFunction> function, |
BailoutId osr_ast_id) { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
for (int i = 0; i < osr_buffer_capacity_; i++) { |
OptimizedCompileJob* current = osr_buffer_[i]; |
if (current != NULL && |
@@ -318,7 +318,7 @@ bool OptimizingCompilerThread::IsQueuedForOSR(Handle<JSFunction> function, |
bool OptimizingCompilerThread::IsQueuedForOSR(JSFunction* function) { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
for (int i = 0; i < osr_buffer_capacity_; i++) { |
OptimizedCompileJob* current = osr_buffer_[i]; |
if (current != NULL && *current->info()->closure() == function) { |
@@ -330,7 +330,7 @@ bool OptimizingCompilerThread::IsQueuedForOSR(JSFunction* function) { |
void OptimizingCompilerThread::AddToOsrBuffer(OptimizedCompileJob* job) { |
- ASSERT(!IsOptimizerThread()); |
+ DCHECK(!IsOptimizerThread()); |
// Find the next slot that is empty or has a stale job. |
OptimizedCompileJob* stale = NULL; |
while (true) { |
@@ -341,7 +341,7 @@ void OptimizingCompilerThread::AddToOsrBuffer(OptimizedCompileJob* job) { |
// Add to found slot and dispose the evicted job. |
if (stale != NULL) { |
- ASSERT(stale->IsWaitingForInstall()); |
+ DCHECK(stale->IsWaitingForInstall()); |
CompilationInfo* info = stale->info(); |
if (FLAG_trace_osr) { |
PrintF("[COSR - Discarded "); |