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

Unified Diff: src/compiler.cc

Issue 543643002: Fix %OptimizeFunctionOnNextCall to actually work when the function has not yet been compiled. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: --allow-natives-syntax Created 6 years, 3 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 | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index f628938fa22851274b6b4bfa5d94416d036d4d0b..273d3c5388909b9f0f5d2d5831d5ef14363065cc 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1246,7 +1246,14 @@ MaybeHandle<Code> Compiler::GetOptimizedCode(Handle<JSFunction> function,
PostponeInterruptsScope postpone(isolate);
Handle<SharedFunctionInfo> shared = info->shared_info();
- DCHECK_NE(ScopeInfo::Empty(isolate), shared->scope_info());
+ if (ScopeInfo::Empty(isolate) == shared->scope_info()) {
+ // The function was never compiled. Compile it unoptimized first.
+ CompilationInfoWithZone nested(function);
+ nested.EnableDeoptimizationSupport();
+ if (!GetUnoptimizedCodeCommon(&nested).ToHandle(&current_code)) {
+ return MaybeHandle<Code>();
+ }
+ }
int compiled_size = shared->end_position() - shared->start_position();
isolate->counters()->total_compile_size()->Increment(compiled_size);
current_code->set_profiler_ticks(0);
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698