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

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: 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
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 5f7b3f2d3b6134b0c8518d76eca776ad1d8b98fd..24ec0566d5e3fe5f1251d0b717cb093c7ec69327 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1713,7 +1713,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
@@ -2321,6 +2322,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();
« src/hydrogen-instructions.cc ('K') | « src/isolate.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698