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

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

Issue 957973006: dart2js: don't emit unneeded native info. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. 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.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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 MainFragment mainFragment = _buildMainFragment(_registry.mainLibrariesMap); 110 MainFragment mainFragment = _buildMainFragment(_registry.mainLibrariesMap);
111 Iterable<Fragment> deferredFragments = 111 Iterable<Fragment> deferredFragments =
112 _registry.deferredLibrariesMap.map(_buildDeferredFragment); 112 _registry.deferredLibrariesMap.map(_buildDeferredFragment);
113 113
114 List<Fragment> fragments = new List<Fragment>(_registry.librariesMapCount); 114 List<Fragment> fragments = new List<Fragment>(_registry.librariesMapCount);
115 fragments[0] = mainFragment; 115 fragments[0] = mainFragment;
116 fragments.setAll(1, deferredFragments); 116 fragments.setAll(1, deferredFragments);
117 117
118 _markEagerClasses(); 118 _markEagerClasses();
119 119
120 bool containsNativeClasses = 120 List<Holder> holders = _registry.holders.toList(growable: false);
121 nativeClasses.length != _unneededNativeClasses.length;
122 121
123 List<Holder> holders = _registry.holders.toList(growable: false); 122 bool needsNativeSupport = _compiler.enqueuer.codegen.nativeEnqueuer
123 .hasInstantiatedNativeClasses();
124
125 assert(!needsNativeSupport || nativeClasses.isNotEmpty);
124 126
125 return new Program( 127 return new Program(
126 fragments, 128 fragments,
127 holders, 129 holders,
128 _buildLoadMap(), 130 _buildLoadMap(),
129 _buildTypeToInterceptorMap(), 131 _buildTypeToInterceptorMap(),
130 _task.metadataCollector, 132 _task.metadataCollector,
131 outputContainsNativeClasses: containsNativeClasses, 133 needsNativeSupport: needsNativeSupport,
132 outputContainsConstantList: _task.outputContainsConstantList, 134 outputContainsConstantList: _task.outputContainsConstantList,
133 hasIsolateSupport: _compiler.hasIsolateSupport); 135 hasIsolateSupport: _compiler.hasIsolateSupport);
134 } 136 }
135 137
136 void _markEagerClasses() { 138 void _markEagerClasses() {
137 _markEagerInterceptorClasses(); 139 _markEagerInterceptorClasses();
138 } 140 }
139 141
140 /// Builds a map from loadId to outputs-to-load. 142 /// Builds a map from loadId to outputs-to-load.
141 Map<String, List<Fragment>> _buildLoadMap() { 143 Map<String, List<Fragment>> _buildLoadMap() {
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 _registry.registerConstant(outputUnit, constantValue); 755 _registry.registerConstant(outputUnit, constantValue);
754 assert(!_constants.containsKey(constantValue)); 756 assert(!_constants.containsKey(constantValue));
755 String name = namer.constantName(constantValue); 757 String name = namer.constantName(constantValue);
756 String constantObject = namer.globalObjectForConstant(constantValue); 758 String constantObject = namer.globalObjectForConstant(constantValue);
757 Holder holder = _registry.registerHolder(constantObject); 759 Holder holder = _registry.registerHolder(constantObject);
758 Constant constant = new Constant(name, holder, constantValue); 760 Constant constant = new Constant(name, holder, constantValue);
759 _constants[constantValue] = constant; 761 _constants[constantValue] = constant;
760 } 762 }
761 } 763 }
762 } 764 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart ('k') | tests/lib/typed_data/byte_data_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698