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.lazy_emitter.model_emitter; | 5 library dart2js.js_emitter.lazy_emitter.model_emitter; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart' | 7 import 'package:js_runtime/shared/embedded_names.dart' |
8 show | 8 show |
9 CREATE_NEW_ISOLATE, | 9 CREATE_NEW_ISOLATE, |
10 DEFERRED_LIBRARY_URIS, | 10 DEFERRED_LIBRARY_URIS, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 }).toList(); | 142 }).toList(); |
143 | 143 |
144 js.Statement mainAst = emitMainFragment(program); | 144 js.Statement mainAst = emitMainFragment(program); |
145 | 145 |
146 js.TokenCounter counter = new js.TokenCounter(); | 146 js.TokenCounter counter = new js.TokenCounter(); |
147 fragmentsCode.forEach(counter.countTokens); | 147 fragmentsCode.forEach(counter.countTokens); |
148 counter.countTokens(mainAst); | 148 counter.countTokens(mainAst); |
149 | 149 |
150 program.finalizers.forEach((js.TokenFinalizer f) => f.finalizeTokens()); | 150 program.finalizers.forEach((js.TokenFinalizer f) => f.finalizeTokens()); |
151 | 151 |
152 // TODO(johnnniwinther): Support source maps in this emitter. | 152 // TODO(johnniwinther): Support source maps in this emitter. |
153 for (int i = 0; i < fragmentsCode.length; ++i) { | 153 for (int i = 0; i < fragmentsCode.length; ++i) { |
154 String code = js | 154 String code = js |
155 .createCodeBuffer(fragmentsCode[i], compiler.options, | 155 .createCodeBuffer(fragmentsCode[i], compiler.options, |
156 backend.sourceInformationStrategy) | 156 backend.sourceInformationStrategy) |
157 .getText(); | 157 .getText(); |
158 totalSize += code.length; | 158 totalSize += code.length; |
159 compiler.outputProvider( | 159 compiler.outputProvider( |
160 fragments[i + 1].outputFileName, deferredExtension, OutputType.jsPart) | 160 fragments[i + 1].outputFileName, deferredExtension, OutputType.jsPart) |
161 ..add(code) | 161 ..add(code) |
162 ..close(); | 162 ..close(); |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 #eagerClasses; | 1275 #eagerClasses; |
1276 | 1276 |
1277 var end = Date.now(); | 1277 var end = Date.now(); |
1278 // print('Setup: ' + (end - start) + ' ms.'); | 1278 // print('Setup: ' + (end - start) + ' ms.'); |
1279 | 1279 |
1280 #invokeMain; // Start main. | 1280 #invokeMain; // Start main. |
1281 | 1281 |
1282 })(Date.now(), #code) | 1282 })(Date.now(), #code) |
1283 }"""; | 1283 }"""; |
1284 } | 1284 } |
OLD | NEW |