Index: runtime/vm/compiler.cc |
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
index cad89e5569697eeabd475731d0f0e6f0a445b1ec..26e51fef239ea5441738b8d239fbafab070bfdf3 100644 |
--- a/runtime/vm/compiler.cc |
+++ b/runtime/vm/compiler.cc |
@@ -1109,6 +1109,7 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, |
bool optimized, |
intptr_t osr_id) { |
ASSERT(!FLAG_precompiled_mode); |
+ ASSERT(!optimized || function.was_compiled()); |
LongJumpScope jump; |
if (setjmp(*jump.Set()) == 0) { |
Thread* const thread = Thread::Current(); |
@@ -1165,7 +1166,11 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, |
} |
const bool success = helper.Compile(pipeline); |
- if (!success) { |
+ if (success) { |
+ if (!optimized) { |
+ function.set_was_compiled(true); |
+ } |
+ } else { |
if (optimized) { |
if (Compiler::IsBackgroundCompilation()) { |
// Try again later, background compilation may abort because of |