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

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

Issue 12528008: Implement CHA through type mask and TypedSelector in the simple type inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (revision 19615)
+++ sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (working copy)
@@ -642,6 +642,8 @@
ClassElement jsFunctionClass;
ClassElement jsNullClass;
ClassElement jsBoolClass;
+ ClassElement typeLiteralClass;
+ ClassElement mapLiteralClass;
Element jsArrayLength;
Element jsStringLength;
Element jsArrayRemoveLast;
@@ -840,6 +842,13 @@
for (ClassElement cls in classes) {
if (cls != null) interceptedClasses.add(cls);
}
+
+ typeLiteralClass = compiler.findHelper(const SourceString('TypeImpl'));
+ // TODO(ngeoffray): We have ConstantMap and
+ // LinkedHashMapImplementation for literal maps. We should somehow
+ // have the users of [mapLiteralClass] know.
+ mapLiteralClass =
+ compiler.coreLibrary.find(const SourceString('LinkedHashMap'));
}
void addInterceptors(ClassElement cls, Enqueuer enqueuer) {
@@ -906,7 +915,7 @@
// The backend will use a literal list to initialize the entries
// of the map.
enqueuer.registerInstantiatedClass(compiler.listClass);
- enqueuer.registerInstantiatedClass(compiler.mapLiteralClass);
+ enqueuer.registerInstantiatedClass(mapLiteralClass);
enqueueInResolution(getMapMaker());
}
}
@@ -1513,4 +1522,15 @@
bool isNullImplementation(ClassElement cls) {
return cls == jsNullClass;
}
+
+ ClassElement get intImplementation => jsIntClass;
+ ClassElement get doubleImplementation => jsDoubleClass;
+ ClassElement get numImplementation => jsNumberClass;
+ ClassElement get stringImplementation => jsStringClass;
+ ClassElement get listImplementation => jsArrayClass;
+ ClassElement get mapImplementation => mapLiteralClass;
+ ClassElement get functionImplementation => jsFunctionClass;
+ ClassElement get typeImplementation => typeLiteralClass;
+ ClassElement get boolImplementation => jsBoolClass;
+ ClassElement get nullImplementation => jsNullClass;
}

Powered by Google App Engine
This is Rietveld 408576698