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

Unified Diff: runtime/vm/code_generator.cc

Issue 2125053002: Fix crash with OSR after isolate reload. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698