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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1001793002: dart2js: Add support for do/while loops to the CPS backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Ummm, semicolon? Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import '../closure.dart' as closurelib; 7 import '../closure.dart' as closurelib;
8 import '../closure.dart' hide ClosureScope; 8 import '../closure.dart' hide ClosureScope;
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (body is ast.Loop) { 367 if (body is ast.Loop) {
368 visit(body); 368 visit(body);
369 } else { 369 } else {
370 JumpTarget target = elements.getTargetDefinition(body); 370 JumpTarget target = elements.getTargetDefinition(body);
371 irBuilder.buildLabeledStatement( 371 irBuilder.buildLabeledStatement(
372 buildBody: subbuild(body), 372 buildBody: subbuild(body),
373 target: target); 373 target: target);
374 } 374 }
375 } 375 }
376 376
377 visitDoWhile(ast.DoWhile node) {
378 irBuilder.buildDoWhile(
379 buildBody: subbuild(node.body),
380 buildCondition: subbuild(node.condition),
381 target: elements.getTargetDefinition(node),
382 closureScope: getClosureScopeForNode(node));
383 }
384
377 visitWhile(ast.While node) { 385 visitWhile(ast.While node) {
378 irBuilder.buildWhile( 386 irBuilder.buildWhile(
379 buildCondition: subbuild(node.condition), 387 buildCondition: subbuild(node.condition),
380 buildBody: subbuild(node.body), 388 buildBody: subbuild(node.body),
381 target: elements.getTargetDefinition(node), 389 target: elements.getTargetDefinition(node),
382 closureScope: getClosureScopeForNode(node)); 390 closureScope: getClosureScopeForNode(node));
383 } 391 }
384 392
385 visitForIn(ast.ForIn node) { 393 visitForIn(ast.ForIn node) {
386 // [node.declaredIdentifier] can be either an [ast.VariableDefinitions] 394 // [node.declaredIdentifier] can be either an [ast.VariableDefinitions]
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 SourceInformation buildCall(ast.Node node) { 1851 SourceInformation buildCall(ast.Node node) {
1844 return new PositionSourceInformation( 1852 return new PositionSourceInformation(
1845 new TokenSourceLocation(sourceFile, node.getBeginToken(), name)); 1853 new TokenSourceLocation(sourceFile, node.getBeginToken(), name));
1846 } 1854 }
1847 1855
1848 @override 1856 @override
1849 SourceInformationBuilder forContext(AstElement element) { 1857 SourceInformationBuilder forContext(AstElement element) {
1850 return new PositionSourceInformationBuilder(element); 1858 return new PositionSourceInformationBuilder(element);
1851 } 1859 }
1852 } 1860 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698