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

Unified Diff: pkg/compiler/lib/src/native/behavior.dart

Issue 2813093002: Remove BackendClasses and JavaScriptBackendClasses. (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/kernel/world_builder.dart ('k') | pkg/compiler/lib/src/native/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/native/behavior.dart
diff --git a/pkg/compiler/lib/src/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart
index 936c8c7dd10f6d7f5b0a9f22b0fbd858682a89d4..e58b277e6208a06481cebf8588873d4ef9beed5e 100644
--- a/pkg/compiler/lib/src/native/behavior.dart
+++ b/pkg/compiler/lib/src/native/behavior.dart
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import '../common.dart';
-import '../common/backend_api.dart' show BackendClasses, ForeignResolver;
+import '../common/backend_api.dart' show ForeignResolver;
import '../common/resolution.dart' show ParsingContext, Resolution;
import '../compiler.dart' show Compiler;
import '../compile_time_constants.dart' show ConstantEnvironment;
@@ -15,6 +15,7 @@ import '../elements/entities.dart';
import '../elements/resolution_types.dart';
import '../elements/types.dart';
import '../js/js.dart' as js;
+import '../js_backend/native_data.dart' show NativeData;
import '../tree/tree.dart';
import '../universe/side_effects.dart' show SideEffects;
import '../util/util.dart';
@@ -775,7 +776,8 @@ class NativeBehavior {
metadata.add(annotation.constant);
}
- BehaviorBuilder builder = new ResolverBehaviorBuilder(compiler);
+ BehaviorBuilder builder =
+ new ResolverBehaviorBuilder(compiler, compiler.backend.nativeData);
return builder.buildMethodBehavior(
type, metadata, lookupFromElement(compiler.resolution, element),
isJsInterop: isJsInterop);
@@ -792,7 +794,8 @@ class NativeBehavior {
metadata.add(annotation.constant);
}
- BehaviorBuilder builder = new ResolverBehaviorBuilder(compiler);
+ BehaviorBuilder builder =
+ new ResolverBehaviorBuilder(compiler, compiler.backend.nativeData);
return builder.buildFieldLoadBehavior(
type, metadata, lookupFromElement(resolution, element),
isJsInterop: isJsInterop);
@@ -800,7 +803,8 @@ class NativeBehavior {
static NativeBehavior ofFieldElementStore(
MemberElement field, Compiler compiler) {
- BehaviorBuilder builder = new ResolverBehaviorBuilder(compiler);
+ BehaviorBuilder builder =
+ new ResolverBehaviorBuilder(compiler, compiler.backend.nativeData);
ResolutionDartType type = field.computeType(compiler.resolution);
return builder.buildFieldStoreBehavior(type);
}
@@ -846,9 +850,9 @@ class NativeBehavior {
abstract class BehaviorBuilder {
CommonElements get commonElements;
- BackendClasses get backendClasses;
DiagnosticReporter get reporter;
ConstantEnvironment get constants;
+ NativeData get nativeData;
bool get trustJSInteropTypeAnnotations;
Resolution get resolution => null;
@@ -946,8 +950,7 @@ abstract class BehaviorBuilder {
if (!isInterop) {
_behavior.typesInstantiated.add(type);
} else {
- if (type is InterfaceType &&
- backendClasses.isNativeClass(type.element)) {
+ if (type is InterfaceType && nativeData.isNativeClass(type.element)) {
// Any declared native or interop type (isNative implies isJsInterop)
// is assumed to be allocated.
_behavior.typesInstantiated.add(type);
@@ -1035,8 +1038,9 @@ abstract class BehaviorBuilder {
class ResolverBehaviorBuilder extends BehaviorBuilder {
final Compiler compiler;
+ final NativeData nativeData;
- ResolverBehaviorBuilder(this.compiler);
+ ResolverBehaviorBuilder(this.compiler, this.nativeData);
@override
CommonElements get commonElements => compiler.commonElements;
@@ -1052,8 +1056,5 @@ class ResolverBehaviorBuilder extends BehaviorBuilder {
DiagnosticReporter get reporter => compiler.reporter;
@override
- BackendClasses get backendClasses => compiler.backend.backendClasses;
-
- @override
Resolution get resolution => compiler.resolution;
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/world_builder.dart ('k') | pkg/compiler/lib/src/native/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698