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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 1392893003: In precompilation, finalize all classes eagerly. Use the stable class hierarchy for doing CHA based… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Sync Created 5 years, 2 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/flow_graph_optimizer.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 3448fd039d899b9653beb0060d97f1b03e225524..2795ffd481e55c23dfcd5741fa1cf833e9c4719f 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -541,7 +541,8 @@ intptr_t CompileType::ToNullableCid() {
cid_ = kNullCid;
} else if (type_->HasResolvedTypeClass()) {
const Class& type_class = Class::Handle(type_->type_class());
- CHA* cha = Thread::Current()->cha();
+ Thread* thread = Thread::Current();
+ CHA* cha = thread->cha();
// Don't infer a cid from an abstract type for signature classes since
// there can be multiple compatible classes with different cids.
if (!type_class.IsSignatureClass() &&
@@ -550,12 +551,15 @@ intptr_t CompileType::ToNullableCid() {
if (type_class.IsPrivate()) {
// Type of a private class cannot change through later loaded libs.
cid_ = type_class.id();
- } else if (FLAG_use_cha_deopt) {
+ } else if (FLAG_use_cha_deopt ||
+ thread->isolate()->all_classes_finalized()) {
if (FLAG_trace_cha) {
THR_Print(" **(CHA) Compile type not subclassed: %s\n",
type_class.ToCString());
}
- cha->AddToLeafClasses(type_class);
+ if (FLAG_use_cha_deopt) {
+ cha->AddToLeafClasses(type_class);
+ }
cid_ = type_class.id();
} else {
cid_ = kDynamicCid;
@@ -793,13 +797,16 @@ CompileType ParameterInstr::ComputeType() const {
// Private classes can never be subclassed by later loaded libs.
cid = type_class.id();
} else {
- if (FLAG_use_cha_deopt) {
+ if (FLAG_use_cha_deopt ||
+ thread->isolate()->all_classes_finalized()) {
if (FLAG_trace_cha) {
- THR_Print(" **(CHA) Computing exact type of parameters, "
+ THR_Print(" **(CHA) Computing exact type of receiver, "
"no subclasses: %s\n",
type_class.ToCString());
}
- thread->cha()->AddToLeafClasses(type_class);
+ if (FLAG_use_cha_deopt) {
+ thread->cha()->AddToLeafClasses(type_class);
+ }
cid = type_class.id();
}
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698