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

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

Issue 2954663002: Handle break as continue (Closed)
Patch Set: Add comments Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'package:js_runtime/shared/embedded_names.dart'; 5 import 'package:js_runtime/shared/embedded_names.dart';
6 import 'package:kernel/ast.dart' as ir; 6 import 'package:kernel/ast.dart' as ir;
7 7
8 import '../closure.dart'; 8 import '../closure.dart';
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 1071
1072 /// Call to notify that [member] is no longer being inlined. 1072 /// Call to notify that [member] is no longer being inlined.
1073 void leaveInlinedMember(covariant MemberEntity member); 1073 void leaveInlinedMember(covariant MemberEntity member);
1074 1074
1075 /// Returns the [Local] for [node]. 1075 /// Returns the [Local] for [node].
1076 Local getLocal(ir.VariableDeclaration node); 1076 Local getLocal(ir.VariableDeclaration node);
1077 1077
1078 /// Returns the [JumpTarget] for the break statement [node]. 1078 /// Returns the [JumpTarget] for the break statement [node].
1079 JumpTarget getJumpTargetForBreak(ir.BreakStatement node); 1079 JumpTarget getJumpTargetForBreak(ir.BreakStatement node);
1080 1080
1081 /// Returns `true` if [node] should generate a `continue` to its [JumpTarget].
1082 bool generateContinueForBreak(ir.BreakStatement node);
1083
1081 /// Returns the [JumpTarget] defined by the labelled statement [node] or 1084 /// Returns the [JumpTarget] defined by the labelled statement [node] or
1082 /// `null` if [node] is not a jump target. 1085 /// `null` if [node] is not a jump target.
1083 JumpTarget getJumpTargetForLabel(ir.LabeledStatement node); 1086 JumpTarget getJumpTargetForLabel(ir.LabeledStatement node);
1084 1087
1085 /// Returns the [JumpTarget] defined by the switch statement [node] or `null` 1088 /// Returns the [JumpTarget] defined by the switch statement [node] or `null`
1086 /// if [node] is not a jump target. 1089 /// if [node] is not a jump target.
1087 JumpTarget getJumpTargetForSwitch(ir.SwitchStatement node); 1090 JumpTarget getJumpTargetForSwitch(ir.SwitchStatement node);
1088 1091
1089 /// Returns the [JumpTarget] for the continue switch statement [node]. 1092 /// Returns the [JumpTarget] for the continue switch statement [node].
1090 JumpTarget getJumpTargetForContinueSwitch(ir.ContinueSwitchStatement node); 1093 JumpTarget getJumpTargetForContinueSwitch(ir.ContinueSwitchStatement node);
(...skipping 22 matching lines...) Expand all
1113 /// [closureClassMaps]. 1116 /// [closureClassMaps].
1114 LoopClosureRepresentationInfo getClosureRepresentationInfoForLoop( 1117 LoopClosureRepresentationInfo getClosureRepresentationInfoForLoop(
1115 ClosureDataLookup closureLookup, ir.TreeNode node); 1118 ClosureDataLookup closureLookup, ir.TreeNode node);
1116 } 1119 }
1117 1120
1118 /// Comparator for the canonical order or named arguments. 1121 /// Comparator for the canonical order or named arguments.
1119 // TODO(johnniwinther): Remove this when named parameters are sorted in dill. 1122 // TODO(johnniwinther): Remove this when named parameters are sorted in dill.
1120 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) { 1123 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) {
1121 return a.name.compareTo(b.name); 1124 return a.name.compareTo(b.name);
1122 } 1125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698