OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.startup_emitter; | 5 library dart2js.js_emitter.startup_emitter; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart' | 7 import 'package:js_runtime/shared/embedded_names.dart' |
8 show JsBuiltin, METADATA, STATIC_FUNCTION_NAME_TO_CLOSURE, TYPES; | 8 show JsBuiltin, METADATA, STATIC_FUNCTION_NAME_TO_CLOSURE, TYPES; |
9 | 9 |
10 import '../../common.dart'; | 10 import '../../common.dart'; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 Emitter(this._compiler, this.namer, NativeEmitter nativeEmitter, | 49 Emitter(this._compiler, this.namer, NativeEmitter nativeEmitter, |
50 this._closedWorld, CodeEmitterTask task, bool shouldGenerateSourceMap) | 50 this._closedWorld, CodeEmitterTask task, bool shouldGenerateSourceMap) |
51 : _emitter = new ModelEmitter(_compiler, namer, nativeEmitter, | 51 : _emitter = new ModelEmitter(_compiler, namer, nativeEmitter, |
52 _closedWorld, task, shouldGenerateSourceMap); | 52 _closedWorld, task, shouldGenerateSourceMap); |
53 | 53 |
54 DiagnosticReporter get reporter => _compiler.reporter; | 54 DiagnosticReporter get reporter => _compiler.reporter; |
55 | 55 |
56 @override | 56 @override |
57 int emitProgram(ProgramBuilder programBuilder) { | 57 int emitProgram(ProgramBuilder programBuilder) { |
58 Program program = programBuilder.buildProgram(); | 58 Program program = programForTesting = programBuilder.buildProgram(); |
59 return _emitter.emitProgram(program); | 59 return _emitter.emitProgram(program); |
60 } | 60 } |
61 | 61 |
62 @override | 62 @override |
63 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) { | 63 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) { |
64 return _emitter.isConstantInlinedOrAlreadyEmitted(constant); | 64 return _emitter.isConstantInlinedOrAlreadyEmitted(constant); |
65 } | 65 } |
66 | 66 |
67 @override | 67 @override |
68 int compareConstants(ConstantValue a, ConstantValue b) { | 68 int compareConstants(ConstantValue a, ConstantValue b) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 @override | 164 @override |
165 int generatedSize(OutputUnit unit) { | 165 int generatedSize(OutputUnit unit) { |
166 Fragment key = _emitter.outputBuffers.keys | 166 Fragment key = _emitter.outputBuffers.keys |
167 .firstWhere((Fragment fragment) => fragment.outputUnit == unit); | 167 .firstWhere((Fragment fragment) => fragment.outputUnit == unit); |
168 return _emitter.outputBuffers[key].length; | 168 return _emitter.outputBuffers[key].length; |
169 } | 169 } |
170 } | 170 } |
OLD | NEW |