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 dart2js.backend_api; | 5 library dart2js.backend_api; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../compiler.dart' show | 10 import '../compiler.dart' show |
(...skipping 18 matching lines...) Expand all Loading... |
29 LibraryElement, | 29 LibraryElement, |
30 MetadataAnnotation; | 30 MetadataAnnotation; |
31 import '../enqueue.dart' show | 31 import '../enqueue.dart' show |
32 Enqueuer, | 32 Enqueuer, |
33 CodegenEnqueuer, | 33 CodegenEnqueuer, |
34 ResolutionEnqueuer; | 34 ResolutionEnqueuer; |
35 import '../io/code_output.dart' show | 35 import '../io/code_output.dart' show |
36 CodeBuffer; | 36 CodeBuffer; |
37 import '../io/source_information.dart' show | 37 import '../io/source_information.dart' show |
38 SourceInformationStrategy; | 38 SourceInformationStrategy; |
| 39 import '../js_backend/backend_helpers.dart' as js_backend show |
| 40 BackendHelpers; |
39 import '../js_backend/js_backend.dart' as js_backend show | 41 import '../js_backend/js_backend.dart' as js_backend show |
40 JavaScriptBackend; | 42 JavaScriptBackend; |
41 import '../library_loader.dart' show | 43 import '../library_loader.dart' show |
42 LibraryLoader, | 44 LibraryLoader, |
43 LoadedLibraries; | 45 LoadedLibraries; |
44 import '../native/native.dart' as native show | 46 import '../native/native.dart' as native show |
45 NativeEnqueuer, | 47 NativeEnqueuer, |
46 maybeEnableNative; | 48 maybeEnableNative; |
47 import '../patch_parser.dart' show | 49 import '../patch_parser.dart' show |
48 checkNativeAnnotation, checkJsInteropAnnotation; | 50 checkNativeAnnotation, checkJsInteropAnnotation; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 /// defines the implementation of [element]. | 281 /// defines the implementation of [element]. |
280 FunctionElement resolveExternalFunction(FunctionElement element) => element; | 282 FunctionElement resolveExternalFunction(FunctionElement element) => element; |
281 | 283 |
282 /// Returns `true` if [library] is a backend specific library whose members | 284 /// Returns `true` if [library] is a backend specific library whose members |
283 /// have special treatment, such as being allowed to extends blacklisted | 285 /// have special treatment, such as being allowed to extends blacklisted |
284 /// classes or member being eagerly resolved. | 286 /// classes or member being eagerly resolved. |
285 bool isBackendLibrary(LibraryElement library) { | 287 bool isBackendLibrary(LibraryElement library) { |
286 // TODO(johnniwinther): Remove this when patching is only done by the | 288 // TODO(johnniwinther): Remove this when patching is only done by the |
287 // JavaScript backend. | 289 // JavaScript backend. |
288 Uri canonicalUri = library.canonicalUri; | 290 Uri canonicalUri = library.canonicalUri; |
289 if (canonicalUri == js_backend.JavaScriptBackend.DART_JS_HELPER || | 291 if (canonicalUri == js_backend.BackendHelpers.DART_JS_HELPER || |
290 canonicalUri == js_backend.JavaScriptBackend.DART_INTERCEPTORS) { | 292 canonicalUri == js_backend.BackendHelpers.DART_INTERCEPTORS) { |
291 return true; | 293 return true; |
292 } | 294 } |
293 return false; | 295 return false; |
294 } | 296 } |
295 | 297 |
296 void registerStaticUse(Element element, Enqueuer enqueuer) {} | 298 void registerStaticUse(Element element, Enqueuer enqueuer) {} |
297 | 299 |
298 /// This method is called immediately after the [LibraryElement] [library] has | 300 /// This method is called immediately after the [LibraryElement] [library] has |
299 /// been created. | 301 /// been created. |
300 void onLibraryCreated(LibraryElement library) {} | 302 void onLibraryCreated(LibraryElement library) {} |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 /// Returns the constant expression of [node], or `null` if [node] is not | 421 /// Returns the constant expression of [node], or `null` if [node] is not |
420 /// a constant expression. | 422 /// a constant expression. |
421 ConstantExpression getConstant(Node node); | 423 ConstantExpression getConstant(Node node); |
422 | 424 |
423 /// Registers [type] as instantiated. | 425 /// Registers [type] as instantiated. |
424 void registerInstantiatedType(InterfaceType type); | 426 void registerInstantiatedType(InterfaceType type); |
425 | 427 |
426 /// Resolves [typeName] to a type in the context of [node]. | 428 /// Resolves [typeName] to a type in the context of [node]. |
427 DartType resolveTypeFromString(Node node, String typeName); | 429 DartType resolveTypeFromString(Node node, String typeName); |
428 } | 430 } |
OLD | NEW |