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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1140703006: dart2js: Construct the entire output as a single AST before printing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments Created 5 years, 7 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
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 2dca5031067a69d05063bccad4a974cf8654d439..2ee1fdbe22285054bd59b328483fbddafc0adc4a 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3556,17 +3556,17 @@ class SsaBuilder extends NewResolvedVisitor {
InterfaceType interface = type;
List<HInstruction> inputs = <HInstruction>[];
bool first = true;
- List<String> templates = <String>[];
+ List<js.Expression> templates = <js.Expression>[];
for (DartType argument in interface.typeArguments) {
- templates.add(rti.getTypeRepresentationWithHashes(argument, (variable) {
+ templates.add(rti.getTypeRepresentationWithPlaceholders(argument, (variable) {
HInstruction runtimeType = addTypeVariableReference(variable);
inputs.add(runtimeType);
}));
}
- String template = '[${templates.join(', ')}]';
// TODO(sra): This is a fresh template each time. We can't let the
// template manager build them.
- js.Template code = js.js.uncachedExpressionTemplate(template);
+ js.Template code = new js.Template(null,
+ new js.ArrayInitializer(templates));
HInstruction representation =
new HForeignCode(code, backend.readableArrayType, inputs,
nativeBehavior: native.NativeBehavior.PURE_ALLOCATION);
@@ -4623,11 +4623,12 @@ class SsaBuilder extends NewResolvedVisitor {
List<HInstruction> inputs = <HInstruction>[];
- String template = rti.getTypeRepresentationWithHashes(argument, (variable) {
- inputs.add(addTypeVariableReference(variable));
- });
+ js.Expression template =
+ rti.getTypeRepresentationWithPlaceholders(argument, (variable) {
+ inputs.add(addTypeVariableReference(variable));
+ });
- js.Template code = js.js.uncachedExpressionTemplate(template);
+ js.Template code = new js.Template(null, template);
HInstruction result = new HForeignCode(code, backend.stringType, inputs,
nativeBehavior: native.NativeBehavior.PURE);
add(result);

Powered by Google App Engine
This is Rietveld 408576698