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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 759193005: Add support for fields to the new dart backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 6 years, 1 month 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
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index 4e0bb8031b7e16b6581f763ecec6855aaa87b72d..d5bad5dbef60864dcb65d8fc50635e5cd30f4be0 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -191,12 +191,12 @@ class IrBuilderSharedState {
final Iterable<Entity> closureLocals;
- final FunctionElement currentFunction;
+ final ExecutableElement currentElement;
final ir.Continuation returnContinuation = new ir.Continuation.retrn();
IrBuilderSharedState(this.constantSystem,
- this.currentFunction,
+ this.currentElement,
this.closureLocals);
}
@@ -240,10 +240,10 @@ class IrBuilder {
ir.Expression _current = null;
IrBuilder(ConstantSystem constantSystem,
- FunctionElement currentFunction,
+ ExecutableElement currentElement,
Iterable<Entity> closureLocals)
: this.state = new IrBuilderSharedState(
- constantSystem, currentFunction, closureLocals),
+ constantSystem, currentElement, closureLocals),
this.environment = new Environment.empty();
/// Construct a delimited visitor for visiting a subtree.
@@ -533,13 +533,21 @@ class IrBuilder {
_current = null;
}
+ /// Create a [ir.FieldDefinition] for the current [Element] using [_root] as
+ /// the body.
+ ir.FieldDefinition makeFieldDefinition() {
+ return new ir.FieldDefinition(state.currentElement,
+ state.returnContinuation,
+ _root);
+ }
+
/// Create a [ir.FunctionDefinition] for [element] using [_root] as the body.
///
/// Parameters must be created before the construction of the body using
/// [createParameter].
ir.FunctionDefinition buildFunctionDefinition(
- FunctionElement element,
List<ConstantExpression> defaults) {
+ FunctionElement element = state.currentElement;
if (element.isAbstract || element.isExternal) {
assert(invariant(element, _root == null,
message: "Non-empty body for abstract method $element: $_root"));
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/constant_propagation.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698