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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 949733003: Share the JavaScript based LinkedHashMap implementation between constant maps and the LinkedHashMap… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 75f3dab49e198e7a3d9bf2656793766d72e2e1c4..c23ec335fc47e3410a31785bd85798088e137e4c 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -2670,17 +2670,23 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks {
registerBackendInstantiation(backend.compiler.listClass, registry);
}
- void onConstantMap(Registry registry) {
+ void onMapLiteral(ResolutionRegistry registry,
+ DartType type,
+ bool isConstant) {
assert(registry.isForResolution);
void enqueue(String name) {
Element e = backend.find(backend.jsHelperLibrary, name);
registerBackendInstantiation(e, registry);
}
- enqueue(JavaScriptMapConstant.DART_CLASS);
- enqueue(JavaScriptMapConstant.DART_PROTO_CLASS);
- enqueue(JavaScriptMapConstant.DART_STRING_CLASS);
- enqueue(JavaScriptMapConstant.DART_GENERAL_CLASS);
+ if (isConstant) {
+ enqueue(JavaScriptMapConstant.DART_CLASS);
+ enqueue(JavaScriptMapConstant.DART_PROTO_CLASS);
+ enqueue(JavaScriptMapConstant.DART_STRING_CLASS);
+ enqueue(JavaScriptMapConstant.DART_GENERAL_CLASS);
+ } else {
+ registry.registerInstantiatedType(type);
+ }
}
/// Called when resolving the `Symbol` constructor.

Powered by Google App Engine
This is Rietveld 408576698