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

Unified Diff: src/runtime-profiler.cc

Issue 10417010: Run Crankshaft on a separate thread. (Closed) Base URL: https://chromiumcodereview.appspot.com/10387157
Patch Set: Created 8 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
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 568e48e412c03f4151f6fb9ae30323efd0a0182b..eaf0735c4aa6b02d3c493cf308b5397e7c4660e4 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -131,6 +131,13 @@ static void GetICCounts(JSFunction* function,
void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
ASSERT(function->IsOptimizable());
+
+ if (FLAG_concurrent_crankshaft && !(isolate_->context() == NULL ||
danno 2012/05/22 10:32:19 I don't see why this is necessary, can you explain
sanjoy 2012/05/22 11:38:55 Sometimes this function is called with the context
+ isolate_->context()->IsContext())) {
+ // This confuses the compiler thread
+ return;
+ }
+
if (FLAG_trace_opt) {
PrintF("[marking ");
function->PrintName();
@@ -144,8 +151,10 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
PrintF("]\n");
}
- // The next call to the function will trigger optimization.
- function->MarkForLazyRecompilation();
+ if (FLAG_concurrent_crankshaft)
+ function->CompileConcurrently();
+ else
+ function->MarkForLazyRecompilation();
}

Powered by Google App Engine
This is Rietveld 408576698