Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 59a25db67fb76051d44543fb8f29f5639bf727da..b52ac294d4d271dfbc250095f0a663981dbb73e3 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -7745,30 +7745,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ParallelRecompile) { |
| } |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_ForceParallelRecompile) { |
| - if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); |
| - HandleScope handle_scope(isolate); |
| - ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); |
| - if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { |
| - return isolate->Throw(*isolate->factory()->InternalizeOneByteString( |
| - STATIC_ASCII_VECTOR("Recompile queue is full."))); |
| - } |
| - CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| - fun->ReplaceCode(isolate->builtins()->builtin(Builtins::kParallelRecompile)); |
| - Compiler::RecompileParallel(fun); |
| - return isolate->heap()->undefined_value(); |
| -} |
| - |
| - |
| RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { |
| if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); |
| HandleScope handle_scope(isolate); |
| - ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); |
| - CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| + ASSERT(FLAG_parallel_recompilation); |
| + CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
|
Sven Panne
2013/03/12 15:44:51
Can we please move the argument access macros (and
Yang
2013/03/12 18:03:38
Done.
|
| OptimizingCompilerThread* opt_thread = isolate->optimizing_compiler_thread(); |
| - Handle<SharedFunctionInfo> shared(fun->shared()); |
| - while (*opt_thread->InstallNextOptimizedFunction() != *shared) { } |
| - return isolate->heap()->undefined_value(); |
| + opt_thread->InstallOptimizedFunctions(); |
| + return function->code(); |
| } |
| @@ -7937,6 +7921,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) { |
| } |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_WaitUntilOptimized) { |
| + RUNTIME_ASSERT(args.length() == 1); |
| + if (FLAG_parallel_recompilation) { |
| + HandleScope scope(isolate); |
| + CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
|
Sven Panne
2013/03/12 15:44:51
Same as above.
Yang
2013/03/12 18:03:38
Done.
|
| + if (V8::UseCrankshaft() && function->IsOptimizable()) { |
| + while (!function->IsOptimized()) OS::Sleep(50); |
| + } |
| + } |
| + return isolate->heap()->undefined_value(); |
| +} |
| + |
| + |
| RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { |
| HandleScope scope(isolate); |
| ASSERT(args.length() == 1); |