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

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: 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..6f609e245f456c89876714904a7c5ce0c60f6051 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) {
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.withExpressionResult(
+ new js.ArrayInitializer(templates), hasPlaceholders : true);
HInstruction representation =
new HForeignCode(code, backend.readableArrayType, inputs,
nativeBehavior: native.NativeBehavior.PURE_ALLOCATION);
@@ -4623,11 +4623,14 @@ class SsaBuilder extends NewResolvedVisitor {
List<HInstruction> inputs = <HInstruction>[];
- String template = rti.getTypeRepresentationWithHashes(argument, (variable) {
- inputs.add(addTypeVariableReference(variable));
- });
+ js.Expression template =
+ rti.getTypeRepresentationWithHashes(argument,
floitsch 2015/05/19 13:43:35 looks like it fits on one line.
herhut 2015/05/19 14:08:09 Done.
+ (variable) {
+ inputs.add(addTypeVariableReference(variable));
+ });
- js.Template code = js.js.uncachedExpressionTemplate(template);
+ js.Template code =
+ new js.Template.withExpressionResult(template, hasPlaceholders : true);
HInstruction result = new HForeignCode(code, backend.stringType, inputs,
nativeBehavior: native.NativeBehavior.PURE);
add(result);

Powered by Google App Engine
This is Rietveld 408576698