Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1537)

Unified Diff: src/runtime.cc

Issue 11419012: Introduce helper functions to test parallel recompilation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « src/runtime.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698