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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 1421003004: Add CoreClasses (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 return globals; 1084 return globals;
1085 } 1085 }
1086 1086
1087 /// Emits the [MANGLED_GLOBAL_NAMES] embedded global. 1087 /// Emits the [MANGLED_GLOBAL_NAMES] embedded global.
1088 /// 1088 ///
1089 /// This global maps minified names for selected classes (some important 1089 /// This global maps minified names for selected classes (some important
1090 /// core classes, and some native classes) to their unminified names. 1090 /// core classes, and some native classes) to their unminified names.
1091 js.Property emitMangledGlobalNames() { 1091 js.Property emitMangledGlobalNames() {
1092 List<js.Property> names = <js.Property>[]; 1092 List<js.Property> names = <js.Property>[];
1093 1093
1094 CoreClasses coreClasses = compiler.coreClasses;
1094 // We want to keep the original names for the most common core classes when 1095 // We want to keep the original names for the most common core classes when
1095 // calling toString on them. 1096 // calling toString on them.
1096 List<ClassElement> nativeClassesNeedingUnmangledName = 1097 List<ClassElement> nativeClassesNeedingUnmangledName =
1097 [compiler.intClass, compiler.doubleClass, compiler.numClass, 1098 [coreClasses.intClass, coreClasses.doubleClass, coreClasses.numClass,
1098 compiler.stringClass, compiler.boolClass, compiler.nullClass, 1099 coreClasses.stringClass, coreClasses.boolClass, coreClasses.nullClass,
1099 compiler.listClass]; 1100 coreClasses.listClass];
1100 // TODO(floitsch): this should probably be on a per-fragment basis. 1101 // TODO(floitsch): this should probably be on a per-fragment basis.
1101 nativeClassesNeedingUnmangledName.forEach((element) { 1102 nativeClassesNeedingUnmangledName.forEach((element) {
1102 names.add(new js.Property(js.quoteName(namer.className(element)), 1103 names.add(new js.Property(js.quoteName(namer.className(element)),
1103 js.string(element.name))); 1104 js.string(element.name)));
1104 }); 1105 });
1105 1106
1106 return new js.Property(js.string(MANGLED_GLOBAL_NAMES), 1107 return new js.Property(js.string(MANGLED_GLOBAL_NAMES),
1107 new js.ObjectInitializer(names)); 1108 new js.ObjectInitializer(names));
1108 } 1109 }
1109 1110
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 } 1313 }
1313 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", 1314 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);",
1314 js.objectLiteral(interceptorsByTag))); 1315 js.objectLiteral(interceptorsByTag)));
1315 statements.add(js.js.statement("setOrUpdateLeafTags(#);", 1316 statements.add(js.js.statement("setOrUpdateLeafTags(#);",
1316 js.objectLiteral(leafTags))); 1317 js.objectLiteral(leafTags)));
1317 statements.add(subclassAssignment); 1318 statements.add(subclassAssignment);
1318 1319
1319 return new js.Block(statements); 1320 return new js.Block(statements);
1320 } 1321 }
1321 } 1322 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698