| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart2js.js_emitter.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 /// The name of the property that stores the tear-off getter on a static | 7 /// The name of the property that stores the tear-off getter on a static |
| 8 /// function. | 8 /// function. |
| 9 /// | 9 /// |
| 10 /// This property is only used when isolates are used. | 10 /// This property is only used when isolates are used. |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 return globals; | 1133 return globals; |
| 1134 } | 1134 } |
| 1135 | 1135 |
| 1136 /// Emits the [MANGLED_GLOBAL_NAMES] embedded global. | 1136 /// Emits the [MANGLED_GLOBAL_NAMES] embedded global. |
| 1137 /// | 1137 /// |
| 1138 /// This global maps minified names for selected classes (some important | 1138 /// This global maps minified names for selected classes (some important |
| 1139 /// core classes, and some native classes) to their unminified names. | 1139 /// core classes, and some native classes) to their unminified names. |
| 1140 js.Property emitMangledGlobalNames() { | 1140 js.Property emitMangledGlobalNames() { |
| 1141 List<js.Property> names = <js.Property>[]; | 1141 List<js.Property> names = <js.Property>[]; |
| 1142 | 1142 |
| 1143 CoreClasses coreClasses = compiler.coreClasses; | 1143 CommonElements commonElements = compiler.commonElements; |
| 1144 // We want to keep the original names for the most common core classes when | 1144 // We want to keep the original names for the most common core classes when |
| 1145 // calling toString on them. | 1145 // calling toString on them. |
| 1146 List<ClassElement> nativeClassesNeedingUnmangledName = [ | 1146 List<ClassElement> nativeClassesNeedingUnmangledName = [ |
| 1147 coreClasses.intClass, | 1147 commonElements.intClass, |
| 1148 coreClasses.doubleClass, | 1148 commonElements.doubleClass, |
| 1149 coreClasses.numClass, | 1149 commonElements.numClass, |
| 1150 coreClasses.stringClass, | 1150 commonElements.stringClass, |
| 1151 coreClasses.boolClass, | 1151 commonElements.boolClass, |
| 1152 coreClasses.nullClass, | 1152 commonElements.nullClass, |
| 1153 coreClasses.listClass | 1153 commonElements.listClass |
| 1154 ]; | 1154 ]; |
| 1155 // TODO(floitsch): this should probably be on a per-fragment basis. | 1155 // TODO(floitsch): this should probably be on a per-fragment basis. |
| 1156 nativeClassesNeedingUnmangledName.forEach((element) { | 1156 nativeClassesNeedingUnmangledName.forEach((element) { |
| 1157 names.add(new js.Property( | 1157 names.add(new js.Property( |
| 1158 js.quoteName(namer.className(element)), js.string(element.name))); | 1158 js.quoteName(namer.className(element)), js.string(element.name))); |
| 1159 }); | 1159 }); |
| 1160 | 1160 |
| 1161 return new js.Property( | 1161 return new js.Property( |
| 1162 js.string(MANGLED_GLOBAL_NAMES), new js.ObjectInitializer(names)); | 1162 js.string(MANGLED_GLOBAL_NAMES), new js.ObjectInitializer(names)); |
| 1163 } | 1163 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 } | 1365 } |
| 1366 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1366 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
| 1367 js.objectLiteral(interceptorsByTag))); | 1367 js.objectLiteral(interceptorsByTag))); |
| 1368 statements.add( | 1368 statements.add( |
| 1369 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1369 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
| 1370 statements.addAll(subclassAssignments); | 1370 statements.addAll(subclassAssignments); |
| 1371 | 1371 |
| 1372 return new js.Block(statements); | 1372 return new js.Block(statements); |
| 1373 } | 1373 } |
| 1374 } | 1374 } |
| OLD | NEW |