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

Unified Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 24615003: Add DartType.treatAsRaw to treat List<dynamic> as List in the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/dart_backend/renamer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index 48bc9f4829d8464ca254e90a5971a8a23b8ae1e2..2fd909e537c9fe8107abc5f2013ec016cdfcf692 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -65,7 +65,7 @@ class ConstantHandler extends CompilerTask {
}
compiler.enqueuer.codegen.registerInstantiatedType(type, elements);
if (type is InterfaceType &&
- !type.isRaw &&
+ !type.treatAsRaw &&
compiler.backend.classNeedsRti(type.element)) {
registerSetRuntimeTypeInfoFunction();
}
@@ -422,9 +422,14 @@ class CompileTimeConstantEvaluator extends Visitor {
bool hasProtoKey = (protoValue != null);
List<Constant> values = map.values.toList();
InterfaceType sourceType = elements.getType(node);
- Link<DartType> arguments =
- new Link<DartType>.fromList([compiler.stringClass.rawType]);
- DartType keysType = new InterfaceType(compiler.listClass, arguments);
+ DartType keysType;
+ if (sourceType.treatAsRaw) {
+ keysType = compiler.listClass.rawType;
+ } else {
+ Link<DartType> arguments =
+ new Link<DartType>.fromList([sourceType.typeArguments.head]);
+ keysType = new InterfaceType(compiler.listClass, arguments);
+ }
ListConstant keysList = new ListConstant(keysType, keys);
if (onlyStringKeys) {
handler.registerCompileTimeConstant(keysList, elements);
@@ -436,8 +441,12 @@ class CompileTimeConstantEvaluator extends Visitor {
ClassElement classElement = compiler.jsHelperLibrary.find(className);
classElement.ensureResolved(compiler);
Link<DartType> typeArgument = sourceType.typeArguments;
- InterfaceType type = new InterfaceType(classElement, typeArgument);
- handler.registerInstantiatedType(type, elements);
+ InterfaceType type;
+ if (sourceType.treatAsRaw) {
+ type = classElement.rawType;
+ } else {
+ type = new InterfaceType(classElement, typeArgument);
+ }
Constant constant =
new MapConstant(type, keysList, values, protoValue, onlyStringKeys);
handler.registerCompileTimeConstant(constant, elements);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698