Chromium Code Reviews| Index: src/execution.cc |
| diff --git a/src/execution.cc b/src/execution.cc |
| index 2613c20f0f4ed1b23e47e211fa8839ca7a22af58..2bf721c46ef802f0308179112667d4cbf9987677 100644 |
| --- a/src/execution.cc |
| +++ b/src/execution.cc |
| @@ -446,6 +446,25 @@ void StackGuard::RequestRuntimeProfilerTick() { |
| } |
| +void StackGuard::RequestCodeReadyEvent() { |
| + ASSERT(FLAG_parallel_recompilation); |
| + if (ExecutionAccess::TryLock(isolate_)) { |
| + thread_local_.interrupt_flags_ |= CODE_READY; |
| + if (thread_local_.postpone_interrupts_nesting_ == 0) { |
| + thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; |
| + isolate_->heap()->SetStackLimits(); |
| + } |
| + ExecutionAccess::Unlock(isolate_); |
| + } |
| +} |
| + |
| + |
| +bool StackGuard::IsCodeReadyEvent() { |
| + ExecutionAccess access(isolate_); |
| + return (thread_local_.interrupt_flags_ & CODE_READY) != 0; |
| +} |
| + |
| + |
| bool StackGuard::IsGCRequest() { |
| ExecutionAccess access(isolate_); |
| return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0; |
| @@ -911,6 +930,17 @@ MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { |
| stack_guard->Continue(GC_REQUEST); |
| } |
| + if (stack_guard->IsCodeReadyEvent()) { |
| + ASSERT(FLAG_parallel_recompilation); |
| + if (FLAG_trace_parallel_recompilation) { |
| + PrintF(" ** CODE_READY event received.\n"); |
| + } |
| + stack_guard->Continue(CODE_READY); |
| + } |
| + if (!stack_guard->IsTerminateExecution()) { |
| + isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| + } |
| + |
| isolate->counters()->stack_interrupts()->Increment(); |
| // If FLAG_count_based_interrupts, every interrupt is a profiler interrupt. |
| if (FLAG_count_based_interrupts || |
| @@ -933,6 +963,7 @@ MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { |
| stack_guard->Continue(INTERRUPT); |
| return isolate->StackOverflow(); |
| } |
| + |
|
Yang
2012/07/19 12:47:30
Stray edit?
sanjoy
2012/07/19 15:06:09
Done.
|
| return isolate->heap()->undefined_value(); |
| } |