| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 void OptimizingCompilerThread::Unblock() { | 294 void OptimizingCompilerThread::Unblock() { |
| 295 ASSERT(!IsOptimizerThread()); | 295 ASSERT(!IsOptimizerThread()); |
| 296 while (blocked_jobs_ > 0) { | 296 while (blocked_jobs_ > 0) { |
| 297 input_queue_semaphore_.Signal(); | 297 input_queue_semaphore_.Signal(); |
| 298 blocked_jobs_--; | 298 blocked_jobs_--; |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 | 301 |
| 302 | 302 |
| 303 RecompileJob* OptimizingCompilerThread::FindReadyOSRCandidate( | 303 RecompileJob* OptimizingCompilerThread::FindReadyOSRCandidate( |
| 304 Handle<JSFunction> function, uint32_t osr_pc_offset) { | 304 Handle<JSFunction> function, BailoutId osr_ast_id) { |
| 305 ASSERT(!IsOptimizerThread()); | 305 ASSERT(!IsOptimizerThread()); |
| 306 for (int i = 0; i < osr_buffer_capacity_; i++) { | 306 for (int i = 0; i < osr_buffer_capacity_; i++) { |
| 307 RecompileJob* current = osr_buffer_[i]; | 307 RecompileJob* current = osr_buffer_[i]; |
| 308 if (current != NULL && | 308 if (current != NULL && |
| 309 current->IsWaitingForInstall() && | 309 current->IsWaitingForInstall() && |
| 310 current->info()->HasSameOsrEntry(function, osr_pc_offset)) { | 310 current->info()->HasSameOsrEntry(function, osr_ast_id)) { |
| 311 osr_hits_++; | 311 osr_hits_++; |
| 312 osr_buffer_[i] = NULL; | 312 osr_buffer_[i] = NULL; |
| 313 return current; | 313 return current; |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 return NULL; | 316 return NULL; |
| 317 } | 317 } |
| 318 | 318 |
| 319 | 319 |
| 320 bool OptimizingCompilerThread::IsQueuedForOSR(Handle<JSFunction> function, | 320 bool OptimizingCompilerThread::IsQueuedForOSR(Handle<JSFunction> function, |
| 321 uint32_t osr_pc_offset) { | 321 BailoutId osr_ast_id) { |
| 322 ASSERT(!IsOptimizerThread()); | 322 ASSERT(!IsOptimizerThread()); |
| 323 for (int i = 0; i < osr_buffer_capacity_; i++) { | 323 for (int i = 0; i < osr_buffer_capacity_; i++) { |
| 324 RecompileJob* current = osr_buffer_[i]; | 324 RecompileJob* current = osr_buffer_[i]; |
| 325 if (current != NULL && | 325 if (current != NULL && |
| 326 current->info()->HasSameOsrEntry(function, osr_pc_offset)) { | 326 current->info()->HasSameOsrEntry(function, osr_ast_id)) { |
| 327 return !current->IsWaitingForInstall(); | 327 return !current->IsWaitingForInstall(); |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| 332 | 332 |
| 333 | 333 |
| 334 bool OptimizingCompilerThread::IsQueuedForOSR(JSFunction* function) { | 334 bool OptimizingCompilerThread::IsQueuedForOSR(JSFunction* function) { |
| 335 ASSERT(!IsOptimizerThread()); | 335 ASSERT(!IsOptimizerThread()); |
| 336 for (int i = 0; i < osr_buffer_capacity_; i++) { | 336 for (int i = 0; i < osr_buffer_capacity_; i++) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 377 |
| 378 | 378 |
| 379 bool OptimizingCompilerThread::IsOptimizerThread() { | 379 bool OptimizingCompilerThread::IsOptimizerThread() { |
| 380 LockGuard<Mutex> lock_guard(&thread_id_mutex_); | 380 LockGuard<Mutex> lock_guard(&thread_id_mutex_); |
| 381 return ThreadId::Current().ToInteger() == thread_id_; | 381 return ThreadId::Current().ToInteger() == thread_id_; |
| 382 } | 382 } |
| 383 #endif | 383 #endif |
| 384 | 384 |
| 385 | 385 |
| 386 } } // namespace v8::internal | 386 } } // namespace v8::internal |
| OLD | NEW |