mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 20:41:45 +00:00
Fix type propagation for signature classes.
After I enabled nullability tracking for checked mode type assertions, we need to fix type propagation for signature classes: We can't use the asserted type to infer a cid for those since it may cause unnecessary deoptimizations. R=vegorov@google.com Review URL: https://codereview.chromium.org//465343002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39197 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
5d09bec212
commit
881060b433
|
@ -71,6 +71,8 @@ bool CHA::HasSubclasses(intptr_t cid) {
|
|||
|
||||
|
||||
bool CHA::IsImplemented(const Class& cls) {
|
||||
// Signature classes have different type checking rules.
|
||||
ASSERT(!cls.IsSignatureClass());
|
||||
// Can't track dependencies for classes on the VM heap since those are
|
||||
// read-only.
|
||||
// TODO(fschneider): Enable tracking of CHA dependent code for VM heap
|
||||
|
|
|
@ -511,7 +511,10 @@ intptr_t CompileType::ToNullableCid() {
|
|||
if (FLAG_use_cha) {
|
||||
const Class& type_class = Class::Handle(type_->type_class());
|
||||
CHA* cha = Isolate::Current()->cha();
|
||||
if (!cha->IsImplemented(type_class) &&
|
||||
// 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() &&
|
||||
!cha->IsImplemented(type_class) &&
|
||||
!cha->HasSubclasses(type_class.id())) {
|
||||
cid_ = type_class.id();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue