1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 20:16:39 +00:00

[dart2js] Move ClassTypeVariableAccess to own file

Moving this enum to its own file breaks a dependency of the element
maps on SSA.

Change-Id: If66d1ddf0af6ccdc5380b4f65d5e447e3cebd8de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248081
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2022-06-13 16:53:57 +00:00 committed by Commit Bot
parent 484a80d5cb
commit 1c442cf9f0
8 changed files with 34 additions and 29 deletions

View File

@ -0,0 +1,25 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Enum that defines how a member has access to the current type variables.
enum ClassTypeVariableAccess {
/// The member has no access to type variables.
none,
/// Type variables are accessible as a property on `this`.
property,
/// Type variables are accessible as parameters in the current context.
parameter,
/// If the current context is a generative constructor, type variables are
/// accessible as parameters, otherwise type variables are accessible as
/// a property on `this`.
///
/// This is used for instance fields whose initializers are executed in the
/// constructors.
// TODO(johnniwinther): Avoid the need for this by adding a field-setter
// to the J-model.
instanceField,
}

View File

@ -15,11 +15,11 @@ import '../ir/closure.dart';
import '../ir/element_map.dart';
import '../ir/static_type_cache.dart';
import '../js_backend/annotations.dart';
import '../js_model/class_type_variable_access.dart';
import '../js_model/element_map.dart';
import '../js_model/env.dart';
import '../ordered_typeset.dart';
import '../serialization/serialization.dart';
import '../ssa/type_builder.dart';
import '../universe/selector.dart';
import 'elements.dart';
import 'js_world_builder.dart' show JsClosedWorldBuilder;

View File

@ -17,10 +17,10 @@ import '../inferrer/abstract_value_domain.dart';
import '../ir/closure.dart';
import '../ir/static_type_provider.dart';
import '../ir/util.dart';
import '../js_model/class_type_variable_access.dart';
import '../js_model/elements.dart' show JGeneratorBody;
import '../native/behavior.dart';
import '../serialization/serialization.dart';
import '../ssa/type_builder.dart';
import '../universe/call_structure.dart';
import '../universe/selector.dart';
import '../world.dart';

View File

@ -38,6 +38,7 @@ import '../ir/static_type_provider.dart';
import '../ir/util.dart';
import '../js_backend/annotations.dart';
import '../js_backend/native_data.dart';
import '../js_model/class_type_variable_access.dart';
import '../kernel/dart2js_target.dart' show allowedNativeTest;
import '../kernel/element_map.dart';
import '../kernel/env.dart';
@ -46,7 +47,6 @@ import '../native/behavior.dart';
import '../options.dart';
import '../ordered_typeset.dart';
import '../serialization/serialization.dart';
import '../ssa/type_builder.dart';
import '../universe/call_structure.dart';
import '../universe/member_usage.dart';
import '../universe/selector.dart';

View File

@ -15,9 +15,9 @@ import '../elements/types.dart';
import '../ir/element_map.dart';
import '../ir/static_type_cache.dart';
import '../ir/util.dart';
import '../js_model/class_type_variable_access.dart';
import '../ordered_typeset.dart';
import '../serialization/serialization.dart';
import '../ssa/type_builder.dart';
import 'closure.dart';
import 'element_map.dart';
import 'element_map_impl.dart';

View File

@ -20,10 +20,10 @@ import '../elements/types.dart';
import '../ir/element_map.dart';
import '../ir/static_type_cache.dart';
import '../ir/util.dart';
import '../js_model/class_type_variable_access.dart';
import '../js_model/element_map.dart';
import '../js_model/env.dart';
import '../ordered_typeset.dart';
import '../ssa/type_builder.dart';
import '../universe/member_usage.dart';
import 'element_map.dart';

View File

@ -39,10 +39,11 @@ import '../js_backend/namer.dart' show ModularNamer;
import '../js_backend/native_data.dart';
import '../js_backend/runtime_types_resolution.dart';
import '../js_emitter/code_emitter_task.dart' show ModularEmitter;
import '../js_model/locals.dart' show GlobalLocalsMap, JumpVisitor;
import '../js_model/elements.dart' show JGeneratorBody;
import '../js_model/class_type_variable_access.dart';
import '../js_model/element_map.dart';
import '../js_model/elements.dart' show JGeneratorBody;
import '../js_model/js_strategy.dart';
import '../js_model/locals.dart' show GlobalLocalsMap, JumpVisitor;
import '../js_model/type_recipe.dart';
import '../kernel/invocation_mirror_constants.dart';
import '../native/behavior.dart';

View File

@ -9,34 +9,13 @@ import 'nodes.dart';
import '../elements/entities.dart';
import '../elements/types.dart';
import '../inferrer/abstract_value_domain.dart';
import '../js_model/class_type_variable_access.dart';
import '../js_model/type_recipe.dart';
import '../io/source_information.dart';
import '../options.dart';
import '../universe/use.dart' show TypeUse;
import '../world.dart';
/// Enum that defines how a member has access to the current type variables.
enum ClassTypeVariableAccess {
/// The member has no access to type variables.
none,
/// Type variables are accessible as a property on `this`.
property,
/// Type variables are accessible as parameters in the current context.
parameter,
/// If the current context is a generative constructor, type variables are
/// accessible as parameters, otherwise type variables are accessible as
/// a property on `this`.
///
/// This is used for instance fields whose initializers are executed in the
/// constructors.
// TODO(johnniwinther): Avoid the need for this by adding a field-setter
// to the J-model.
instanceField,
}
/// Functions to insert type checking, coercion, and instruction insertion
/// depending on the environment for dart code.
abstract class TypeBuilder {