| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 js_backend.backend; | 5 library js_backend.backend; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
| 10 | 10 |
| 11 import '../closure.dart'; | 11 import '../closure.dart'; |
| 12 import '../common.dart'; | 12 import '../common.dart'; |
| 13 import '../common/backend_api.dart' | 13 import '../common/backend_api.dart' |
| 14 show | 14 show |
| 15 Backend, | 15 Backend, |
| 16 BackendClasses, | 16 BackendClasses, |
| 17 ImpactTransformer, | 17 ImpactTransformer, |
| 18 ForeignResolver, | 18 ForeignResolver, |
| 19 NativeRegistry; | 19 NativeRegistry; |
| 20 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; | 20 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; |
| 21 import '../common/names.dart' show Identifiers, Selectors, Uris; | 21 import '../common/names.dart' show Identifiers, Selectors, Uris; |
| 22 import '../common/registry.dart' show Registry; | |
| 23 import '../common/resolution.dart' show Frontend, Resolution, ResolutionImpact; | 22 import '../common/resolution.dart' show Frontend, Resolution, ResolutionImpact; |
| 24 import '../common/tasks.dart' show CompilerTask; | 23 import '../common/tasks.dart' show CompilerTask; |
| 25 import '../compiler.dart' show Compiler; | 24 import '../compiler.dart' show Compiler; |
| 26 import '../constants/constant_system.dart'; | 25 import '../constants/constant_system.dart'; |
| 27 import '../constants/expressions.dart'; | 26 import '../constants/expressions.dart'; |
| 28 import '../constants/values.dart'; | 27 import '../constants/values.dart'; |
| 29 import '../core_types.dart' show CoreClasses, CoreTypes; | 28 import '../core_types.dart' show CoreClasses, CoreTypes; |
| 30 import '../dart_types.dart'; | 29 import '../dart_types.dart'; |
| 31 import '../deferred_load.dart' show DeferredLoadTask; | 30 import '../deferred_load.dart' show DeferredLoadTask; |
| 32 import '../dump_info.dart' show DumpInfoTask; | 31 import '../dump_info.dart' show DumpInfoTask; |
| (...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 } | 1920 } |
| 1922 | 1921 |
| 1923 /// Called when [:const Symbol(name):] is seen. | 1922 /// Called when [:const Symbol(name):] is seen. |
| 1924 void registerConstSymbol(String name) { | 1923 void registerConstSymbol(String name) { |
| 1925 symbolsUsed.add(name); | 1924 symbolsUsed.add(name); |
| 1926 if (name.endsWith('=')) { | 1925 if (name.endsWith('=')) { |
| 1927 symbolsUsed.add(name.substring(0, name.length - 1)); | 1926 symbolsUsed.add(name.substring(0, name.length - 1)); |
| 1928 } | 1927 } |
| 1929 } | 1928 } |
| 1930 | 1929 |
| 1931 /// Called when [:new Symbol(...):] is seen. | |
| 1932 void registerNewSymbol(Registry registry) {} | |
| 1933 | |
| 1934 /// Should [element] (a getter) that would normally not be generated due to | 1930 /// Should [element] (a getter) that would normally not be generated due to |
| 1935 /// treeshaking be retained for reflection? | 1931 /// treeshaking be retained for reflection? |
| 1936 bool shouldRetainGetter(Element element) { | 1932 bool shouldRetainGetter(Element element) { |
| 1937 return isTreeShakingDisabled && isAccessibleByReflection(element); | 1933 return isTreeShakingDisabled && isAccessibleByReflection(element); |
| 1938 } | 1934 } |
| 1939 | 1935 |
| 1940 /// Should [element] (a setter) hat would normally not be generated due to | 1936 /// Should [element] (a setter) hat would normally not be generated due to |
| 1941 /// treeshaking be retained for reflection? | 1937 /// treeshaking be retained for reflection? |
| 1942 bool shouldRetainSetter(Element element) { | 1938 bool shouldRetainSetter(Element element) { |
| 1943 return isTreeShakingDisabled && isAccessibleByReflection(element); | 1939 return isTreeShakingDisabled && isAccessibleByReflection(element); |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3276 ClassElement get mapImplementation => helpers.mapLiteralClass; | 3272 ClassElement get mapImplementation => helpers.mapLiteralClass; |
| 3277 ClassElement get constMapImplementation => helpers.constMapLiteralClass; | 3273 ClassElement get constMapImplementation => helpers.constMapLiteralClass; |
| 3278 ClassElement get typeImplementation => helpers.typeLiteralClass; | 3274 ClassElement get typeImplementation => helpers.typeLiteralClass; |
| 3279 ClassElement get boolImplementation => helpers.jsBoolClass; | 3275 ClassElement get boolImplementation => helpers.jsBoolClass; |
| 3280 ClassElement get nullImplementation => helpers.jsNullClass; | 3276 ClassElement get nullImplementation => helpers.jsNullClass; |
| 3281 ClassElement get syncStarIterableImplementation => helpers.syncStarIterable; | 3277 ClassElement get syncStarIterableImplementation => helpers.syncStarIterable; |
| 3282 ClassElement get asyncFutureImplementation => helpers.futureImplementation; | 3278 ClassElement get asyncFutureImplementation => helpers.futureImplementation; |
| 3283 ClassElement get asyncStarStreamImplementation => helpers.controllerStream; | 3279 ClassElement get asyncStarStreamImplementation => helpers.controllerStream; |
| 3284 ClassElement get functionImplementation => helpers.coreClasses.functionClass; | 3280 ClassElement get functionImplementation => helpers.coreClasses.functionClass; |
| 3285 } | 3281 } |
| OLD | NEW |