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

Side by Side Diff: pkg/compiler/lib/src/ssa/ssa_branch_builder.dart

Issue 2897263002: Add KernelToElementMap.getSpannable to avoid most usage of KernelAstAdapter.getNode (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../common.dart'; 5 import '../common.dart';
6 import '../io/source_information.dart'; 6 import '../io/source_information.dart';
7 import '../tree/tree.dart' as ast; 7 import '../tree/tree.dart' as ast;
8 8
9 import 'graph_builder.dart'; 9 import 'graph_builder.dart';
10 import 'locals_handler.dart'; 10 import 'locals_handler.dart';
11 import 'nodes.dart'; 11 import 'nodes.dart';
12 12
13 class SsaBranch { 13 class SsaBranch {
14 final SsaBranchBuilder branchBuilder; 14 final SsaBranchBuilder branchBuilder;
15 final HBasicBlock block; 15 final HBasicBlock block;
16 LocalsHandler startLocals; 16 LocalsHandler startLocals;
17 LocalsHandler exitLocals; 17 LocalsHandler exitLocals;
18 SubGraph graph; 18 SubGraph graph;
19 19
20 SsaBranch(this.branchBuilder) : block = new HBasicBlock(); 20 SsaBranch(this.branchBuilder) : block = new HBasicBlock();
21 } 21 }
22 22
23 class SsaBranchBuilder { 23 class SsaBranchBuilder {
24 final GraphBuilder builder; 24 final GraphBuilder builder;
25 final ast.Node diagnosticNode; 25 final Spannable diagnosticNode;
26 26
27 SsaBranchBuilder(this.builder, [this.diagnosticNode]); 27 SsaBranchBuilder(this.builder, [this.diagnosticNode]);
28 28
29 void checkNotAborted() { 29 void checkNotAborted() {
30 if (builder.isAborted()) { 30 if (builder.isAborted()) {
31 throw new SpannableAssertionFailure( 31 throw new SpannableAssertionFailure(
32 diagnosticNode, "aborted control flow"); 32 diagnosticNode, "aborted control flow");
33 } 33 }
34 } 34 }
35 35
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 new HSubGraphBlockInformation(elseBranch.graph)); 219 new HSubGraphBlockInformation(elseBranch.graph));
220 220
221 HBasicBlock conditionStartBlock = conditionBranch.block; 221 HBasicBlock conditionStartBlock = conditionBranch.block;
222 conditionStartBlock.setBlockFlow(info, joinBlock); 222 conditionStartBlock.setBlockFlow(info, joinBlock);
223 SubGraph conditionGraph = conditionBranch.graph; 223 SubGraph conditionGraph = conditionBranch.graph;
224 HIf branch = conditionGraph.end.last; 224 HIf branch = conditionGraph.end.last;
225 assert(branch is HIf); 225 assert(branch is HIf);
226 branch.blockInformation = conditionStartBlock.blockFlow; 226 branch.blockInformation = conditionStartBlock.blockFlow;
227 } 227 }
228 } 228 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698