| OLD | NEW |
| 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'; |
| 11 import '../js/js.dart' as js; | 11 import '../../js/js.dart' as js; |
| 12 | 12 |
| 13 import '../js_backend/js_backend.dart' show | 13 import '../../js_backend/js_backend.dart' show |
| 14 Namer, | 14 Namer, |
| 15 JavaScriptBackend, | 15 JavaScriptBackend, |
| 16 JavaScriptConstantCompiler; | 16 JavaScriptConstantCompiler; |
| 17 | 17 |
| 18 import 'js_emitter.dart' show | 18 import '../js_emitter.dart' show |
| 19 ClassStubGenerator, | 19 ClassStubGenerator, |
| 20 CodeEmitterTask, | 20 CodeEmitterTask, |
| 21 InterceptorStubGenerator, | 21 InterceptorStubGenerator, |
| 22 MainCallStubGenerator, | 22 MainCallStubGenerator, |
| 23 ParameterStubGenerator, | 23 ParameterStubGenerator, |
| 24 RuntimeTypeGenerator, | 24 RuntimeTypeGenerator, |
| 25 TypeTestProperties; | 25 TypeTestProperties; |
| 26 | 26 |
| 27 import '../elements/elements.dart' show ParameterElement, MethodElement; | 27 import '../../elements/elements.dart' show ParameterElement, MethodElement; |
| 28 | 28 |
| 29 import '../universe/universe.dart' show Universe, TypeMaskSet; | 29 import '../../universe/universe.dart' show Universe, TypeMaskSet; |
| 30 import '../deferred_load.dart' show DeferredLoadTask, OutputUnit; | 30 import '../../deferred_load.dart' show DeferredLoadTask, OutputUnit; |
| 31 | 31 |
| 32 part 'registry.dart'; | 32 part 'registry.dart'; |
| 33 | 33 |
| 34 /// Builds a self-contained representation of the program that can then be |
| 35 /// emitted more easily by the individual emitters. |
| 34 class ProgramBuilder { | 36 class ProgramBuilder { |
| 35 final Compiler _compiler; | 37 final Compiler _compiler; |
| 36 final Namer namer; | 38 final Namer namer; |
| 37 final CodeEmitterTask _task; | 39 final CodeEmitterTask _task; |
| 38 | 40 |
| 39 final Registry _registry; | 41 final Registry _registry; |
| 40 | 42 |
| 41 /// True if the program should store function types in the metadata. | 43 /// True if the program should store function types in the metadata. |
| 42 bool _storeFunctionTypesInMetadata = false; | 44 bool _storeFunctionTypesInMetadata = false; |
| 43 | 45 |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 _registry.registerConstant(outputUnit, constantValue); | 762 _registry.registerConstant(outputUnit, constantValue); |
| 761 assert(!_constants.containsKey(constantValue)); | 763 assert(!_constants.containsKey(constantValue)); |
| 762 js.Name name = namer.constantName(constantValue); | 764 js.Name name = namer.constantName(constantValue); |
| 763 String constantObject = namer.globalObjectForConstant(constantValue); | 765 String constantObject = namer.globalObjectForConstant(constantValue); |
| 764 Holder holder = _registry.registerHolder(constantObject); | 766 Holder holder = _registry.registerHolder(constantObject); |
| 765 Constant constant = new Constant(name, holder, constantValue); | 767 Constant constant = new Constant(name, holder, constantValue); |
| 766 _constants[constantValue] = constant; | 768 _constants[constantValue] = constant; |
| 767 } | 769 } |
| 768 } | 770 } |
| 769 } | 771 } |
| OLD | NEW |