OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/execution.h" | 5 #include "src/execution.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 ExecutionAccess access(isolate_); | 406 ExecutionAccess access(isolate_); |
407 // Check the chain of PostponeInterruptsScopes for interception. | 407 // Check the chain of PostponeInterruptsScopes for interception. |
408 if (thread_local_.postpone_interrupts_ && | 408 if (thread_local_.postpone_interrupts_ && |
409 thread_local_.postpone_interrupts_->Intercept(flag)) { | 409 thread_local_.postpone_interrupts_->Intercept(flag)) { |
410 return; | 410 return; |
411 } | 411 } |
412 | 412 |
413 // Not intercepted. Set as active interrupt flag. | 413 // Not intercepted. Set as active interrupt flag. |
414 thread_local_.interrupt_flags_ |= flag; | 414 thread_local_.interrupt_flags_ |= flag; |
415 set_interrupt_limits(access); | 415 set_interrupt_limits(access); |
| 416 |
| 417 // If this isolate is waiting in a futex, notify it to wake up. |
| 418 if (isolate_->futex_wait_list_node()->waiting()) { |
| 419 // Release the execution lock to prevent potential deadlock due to lock |
| 420 // order inversion with the futex lock. |
| 421 ExecutionAccess::Unlock(isolate_); |
| 422 isolate_->futex_wait_list_node()->NotifyWake(); |
| 423 ExecutionAccess::Lock(isolate_); |
| 424 } |
416 } | 425 } |
417 | 426 |
418 | 427 |
419 void StackGuard::ClearInterrupt(InterruptFlag flag) { | 428 void StackGuard::ClearInterrupt(InterruptFlag flag) { |
420 ExecutionAccess access(isolate_); | 429 ExecutionAccess access(isolate_); |
421 // Clear the interrupt flag from the chain of PostponeInterruptsScopes. | 430 // Clear the interrupt flag from the chain of PostponeInterruptsScopes. |
422 for (PostponeInterruptsScope* current = thread_local_.postpone_interrupts_; | 431 for (PostponeInterruptsScope* current = thread_local_.postpone_interrupts_; |
423 current != NULL; | 432 current != NULL; |
424 current = current->prev_) { | 433 current = current->prev_) { |
425 current->intercepted_flags_ &= ~flag; | 434 current->intercepted_flags_ &= ~flag; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 | 672 |
664 isolate_->counters()->stack_interrupts()->Increment(); | 673 isolate_->counters()->stack_interrupts()->Increment(); |
665 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 674 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
666 isolate_->runtime_profiler()->OptimizeNow(); | 675 isolate_->runtime_profiler()->OptimizeNow(); |
667 | 676 |
668 return isolate_->heap()->undefined_value(); | 677 return isolate_->heap()->undefined_value(); |
669 } | 678 } |
670 | 679 |
671 } // namespace internal | 680 } // namespace internal |
672 } // namespace v8 | 681 } // namespace v8 |
OLD | NEW |