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

Unified Diff: src/isolate.cc

Issue 12832002: Parallel recompilation: fewer handle dereferences and tighter checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 9 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/isolate.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 4192d113c78c1a61bb21d94e5550b07209553725..fb9cab1d68a430acfef7e528129fcb188c36c789 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1709,7 +1709,8 @@ Isolate::Isolate()
memset(code_kind_statistics_, 0,
sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS);
- allow_handle_deref_ = true;
+ allow_compiler_thread_handle_deref_ = true;
+ allow_execution_thread_handle_deref_ = true;
#endif
#ifdef ENABLE_DEBUGGER_SUPPORT
@@ -2317,6 +2318,33 @@ void Isolate::UnlinkDeferredHandles(DeferredHandles* deferred) {
}
+#ifdef DEBUG
+bool Isolate::AllowHandleDereference() {
+ if (allow_execution_thread_handle_deref_ &&
+ allow_compiler_thread_handle_deref_) {
+ // Short-cut to avoid polling thread id.
+ return true;
+ }
+ if (FLAG_parallel_recompilation &&
+ optimizing_compiler_thread()->IsOptimizerThread()) {
+ return allow_compiler_thread_handle_deref_;
+ } else {
+ return allow_execution_thread_handle_deref_;
+ }
+}
+
+
+void Isolate::SetAllowHandleDereference(bool allow) {
+ if (FLAG_parallel_recompilation &&
+ optimizing_compiler_thread()->IsOptimizerThread()) {
+ allow_compiler_thread_handle_deref_ = allow;
+ } else {
+ allow_execution_thread_handle_deref_ = allow;
+ }
+}
+#endif
+
+
HStatistics* Isolate::GetHStatistics() {
if (hstatistics() == NULL) set_hstatistics(new HStatistics());
return hstatistics();
« no previous file with comments | « src/isolate.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698