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

Unified Diff: runtime/vm/kernel_binary_flowgraph.cc

Issue 3007123002: [kernel] const constructor type arguments (Closed)
Patch Set: Created 3 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_binary_flowgraph.cc
diff --git a/runtime/vm/kernel_binary_flowgraph.cc b/runtime/vm/kernel_binary_flowgraph.cc
index 274a4654bbe6664d5add3cdc6e39fd360e602184..42afa915e0b1aa894a2cbe6af70044144674b823 100644
--- a/runtime/vm/kernel_binary_flowgraph.cc
+++ b/runtime/vm/kernel_binary_flowgraph.cc
@@ -2534,6 +2534,19 @@ void StreamingConstantEvaluator::EvaluateConstructorInvocationInternal() {
const TypeArguments* type_arguments =
TranslateTypeArguments(constructor, &klass); // read argument types.
+ if (klass.NumTypeArguments() > 0 && !klass.IsGeneric()) {
jensj 2017/09/04 07:56:42 This code is basically just a copy-pasta from the
kustermann 2017/09/04 10:21:34 It seems correct, since NumTypeArguments (as oppos
+ Type& type = Type::ZoneHandle(Z, T.ReceiverType(klass).raw());
+ // TODO(27590): Can we move this code into [ReceiverType]?
+ type ^= ClassFinalizer::FinalizeType(*builder_->active_class()->klass, type,
+ ClassFinalizer::kFinalize);
+ ASSERT(!type.IsMalformedOrMalbounded());
+
+ TypeArguments& canonicalized_type_arguments =
+ TypeArguments::ZoneHandle(Z, type.arguments());
+ canonicalized_type_arguments = canonicalized_type_arguments.Canonicalize();
+ type_arguments = &canonicalized_type_arguments;
+ }
+
// Prepare either the instance or the type argument vector for the constructor
// call.
Instance* receiver = NULL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698