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

Unified Diff: runtime/vm/precompiler.cc

Issue 3007603002: [VM generic function reification] Support generic functions in Invocation class. (Closed)
Patch Set: address review comment Created 3 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/parser.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index fa650c4027686b2d821132965e1e3fd391263353..f30f12714029913a4072b084414957917da09a3b 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -276,6 +276,7 @@ bool TypeRangeCache::InstanceOfHasClassRange(const AbstractType& type,
HANDLESCOPE(thread_);
if (!table->HasValidClassAt(cid)) continue;
+ if (cid == kTypeArgumentsCid) continue;
if (cid == kVoidCid) continue;
if (cid == kDynamicCid) continue;
if (cid == kNullCid) continue; // Instance is not at Bottom like Null type.
@@ -673,8 +674,9 @@ void Precompiler::AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]) {
if (!isolate()->class_table()->HasValidClassAt(cid)) {
continue;
}
- if ((cid == kDynamicCid) || (cid == kVoidCid) ||
- (cid == kFreeListElement) || (cid == kForwardingCorpse)) {
+ if ((cid == kTypeArgumentsCid) || (cid == kDynamicCid) ||
+ (cid == kVoidCid) || (cid == kFreeListElement) ||
+ (cid == kForwardingCorpse)) {
continue;
}
cls = isolate()->class_table()->At(cid);
@@ -964,6 +966,8 @@ void Precompiler::AddCalleesOf(const Function& function) {
instance ^= entry.raw();
if (entry.IsAbstractType()) {
AddType(AbstractType::Cast(entry));
+ } else if (entry.IsTypeArguments()) {
+ AddTypeArguments(TypeArguments::Cast(entry));
} else {
AddConstObject(instance);
}
@@ -977,8 +981,6 @@ void Precompiler::AddCalleesOf(const Function& function) {
cls ^= target_code.owner();
AddInstantiatedClass(cls);
}
- } else if (entry.IsTypeArguments()) {
- AddTypeArguments(TypeArguments::Cast(entry));
}
}
}
@@ -1157,7 +1159,9 @@ void Precompiler::AddConstObject(const Instance& instance) {
virtual void VisitPointers(RawObject** first, RawObject** last) {
for (RawObject** current = first; current <= last; current++) {
subinstance_ = *current;
- if (subinstance_.IsInstance()) {
+ if (subinstance_.IsTypeArguments()) {
+ precompiler_->AddTypeArguments(TypeArguments::Cast(subinstance_));
+ } else if (subinstance_.IsInstance()) {
precompiler_->AddConstObject(Instance::Cast(subinstance_));
}
}
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698