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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1896843002: Store and serialize NativeBehavior in TreeElements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 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
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 1c4df41cc3329ef7b377ff679a46f6fab1a8c5c2..a7d67ddae81557e377bf87e4ff3c8068ed61cfeb 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -1294,16 +1294,16 @@ class JavaScriptBackend extends Backend {
}
/// Called when resolving a call to a foreign function.
- void registerForeignCall(Send node, Element element,
+ native.NativeBehavior resolveForeignCall(Send node, Element element,
CallStructure callStructure, ForeignResolver resolver) {
native.NativeResolutionEnqueuer nativeEnqueuer =
compiler.enqueuer.resolution.nativeEnqueuer;
if (element.name == 'JS') {
- nativeEnqueuer.registerJsCall(node, resolver);
+ return nativeEnqueuer.resolveJsCall(node, resolver);
} else if (element.name == 'JS_EMBEDDED_GLOBAL') {
- nativeEnqueuer.registerJsEmbeddedGlobalCall(node, resolver);
+ return nativeEnqueuer.resolveJsEmbeddedGlobalCall(node, resolver);
} else if (element.name == 'JS_BUILTIN') {
- nativeEnqueuer.registerJsBuiltinCall(node, resolver);
+ return nativeEnqueuer.resolveJsBuiltinCall(node, resolver);
} else if (element.name == 'JS_INTERCEPTOR_CONSTANT') {
// The type constant that is an argument to JS_INTERCEPTOR_CONSTANT names
// a class that will be instantiated outside the program by attaching a
@@ -1315,13 +1315,16 @@ class JavaScriptBackend extends Backend {
TypeConstantExpression typeConstant = constant;
if (typeConstant.type is InterfaceType) {
resolver.registerInstantiatedType(typeConstant.type);
- return;
+ // No native behavior for this call.
+ return null;
}
}
}
reporter.reportErrorMessage(
node, MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
}
+ // No native behavior for this call.
+ return null;
}
void enableNoSuchMethod(Enqueuer world) {
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/js_backend/backend_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698