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

Unified Diff: src/execution.cc

Issue 177493002: Introduce SynchronizedScope to allow heap access from compiler thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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') | src/log.h » ('j') | src/optimizing-compiler-thread.cc » ('J')
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 690a4e3f4e6cd8570a0b052ee643b8fedb24aa69..b967e9f8ff6eb717deeca4ef303236645a33f259 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -503,6 +503,22 @@ void StackGuard::RequestInstallCode() {
}
+bool StackGuard::IsCompilerSyncRequest() {
+ ExecutionAccess access(isolate_);
+ return (thread_local_.interrupt_flags_ & COMPILER_SYNC) != 0;
+}
+
+
+void StackGuard::RequestCompilerSync() {
+ ExecutionAccess access(isolate_);
+ thread_local_.interrupt_flags_ |= COMPILER_SYNC;
+ if (thread_local_.postpone_interrupts_nesting_ == 0) {
+ thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
+ isolate_->heap()->SetStackLimits();
+ }
+}
+
+
bool StackGuard::IsFullDeopt() {
ExecutionAccess access(isolate_);
return (thread_local_.interrupt_flags_ & FULL_DEOPT) != 0;
@@ -1049,7 +1065,13 @@ MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) {
stack_guard->Continue(INSTALL_CODE);
isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
}
- isolate->runtime_profiler()->OptimizeNow();
+ if (stack_guard->IsCompilerSyncRequest()) {
+ ASSERT(isolate->concurrent_recompilation_enabled());
+ stack_guard->Continue(COMPILER_SYNC);
+ isolate->optimizing_compiler_thread()->YieldToCompilerThread();
+ } else {
+ isolate->runtime_profiler()->OptimizeNow();
+ }
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/execution.h ('k') | src/log.h » ('j') | src/optimizing-compiler-thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698