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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/constants.dart

Issue 190763013: Detect total switches to prevent type pollution by default cases. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart2js; 5 part of dart2js;
6 6
7 abstract class ConstantVisitor<R> { 7 abstract class ConstantVisitor<R> {
8 R visitFunction(FunctionConstant constant); 8 R visitFunction(FunctionConstant constant);
9 R visitNull(NullConstant constant); 9 R visitNull(NullConstant constant);
10 R visitInt(IntConstant constant); 10 R visitInt(IntConstant constant);
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 535
536 accept(ConstantVisitor visitor) => visitor.visitInterceptor(this); 536 accept(ConstantVisitor visitor) => visitor.visitInterceptor(this);
537 537
538 DartType computeType(Compiler compiler) => compiler.types.dynamicType; 538 DartType computeType(Compiler compiler) => compiler.types.dynamicType;
539 539
540 ti.TypeMask computeMask(Compiler compiler) { 540 ti.TypeMask computeMask(Compiler compiler) {
541 return compiler.typesTask.nonNullType; 541 return compiler.typesTask.nonNullType;
542 } 542 }
543 543
544 String toString() { 544 String toString() {
545 return 'InterceptorConstant(${Error.safeToString(dispatchedType)})'; 545 return 'InterceptorConstant(${dispatchedType.getStringAsDeclared("o")})';
546 } 546 }
547 } 547 }
548 548
549 class DummyConstant extends Constant { 549 class DummyConstant extends Constant {
550 final ti.TypeMask typeMask; 550 final ti.TypeMask typeMask;
551 551
552 DummyConstant(this.typeMask); 552 DummyConstant(this.typeMask);
553 553
554 bool isDummy() => true; 554 bool isDummy() => true;
555 555
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 if (i > 0) sb.write(','); 639 if (i > 0) sb.write(',');
640 sb.write(Error.safeToString(field.name)); 640 sb.write(Error.safeToString(field.name));
641 sb.write('='); 641 sb.write('=');
642 sb.write(Error.safeToString(value)); 642 sb.write(Error.safeToString(value));
643 i++; 643 i++;
644 }); 644 });
645 sb.write('))'); 645 sb.write('))');
646 return sb.toString(); 646 return sb.toString();
647 } 647 }
648 } 648 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698