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

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

Issue 2686533002: Refactor computation of NativeBehavior. (Closed)
Patch Set: Updated cf. comments. 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
« no previous file with comments | « pkg/compiler/lib/src/native/enqueue.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ae0f6b90d2e6987e26cb5a797b43edc9b567335a 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.BehaviorBuilder get nativeBehaviorBuilder =>
+ new native.ResolverBehaviorBuilder(_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].
+ return nativeBehaviorBuilder.buildFieldLoadBehavior(
+ 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 nativeBehaviorBuilder.buildFieldStoreBehavior(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 nativeBehaviorBuilder.buildMethodBehavior(
+ type, metadata, typeLookup(resolveAsRaw: false),
isJsInterop: false);
}
« no previous file with comments | « 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