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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart

Issue 1153243003: dart2js: Use frequency of occurence to sort metadata indices. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed sra's comments Created 5 years, 6 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/js_emitter/old_emitter/container_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
index bccbce84ef88848779263eb1bbbe65b3250e7238..173f7c0ffa8a457956df059ab12b10a12d338ec9 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
@@ -130,23 +130,20 @@ class ContainerBuilder extends CodeEmitterHelper {
..add(js.number(requiredParameterCount))
..add(js.number(optionalParameterCount))
..add(memberTypeExpression == null ? js("null") : memberTypeExpression)
- ..addAll(task.metadataCollector
- .reifyDefaultArguments(member).map(js.number));
+ ..addAll(task.metadataCollector.reifyDefaultArguments(member));
if (canBeReflected || canBeApplied) {
parameters.forEachParameter((Element parameter) {
- expressions.add(
- js.number(task.metadataCollector.reifyName(parameter.name)));
+ expressions.add(task.metadataCollector.reifyName(parameter.name));
if (backend.mustRetainMetadata) {
- Iterable<int> metadataIndices =
+ Iterable<jsAst.Expression> metadataIndices =
parameter.metadata.map((MetadataAnnotation annotation) {
ConstantValue constant =
backend.constants.getConstantValueForMetadata(annotation);
backend.constants.addCompileTimeConstantForEmission(constant);
return task.metadataCollector.reifyMetadata(annotation);
});
- expressions.add(new jsAst.ArrayInitializer(
- metadataIndices.map(js.number).toList()));
+ expressions.add(new jsAst.ArrayInitializer(metadataIndices.toList()));
}
});
}
@@ -163,8 +160,7 @@ class ContainerBuilder extends CodeEmitterHelper {
}
expressions
..add(reflectionName)
- ..addAll(task.metadataCollector
- .computeMetadata(member).map(js.number));
+ ..addAll(task.metadataCollector.computeMetadata(member));
} else if (isClosure && canBeApplied) {
expressions.add(js.string(namer.privateName(member.memberName)));
}

Powered by Google App Engine
This is Rietveld 408576698