Chromium Code Reviews| 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(); |
| } |