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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 229083002: Revert "Construct literal maps using factory constructor." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index cf6c61c0fadcb3e4df52d549651af7973ef94f5a..64d62e5ddb59080d42670c5b33adced238e82dfa 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -102,8 +102,6 @@ class JavaScriptBackend extends Backend {
ClassElement mapLiteralClass;
ClassElement constMapLiteralClass;
ClassElement typeVariableClass;
- Element mapLiteralConstructor;
- Element mapLiteralConstructorEmpty;
ClassElement noSideEffectsClass;
ClassElement noThrowsClass;
@@ -730,6 +728,7 @@ class JavaScriptBackend extends Backend {
// For map literals, the dependency between the implementation class
// and [Map] is not visible, so we have to add it manually.
rti.registerRtiDependency(mapLiteralClass, cls);
+ enqueueInResolution(getMapMaker(), elements);
} else if (cls == compiler.boundClosureClass) {
// TODO(ngeoffray): Move the bound closure class in the
// backend.
@@ -738,24 +737,6 @@ class JavaScriptBackend extends Backend {
enqueue(enqueuer, getNativeInterceptorMethod, elements);
enqueueClass(enqueuer, jsInterceptorClass, compiler.globalDependencies);
enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, elements);
- } else if (cls == mapLiteralClass) {
- // For map literals, the dependency between the implementation class
- // and [Map] is not visible, so we have to add it manually.
- Element getFactory(String name, int arity) {
- return mapLiteralClass.patch.lookupConstructor(
- new Selector.callConstructor(
- name, mapLiteralClass.getLibrary(), arity),
- (element) {
- compiler.internalError(mapLiteralClass,
- "Map literal class $mapLiteralClass missing "
- "'$name' constructor"
- " ${mapLiteralClass.constructors}");
- });
- }
- mapLiteralConstructor = getFactory('_literal', 1);
- mapLiteralConstructorEmpty = getFactory('_empty', 0);
- enqueueInResolution(mapLiteralConstructor, elements);
- enqueueInResolution(mapLiteralConstructorEmpty, elements);
}
}
if (cls == compiler.closureClass) {
@@ -1467,6 +1448,10 @@ class JavaScriptBackend extends Backend {
return compiler.findHelper('getTraceFromException');
}
+ Element getMapMaker() {
+ return compiler.findHelper('makeLiteralMap');
+ }
+
Element getSetRuntimeTypeInfo() {
return compiler.findHelper('setRuntimeTypeInfo');
}
@@ -1901,3 +1886,4 @@ class Dependency {
const Dependency(this.constant, this.user);
}
+
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698