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

Unified Diff: src/execution.cc

Issue 309533009: Release execution lock before dispatching interrupt handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: small fix to rebase mistake Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 1c8b0b9bb80a8ba5d96a6218f1525ceaa4e8c557..7b53ff958125fe93d6095de6cffbf2b32c5d4e12 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;
}
@@ -655,46 +655,43 @@ Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
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()) {
- isolate_->debug()->DebugBreakHelper();
- }
-
- 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()) {
+ isolate_->debug()->DebugBreakHelper();
+ }
- 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();
}
« no previous file with comments | « src/execution.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698