| 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; |
| 11 import 'package:js_runtime/shared/embedded_names.dart' | 11 import 'package:js_runtime/shared/embedded_names.dart' |
| 12 show JsBuiltin, JsGetName; | 12 show JsBuiltin, JsGetName; |
| 13 | 13 |
| 14 import '../../common.dart'; | 14 import '../../common.dart'; |
| 15 import '../../common/names.dart' show Names; | |
| 16 import '../../compiler.dart' show Compiler; | 15 import '../../compiler.dart' show Compiler; |
| 17 import '../../constants/values.dart'; | 16 import '../../constants/values.dart'; |
| 18 import '../../core_types.dart' show CommonElements; | 17 import '../../core_types.dart' show CommonElements; |
| 19 import '../../elements/resolution_types.dart' show ResolutionDartType; | 18 import '../../elements/resolution_types.dart' show ResolutionDartType; |
| 20 import '../../deferred_load.dart' show OutputUnit; | 19 import '../../deferred_load.dart' show OutputUnit; |
| 21 import '../../elements/elements.dart' | 20 import '../../elements/elements.dart' |
| 22 show | 21 show |
| 23 ClassElement, | 22 ClassElement, |
| 24 Element, | 23 Element, |
| 25 Elements, | 24 Elements, |
| 26 FieldElement, | 25 FieldElement, |
| 27 FunctionElement, | 26 FunctionElement, |
| 28 FunctionSignature, | 27 FunctionSignature, |
| 29 LibraryElement, | 28 LibraryElement, |
| 30 MemberElement, | |
| 31 MetadataAnnotation, | |
| 32 MethodElement, | 29 MethodElement, |
| 33 Name, | |
| 34 TypedefElement, | 30 TypedefElement, |
| 35 VariableElement; | 31 VariableElement; |
| 36 import '../../hash/sha1.dart' show Hasher; | 32 import '../../hash/sha1.dart' show Hasher; |
| 37 import '../../io/code_output.dart'; | 33 import '../../io/code_output.dart'; |
| 38 import '../../io/line_column_provider.dart' | 34 import '../../io/line_column_provider.dart' |
| 39 show LineColumnCollector, LineColumnProvider; | 35 show LineColumnCollector, LineColumnProvider; |
| 40 import '../../io/source_map_builder.dart' show SourceMapBuilder; | 36 import '../../io/source_map_builder.dart' show SourceMapBuilder; |
| 41 import '../../js/js.dart' as jsAst; | 37 import '../../js/js.dart' as jsAst; |
| 42 import '../../js/js.dart' show js; | 38 import '../../js/js.dart' show js; |
| 43 import '../../js_backend/backend_helpers.dart' show BackendHelpers; | 39 import '../../js_backend/backend_helpers.dart' show BackendHelpers; |
| 44 import '../../js_backend/js_backend.dart' | 40 import '../../js_backend/js_backend.dart' |
| 45 show | 41 show |
| 46 CompoundName, | |
| 47 ConstantEmitter, | 42 ConstantEmitter, |
| 48 GetterName, | |
| 49 JavaScriptBackend, | 43 JavaScriptBackend, |
| 50 JavaScriptConstantCompiler, | 44 JavaScriptConstantCompiler, |
| 51 Namer, | 45 Namer, |
| 52 SetterName, | 46 SetterName, |
| 53 TypeVariableHandler; | 47 TypeVariableHandler; |
| 54 import '../../universe/call_structure.dart' show CallStructure; | 48 import '../../universe/call_structure.dart' show CallStructure; |
| 55 import '../../universe/selector.dart' show Selector; | 49 import '../../universe/selector.dart' show Selector; |
| 56 import '../../universe/world_builder.dart' show CodegenWorldBuilder; | 50 import '../../universe/world_builder.dart' show CodegenWorldBuilder; |
| 57 import '../../util/characters.dart' show $$, $A, $HASH, $Z, $a, $z; | |
| 58 import '../../util/uri_extras.dart' show relativize; | 51 import '../../util/uri_extras.dart' show relativize; |
| 59 import '../../util/util.dart' show equalElements; | |
| 60 import '../../world.dart' show ClosedWorld; | 52 import '../../world.dart' show ClosedWorld; |
| 61 import '../constant_ordering.dart' show deepCompareConstants; | 53 import '../constant_ordering.dart' show deepCompareConstants; |
| 62 import '../headers.dart'; | 54 import '../headers.dart'; |
| 63 import '../js_emitter.dart' hide Emitter, EmitterFactory; | 55 import '../js_emitter.dart' hide Emitter, EmitterFactory; |
| 64 import '../js_emitter.dart' as js_emitter show Emitter, EmitterFactory; | 56 import '../js_emitter.dart' as js_emitter show Emitter, EmitterFactory; |
| 65 import '../model.dart'; | 57 import '../model.dart'; |
| 66 import '../program_builder/program_builder.dart'; | 58 import '../program_builder/program_builder.dart'; |
| 67 | 59 |
| 68 part 'class_builder.dart'; | 60 import 'class_builder.dart'; |
| 69 part 'class_emitter.dart'; | 61 import 'class_emitter.dart'; |
| 62 import 'container_builder.dart'; |
| 63 import 'interceptor_emitter.dart'; |
| 64 import 'nsm_emitter.dart'; |
| 65 |
| 66 export 'class_builder.dart'; |
| 67 export 'class_emitter.dart'; |
| 68 export 'container_builder.dart'; |
| 69 export 'interceptor_emitter.dart'; |
| 70 export 'nsm_emitter.dart'; |
| 71 |
| 70 part 'code_emitter_helper.dart'; | 72 part 'code_emitter_helper.dart'; |
| 71 part 'container_builder.dart'; | |
| 72 part 'declarations.dart'; | 73 part 'declarations.dart'; |
| 73 part 'deferred_output_unit_hash.dart'; | 74 part 'deferred_output_unit_hash.dart'; |
| 74 part 'interceptor_emitter.dart'; | |
| 75 part 'nsm_emitter.dart'; | |
| 76 part 'setup_program_builder.dart'; | 75 part 'setup_program_builder.dart'; |
| 77 | 76 |
| 78 class EmitterFactory implements js_emitter.EmitterFactory { | 77 class EmitterFactory implements js_emitter.EmitterFactory { |
| 79 final bool generateSourceMap; | 78 final bool generateSourceMap; |
| 80 | 79 |
| 81 EmitterFactory({this.generateSourceMap}); | 80 EmitterFactory({this.generateSourceMap}); |
| 82 | 81 |
| 83 @override | 82 @override |
| 84 String get patchVersion => "full"; | 83 String get patchVersion => "full"; |
| 85 | 84 |
| (...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2182 void invalidateCaches() { | 2181 void invalidateCaches() { |
| 2183 if (!compiler.options.hasIncrementalSupport) return; | 2182 if (!compiler.options.hasIncrementalSupport) return; |
| 2184 if (cachedElements.isEmpty) return; | 2183 if (cachedElements.isEmpty) return; |
| 2185 for (Element element in backend.codegenEnqueuer.newlyEnqueuedElements) { | 2184 for (Element element in backend.codegenEnqueuer.newlyEnqueuedElements) { |
| 2186 if (element.isInstanceMember) { | 2185 if (element.isInstanceMember) { |
| 2187 cachedClassBuilders.remove(element.enclosingClass); | 2186 cachedClassBuilders.remove(element.enclosingClass); |
| 2188 } | 2187 } |
| 2189 } | 2188 } |
| 2190 } | 2189 } |
| 2191 } | 2190 } |
| OLD | NEW |