| 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 '../common/codegen.dart' show CodegenImpact; | 10 import '../common/codegen.dart' show CodegenImpact; |
| 11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target; | 11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target; |
| 12 import '../compile_time_constants.dart' | 12 import '../compile_time_constants.dart' |
| 13 show BackendConstantEnvironment, ConstantCompilerTask; | 13 show BackendConstantEnvironment, ConstantCompilerTask; |
| 14 import '../compiler.dart' show Compiler; | 14 import '../compiler.dart' show Compiler; |
| 15 import '../constants/constant_system.dart' show ConstantSystem; | 15 import '../constants/constant_system.dart' show ConstantSystem; |
| 16 import '../constants/expressions.dart' show ConstantExpression; | 16 import '../constants/expressions.dart' show ConstantExpression; |
| 17 import '../constants/values.dart' show ConstantValue; | 17 import '../constants/values.dart' show ConstantValue; |
| 18 import '../dart_types.dart' show DartType, InterfaceType; | 18 import '../dart_types.dart' show DartType, InterfaceType; |
| 19 import '../elements/elements.dart' | 19 import '../elements/elements.dart' |
| 20 show ClassElement, Element, FunctionElement, MethodElement, LibraryElement; | 20 show |
| 21 ClassElement, |
| 22 Element, |
| 23 FunctionElement, |
| 24 MemberElement, |
| 25 MethodElement, |
| 26 LibraryElement; |
| 21 import '../elements/entities.dart'; | 27 import '../elements/entities.dart'; |
| 22 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; | 28 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; |
| 23 import '../io/code_output.dart' show CodeBuffer; | 29 import '../io/code_output.dart' show CodeBuffer; |
| 24 import '../io/source_information.dart' show SourceInformationStrategy; | 30 import '../io/source_information.dart' show SourceInformationStrategy; |
| 25 import '../js_backend/backend_helpers.dart' as js_backend show BackendHelpers; | 31 import '../js_backend/backend_helpers.dart' as js_backend show BackendHelpers; |
| 26 import '../js_backend/js_backend.dart' as js_backend; | 32 import '../js_backend/js_backend.dart' as js_backend; |
| 27 import '../library_loader.dart' show LibraryLoader, LoadedLibraries; | 33 import '../library_loader.dart' show LibraryLoader, LoadedLibraries; |
| 28 import '../native/native.dart' as native show NativeEnqueuer, maybeEnableNative; | 34 import '../native/native.dart' as native show NativeEnqueuer, maybeEnableNative; |
| 29 import '../patch_parser.dart' | 35 import '../patch_parser.dart' |
| 30 show checkNativeAnnotation, checkJsInteropAnnotation; | 36 show checkNativeAnnotation, checkJsInteropAnnotation; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 Uri canonicalUri = library.canonicalUri; | 204 Uri canonicalUri = library.canonicalUri; |
| 199 if (canonicalUri == js_backend.BackendHelpers.DART_JS_HELPER || | 205 if (canonicalUri == js_backend.BackendHelpers.DART_JS_HELPER || |
| 200 canonicalUri == js_backend.BackendHelpers.DART_INTERCEPTORS) { | 206 canonicalUri == js_backend.BackendHelpers.DART_INTERCEPTORS) { |
| 201 return true; | 207 return true; |
| 202 } | 208 } |
| 203 return false; | 209 return false; |
| 204 } | 210 } |
| 205 | 211 |
| 206 /// Called to register that [element] is statically known to be used. Any | 212 /// Called to register that [element] is statically known to be used. Any |
| 207 /// backend specific [WorldImpact] of this is returned. | 213 /// backend specific [WorldImpact] of this is returned. |
| 208 WorldImpact registerUsedElement(Element element, {bool forResolution}) => | 214 WorldImpact registerUsedElement(MemberElement element, |
| 215 {bool forResolution}) => |
| 209 const WorldImpact(); | 216 const WorldImpact(); |
| 210 | 217 |
| 211 /// This method is called immediately after the [LibraryElement] [library] has | 218 /// This method is called immediately after the [LibraryElement] [library] has |
| 212 /// been created. | 219 /// been created. |
| 213 void onLibraryCreated(LibraryElement library) {} | 220 void onLibraryCreated(LibraryElement library) {} |
| 214 | 221 |
| 215 /// This method is called immediately after the [library] and its parts have | 222 /// This method is called immediately after the [library] and its parts have |
| 216 /// been scanned. | 223 /// been scanned. |
| 217 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { | 224 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { |
| 218 // TODO(johnniwinther): Move this to [JavaScriptBackend]. | 225 // TODO(johnniwinther): Move this to [JavaScriptBackend]. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 ClassElement get asyncFutureImplementation; | 413 ClassElement get asyncFutureImplementation; |
| 407 ClassElement get asyncStarStreamImplementation; | 414 ClassElement get asyncStarStreamImplementation; |
| 408 ClassElement get indexableImplementation; | 415 ClassElement get indexableImplementation; |
| 409 ClassElement get mutableIndexableImplementation; | 416 ClassElement get mutableIndexableImplementation; |
| 410 ClassElement get indexingBehaviorImplementation; | 417 ClassElement get indexingBehaviorImplementation; |
| 411 | 418 |
| 412 bool isDefaultEqualityImplementation(Element element); | 419 bool isDefaultEqualityImplementation(Element element); |
| 413 bool isInterceptorClass(ClassElement cls); | 420 bool isInterceptorClass(ClassElement cls); |
| 414 bool isNative(Element element); | 421 bool isNative(Element element); |
| 415 } | 422 } |
| OLD | NEW |