Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index f628938fa22851274b6b4bfa5d94416d036d4d0b..30a608633d998a57a2514c07698fce7bccf4e4d5 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -1246,7 +1246,13 @@ 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); |
Yang
2014/09/04 09:07:18
at this point, if deopt support is not enabled, we
|
+ if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_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); |