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

Unified Diff: src/runtime.cc

Issue 12442002: Details wrt parallel recompilation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: re-added accidental delete Created 7 years, 10 months 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/optimizing-compiler-thread.cc ('k') | src/smart-pointers.h » ('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 aedd91b3adbd8eb74950c26b0578824bc8e0f5ea..ec5a5638e56ffea59d224fe689c2be007c9280ea 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7682,31 +7682,36 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyCompile) {
}
-RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) {
- HandleScope scope(isolate);
- ASSERT(args.length() == 1);
- Handle<JSFunction> function = args.at<JSFunction>(0);
-
+bool AllowOptimization(Isolate* isolate, Handle<JSFunction> function) {
// If the function is not compiled ignore the lazy
// recompilation. This can happen if the debugger is activated and
// the function is returned to the not compiled state.
- if (!function->shared()->is_compiled()) {
- function->ReplaceCode(function->shared()->code());
- return function->code();
- }
+ if (!function->shared()->is_compiled()) return false;
// If the function is not optimizable or debugger is active continue using the
// code from the full compiler.
if (!FLAG_crankshaft ||
- !function->shared()->code()->optimizable() ||
+ function->shared()->optimization_disabled() ||
isolate->DebuggerHasBreakPoints()) {
if (FLAG_trace_opt) {
PrintF("[failed to optimize ");
function->PrintName();
PrintF(": is code optimizable: %s, is debugger enabled: %s]\n",
- function->shared()->code()->optimizable() ? "T" : "F",
+ function->shared()->optimization_disabled() ? "F" : "T",
isolate->DebuggerHasBreakPoints() ? "T" : "F");
}
+ return false;
+ }
+ return true;
+}
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ Handle<JSFunction> function = args.at<JSFunction>(0);
+
+ if (!AllowOptimization(isolate, function)) {
function->ReplaceCode(function->shared()->code());
return function->code();
}
@@ -7728,8 +7733,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ParallelRecompile) {
HandleScope handle_scope(isolate);
+ Handle<JSFunction> function = args.at<JSFunction>(0);
+ if (!AllowOptimization(isolate, function)) {
+ function->ReplaceCode(function->shared()->code());
+ return function->code();
+ }
+ function->shared()->code()->set_profiler_ticks(0);
ASSERT(FLAG_parallel_recompilation);
- Compiler::RecompileParallel(args.at<JSFunction>(0));
+ Compiler::RecompileParallel(function);
return isolate->heap()->undefined_value();
}
@@ -7913,10 +7924,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
if (args.length() == 2 &&
unoptimized->kind() == Code::FUNCTION) {
CONVERT_ARG_HANDLE_CHECKED(String, type, 1);
- CHECK(type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("osr")));
- isolate->runtime_profiler()->AttemptOnStackReplacement(*function);
- unoptimized->set_allow_osr_at_loop_nesting_level(
- Code::kMaxLoopNestingMarker);
+ if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("osr"))) {
+ isolate->runtime_profiler()->AttemptOnStackReplacement(*function);
+ unoptimized->set_allow_osr_at_loop_nesting_level(
+ Code::kMaxLoopNestingMarker);
+ } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) {
+ function->MarkForParallelRecompilation();
+ }
}
return isolate->heap()->undefined_value();
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | src/smart-pointers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698