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

Side by Side Diff: pkg/compiler/lib/src/resolution/tree_elements.dart

Issue 1311403003: dart2js cps: Track existence of try statements in resolution instead of traversing AST/IR nodes to … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.resolution.tree_elements; 5 library dart2js.resolution.tree_elements;
6 6
7 import '../constants/expressions.dart'; 7 import '../constants/expressions.dart';
8 import '../dart_types.dart'; 8 import '../dart_types.dart';
9 import '../diagnostics/invariant.dart' show 9 import '../diagnostics/invariant.dart' show
10 invariant; 10 invariant;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 JumpTarget getTargetDefinition(Node node); 115 JumpTarget getTargetDefinition(Node node);
116 116
117 /// Returns the jump target of the [node]. 117 /// Returns the jump target of the [node].
118 JumpTarget getTargetOf(GotoStatement node); 118 JumpTarget getTargetOf(GotoStatement node);
119 119
120 /// Returns the label defined by [node]. 120 /// Returns the label defined by [node].
121 LabelDefinition getLabelDefinition(Label node); 121 LabelDefinition getLabelDefinition(Label node);
122 122
123 /// Returns the label that [node] targets. 123 /// Returns the label that [node] targets.
124 LabelDefinition getTargetLabel(GotoStatement node); 124 LabelDefinition getTargetLabel(GotoStatement node);
125
126 /// `true` if the [analyzedElement]'s source code contains a [TryStatement].
127 bool get containsTryStatement;
125 } 128 }
126 129
127 class TreeElementMapping extends TreeElements { 130 class TreeElementMapping extends TreeElements {
128 final AnalyzableElement analyzedElement; 131 final AnalyzableElement analyzedElement;
129 Map<Spannable, Selector> _selectors; 132 Map<Spannable, Selector> _selectors;
130 Map<Spannable, TypeMask> _typeMasks; 133 Map<Spannable, TypeMask> _typeMasks;
131 Map<Node, DartType> _types; 134 Map<Node, DartType> _types;
132 Setlet<Node> _superUses; 135 Setlet<Node> _superUses;
133 Setlet<Element> _otherDependencies; 136 Setlet<Element> _otherDependencies;
134 Map<Node, ConstantExpression> _constants; 137 Map<Node, ConstantExpression> _constants;
135 Map<VariableElement, List<Node>> _potentiallyMutated; 138 Map<VariableElement, List<Node>> _potentiallyMutated;
136 Map<Node, Map<VariableElement, List<Node>>> _potentiallyMutatedIn; 139 Map<Node, Map<VariableElement, List<Node>>> _potentiallyMutatedIn;
137 Map<VariableElement, List<Node>> _potentiallyMutatedInClosure; 140 Map<VariableElement, List<Node>> _potentiallyMutatedInClosure;
138 Map<Node, Map<VariableElement, List<Node>>> _accessedByClosureIn; 141 Map<Node, Map<VariableElement, List<Node>>> _accessedByClosureIn;
139 Setlet<Element> _elements; 142 Setlet<Element> _elements;
140 Setlet<Send> _asserts; 143 Setlet<Send> _asserts;
141 Maplet<Send, SendStructure> _sendStructureMap; 144 Maplet<Send, SendStructure> _sendStructureMap;
142 Setlet<DartType> _requiredTypes; 145 Setlet<DartType> _requiredTypes;
146 bool containsTryStatement = false;
143 147
144 /// Map from nodes to the targets they define. 148 /// Map from nodes to the targets they define.
145 Map<Node, JumpTarget> _definedTargets; 149 Map<Node, JumpTarget> _definedTargets;
146 150
147 /// Map from goto statements to their targets. 151 /// Map from goto statements to their targets.
148 Map<GotoStatement, JumpTarget> _usedTargets; 152 Map<GotoStatement, JumpTarget> _usedTargets;
149 153
150 /// Map from labels to their label definition. 154 /// Map from labels to their label definition.
151 Map<Label, LabelDefinition> _definedLabels; 155 Map<Label, LabelDefinition> _definedLabels;
152 156
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 550 }
547 551
548 void setCurrentTypeMask(ForIn node, TypeMask mask) { 552 void setCurrentTypeMask(ForIn node, TypeMask mask) {
549 _setTypeMask(node.inToken, mask); 553 _setTypeMask(node.inToken, mask);
550 } 554 }
551 555
552 TypeMask getCurrentTypeMask(ForIn node) { 556 TypeMask getCurrentTypeMask(ForIn node) {
553 return _getTypeMask(node.inToken); 557 return _getTypeMask(node.inToken);
554 } 558 }
555 } 559 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698