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

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

Issue 858433005: dart2js: Don't reference mixins when they are only used for RTI. (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
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 outputs.setAll(1, deferredOutputs); 81 outputs.setAll(1, deferredOutputs);
82 82
83 Program result = 83 Program result =
84 new Program(outputs, _task.outputContainsConstantList, _buildLoadMap()); 84 new Program(outputs, _task.outputContainsConstantList, _buildLoadMap());
85 85
86 // Resolve the superclass references after we've processed all the classes. 86 // Resolve the superclass references after we've processed all the classes.
87 _classes.forEach((ClassElement element, Class c) { 87 _classes.forEach((ClassElement element, Class c) {
88 if (element.superclass != null) { 88 if (element.superclass != null) {
89 c.setSuperclass(_classes[element.superclass]); 89 c.setSuperclass(_classes[element.superclass]);
90 } 90 }
91 if (element.isMixinApplication) { 91 if (c is MixinApplication) {
92 MixinApplication mixinApplication = c; 92 c.setMixinClass(_classes[computeMixinClass(element)]);
93 mixinApplication.setMixinClass(_classes[computeMixinClass(element)]);
94 } 93 }
95 }); 94 });
96 95
97 _markEagerClasses(); 96 _markEagerClasses();
98 97
99 return result; 98 return result;
100 } 99 }
101 100
102 void _markEagerClasses() { 101 void _markEagerClasses() {
103 _markEagerInterceptorClasses(); 102 _markEagerInterceptorClasses();
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 }); 291 });
293 292
294 String name = namer.getNameOfClass(element); 293 String name = namer.getNameOfClass(element);
295 String holderName = namer.globalObjectFor(element); 294 String holderName = namer.globalObjectFor(element);
296 Holder holder = _registry.registerHolder(holderName); 295 Holder holder = _registry.registerHolder(holderName);
297 bool onlyForRti = _task.typeTestRegistry.rtiNeededClasses.contains(element); 296 bool onlyForRti = _task.typeTestRegistry.rtiNeededClasses.contains(element);
298 bool isInstantiated = 297 bool isInstantiated =
299 _compiler.codegenWorld.directlyInstantiatedClasses.contains(element); 298 _compiler.codegenWorld.directlyInstantiatedClasses.contains(element);
300 299
301 Class result; 300 Class result;
302 if (element.isMixinApplication) { 301 if (element.isMixinApplication && !onlyForRti) {
303 result = new MixinApplication(element, 302 result = new MixinApplication(element,
304 name, holder, methods, fields, 303 name, holder, methods, fields,
305 isDirectlyInstantiated: isInstantiated, 304 isDirectlyInstantiated: isInstantiated,
306 onlyForRti: onlyForRti); 305 onlyForRti: onlyForRti);
307 } else { 306 } else {
308 result = new Class(element, 307 result = new Class(element,
309 name, holder, methods, fields, 308 name, holder, methods, fields,
310 isDirectlyInstantiated: isInstantiated, 309 isDirectlyInstantiated: isInstantiated,
311 onlyForRti: onlyForRti); 310 onlyForRti: onlyForRti);
312 } 311 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 _registry.registerConstant(outputUnit, constantValue); 446 _registry.registerConstant(outputUnit, constantValue);
448 assert(!_constants.containsKey(constantValue)); 447 assert(!_constants.containsKey(constantValue));
449 String name = namer.constantName(constantValue); 448 String name = namer.constantName(constantValue);
450 String constantObject = namer.globalObjectForConstant(constantValue); 449 String constantObject = namer.globalObjectForConstant(constantValue);
451 Holder holder = _registry.registerHolder(constantObject); 450 Holder holder = _registry.registerHolder(constantObject);
452 Constant constant = new Constant(name, holder, constantValue); 451 Constant constant = new Constant(name, holder, constantValue);
453 _constants[constantValue] = constant; 452 _constants[constantValue] = constant;
454 } 453 }
455 } 454 }
456 } 455 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698