| 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 '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| 11 import '../compile_time_constants.dart' show | 11 import '../compile_time_constants.dart' show |
| 12 BackendConstantEnvironment, | 12 BackendConstantEnvironment, |
| 13 ConstantCompilerTask; | 13 ConstantCompilerTask; |
| 14 import '../constants/expressions.dart' show |
| 15 ConstantExpression; |
| 14 import '../constants/constant_system.dart' show | 16 import '../constants/constant_system.dart' show |
| 15 ConstantSystem; | 17 ConstantSystem; |
| 16 import '../constants/values.dart' show | 18 import '../constants/values.dart' show |
| 17 ConstantValue; | 19 ConstantValue; |
| 18 import '../dart_types.dart' show | 20 import '../dart_types.dart' show |
| 19 DartType, | 21 DartType, |
| 20 InterfaceType; | 22 InterfaceType; |
| 21 import '../diagnostics/spannable.dart' show | 23 import '../diagnostics/spannable.dart' show |
| 22 Spannable, | 24 Spannable, |
| 23 SpannableAssertionFailure; | 25 SpannableAssertionFailure; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 JavaScriptBackend; | 43 JavaScriptBackend; |
| 42 import '../library_loader.dart' show | 44 import '../library_loader.dart' show |
| 43 LibraryLoader, | 45 LibraryLoader, |
| 44 LoadedLibraries; | 46 LoadedLibraries; |
| 45 import '../native/native.dart' as native show | 47 import '../native/native.dart' as native show |
| 46 NativeEnqueuer; | 48 NativeEnqueuer; |
| 47 import '../patch_parser.dart' show | 49 import '../patch_parser.dart' show |
| 48 checkNativeAnnotation; | 50 checkNativeAnnotation; |
| 49 import '../resolution/tree_elements.dart' show | 51 import '../resolution/tree_elements.dart' show |
| 50 TreeElements; | 52 TreeElements; |
| 53 import '../tree/tree.dart' show |
| 54 Node, |
| 55 Send; |
| 56 import '../universe/call_structure.dart' show |
| 57 CallStructure; |
| 51 | 58 |
| 52 import 'codegen.dart' show | 59 import 'codegen.dart' show |
| 53 CodegenWorkItem; | 60 CodegenWorkItem; |
| 54 import 'registry.dart' show | 61 import 'registry.dart' show |
| 55 Registry; | 62 Registry; |
| 56 import 'resolution.dart' show | 63 import 'resolution.dart' show |
| 57 ResolutionCallbacks; | 64 ResolutionCallbacks; |
| 58 import 'tasks.dart' show | 65 import 'tasks.dart' show |
| 59 CompilerTask; | 66 CompilerTask; |
| 60 import 'work.dart' show | 67 import 'work.dart' show |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 375 |
| 369 FunctionElement helperForMainArity() => null; | 376 FunctionElement helperForMainArity() => null; |
| 370 | 377 |
| 371 void forgetElement(Element element) {} | 378 void forgetElement(Element element) {} |
| 372 | 379 |
| 373 void registerMainHasArguments(Enqueuer enqueuer) {} | 380 void registerMainHasArguments(Enqueuer enqueuer) {} |
| 374 | 381 |
| 375 void registerAsyncMarker(FunctionElement element, | 382 void registerAsyncMarker(FunctionElement element, |
| 376 Enqueuer enqueuer, | 383 Enqueuer enqueuer, |
| 377 Registry registry) {} | 384 Registry registry) {} |
| 385 |
| 386 /// Called when resolving a call to a foreign function. |
| 387 void registerForeignCall(Send node, |
| 388 Element element, |
| 389 CallStructure callStructure, |
| 390 ForeignResolver resolver) {} |
| 378 } | 391 } |
| 379 | 392 |
| 393 /// Interface for resolving calls to foreign functions. |
| 394 abstract class ForeignResolver { |
| 395 /// Returns the constant expression of [node], or `null` if [node] is not |
| 396 /// a constant expression. |
| 397 ConstantExpression getConstant(Node node); |
| 398 |
| 399 /// Registers [type] as instantiated. |
| 400 void registerInstantiatedType(InterfaceType type); |
| 401 |
| 402 /// Resolves [typeName] to a type in the context of [node]. |
| 403 DartType resolveTypeFromString(Node node, String typeName); |
| 404 } |
| OLD | NEW |