| 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 19 matching lines...) Expand all Loading... |
| 30 MethodElement, | 30 MethodElement, |
| 31 TypedefElement, | 31 TypedefElement, |
| 32 VariableElement; | 32 VariableElement; |
| 33 import '../../elements/entities.dart'; | 33 import '../../elements/entities.dart'; |
| 34 import '../../hash/sha1.dart' show Hasher; | 34 import '../../hash/sha1.dart' show Hasher; |
| 35 import '../../io/code_output.dart'; | 35 import '../../io/code_output.dart'; |
| 36 import '../../io/location_provider.dart' show LocationCollector; | 36 import '../../io/location_provider.dart' show LocationCollector; |
| 37 import '../../io/source_map_builder.dart' show SourceMapBuilder; | 37 import '../../io/source_map_builder.dart' show SourceMapBuilder; |
| 38 import '../../js/js.dart' as jsAst; | 38 import '../../js/js.dart' as jsAst; |
| 39 import '../../js/js.dart' show js; | 39 import '../../js/js.dart' show js; |
| 40 import '../../js_backend/backend_helpers.dart' show BackendHelpers; | |
| 41 import '../../js_backend/js_backend.dart' | 40 import '../../js_backend/js_backend.dart' |
| 42 show | 41 show |
| 43 ConstantEmitter, | 42 ConstantEmitter, |
| 44 JavaScriptBackend, | 43 JavaScriptBackend, |
| 45 JavaScriptConstantCompiler, | 44 JavaScriptConstantCompiler, |
| 46 Namer, | 45 Namer, |
| 47 SetterName, | 46 SetterName, |
| 48 TypeVariableCodegenAnalysis; | 47 TypeVariableCodegenAnalysis; |
| 49 import '../../universe/call_structure.dart' show CallStructure; | 48 import '../../universe/call_structure.dart' show CallStructure; |
| 50 import '../../universe/selector.dart' show Selector; | 49 import '../../universe/selector.dart' show Selector; |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES); | 819 generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES); |
| 821 jsAst.Expression getTypeFromNameAccess = | 820 jsAst.Expression getTypeFromNameAccess = |
| 822 generateEmbeddedGlobalAccess(embeddedNames.GET_TYPE_FROM_NAME); | 821 generateEmbeddedGlobalAccess(embeddedNames.GET_TYPE_FROM_NAME); |
| 823 jsAst.Expression interceptorsByTagAccess = | 822 jsAst.Expression interceptorsByTagAccess = |
| 824 generateEmbeddedGlobalAccess(embeddedNames.INTERCEPTORS_BY_TAG); | 823 generateEmbeddedGlobalAccess(embeddedNames.INTERCEPTORS_BY_TAG); |
| 825 jsAst.Expression leafTagsAccess = | 824 jsAst.Expression leafTagsAccess = |
| 826 generateEmbeddedGlobalAccess(embeddedNames.LEAF_TAGS); | 825 generateEmbeddedGlobalAccess(embeddedNames.LEAF_TAGS); |
| 827 jsAst.Expression finishedClassesAccess = | 826 jsAst.Expression finishedClassesAccess = |
| 828 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES); | 827 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES); |
| 829 jsAst.Expression cyclicThrow = | 828 jsAst.Expression cyclicThrow = |
| 830 staticFunctionAccess(backend.helpers.cyclicThrowHelper); | 829 staticFunctionAccess(backend.commonElements.cyclicThrowHelper); |
| 831 jsAst.Expression laziesAccess = | 830 jsAst.Expression laziesAccess = |
| 832 generateEmbeddedGlobalAccess(embeddedNames.LAZIES); | 831 generateEmbeddedGlobalAccess(embeddedNames.LAZIES); |
| 833 | 832 |
| 834 return js.statement( | 833 return js.statement( |
| 835 ''' | 834 ''' |
| 836 function init() { | 835 function init() { |
| 837 $isolatePropertiesName = Object.create(null); | 836 $isolatePropertiesName = Object.create(null); |
| 838 #allClasses = map(); | 837 #allClasses = map(); |
| 839 #getTypeFromName = function(name) {return #allClasses[name];}; | 838 #getTypeFromName = function(name) {return #allClasses[name];}; |
| 840 #interceptorsByTag = map(); | 839 #interceptorsByTag = map(); |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 // data. | 1928 // data. |
| 1930 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 1929 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
| 1931 "needed for a given deferred library import."; | 1930 "needed for a given deferred library import."; |
| 1932 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 1931 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
| 1933 compiler.outputProvider( | 1932 compiler.outputProvider( |
| 1934 compiler.options.deferredMapUri.path, '', OutputType.info) | 1933 compiler.options.deferredMapUri.path, '', OutputType.info) |
| 1935 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 1934 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
| 1936 ..close(); | 1935 ..close(); |
| 1937 } | 1936 } |
| 1938 } | 1937 } |
| OLD | NEW |