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

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

Issue 977553004: Translate constructors without bad references. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long line Created 5 years, 10 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 | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b0bc57c952d98caeae7607b22b66fad27d4a147b..acceaa517b3ba42cc3258952492f50137f7cef74 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -368,6 +368,14 @@ abstract class IrBuilder {
..environment = new Environment.from(environment);
}
+ /// Construct a builder for making constructor field initializers.
+ IrBuilder makeInitializerBuilder() {
+ return _makeInstance()
+ ..state = new IrBuilderDelimitedState(state.constantSystem,
+ state.currentElement)
+ ..environment = new Environment.from(environment);
+ }
+
/// Construct a visitor for a recursive continuation.
///
/// The recursive continuation builder has fresh parameters (i.e. SSA phis)
@@ -666,18 +674,23 @@ abstract class IrBuilder {
}
}
+ /// Create a constructor definition without a body, for representing
+ /// external constructors declarations.
+ ir.ConstructorDefinition makeAbstractConstructorDefinition(
+ List<ConstantExpression> defaults) {
+ FunctionElement element = state.currentElement;
+ assert(invariant(element, _root == null,
+ message: "Non-empty body for external constructor $element: $_root"));
+ assert(invariant(element, state.localConstants.isEmpty,
+ message: "Local constants for external constructor $element: "
+ "${state.localConstants}"));
+ return new ir.ConstructorDefinition.abstract(
+ element, state.functionParameters, defaults);
+ }
+
ir.ConstructorDefinition makeConstructorDefinition(
List<ConstantExpression> defaults, List<ir.Initializer> initializers) {
FunctionElement element = state.currentElement;
- if (element.isExternal) {
- assert(invariant(element, _root == null,
- message: "Non-empty body for external constructor $element: $_root"));
- assert(invariant(element, state.localConstants.isEmpty,
- message: "Local constants for external constructor $element: "
- "${state.localConstants}"));
- return new ir.ConstructorDefinition.abstract(
- element, state.functionParameters, defaults);
- }
ir.RunnableBody body = makeRunnableBody();
return new ir.ConstructorDefinition(
element, state.functionParameters, body, initializers,
« no previous file with comments | « no previous file | 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