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

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

Issue 2335203005: kernel -> ssa: implement literal maps (Closed)
Patch Set: Created 4 years, 3 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/ssa/builder_kernel.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 ab50d3155c4a291d166770e61c463686da9f5289..a1294a53e4d17c2f4a99e3f55911f1d81cf3636d 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -10,46 +10,40 @@ import '../constants/values.dart';
import '../dart_types.dart';
import '../elements/elements.dart';
import '../js_backend/js_backend.dart';
+import '../kernel/kernel.dart';
import '../resolution/tree_elements.dart';
import '../tree/tree.dart' as ast;
import '../types/masks.dart';
import '../universe/call_structure.dart';
import '../universe/selector.dart';
import '../universe/side_effects.dart';
-
import 'types.dart';
/// 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 {
+ final Kernel kernel;
final JavaScriptBackend _backend;
final ResolvedAst _resolvedAst;
final Map<ir.Node, ast.Node> _nodeToAst;
final Map<ir.Node, Element> _nodeToElement;
DartTypeConverter _typeConverter;
- KernelAstAdapter(
- this._backend,
- this._resolvedAst,
- this._nodeToAst,
- this._nodeToElement,
- Map<FieldElement, ir.Field> fields,
- Map<FunctionElement, ir.Member> functions,
- Map<ClassElement, ir.Class> classes,
- Map<LibraryElement, ir.Library> libraries) {
+ KernelAstAdapter(this.kernel, this._backend, this._resolvedAst,
+ this._nodeToAst, this._nodeToElement) {
// TODO(het): Maybe just use all of the kernel maps directly?
- for (FieldElement fieldElement in fields.keys) {
- _nodeToElement[fields[fieldElement]] = fieldElement;
+ for (FieldElement fieldElement in kernel.fields.keys) {
+ _nodeToElement[kernel.fields[fieldElement]] = fieldElement;
}
- for (FunctionElement functionElement in functions.keys) {
- _nodeToElement[functions[functionElement]] = functionElement;
+ for (FunctionElement functionElement in kernel.functions.keys) {
+ _nodeToElement[kernel.functions[functionElement]] = functionElement;
}
- for (ClassElement classElement in classes.keys) {
- _nodeToElement[classes[classElement]] = classElement;
+ for (ClassElement classElement in kernel.classes.keys) {
+ _nodeToElement[kernel.classes[classElement]] = classElement;
}
- for (LibraryElement libraryElement in libraries.keys) {
- _nodeToElement[libraries[libraryElement]] = libraryElement;
+ for (LibraryElement libraryElement in kernel.libraries.keys) {
+ _nodeToElement[kernel.libraries[libraryElement]] = libraryElement;
}
_typeConverter = new DartTypeConverter(this);
}
@@ -163,6 +157,12 @@ class KernelAstAdapter {
return _backend.isInterceptedSelector(selector);
}
+ ir.Procedure get mapLiteralConstructor =>
+ kernel.functions[_backend.helpers.mapLiteralConstructor];
+
+ ir.Procedure get mapLiteralConstructorEmpty =>
+ kernel.functions[_backend.helpers.mapLiteralConstructorEmpty];
+
DartType getDartType(ir.DartType type) {
return type.accept(_typeConverter);
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.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