| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler-dispatcher/compiler-dispatcher.h" | 5 #include "src/compiler-dispatcher/compiler-dispatcher.h" |
| 6 | 6 |
| 7 #include "include/v8-platform.h" | 7 #include "include/v8-platform.h" |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "src/base/platform/time.h" | 9 #include "src/base/platform/time.h" |
| 10 #include "src/cancelable-task.h" | 10 #include "src/cancelable-task.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return false; | 233 return false; |
| 234 } | 234 } |
| 235 | 235 |
| 236 { | 236 { |
| 237 base::LockGuard<base::Mutex> lock(&mutex_); | 237 base::LockGuard<base::Mutex> lock(&mutex_); |
| 238 if (abort_) return false; | 238 if (abort_) return false; |
| 239 } | 239 } |
| 240 | 240 |
| 241 // We only handle functions (no eval / top-level code / wasm) that are | 241 // We only handle functions (no eval / top-level code / wasm) that are |
| 242 // attached to a script. | 242 // attached to a script. |
| 243 if (!function->script()->IsScript() || !function->is_function() || | 243 if (!function->script()->IsScript() || function->is_toplevel() || |
| 244 function->asm_function() || function->native()) { | 244 function->asm_function() || function->native()) { |
| 245 return false; | 245 return false; |
| 246 } | 246 } |
| 247 | 247 |
| 248 if (IsEnqueued(function)) return true; | 248 if (IsEnqueued(function)) return true; |
| 249 | 249 |
| 250 if (trace_compiler_dispatcher_) { | 250 if (trace_compiler_dispatcher_) { |
| 251 PrintF("CompilerDispatcher: enqueuing "); | 251 PrintF("CompilerDispatcher: enqueuing "); |
| 252 function->ShortPrint(); | 252 function->ShortPrint(); |
| 253 PrintF("\n"); | 253 PrintF("\n"); |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 lock.reset(); | 622 lock.reset(); |
| 623 DoNextStepOnMainThread(isolate_, job->second.get(), | 623 DoNextStepOnMainThread(isolate_, job->second.get(), |
| 624 ExceptionHandling::kSwallow); | 624 ExceptionHandling::kSwallow); |
| 625 } | 625 } |
| 626 } | 626 } |
| 627 if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded(); | 627 if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded(); |
| 628 } | 628 } |
| 629 | 629 |
| 630 } // namespace internal | 630 } // namespace internal |
| 631 } // namespace v8 | 631 } // namespace v8 |
| OLD | NEW |