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

Unified Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 831133004: Use closure conversion in new dart2js backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 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 | « no previous file | pkg/compiler/lib/src/closure.dart » ('j') | pkg/compiler/lib/src/closure.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/lib/src/cps_generator.dart
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index 7efa4230461449f143e5dbec2adc3d6d24876d7f..0bb9520e86f474f9bbb43c1fdfe119e59de12a87 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -65,11 +65,12 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
analyzer.PropertyInducingElement field, VariableDeclaration node) {
dart2js.FieldElement element = converter.convertElement(field);
return withBuilder(
- new IrBuilder(DART_CONSTANT_SYSTEM,
+ new DartIrBuilder(DART_CONSTANT_SYSTEM,
element,
Kevin Millikin (Google) 2015/01/13 08:25:36 The arguments were aligned before, now they're off
asgerf 2015/01/13 10:04:26 Thanks
// TODO(johnniwinther): Supported closure variables.
- const <dart2js.Local>[]),
+ new NullClosureVariableInfo()),
() {
+ irBuilder.beginField();
ir.Primitive initializer = build(node.initializer);
return irBuilder.makeFieldDefinition(initializer);
});
@@ -79,16 +80,13 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
analyzer.FunctionElement function, FunctionExpression node) {
dart2js.FunctionElement element = converter.convertElement(function);
return withBuilder(
- new IrBuilder(DART_CONSTANT_SYSTEM,
+ new DartIrBuilder(DART_CONSTANT_SYSTEM,
element,
Kevin Millikin (Google) 2015/01/13 08:25:36 Same: 4-space indent.
// TODO(johnniwinther): Supported closure variables.
- const <dart2js.Local>[]),
+ new NullClosureVariableInfo()),
() {
- function.parameters.forEach((analyzer.ParameterElement parameter) {
- // TODO(johnniwinther): Support "closure variables", that is variables
- // accessed from an inner function.
- irBuilder.createFunctionParameter(converter.convertElement(parameter));
- });
+ irBuilder.beginFunction(
+ function.parameters.map(converter.convertElement));
// Visit the body directly to avoid processing the signature as
// expressions.
visit(node.body);
@@ -521,3 +519,7 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
isTypeTest: false);
}
}
+
+class NullClosureVariableInfo extends ClosureVariableInfo {
+ Iterable get capturedVariables => const [];
+}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/closure.dart » ('j') | pkg/compiler/lib/src/closure.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698