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

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel_visitor.dart

Issue 2377813002: kernel->ssa: implement for-in loops (Closed)
Patch Set: fix another import Created 4 years, 2 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 import 'package:kernel/frontend/accessors.dart' 6 import 'package:kernel/frontend/accessors.dart'
7 show 7 show
8 Accessor, 8 Accessor,
9 IndexAccessor, 9 IndexAccessor,
10 NullAwarePropertyAccessor, 10 NullAwarePropertyAccessor,
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 } 429 }
430 430
431 ir.Statement buildForInCommon( 431 ir.Statement buildForInCommon(
432 ForIn node, ir.VariableDeclaration variable, ir.Statement body, 432 ForIn node, ir.VariableDeclaration variable, ir.Statement body,
433 {bool isAsync}) { 433 {bool isAsync}) {
434 ir.Expression iterable = visitForValue(node.expression); 434 ir.Expression iterable = visitForValue(node.expression);
435 JumpTarget jumpTarget = elements.getTargetDefinition(node); 435 JumpTarget jumpTarget = elements.getTargetDefinition(node);
436 body = buildContinueTarget(body, node, jumpTarget); 436 body = buildContinueTarget(body, node, jumpTarget);
437 return buildBreakTarget( 437 return buildBreakTarget(
438 new ir.ForInStatement(variable, iterable, body, isAsync: isAsync), 438 associateNode(
439 new ir.ForInStatement(variable, iterable, body, isAsync: isAsync),
440 node),
439 node, 441 node,
440 jumpTarget); 442 jumpTarget);
441 } 443 }
442 444
443 /// Builds a for-in statement for this case: 445 /// Builds a for-in statement for this case:
444 /// 446 ///
445 /// for (constOrVarOrType loopVariable in expression) body 447 /// for (constOrVarOrType loopVariable in expression) body
446 ir.Statement buildForInWithDeclaration( 448 ir.Statement buildForInWithDeclaration(
447 ForIn node, VariableDefinitions declaration, 449 ForIn node, VariableDefinitions declaration,
448 {bool isAsync}) { 450 {bool isAsync}) {
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 : this(null, true, node, initializers); 2776 : this(null, true, node, initializers);
2775 2777
2776 accept(ir.Visitor v) => throw "unsupported"; 2778 accept(ir.Visitor v) => throw "unsupported";
2777 2779
2778 visitChildren(ir.Visitor v) => throw "unsupported"; 2780 visitChildren(ir.Visitor v) => throw "unsupported";
2779 2781
2780 String toString() { 2782 String toString() {
2781 return "IrFunction($kind, $isConstructor, $node, $initializers)"; 2783 return "IrFunction($kind, $isConstructor, $node, $initializers)";
2782 } 2784 }
2783 } 2785 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698