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

Unified Diff: runtime/vm/object.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: d Created 4 years, 12 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/object.h ('k') | runtime/vm/weak_code.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 837e8b76a370c05e6be19cf9c9ac61353268b2a9..a26569ab36f4db0bfb76051f1a69a5a109186f60 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -2797,9 +2797,10 @@ static bool IsMutatorOrAtSafepoint() {
}
#endif
+
void Class::RegisterCHACode(const Code& code) {
if (FLAG_trace_cha) {
- THR_Print("RegisterCHACode %s class %s\n",
+ THR_Print("RegisterCHACode '%s' depends on class '%s'\n",
Function::Handle(code.function()).ToQualifiedCString(), ToCString());
}
DEBUG_ASSERT(IsMutatorOrAtSafepoint());
@@ -2809,9 +2810,12 @@ void Class::RegisterCHACode(const Code& code) {
}
-void Class::DisableCHAOptimizedCode() {
+void Class::DisableCHAOptimizedCode(const Class& subclass) {
ASSERT(Thread::Current()->IsMutatorThread());
CHACodeArray a(*this);
+ if (FLAG_trace_deoptimization && a.HasCodes()) {
+ THR_Print("Adding subclass %s\n", subclass.ToCString());
+ }
a.DisableCode();
}
@@ -5820,7 +5824,7 @@ bool Function::IsOptimizable() const {
((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) {
// Additional check needed for implicit getters.
return (unoptimized_code() == Object::null()) ||
- (Code::Handle(unoptimized_code()).Size() <
+ (Code::Handle(unoptimized_code()).Size() <
FLAG_huge_method_cutoff_in_code_size);
}
return false;
@@ -5837,6 +5841,7 @@ void Function::SetIsOptimizable(bool value) const {
set_is_optimizable(value);
if (!value) {
set_is_inlinable(false);
+ set_usage_counter(INT_MIN);
}
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/weak_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698