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

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

Issue 868473003: dart2js: Run prepareNativeClasses in the program builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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.js_emitter.program_builder; 5 library dart2js.js_emitter.program_builder;
6 6
7 import 'js_emitter.dart' show computeMixinClass; 7 import 'js_emitter.dart' show computeMixinClass;
8 import 'model.dart'; 8 import 'model.dart';
9 9
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (element.superclass != null) { 94 if (element.superclass != null) {
95 c.setSuperclass(_classes[element.superclass]); 95 c.setSuperclass(_classes[element.superclass]);
96 assert(c.superclass != null); 96 assert(c.superclass != null);
97 } 97 }
98 if (c is MixinApplication) { 98 if (c is MixinApplication) {
99 c.setMixinClass(_classes[computeMixinClass(element)]); 99 c.setMixinClass(_classes[computeMixinClass(element)]);
100 assert(c.mixinClass != null); 100 assert(c.mixinClass != null);
101 } 101 }
102 }); 102 });
103 103
104 Map<Class, Map<String, js.Expression>> additionalProperties =
105 new Map<Class, Map<String, js.Expression>>();
106
107 List<Class> nativeNeededClasses =
herhut 2015/01/26 13:50:15 This reads strange. Why not neededNativeClasses?
floitsch 2015/01/26 17:50:40 Done.
108 _task.nativeEmitter.prepareNativeClasses(
109 nativeClasses,
110 additionalProperties);
111
104 _markEagerClasses(); 112 _markEagerClasses();
105 113
106 return new Program(outputs, 114 return new Program(
107 nativeClasses, 115 outputs,
108 _task.outputContainsConstantList, 116 nativeNeededClasses,
109 _buildLoadMap()); 117 additionalProperties,
118 _buildLoadMap(),
119 outputContainsNativeClasses: nativeNeededClasses.isNotEmpty,
120 outputContainsConstantList: _task.outputContainsConstantList);
110 } 121 }
111 122
112 void _markEagerClasses() { 123 void _markEagerClasses() {
113 _markEagerInterceptorClasses(); 124 _markEagerInterceptorClasses();
114 } 125 }
115 126
116 /// Builds a map from loadId to outputs-to-load. 127 /// Builds a map from loadId to outputs-to-load.
117 Map<String, List<Fragment>> _buildLoadMap() { 128 Map<String, List<Fragment>> _buildLoadMap() {
118 List<OutputUnit> convertHunks(List<OutputUnit> hunks) { 129 List<OutputUnit> convertHunks(List<OutputUnit> hunks) {
119 return hunks.map((OutputUnit unit) => _outputs[unit]) 130 return hunks.map((OutputUnit unit) => _outputs[unit])
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 _registry.registerConstant(outputUnit, constantValue); 513 _registry.registerConstant(outputUnit, constantValue);
503 assert(!_constants.containsKey(constantValue)); 514 assert(!_constants.containsKey(constantValue));
504 String name = namer.constantName(constantValue); 515 String name = namer.constantName(constantValue);
505 String constantObject = namer.globalObjectForConstant(constantValue); 516 String constantObject = namer.globalObjectForConstant(constantValue);
506 Holder holder = _registry.registerHolder(constantObject); 517 Holder holder = _registry.registerHolder(constantObject);
507 Constant constant = new Constant(name, holder, constantValue); 518 Constant constant = new Constant(name, holder, constantValue);
508 _constants[constantValue] = constant; 519 _constants[constantValue] = constant;
509 } 520 }
510 } 521 }
511 } 522 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698