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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1559653002: Investigate & fix issues around usage_count and deoptimization_count (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: y Created 5 years 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 | runtime/vm/code_generator.cc » ('j') | runtime/vm/compiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 1151e2d1941785a93933b68ad8946e518a433784..8ef3511c611dac6c57f9c0cc6ec2e40eced3fbdd 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -35,9 +35,12 @@ bool ClassFinalizer::AllClassesFinalized() {
// Only methods which owner classes where subclasses can be invalid.
// TODO(srdjan): Be even more precise by recording the exact CHA optimization.
static void RemoveCHAOptimizedCode(
+ const Class& subclass,
const GrowableArray<intptr_t>& added_subclass_to_cids) {
ASSERT(FLAG_use_cha_deopt);
- if (added_subclass_to_cids.is_empty()) return;
+ if (added_subclass_to_cids.is_empty()) {
+ return;
+ }
// Switch all functions' code to unoptimized.
const ClassTable& class_table = *Isolate::Current()->class_table();
Class& cls = Class::Handle();
@@ -45,7 +48,7 @@ static void RemoveCHAOptimizedCode(
intptr_t cid = added_subclass_to_cids[i];
cls = class_table.At(cid);
ASSERT(!cls.IsNull());
- cls.DisableCHAOptimizedCode();
+ cls.DisableCHAOptimizedCode(subclass);
}
}
@@ -2412,7 +2415,7 @@ void ClassFinalizer::FinalizeClass(const Class& cls) {
GrowableArray<intptr_t> cids;
CollectFinalizedSuperClasses(cls, &cids);
CollectImmediateSuperInterfaces(cls, &cids);
- RemoveCHAOptimizedCode(cids);
+ RemoveCHAOptimizedCode(cls, cids);
}
if (cls.is_enum_class()) {
AllocateEnumValues(cls);
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | runtime/vm/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698