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

Unified Diff: src/execution.cc

Issue 291123002: Ensure that interruptor callback registered through API is called outside of ExecutionAccess lock. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | src/isolate.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 b550415bfdea82e43cf1687c4573b424a3d3deb5..62a4cbef16e351b73c3a0f2a4eae9a5de589bd2f 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -713,43 +713,50 @@ void Execution::ProcessDebugMessages(Isolate* isolate,
Object* StackGuard::HandleInterrupts() {
- ExecutionAccess access(isolate_);
- if (should_postpone_interrupts(access)) {
- return isolate_->heap()->undefined_value();
- }
+ bool has_api_interrupt = false;
+ {
+ ExecutionAccess access(isolate_);
+ if (should_postpone_interrupts(access)) {
+ return isolate_->heap()->undefined_value();
+ }
- if (CheckAndClearInterrupt(API_INTERRUPT, access)) {
- isolate_->InvokeApiInterruptCallback();
- }
+ if (CheckAndClearInterrupt(GC_REQUEST, access)) {
+ isolate_->heap()->CollectAllGarbage(Heap::kNoGCFlags, "GC interrupt");
+ }
- if (CheckAndClearInterrupt(GC_REQUEST, access)) {
- isolate_->heap()->CollectAllGarbage(Heap::kNoGCFlags, "GC interrupt");
- }
+ if (CheckDebugBreak() || CheckDebugCommand()) {
+ Execution::DebugBreakHelper(isolate_);
+ }
- if (CheckDebugBreak() || CheckDebugCommand()) {
- Execution::DebugBreakHelper(isolate_);
- }
+ if (CheckAndClearInterrupt(TERMINATE_EXECUTION, access)) {
+ return isolate_->TerminateExecution();
+ }
- if (CheckAndClearInterrupt(TERMINATE_EXECUTION, access)) {
- return isolate_->TerminateExecution();
- }
+ if (CheckAndClearInterrupt(FULL_DEOPT, access)) {
+ Deoptimizer::DeoptimizeAll(isolate_);
+ }
- if (CheckAndClearInterrupt(FULL_DEOPT, access)) {
- Deoptimizer::DeoptimizeAll(isolate_);
- }
+ if (CheckAndClearInterrupt(DEOPT_MARKED_ALLOCATION_SITES, access)) {
+ isolate_->heap()->DeoptMarkedAllocationSites();
+ }
- if (CheckAndClearInterrupt(DEOPT_MARKED_ALLOCATION_SITES, access)) {
- isolate_->heap()->DeoptMarkedAllocationSites();
+ if (CheckAndClearInterrupt(INSTALL_CODE, access)) {
+ ASSERT(isolate_->concurrent_recompilation_enabled());
+ isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions();
+ }
+
+ has_api_interrupt = CheckAndClearInterrupt(API_INTERRUPT, access);
+
+ isolate_->counters()->stack_interrupts()->Increment();
+ isolate_->counters()->runtime_profiler_ticks()->Increment();
+ isolate_->runtime_profiler()->OptimizeNow();
}
- if (CheckAndClearInterrupt(INSTALL_CODE, access)) {
- ASSERT(isolate_->concurrent_recompilation_enabled());
- isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions();
+ if (has_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 | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698