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

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

Issue 1779153002: Make source information on conditions mandatory in CPS (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_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) 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 cps_ir.cps_fragment; 5 library cps_ir.cps_fragment;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../universe/selector.dart' show Selector; 9 import '../universe/selector.dart' show Selector;
10 import '../types/types.dart' show TypeMask; 10 import '../types/types.dart' show TypeMask;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 /// Returns a new fragment for the 'then' branch, or the 'else' branch 193 /// Returns a new fragment for the 'then' branch, or the 'else' branch
194 /// if [negate] is true. 194 /// if [negate] is true.
195 /// 195 ///
196 /// The other branch becomes the new hole. 196 /// The other branch becomes the new hole.
197 CpsFragment branch(Primitive condition, 197 CpsFragment branch(Primitive condition,
198 {bool negate: false, 198 {bool negate: false,
199 bool strict: false}) { 199 bool strict: false}) {
200 Continuation trueCont = new Continuation(<Parameter>[]); 200 Continuation trueCont = new Continuation(<Parameter>[]);
201 Continuation falseCont = new Continuation(<Parameter>[]); 201 Continuation falseCont = new Continuation(<Parameter>[]);
202 put(new LetCont.two(trueCont, falseCont, 202 put(new LetCont.two(trueCont, falseCont,
203 new Branch(condition, trueCont, falseCont, strict: strict))); 203 new Branch(condition, trueCont, falseCont,
204 sourceInformation, strict: strict)));
204 if (negate) { 205 if (negate) {
205 context = trueCont; 206 context = trueCont;
206 return new CpsFragment(sourceInformation, falseCont); 207 return new CpsFragment(sourceInformation, falseCont);
207 } else { 208 } else {
208 context = falseCont; 209 context = falseCont;
209 return new CpsFragment(sourceInformation, trueCont); 210 return new CpsFragment(sourceInformation, trueCont);
210 } 211 }
211 } 212 }
212 213
213 /// Branch on [condition]. 214 /// Branch on [condition].
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 while (prim.firstRef != null) { 371 while (prim.firstRef != null) {
371 Refinement refine = prim.firstRef.parent; 372 Refinement refine = prim.firstRef.parent;
372 destroyRefinementsOfDeadPrimitive(refine); 373 destroyRefinementsOfDeadPrimitive(refine);
373 LetPrim letPrim = refine.parent; 374 LetPrim letPrim = refine.parent;
374 InteriorNode parent = letPrim.parent; 375 InteriorNode parent = letPrim.parent;
375 parent.body = letPrim.body; 376 parent.body = letPrim.body;
376 letPrim.body.parent = parent; 377 letPrim.body.parent = parent;
377 prim.firstRef.unlink(); 378 prim.firstRef.unlink();
378 } 379 }
379 } 380 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698