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.full_emitter; | 5 library dart2js.js_emitter.full_emitter; |
6 | 6 |
7 import 'dart:collection' show HashMap; | 7 import 'dart:collection' show HashMap; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 | 1058 |
1059 return false; | 1059 return false; |
1060 })(); | 1060 })(); |
1061 '''); | 1061 '''); |
1062 | 1062 |
1063 return supportsDirectProtoAccess; | 1063 return supportsDirectProtoAccess; |
1064 } | 1064 } |
1065 | 1065 |
1066 jsAst.Expression generateLibraryDescriptor( | 1066 jsAst.Expression generateLibraryDescriptor( |
1067 LibraryEntity library, Fragment fragment) { | 1067 LibraryEntity library, Fragment fragment) { |
1068 var uri = ""; | 1068 dynamic uri = ""; |
1069 if (!compiler.options.enableMinification || | 1069 if (!compiler.options.enableMinification || |
1070 backend.mirrorsData.mustPreserveUris) { | 1070 backend.mirrorsData.mustPreserveUris) { |
1071 uri = library.canonicalUri; | 1071 uri = library.canonicalUri; |
1072 if (uri.scheme == 'file' && compiler.options.outputUri != null) { | 1072 if (uri.scheme == 'file' && compiler.options.outputUri != null) { |
1073 uri = | 1073 uri = |
1074 relativize(compiler.options.outputUri, library.canonicalUri, false); | 1074 relativize(compiler.options.outputUri, library.canonicalUri, false); |
1075 } | 1075 } |
1076 } | 1076 } |
1077 | 1077 |
1078 String libraryName = (!compiler.options.enableMinification || | 1078 String libraryName = (!compiler.options.enableMinification || |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 return outputs; | 1621 return outputs; |
1622 } | 1622 } |
1623 | 1623 |
1624 void finalizeTokensInAst( | 1624 void finalizeTokensInAst( |
1625 jsAst.Program main, Iterable<jsAst.Program> deferredParts) { | 1625 jsAst.Program main, Iterable<jsAst.Program> deferredParts) { |
1626 jsAst.TokenCounter counter = new jsAst.TokenCounter(); | 1626 jsAst.TokenCounter counter = new jsAst.TokenCounter(); |
1627 counter.countTokens(main); | 1627 counter.countTokens(main); |
1628 deferredParts.forEach(counter.countTokens); | 1628 deferredParts.forEach(counter.countTokens); |
1629 task.metadataCollector.finalizeTokens(); | 1629 task.metadataCollector.finalizeTokens(); |
1630 if (backend.namer is jsAst.TokenFinalizer) { | 1630 if (backend.namer is jsAst.TokenFinalizer) { |
1631 var finalizer = backend.namer; | 1631 dynamic finalizer = backend.namer; |
1632 finalizer.finalizeTokens(); | 1632 finalizer.finalizeTokens(); |
1633 } | 1633 } |
1634 } | 1634 } |
1635 | 1635 |
1636 int emitProgram(ProgramBuilder programBuilder) { | 1636 int emitProgram(ProgramBuilder programBuilder) { |
1637 Program program = | 1637 Program program = |
1638 programBuilder.buildProgram(storeFunctionTypesInMetadata: true); | 1638 programBuilder.buildProgram(storeFunctionTypesInMetadata: true); |
1639 | 1639 |
1640 outputStaticNonFinalFieldLists = | 1640 outputStaticNonFinalFieldLists = |
1641 programBuilder.collector.outputStaticNonFinalFieldLists; | 1641 programBuilder.collector.outputStaticNonFinalFieldLists; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 // data. | 1972 // data. |
1973 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 1973 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
1974 "needed for a given deferred library import."; | 1974 "needed for a given deferred library import."; |
1975 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 1975 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
1976 compiler.outputProvider( | 1976 compiler.outputProvider( |
1977 compiler.options.deferredMapUri.path, '', OutputType.info) | 1977 compiler.options.deferredMapUri.path, '', OutputType.info) |
1978 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 1978 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
1979 ..close(); | 1979 ..close(); |
1980 } | 1980 } |
1981 } | 1981 } |
OLD | NEW |