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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 11 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/intrinsifier.cc » ('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 7ea528a4a6fa010c8a8769d55d404071ad20934b..85371e08680eb9d48cc397ef9bec78c8e9bf84c7 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -489,15 +489,15 @@ intptr_t CompileType::ToNullableCid() {
cid_ = kDynamicCid;
} else if (type_->IsVoidType()) {
cid_ = kNullCid;
+ } else if (type_->IsFunctionType() || type_->IsDartFunctionType()) {
+ cid_ = kClosureCid;
} else if (type_->HasResolvedTypeClass()) {
const Class& type_class = Class::Handle(type_->type_class());
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() &&
- !CHA::IsImplemented(type_class) &&
- !CHA::HasSubclasses(type_class)) {
+ // Don't infer a cid from an abstract type since there can be multiple
+ // compatible classes with different cids.
+ if (!CHA::IsImplemented(type_class) && !CHA::HasSubclasses(type_class)) {
if (type_class.IsPrivate()) {
// Type of a private class cannot change through later loaded libs.
cid_ = type_class.id();
@@ -978,10 +978,11 @@ CompileType CreateArrayInstr::ComputeType() const {
CompileType AllocateObjectInstr::ComputeType() const {
if (!closure_function().IsNull()) {
- ASSERT(cls().raw() == closure_function().signature_class());
+ ASSERT(cls().id() == kClosureCid);
return CompileType(CompileType::kNonNullable,
- cls().id(),
- &Type::ZoneHandle(cls().SignatureType()));
+ kClosureCid,
+ &FunctionType::ZoneHandle(
+ closure_function().SignatureType()));
}
// TODO(vegorov): Incorporate type arguments into the returned type.
return CompileType::FromCid(cls().id());
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intrinsifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698