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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 463103002: Fix bug with CHA dependencies by recording a set of classes for registering code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: address remaining comments Created 6 years, 4 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
===================================================================
--- runtime/vm/flow_graph_type_propagator.cc (revision 39070)
+++ runtime/vm/flow_graph_type_propagator.cc (working copy)
@@ -498,20 +498,6 @@
}
-// Return true if the class is private to our internal libraries (not extendable
-// or implementable by users).
-// (TODO): Allow more libraries.
-static bool IsKnownPrivateClass(const Class& type_class) {
- if (!Library::IsPrivate(String::Handle(type_class.Name()))) return false;
- const Library& library = Library::Handle(type_class.library());
- if (library.raw() == Library::CoreLibrary()) return true;
- if (library.raw() == Library::CollectionLibrary()) return true;
- if (library.raw() == Library::TypedDataLibrary()) return true;
- if (library.raw() == Library::MathLibrary()) return true;
- return false;
-}
-
-
intptr_t CompileType::ToNullableCid() {
if (cid_ == kIllegalCid) {
if (type_ == NULL) {
@@ -522,11 +508,11 @@
} else if (type_->IsVoidType()) {
cid_ = kNullCid;
} else if (type_->HasResolvedTypeClass()) {
- const Class& type_class = Class::Handle(type_->type_class());
- if (FLAG_use_cha || IsKnownPrivateClass(type_class)) {
- // A known private class cannot be subclassed or implemented.
- if (!type_class.is_implemented() &&
- !CHA::HasSubclassesSafe(type_class.id())) {
+ if (FLAG_use_cha) {
+ const Class& type_class = Class::Handle(type_->type_class());
+ CHA* cha = Isolate::Current()->cha();
+ if (!cha->IsImplemented(type_class) &&
+ !cha->HasSubclasses(type_class.id())) {
cid_ = type_class.id();
} else {
cid_ = kDynamicCid;
@@ -743,7 +729,7 @@
intptr_t cid = kDynamicCid;
if (FLAG_use_cha && type.HasResolvedTypeClass()) {
const Class& type_class = Class::Handle(type.type_class());
- if (!CHA::HasSubclasses(type_class.id())) {
+ if (!Isolate::Current()->cha()->HasSubclasses(type_class.id())) {
cid = type_class.id();
}
}
@@ -788,15 +774,18 @@
return ZoneCompileType::Wrap(CompileType::Null());
}
- return ZoneCompileType::Wrap(CompileType::FromAbstractType(dst_type()));
+ return ZoneCompileType::Wrap(
+ CompileType::FromAbstractType(dst_type(), value_type->is_nullable()));
}
bool AssertAssignableInstr::RecomputeType() {
CompileType* value_type = value()->Type();
- return UpdateType(value_type->IsMoreSpecificThan(dst_type())
- ? *value_type
- : CompileType::FromAbstractType(dst_type()));
+ return UpdateType(
+ value_type->IsMoreSpecificThan(dst_type())
+ ? *value_type
+ : CompileType::FromAbstractType(dst_type(),
+ value_type->is_nullable()));
}
« 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