Chromium Code Reviews| Index: runtime/vm/code_generator.cc |
| diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc |
| index 4b572a7cdf8b9258e0c4fbb0736ca30285d25818..2058619ef4acfb1dfb4714518fb58f9a59bb0af4 100644 |
| --- a/runtime/vm/code_generator.cc |
| +++ b/runtime/vm/code_generator.cc |
| @@ -1341,6 +1341,7 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| ASSERT(frame != NULL); |
| const Code& code = Code::ZoneHandle(frame->LookupDartCode()); |
| ASSERT(!code.IsNull()); |
| + ASSERT(!code.is_optimized()); |
| const Function& function = Function::Handle(code.function()); |
| ASSERT(!function.IsNull()); |
| // Since the code is referenced from the frame and the ZoneHandle, |
| @@ -1358,7 +1359,13 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| ASSERT(function.unoptimized_code() != Object::null()); |
| intptr_t osr_id = |
| Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc()); |
| - ASSERT(osr_id != Compiler::kNoOSRDeoptId); |
| + if (osr_id == Compiler::kNoOSRDeoptId) { |
| + // The unoptimized code can have been reset to the lazy-compile stub |
|
rmacnak
2016/07/06 17:31:57
As discussed offline, this should be
if (frame.co
|
| + // by an isolate reload. We can't do OSR in this invocation. |
| + ASSERT(function.unoptimized_code() == |
| + StubCode::LazyCompile_entry()->code()); |
| + return; |
| + } |
| if (FLAG_trace_osr) { |
| OS::Print("Attempting OSR for %s at id=%" Pd ", count=%" Pd "\n", |
| function.ToFullyQualifiedCString(), |