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

Side by Side Diff: lib/compiler/implementation/ssa/types.dart

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
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 abstract class HType { 5 abstract class HType {
6 const HType(); 6 const HType();
7 7
8 /** 8 /**
9 * Returns an [HType] that represents [type] and all types that have 9 * Returns an [HType] that represents [type] and all types that have
10 * [type] as supertype. 10 * [type] as supertype.
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 return 'BoundedType($type, $_canBeNull, $_isExact)'; 676 return 'BoundedType($type, $_canBeNull, $_isExact)';
677 } 677 }
678 678
679 bool canBeNull() => _canBeNull; 679 bool canBeNull() => _canBeNull;
680 680
681 bool isExact() => _isExact; 681 bool isExact() => _isExact;
682 682
683 const HBoundedType(DartType this.type, 683 const HBoundedType(DartType this.type,
684 [bool canBeNull = false, isExact = false]) 684 [bool canBeNull = false, isExact = false])
685 : _canBeNull = canBeNull, _isExact = isExact; 685 : _canBeNull = canBeNull, _isExact = isExact;
686 const HBoundedType.exact(DartType type) : this(type, isExact: true); 686 const HBoundedType.exact(DartType type) : this(type, false, true);
687 const HBoundedType.withNull(DartType type) : this(type, canBeNull: true); 687 const HBoundedType.withNull(DartType type) : this(type, true, false);
688 const HBoundedType.nonNull(DartType type) : this(type); 688 const HBoundedType.nonNull(DartType type) : this(type);
689 689
690 DartType computeType(Compiler compiler) => type; 690 DartType computeType(Compiler compiler) => type;
691 691
692 Element lookupMember(SourceString name) { 692 Element lookupMember(SourceString name) {
693 if (!isExact()) return null; 693 if (!isExact()) return null;
694 ClassElement classElement = type.element; 694 ClassElement classElement = type.element;
695 return classElement.lookupMember(name); 695 return classElement.lookupMember(name);
696 } 696 }
697 697
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 operator [](HInstruction instruction) { 867 operator [](HInstruction instruction) {
868 HType result = _map[instruction]; 868 HType result = _map[instruction];
869 if (result == null) return instruction.guaranteedType; 869 if (result == null) return instruction.guaranteedType;
870 return result; 870 return result;
871 } 871 }
872 872
873 operator []=(HInstruction instruction, HType value) { 873 operator []=(HInstruction instruction, HType value) {
874 _map[instruction] = value; 874 _map[instruction] = value;
875 } 875 }
876 } 876 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/optimize.dart ('k') | lib/compiler/implementation/string_validator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698