| OLD | NEW |
| 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 visitBitAnd(HBitAnd node); | 9 R visitBitAnd(HBitAnd node); |
| 10 R visitBitNot(HBitNot node); | 10 R visitBitNot(HBitNot node); |
| (...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1926 bool isConstantFalse() => constant.isFalse(); | 1926 bool isConstantFalse() => constant.isFalse(); |
| 1927 bool isConstantTrue() => constant.isTrue(); | 1927 bool isConstantTrue() => constant.isTrue(); |
| 1928 bool isConstantSentinel() => constant.isSentinel(); | 1928 bool isConstantSentinel() => constant.isSentinel(); |
| 1929 | 1929 |
| 1930 bool isInterceptor(Compiler compiler) => constant.isInterceptor(); | 1930 bool isInterceptor(Compiler compiler) => constant.isInterceptor(); |
| 1931 | 1931 |
| 1932 // Maybe avoid this if the literal is big? | 1932 // Maybe avoid this if the literal is big? |
| 1933 bool isCodeMotionInvariant() => true; | 1933 bool isCodeMotionInvariant() => true; |
| 1934 | 1934 |
| 1935 set instructionType(type) { | 1935 set instructionType(type) { |
| 1936 assert((type.isEmpty && super.instructionType.isEmpty) | 1936 // Only lists can be specialized. The SSA builder uses the |
| 1937 || !type.isNullable); | 1937 // inferrer for finding the type of a constant list. We should |
| 1938 assert(!isConstantNull() || (type.isEmpty && type.isNullable)); | 1938 // have the constant know its type instead. |
| 1939 if (!isConstantList()) return; |
| 1939 super.instructionType = type; | 1940 super.instructionType = type; |
| 1940 } | 1941 } |
| 1941 } | 1942 } |
| 1942 | 1943 |
| 1943 class HNot extends HInstruction { | 1944 class HNot extends HInstruction { |
| 1944 HNot(HInstruction value, TypeMask type) : super(<HInstruction>[value], type) { | 1945 HNot(HInstruction value, TypeMask type) : super(<HInstruction>[value], type) { |
| 1945 setUseGvn(); | 1946 setUseGvn(); |
| 1946 } | 1947 } |
| 1947 | 1948 |
| 1948 accept(HVisitor visitor) => visitor.visitNot(this); | 1949 accept(HVisitor visitor) => visitor.visitNot(this); |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2906 class HDynamicType extends HRuntimeType { | 2907 class HDynamicType extends HRuntimeType { |
| 2907 HDynamicType(DynamicType dartType, TypeMask instructionType) | 2908 HDynamicType(DynamicType dartType, TypeMask instructionType) |
| 2908 : super(const <HInstruction>[], dartType, instructionType); | 2909 : super(const <HInstruction>[], dartType, instructionType); |
| 2909 | 2910 |
| 2910 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 2911 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
| 2911 | 2912 |
| 2912 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 2913 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
| 2913 | 2914 |
| 2914 bool typeEquals(HInstruction other) => other is HDynamicType; | 2915 bool typeEquals(HInstruction other) => other is HDynamicType; |
| 2915 } | 2916 } |
| OLD | NEW |