Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 5ce6a3cb53f4e620d549a3536ad9d7fb429ee6a8..eb5f05ea175f5c3457ee25405058af9f9ad40f8e 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -7990,7 +7990,36 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ParallelRecompile) { |
HandleScope handle_scope(isolate); |
ASSERT(FLAG_parallel_recompilation); |
Compiler::RecompileParallel(args.at<JSFunction>(0)); |
- return *isolate->factory()->undefined_value(); |
+ return isolate->heap()->undefined_value(); |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_ForceParallelRecompile) { |
+ HandleScope handle_scope(isolate); |
+ ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); |
+ if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { |
+ return isolate->Throw(*isolate->factory()->LookupAsciiSymbol( |
+ "Recompile queue is full.")); |
Jakob Kummerow
2012/11/16 10:34:01
nit: I'd prefer to break the line after "Throw("
|
+ } |
+ 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) { |
+ HandleScope handle_scope(isolate); |
+ ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); |
+ CONVERT_ARG_HANDLE_CHECKED(HeapObject, arg, 0); |
+ OptimizingCompilerThread* opt_thread = isolate->optimizing_compiler_thread(); |
+ if (!arg->IsJSFunction()) { |
+ opt_thread->InstallOptimizedFunctions(); |
+ } else if (!JSFunction::cast(*arg)->IsOptimized()) { |
+ Handle<SharedFunctionInfo> shared(JSFunction::cast(*arg)->shared()); |
+ while (*opt_thread->InstallNextOptimizedFunction() != *shared) { } |
+ } |
+ return isolate->heap()->undefined_value(); |
} |