| 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 abstract class ConstantVisitor<R> { | 5 abstract class ConstantVisitor<R> { |
| 6 R visitSentinel(SentinelConstant constant); | 6 R visitSentinel(SentinelConstant constant); |
| 7 R visitFunction(FunctionConstant constant); | 7 R visitFunction(FunctionConstant constant); |
| 8 R visitNull(NullConstant constant); | 8 R visitNull(NullConstant constant); |
| 9 R visitInt(IntConstant constant); | 9 R visitInt(IntConstant constant); |
| 10 R visitDouble(DoubleConstant constant); | 10 R visitDouble(DoubleConstant constant); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 static final SENTINEL = const SentinelConstant(); | 52 static final SENTINEL = const SentinelConstant(); |
| 53 | 53 |
| 54 List<Constant> getDependencies() => const <Constant>[]; | 54 List<Constant> getDependencies() => const <Constant>[]; |
| 55 | 55 |
| 56 // Just use a random value. | 56 // Just use a random value. |
| 57 int hashCode() => 24297418; | 57 int hashCode() => 24297418; |
| 58 | 58 |
| 59 bool isSentinel() => true; | 59 bool isSentinel() => true; |
| 60 | 60 |
| 61 accept(ConstantVisitor visitor) => visitor.visitSentinel(this); | 61 accept(ConstantVisitor visitor) => visitor.visitSentinel(this); |
| 62 |
| 63 DartType computeType(Compiler compiler) => compiler.types.dynamicType; |
| 62 } | 64 } |
| 63 | 65 |
| 64 class FunctionConstant extends Constant { | 66 class FunctionConstant extends Constant { |
| 65 Element element; | 67 Element element; |
| 66 | 68 |
| 67 FunctionConstant(this.element); | 69 FunctionConstant(this.element); |
| 68 | 70 |
| 69 bool isFunction() => true; | 71 bool isFunction() => true; |
| 70 | 72 |
| 71 bool operator ==(var other) { | 73 bool operator ==(var other) { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 if (fields[i] != other.fields[i]) return false; | 436 if (fields[i] != other.fields[i]) return false; |
| 435 } | 437 } |
| 436 return true; | 438 return true; |
| 437 } | 439 } |
| 438 | 440 |
| 439 int hashCode() => _hashCode; | 441 int hashCode() => _hashCode; |
| 440 List<Constant> getDependencies() => fields; | 442 List<Constant> getDependencies() => fields; |
| 441 | 443 |
| 442 accept(ConstantVisitor visitor) => visitor.visitConstructed(this); | 444 accept(ConstantVisitor visitor) => visitor.visitConstructed(this); |
| 443 } | 445 } |
| OLD | NEW |