Index: src/runtime-profiler.cc |
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc |
index cfce1dff8b389dcd432c3c5d2852ad57e2125a52..5d62a68a1ecb429b11aa3badea09b22f521b721b 100644 |
--- a/src/runtime-profiler.cc |
+++ b/src/runtime-profiler.cc |
@@ -139,7 +139,16 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { |
PrintF("]\n"); |
} |
+ |
if (FLAG_concurrent_recompilation && !isolate_->bootstrapper()->IsActive()) { |
+ if (FLAG_concurrent_osr && |
+ isolate_->optimizing_compiler_thread()->IsQueuedForOSR(function)) { |
+ // Do not attempt regular recompilation if we already queued this for OSR. |
+ // TODO(yangguo): This is necessary so that we don't install optimized |
+ // code on a function that is already optimized, since OSR and regular |
+ // recompilation race. This goes away as soon as OSR becomes one-shot. |
+ return; |
Yang
2013/09/10 14:27:50
This is not actually a change in heuristic. We use
|
+ } |
ASSERT(!function->IsMarkedForInstallingRecompiledCode()); |
ASSERT(!function->IsInRecompileQueue()); |
function->MarkForConcurrentRecompilation(); |
@@ -224,6 +233,8 @@ void RuntimeProfiler::OptimizeNow() { |
isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
} |
+ DisallowHeapAllocation no_gc; |
+ |
// Run through the JavaScript frames and collect them. If we already |
// have a sample of the function, we mark it for optimizations |
// (eagerly or lazily). |
@@ -232,6 +243,7 @@ void RuntimeProfiler::OptimizeNow() { |
int frame_count = 0; |
int frame_count_limit = FLAG_watch_ic_patching ? FLAG_frame_count |
: kSamplerFrameCount; |
+ |
titzer
2013/09/11 11:02:28
Whitespace change
|
for (JavaScriptFrameIterator it(isolate_); |
frame_count++ < frame_count_limit && !it.done(); |
it.Advance()) { |