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

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

Issue 1330503003: dart2js cps: Add path-sensitive types by inserting refinement IR nodes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use IterableBase and isEmpty 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.ir_nodes_sexpr; 5 library dart2js.ir_nodes_sexpr;
6 6
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../util/util.dart'; 8 import '../util/util.dart';
9 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
10 import '../universe/universe.dart' show Selector, CallStructure; 10 import '../universe/universe.dart' show Selector, CallStructure;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 String value = access(node.value); 354 String value = access(node.value);
355 return '(SetIndex $object $index $value)'; 355 return '(SetIndex $object $index $value)';
356 } 356 }
357 357
358 @override 358 @override
359 String visitAwait(Await node) { 359 String visitAwait(Await node) {
360 String value = access(node.input); 360 String value = access(node.input);
361 String continuation = access(node.continuation); 361 String continuation = access(node.continuation);
362 return '(Await $value $continuation)'; 362 return '(Await $value $continuation)';
363 } 363 }
364
365 @override
366 String visitRefinement(Refinement node) {
367 String value = access(node.value);
368 return '(Refinement $value (${node.type}))';
Kevin Millikin (Google) 2015/09/03 10:21:06 We were only using the extra parens for variable a
asgerf 2015/09/03 12:31:39 Done.
369 }
364 } 370 }
365 371
366 class ConstantStringifier extends ConstantValueVisitor<String, Null> { 372 class ConstantStringifier extends ConstantValueVisitor<String, Null> {
367 // Some of these methods are unimplemented because we haven't had a need 373 // Some of these methods are unimplemented because we haven't had a need
368 // to print such constants. When printing is implemented, the corresponding 374 // to print such constants. When printing is implemented, the corresponding
369 // parsing support should be added to SExpressionUnstringifier.parseConstant 375 // parsing support should be added to SExpressionUnstringifier.parseConstant
370 // in the dart2js tests (currently in the file 376 // in the dart2js tests (currently in the file
371 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart). 377 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart).
372 378
373 String _failWith(ConstantValue constant) { 379 String _failWith(ConstantValue constant) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 void setReturnContinuation(Continuation node) { 474 void setReturnContinuation(Continuation node) {
469 assert(!_names.containsKey(node) || _names[node] == 'return'); 475 assert(!_names.containsKey(node) || _names[node] == 'return');
470 _names[node] = 'return'; 476 _names[node] = 'return';
471 } 477 }
472 478
473 String getName(Node node) { 479 String getName(Node node) {
474 if (!_names.containsKey(node)) return 'MISSING_NAME'; 480 if (!_names.containsKey(node)) return 'MISSING_NAME';
475 return _names[node]; 481 return _names[node];
476 } 482 }
477 } 483 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698