Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: pkg/compiler/lib/src/common/backend_api.dart

Issue 1384523003: Refactor resolution of foreign calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/backend_api.dart
diff --git a/pkg/compiler/lib/src/common/backend_api.dart b/pkg/compiler/lib/src/common/backend_api.dart
index 487f01d4cb6f0daac9c3bc005341636d41428131..b4425f5a33c4836764956478cdabb55aeaae3731 100644
--- a/pkg/compiler/lib/src/common/backend_api.dart
+++ b/pkg/compiler/lib/src/common/backend_api.dart
@@ -11,6 +11,8 @@ import '../compiler.dart' show
import '../compile_time_constants.dart' show
BackendConstantEnvironment,
ConstantCompilerTask;
+import '../constants/expressions.dart' show
+ ConstantExpression;
import '../constants/constant_system.dart' show
ConstantSystem;
import '../constants/values.dart' show
@@ -48,6 +50,11 @@ import '../patch_parser.dart' show
checkNativeAnnotation;
import '../resolution/tree_elements.dart' show
TreeElements;
+import '../tree/tree.dart' show
+ Node,
+ Send;
+import '../universe/call_structure.dart' show
+ CallStructure;
import 'codegen.dart' show
CodegenWorkItem;
@@ -375,5 +382,23 @@ abstract class Backend {
void registerAsyncMarker(FunctionElement element,
Enqueuer enqueuer,
Registry registry) {}
+
+ /// Called when resolving a call to a foreign function.
+ void registerForeignCall(Send node,
+ Element element,
+ CallStructure callStructure,
+ ForeignResolver resolver) {}
}
+/// Interface for resolving calls to foreign functions.
+abstract class ForeignResolver {
+ /// Returns the constant expression of [node], or `null` if [node] is not
+ /// a constant expression.
+ ConstantExpression getConstant(Node node);
+
+ /// Registers [type] as instantiated.
+ void registerInstantiatedType(InterfaceType type);
+
+ /// Resolves [typeName] to a type in the context of [node].
+ DartType resolveTypeFromString(Node node, String typeName);
+}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698