| Index: src/execution.cc
|
| diff --git a/src/execution.cc b/src/execution.cc
|
| index fb2444c20af96b257c9de1570ef61c0a09efd2b7..d560a121ffac8ca1d8bdfe994654d8ae4fd6ac97 100644
|
| --- a/src/execution.cc
|
| +++ b/src/execution.cc
|
| @@ -366,13 +366,13 @@ void StackGuard::ClearInterrupt(int flagbit) {
|
| }
|
|
|
|
|
| -bool StackGuard::CheckAndClearInterrupt(InterruptFlag flag,
|
| - const ExecutionAccess& lock) {
|
| +bool StackGuard::CheckAndClearInterrupt(InterruptFlag flag) {
|
| + ExecutionAccess access(isolate_);
|
| int flagbit = 1 << flag;
|
| bool result = (thread_local_.interrupt_flags_ & flagbit);
|
| thread_local_.interrupt_flags_ &= ~flagbit;
|
| - if (!should_postpone_interrupts(lock) && !has_pending_interrupts(lock)) {
|
| - reset_limits(lock);
|
| + if (!should_postpone_interrupts(access) && !has_pending_interrupts(access)) {
|
| + reset_limits(access);
|
| }
|
| return result;
|
| }
|
| @@ -709,46 +709,43 @@ void Execution::ProcessDebugMessages(Isolate* isolate,
|
|
|
|
|
| Object* StackGuard::HandleInterrupts() {
|
| - bool has_api_interrupt = false;
|
| {
|
| ExecutionAccess access(isolate_);
|
| if (should_postpone_interrupts(access)) {
|
| return isolate_->heap()->undefined_value();
|
| }
|
| + }
|
|
|
| - if (CheckAndClearInterrupt(GC_REQUEST, access)) {
|
| - isolate_->heap()->CollectAllGarbage(Heap::kNoGCFlags, "GC interrupt");
|
| - }
|
| -
|
| - if (CheckDebugBreak() || CheckDebugCommand()) {
|
| - Execution::DebugBreakHelper(isolate_);
|
| - }
|
| -
|
| - if (CheckAndClearInterrupt(TERMINATE_EXECUTION, access)) {
|
| - return isolate_->TerminateExecution();
|
| - }
|
| + if (CheckAndClearInterrupt(GC_REQUEST)) {
|
| + isolate_->heap()->CollectAllGarbage(Heap::kNoGCFlags, "GC interrupt");
|
| + }
|
|
|
| - if (CheckAndClearInterrupt(DEOPT_MARKED_ALLOCATION_SITES, access)) {
|
| - isolate_->heap()->DeoptMarkedAllocationSites();
|
| - }
|
| + if (CheckDebugBreak() || CheckDebugCommand()) {
|
| + Execution::DebugBreakHelper(isolate_);
|
| + }
|
|
|
| - if (CheckAndClearInterrupt(INSTALL_CODE, access)) {
|
| - ASSERT(isolate_->concurrent_recompilation_enabled());
|
| - isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions();
|
| - }
|
| + if (CheckAndClearInterrupt(TERMINATE_EXECUTION)) {
|
| + return isolate_->TerminateExecution();
|
| + }
|
|
|
| - has_api_interrupt = CheckAndClearInterrupt(API_INTERRUPT, access);
|
| + if (CheckAndClearInterrupt(DEOPT_MARKED_ALLOCATION_SITES)) {
|
| + isolate_->heap()->DeoptMarkedAllocationSites();
|
| + }
|
|
|
| - isolate_->counters()->stack_interrupts()->Increment();
|
| - isolate_->counters()->runtime_profiler_ticks()->Increment();
|
| - isolate_->runtime_profiler()->OptimizeNow();
|
| + if (CheckAndClearInterrupt(INSTALL_CODE)) {
|
| + ASSERT(isolate_->concurrent_recompilation_enabled());
|
| + isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions();
|
| }
|
|
|
| - if (has_api_interrupt) {
|
| + if (CheckAndClearInterrupt(API_INTERRUPT)) {
|
| // Callback must be invoked outside of ExecusionAccess lock.
|
| isolate_->InvokeApiInterruptCallback();
|
| }
|
|
|
| + isolate_->counters()->stack_interrupts()->Increment();
|
| + isolate_->counters()->runtime_profiler_ticks()->Increment();
|
| + isolate_->runtime_profiler()->OptimizeNow();
|
| +
|
| return isolate_->heap()->undefined_value();
|
| }
|
|
|
|
|