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

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

Issue 1755823003: Replace TypeMask.isEmpty by isEmptyOrNull, use isEmpty when it's really empty. (Closed) Base URL: git@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
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 ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitAwait(HAwait node); 9 R visitAwait(HAwait node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 874
875 /// Does this node potentially affect control flow. 875 /// Does this node potentially affect control flow.
876 bool isControlFlow() => false; 876 bool isControlFlow() => false;
877 877
878 bool isExact() => instructionType.isExact || isNull(); 878 bool isExact() => instructionType.isExact || isNull();
879 879
880 bool isValue() => instructionType.isValue; 880 bool isValue() => instructionType.isValue;
881 881
882 bool canBeNull() => instructionType.isNullable; 882 bool canBeNull() => instructionType.isNullable;
883 883
884 bool isNull() => instructionType.isEmpty && instructionType.isNullable; 884 bool isNull() => instructionType.isNull;
885 bool isConflicting() { 885
886 return instructionType.isEmpty && !instructionType.isNullable; 886 bool isConflicting() => instructionType.isEmpty;
887 }
888 887
889 /// Returns `true` if [typeMask] contains [cls]. 888 /// Returns `true` if [typeMask] contains [cls].
890 static bool containsType( 889 static bool containsType(
891 TypeMask typeMask, 890 TypeMask typeMask,
892 ClassElement cls, 891 ClassElement cls,
893 ClassWorld classWorld) { 892 ClassWorld classWorld) {
894 return classWorld.isInstantiated(cls) && typeMask.contains(cls, classWorld); 893 return classWorld.isInstantiated(cls) && typeMask.contains(cls, classWorld);
895 } 894 }
896 895
897 /// Returns `true` if [typeMask] contains only [cls]. 896 /// Returns `true` if [typeMask] contains only [cls].
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after
3342 class HDynamicType extends HRuntimeType { 3341 class HDynamicType extends HRuntimeType {
3343 HDynamicType(DynamicType dartType, TypeMask instructionType) 3342 HDynamicType(DynamicType dartType, TypeMask instructionType)
3344 : super(const <HInstruction>[], dartType, instructionType); 3343 : super(const <HInstruction>[], dartType, instructionType);
3345 3344
3346 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3345 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3347 3346
3348 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3347 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3349 3348
3350 bool typeEquals(HInstruction other) => other is HDynamicType; 3349 bool typeEquals(HInstruction other) => other is HDynamicType;
3351 } 3350 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/interceptor_simplifier.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698