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

Unified Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2686533002: Refactor computation of NativeBehavior. (Closed)
Patch Set: Rebased Created 3 years, 10 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/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index e43efdfe44bea5399e9627cff5e5083aabd86f7e..065b098c0af4d8d4fb3c90efcc02fa47a90a78eb 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -588,30 +588,35 @@ class KernelAstAdapter extends KernelElementAdapterMixin {
return cls.thisType;
}
+ native.BehaviorComputer get nativeBehaviorComputer =>
+ new native.BehaviorComputerImpl(_compiler);
+
/// Computes the native behavior for reading the native [field].
// TODO(johnniwinther): Cache this for later use.
native.NativeBehavior getNativeBehaviorForFieldLoad(ir.Field field) {
ResolutionDartType type = getDartType(field.type);
List<ConstantExpression> metadata = getMetadata(field.annotations);
- return native.NativeBehavior.ofFieldLoad(CURRENT_ELEMENT_SPANNABLE, type,
- metadata, typeLookup(resolveAsRaw: false), _compiler,
+ // TODO(johnniwinther): Provide the correct value for [isJsInterop].
Siggi Cherem (dart-lang) 2017/02/08 17:00:28 was this working before? (are there tests that wil
Johnni Winther 2017/02/10 09:11:45 Same behavior as before (probably not working).
+ return nativeBehaviorComputer.ofFieldLoad(
+ type, metadata, typeLookup(resolveAsRaw: false),
isJsInterop: false);
}
/// Computes the native behavior for writing to the native [field].
// TODO(johnniwinther): Cache this for later use.
native.NativeBehavior getNativeBehaviorForFieldStore(ir.Field field) {
- ResolutionDartType type = getDartType(field.type);
- return native.NativeBehavior.ofFieldStore(type, _compiler.resolution);
+ DartType type = getDartType(field.type);
+ return nativeBehaviorComputer.ofFieldStore(type);
}
/// Computes the native behavior for calling [procedure].
// TODO(johnniwinther): Cache this for later use.
native.NativeBehavior getNativeBehaviorForMethod(ir.Procedure procedure) {
- ResolutionDartType type = getFunctionType(procedure.function);
+ DartType type = getFunctionType(procedure.function);
List<ConstantExpression> metadata = getMetadata(procedure.annotations);
- return native.NativeBehavior.ofMethod(CURRENT_ELEMENT_SPANNABLE, type,
- metadata, typeLookup(resolveAsRaw: false), _compiler,
+ // TODO(johnniwinther): Provide the correct value for [isJsInterop].
+ return nativeBehaviorComputer.ofMethod(
+ type, metadata, typeLookup(resolveAsRaw: false),
isJsInterop: false);
}
« pkg/compiler/lib/src/native/behavior.dart ('K') | « pkg/compiler/lib/src/native/enqueue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698