Commit daf4101a authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix infinite loop in regress-opt-after-deopt.

%CompleteOptimization attempts to install optimized functions
that the parallel thread has put on the output queue, as long as
the function is marked with a builtin.  However, activating the
debugger will set all functions to the lazy recompile builtin,
without the function being on the parallel recompilation pipeline.
So we wait for the function to finish parallel recompilation
while it's marked by a builtin that's unrelated to parallel
recompilation.

R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/18129003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4aed3b8e
......@@ -8314,8 +8314,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) {
ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
if (FLAG_parallel_recompilation && V8::UseCrankshaft()) {
// While function is in optimization pipeline, it is marked with builtins.
while (function->code()->kind() == Code::BUILTIN) {
// While function is in optimization pipeline, it is marked accordingly.
// Note that if the debugger is activated during parallel recompilation,
// the function will be marked with the lazy-recompile builtin, which is
// not related to parallel recompilation.
while (function->IsMarkedForParallelRecompilation() ||
function->IsInRecompileQueue() ||
function->IsMarkedForInstallingRecompiledCode()) {
isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
OS::Sleep(50);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment