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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart

Issue 891673003: dart2js: Refactoring, documentation, and a few bugfixes in Namer class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.new_js_emitter.model_emitter; 5 library dart2js.new_js_emitter.model_emitter;
6 6
7 import '../../constants/values.dart' show ConstantValue; 7 import '../../constants/values.dart' show ConstantValue;
8 import '../../dart2jslib.dart' show Compiler; 8 import '../../dart2jslib.dart' show Compiler;
9 import '../../dart_types.dart' show DartType; 9 import '../../dart_types.dart' show DartType;
10 import '../../elements/elements.dart' show ClassElement; 10 import '../../elements/elements.dart' show ClassElement;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 js.Property emitMangledGlobalNames() { 258 js.Property emitMangledGlobalNames() {
259 List<js.Property> names = <js.Property>[]; 259 List<js.Property> names = <js.Property>[];
260 260
261 // We want to keep the original names for the most common core classes when 261 // We want to keep the original names for the most common core classes when
262 // calling toString on them. 262 // calling toString on them.
263 List<ClassElement> nativeClassesNeedingUnmangledName = 263 List<ClassElement> nativeClassesNeedingUnmangledName =
264 [compiler.intClass, compiler.doubleClass, compiler.numClass, 264 [compiler.intClass, compiler.doubleClass, compiler.numClass,
265 compiler.stringClass, compiler.boolClass, compiler.nullClass, 265 compiler.stringClass, compiler.boolClass, compiler.nullClass,
266 compiler.listClass]; 266 compiler.listClass];
267 nativeClassesNeedingUnmangledName.forEach((element) { 267 nativeClassesNeedingUnmangledName.forEach((element) {
268 names.add(new js.Property(js.string(namer.getNameOfClass(element)), 268 names.add(new js.Property(js.string(namer.className(element)),
269 js.string(element.name))); 269 js.string(element.name)));
270 }); 270 });
271 271
272 return new js.Property(js.string(MANGLED_GLOBAL_NAMES), 272 return new js.Property(js.string(MANGLED_GLOBAL_NAMES),
273 new js.ObjectInitializer(names)); 273 new js.ObjectInitializer(names));
274 } 274 }
275 275
276 js.Statement emitDeferredInitializerGlobal(Map loadMap) { 276 js.Statement emitDeferredInitializerGlobal(Map loadMap) {
277 if (loadMap.isEmpty) return new js.Block.empty(); 277 if (loadMap.isEmpty) return new js.Block.empty();
278 278
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 1020
1021 var end = Date.now(); 1021 var end = Date.now();
1022 // print('Setup: ' + (end - start) + ' ms.'); 1022 // print('Setup: ' + (end - start) + ' ms.');
1023 1023
1024 #invokeMain; // Start main. 1024 #invokeMain; // Start main.
1025 1025
1026 }(Date.now(), #code) 1026 }(Date.now(), #code)
1027 }"""; 1027 }""";
1028 1028
1029 } 1029 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698