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

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

Issue 1239953003: dart2js: Support mock compilation in the program builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | 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, Emitter; 7 import '../js_emitter.dart' show computeMixinClass, Emitter;
8 import '../model.dart'; 8 import '../model.dart';
9 9
10 import '../../common.dart'; 10 import '../../common.dart';
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 _buildInvokeMain(), 201 _buildInvokeMain(),
202 _buildLibraries(librariesMap), 202 _buildLibraries(librariesMap),
203 _buildStaticNonFinalFields(librariesMap), 203 _buildStaticNonFinalFields(librariesMap),
204 _buildStaticLazilyInitializedFields(librariesMap), 204 _buildStaticLazilyInitializedFields(librariesMap),
205 _buildConstants(librariesMap)); 205 _buildConstants(librariesMap));
206 _outputs[librariesMap.outputUnit] = result; 206 _outputs[librariesMap.outputUnit] = result;
207 return result; 207 return result;
208 } 208 }
209 209
210 js.Statement _buildInvokeMain() { 210 js.Statement _buildInvokeMain() {
211 if (_compiler.isMockCompilation) return js.js.comment("Mock compilation");
212
211 MainCallStubGenerator generator = 213 MainCallStubGenerator generator =
212 new MainCallStubGenerator(_compiler, backend, backend.emitter); 214 new MainCallStubGenerator(_compiler, backend, backend.emitter);
213 return generator.generateInvokeMain(); 215 return generator.generateInvokeMain();
214 } 216 }
215 217
216 DeferredFragment _buildDeferredFragment(LibrariesMap librariesMap) { 218 DeferredFragment _buildDeferredFragment(LibrariesMap librariesMap) {
217 DeferredFragment result = new DeferredFragment( 219 DeferredFragment result = new DeferredFragment(
218 librariesMap.outputUnit, 220 librariesMap.outputUnit,
219 backend.deferredPartFileName(librariesMap.name, addExtension: false), 221 backend.deferredPartFileName(librariesMap.name, addExtension: false),
220 librariesMap.name, 222 librariesMap.name,
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 _registry.registerConstant(outputUnit, constantValue); 792 _registry.registerConstant(outputUnit, constantValue);
791 assert(!_constants.containsKey(constantValue)); 793 assert(!_constants.containsKey(constantValue));
792 js.Name name = namer.constantName(constantValue); 794 js.Name name = namer.constantName(constantValue);
793 String constantObject = namer.globalObjectForConstant(constantValue); 795 String constantObject = namer.globalObjectForConstant(constantValue);
794 Holder holder = _registry.registerHolder(constantObject); 796 Holder holder = _registry.registerHolder(constantObject);
795 Constant constant = new Constant(name, holder, constantValue); 797 Constant constant = new Constant(name, holder, constantValue);
796 _constants[constantValue] = constant; 798 _constants[constantValue] = constant;
797 } 799 }
798 } 800 }
799 } 801 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698