Skip to content

Commit 6955247

Browse files
rakudramacommit-bot@chromium.org
authored andcommitted
[dart2js] new-rti: forward allocated list types
Change-Id: Idbf7bf134096a017b9fd4ae8100944941f0b2f64 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119104 Commit-Queue: Stephen Adams <sra@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com>
1 parent a447dbc commit 6955247

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/compiler/lib/src/ssa/optimize.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,10 +2098,20 @@ class SsaInstructionSimplifier extends HBaseVisitor
20982098
_registry.registerInstantiation(constantValue.type);
20992099
return HLoadType.type(constantValue.type, instance.instructionType);
21002100
}
2101+
if (constantValue is ListConstantValue) {
2102+
InterfaceType type = constantValue.type;
2103+
_registry.registerInstantiation(type);
2104+
return HLoadType.type(type, instance.instructionType);
2105+
}
21012106
return node;
21022107
}
21032108

2104-
// TODO(sra): Store-forward list literal types.
2109+
if (instance is HInvokeStatic &&
2110+
instance.element == commonElements.setRuntimeTypeInfo) {
2111+
// TODO(sra): What is the 'instantiated type' we should be registering as
2112+
// discussed above? Perhaps it should be carried on HLiteralList.
2113+
return instance.inputs.last;
2114+
}
21052115

21062116
return node;
21072117
}

0 commit comments

Comments
 (0)