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

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

Issue 2655263002: Rename KernelWorldBuilder to KernelElementAdapter. (Closed)
Patch Set: Created 3 years, 11 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/element_adapter.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.dart » ('j') | 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 ea8dedbf4b127ac463cc01deca9fc15eb29d9ffd..8a4edae6ec05ca317ab1c17694e33b00d343fd38 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -18,6 +18,7 @@ import '../elements/types.dart';
import '../js/js.dart' as js;
import '../js_backend/backend_helpers.dart';
import '../js_backend/js_backend.dart';
+import '../kernel/element_adapter.dart';
import '../kernel/kernel.dart';
import '../kernel/kernel_debug.dart';
import '../native/native.dart' as native;
@@ -34,92 +35,10 @@ import 'jump_handler.dart' show SwitchCaseJumpHandler;
import 'locals_handler.dart';
import 'types.dart';
-/// Interface that translates between Kernel IR nodes and entities.
-abstract class KernelWorldBuilder {
- /// Returns the [DartType] corresponding to [type].
- DartType getDartType(ir.DartType type);
-
- /// Returns the list of [DartType]s corresponding to [types].
- List<DartType> getDartTypes(List<ir.DartType> types);
-
- /// Returns the [InterfaceType] corresponding to [type].
- InterfaceType getInterfaceType(ir.InterfaceType type);
-
- /// Return the [InterfaceType] corresponding to the [cls] with the given
- /// [typeArguments].
- InterfaceType createInterfaceType(
- ir.Class cls, List<ir.DartType> typeArguments);
-
- /// Returns the [CallStructure] corresponding to the [arguments].
- CallStructure getCallStructure(ir.Arguments arguments);
-
- /// Returns the [Selector] corresponding to the invocation or getter/setter
- /// access of [node].
- Selector getSelector(ir.Expression node);
-
- /// Returns the [FunctionEntity] corresponding to the generative or factory
- /// constructor [node].
- FunctionEntity getConstructor(ir.Member node);
-
- /// Returns the [MemberEntity] corresponding to the member [node].
- MemberEntity getMember(ir.Member node);
-
- /// Returns the [FunctionEntity] corresponding to the procedure [node].
- FunctionEntity getMethod(ir.Procedure node);
-
- /// Returns the [FieldEntity] corresponding to the field [node].
- FieldEntity getField(ir.Field node);
-
- /// Returns the [ClassEntity] corresponding to the class [node].
- ClassEntity getClass(ir.Class node);
-
- /// Returns the [Local] corresponding to the [node]. The node must be either
- /// a [ir.FunctionDeclaration] or [ir.FunctionExpression].
- Local getLocalFunction(ir.Node node);
-
- /// Returns the [Name] corresponding to [name].
- Name getName(ir.Name name);
-
- /// Returns `true` is [node] has a `@Native(...)` annotation.
- bool isNativeClass(ir.Class node);
-
- /// Return `true` if [node] is the `dart:_foreign_helper` library.
- bool isForeignLibrary(ir.Library node);
-
- /// Computes the native behavior for reading the native [field].
- native.NativeBehavior getNativeBehaviorForFieldLoad(ir.Field field);
-
- /// Computes the native behavior for writing to the native [field].
- native.NativeBehavior getNativeBehaviorForFieldStore(ir.Field field);
-
- /// Computes the native behavior for calling [procedure].
- native.NativeBehavior getNativeBehaviorForMethod(ir.Procedure procedure);
-
- /// Computes the [native.NativeBehavior] for a call to the [JS] function.
- native.NativeBehavior getNativeBehaviorForJsCall(ir.StaticInvocation node);
-
- /// Computes the [native.NativeBehavior] for a call to the [JS_BUILTIN]
- /// function.
- native.NativeBehavior getNativeBehaviorForJsBuiltinCall(
- ir.StaticInvocation node);
-
- /// Computes the [native.NativeBehavior] for a call to the
- /// [JS_EMBEDDED_GLOBAL] function.
- native.NativeBehavior getNativeBehaviorForJsEmbeddedGlobalCall(
- ir.StaticInvocation node);
-
- /// Compute the kind of foreign helper function called by [node], if any.
- ForeignKind getForeignKind(ir.StaticInvocation node);
-
- /// Computes the [InterfaceType] referenced by a call to the
- /// [JS_INTERCEPTOR_CONSTANT] function, if any.
- InterfaceType getInterfaceTypeForJsInterceptorCall(ir.StaticInvocation node);
-}
-
/// A helper class that abstracts all accesses of the AST from Kernel nodes.
///
/// The goal is to remove all need for the AST from the Kernel SSA builder.
-class KernelAstAdapter implements KernelWorldBuilder {
+class KernelAstAdapter implements KernelElementAdapter {
final Kernel kernel;
final JavaScriptBackend _backend;
final Map<ir.Node, ast.Node> _nodeToAst;
@@ -925,15 +844,6 @@ class KernelAstAdapter implements KernelWorldBuilder {
}
}
-/// Kinds of foreign functions.
-enum ForeignKind {
- JS,
- JS_BUILTIN,
- JS_EMBEDDED_GLOBAL,
- JS_INTERCEPTOR_CONSTANT,
- NONE,
-}
-
/// Visitor that converts kernel dart types into [ResolutionDartType].
class DartTypeConverter extends ir.DartTypeVisitor<ResolutionDartType> {
final KernelAstAdapter astAdapter;
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_adapter.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698