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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 150923002: Mark optimized code that used CHA for optimization so that lazy class 'finalization' does not inval… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 32176)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -36,7 +36,7 @@
// optimizations may have become invalid.
// Only methods which owner classes where subclasses can be invalid.
// TODO(srdjan): Be even more precise by recording the exact CHA optimization.
-static void RemoveOptimizedCode(
+static void RemoveCHAOptimizedCode(
const GrowableArray<intptr_t>& added_subclass_to_cids) {
ASSERT(FLAG_use_cha);
if (added_subclass_to_cids.is_empty()) return;
@@ -56,7 +56,8 @@
for (intptr_t f = 0; f < num_functions; f++) {
function ^= array.At(f);
ASSERT(!function.IsNull());
- if (function.HasOptimizedCode()) {
+ if (function.HasCode() &&
+ Code::Handle(function.CurrentCode()).has_used_cha()) {
function.SwitchToUnoptimizedCode();
}
}
@@ -2195,7 +2196,7 @@
CheckForLegalConstClass(cls);
}
if (FLAG_use_cha) {
- RemoveOptimizedCode(added_subclass_to_cids);
+ RemoveCHAOptimizedCode(added_subclass_to_cids);
}
}
« runtime/vm/cha.cc ('K') | « runtime/vm/cha.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698