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

Unified Diff: runtime/vm/object.cc

Issue 296853002: Fix code invalidation of functions with references to deferred libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « runtime/vm/code_generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 36363)
+++ runtime/vm/object.cc (working copy)
@@ -2514,7 +2514,14 @@
function.SwitchToUnoptimizedCode();
} else if (function.unoptimized_code() == code.raw()) {
ReportSwitchingCode(code);
+ // Remove the code object from the function. The next time the
+ // function is invoked, it will be compiled again.
function.ClearCode();
+ // Invalidate the old code object so existing references to it
+ // (from optimized code) will fail when invoked.
+ if (!CodePatcher::IsEntryPatched(code)) {
+ CodePatcher::PatchEntry(code);
+ }
}
}
}
@@ -9559,9 +9566,10 @@
virtual void ReportSwitchingCode(const Code& code) {
if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
- OS::PrintErr("Prefix '%s': deleting %s code for function '%s'\n",
+ OS::PrintErr("Prefix '%s': deleting %s code for %s function '%s'\n",
String::Handle(prefix_.name()).ToCString(),
code.is_optimized() ? "optimized" : "unoptimized",
+ CodePatcher::IsEntryPatched(code) ? "patched" : "unpatched",
Function::Handle(code.function()).ToCString());
}
}
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698