Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/execution.cc

Issue 1230303005: Signal a blocked futex if the isolate is interrupted; don't busy-wait (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/futex-emulation.h » ('j') | src/futex-emulation.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/futex-emulation.h » ('j') | src/futex-emulation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698