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

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: remove atomic waiting_ 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') | no next file with comments »
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 isolate_->futex_wait_list_node()->NotifyWake();
416 } 419 }
417 420
418 421
419 void StackGuard::ClearInterrupt(InterruptFlag flag) { 422 void StackGuard::ClearInterrupt(InterruptFlag flag) {
420 ExecutionAccess access(isolate_); 423 ExecutionAccess access(isolate_);
421 // Clear the interrupt flag from the chain of PostponeInterruptsScopes. 424 // Clear the interrupt flag from the chain of PostponeInterruptsScopes.
422 for (PostponeInterruptsScope* current = thread_local_.postpone_interrupts_; 425 for (PostponeInterruptsScope* current = thread_local_.postpone_interrupts_;
423 current != NULL; 426 current != NULL;
424 current = current->prev_) { 427 current = current->prev_) {
425 current->intercepted_flags_ &= ~flag; 428 current->intercepted_flags_ &= ~flag;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 662
660 isolate_->counters()->stack_interrupts()->Increment(); 663 isolate_->counters()->stack_interrupts()->Increment();
661 isolate_->counters()->runtime_profiler_ticks()->Increment(); 664 isolate_->counters()->runtime_profiler_ticks()->Increment();
662 isolate_->runtime_profiler()->OptimizeNow(); 665 isolate_->runtime_profiler()->OptimizeNow();
663 666
664 return isolate_->heap()->undefined_value(); 667 return isolate_->heap()->undefined_value();
665 } 668 }
666 669
667 } // namespace internal 670 } // namespace internal
668 } // namespace v8 671 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/futex-emulation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698