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

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: Removed redundant null-check 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') | no next file with comments »
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..369b5da89604245935560a5fa38d8bd2465690a2 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,
- element,
- // TODO(johnniwinther): Supported closure variables.
- const <dart2js.Local>[]),
+ new DartIrBuilder(DART_CONSTANT_SYSTEM,
+ element,
+ // TODO(johnniwinther): Supported closure variables.
+ new NullClosureVariableInfo()),
() {
+ irBuilder.buildFieldInitializerHeader();
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,
- element,
- // TODO(johnniwinther): Supported closure variables.
- const <dart2js.Local>[]),
+ new DartIrBuilder(DART_CONSTANT_SYSTEM,
+ element,
+ // TODO(johnniwinther): Supported closure variables.
+ 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.buildFunctionHeader(
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698