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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2624273002: VM: [Kernel] Fix constructor invocations by creating the unfolded type argument vector (Closed)
Patch Set: Created 3 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 | « no previous file | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 2133a130028d3bd2245938b02c716f500df376c5..9745cd3b3f5627d749e97f65a880375603e573af 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -4576,26 +4576,21 @@ void FlowGraphBuilder::VisitConstructorInvocation(ConstructorInvocation* node) {
const TypeArguments& type_arguments = T.TranslateInstantiatedTypeArguments(
klass, kernel_type_arguments.raw_array(),
kernel_type_arguments.length());
-
- if (type_arguments.IsNull() || type_arguments.IsInstantiated()) {
- instructions += TranslateInstantiatedTypeArguments(type_arguments);
kustermann 2017/01/11 19:16:37 This CL replaces if () { X } else { Y } with
+ if (!klass.IsGeneric()) {
+ Type& type = Type::ZoneHandle(Z, T.ReceiverType(klass).raw());
+
+ // TODO(27590): Can we move this code into [ReceiverType]?
+ type ^= ClassFinalizer::FinalizeType(*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();
+ instructions += Constant(canonicalized_type_arguments);
} else {
- if (!klass.IsGeneric()) {
- Type& type = Type::ZoneHandle(Z, T.ReceiverType(klass).raw());
-
- // TODO(27590): Can we move this code into [ReceiverType]?
- type ^= ClassFinalizer::FinalizeType(*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();
- instructions += Constant(canonicalized_type_arguments);
- } else {
- instructions += TranslateInstantiatedTypeArguments(type_arguments);
- }
+ instructions += TranslateInstantiatedTypeArguments(type_arguments);
}
instructions += PushArgument();
« no previous file with comments | « no previous file | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698