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 visitAwait(HAwait node); | 9 R visitAwait(HAwait node); |
10 R visitBitAnd(HBitAnd node); | 10 R visitBitAnd(HBitAnd node); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 constants[constant] = result; | 181 constants[constant] = result; |
182 } else if (result.block == null) { | 182 } else if (result.block == null) { |
183 // The constant was not used anymore. | 183 // The constant was not used anymore. |
184 entry.addAtExit(result); | 184 entry.addAtExit(result); |
185 } | 185 } |
186 return result; | 186 return result; |
187 } | 187 } |
188 | 188 |
189 HConstant addDeferredConstant(ConstantValue constant, PrefixElement prefix, | 189 HConstant addDeferredConstant(ConstantValue constant, PrefixElement prefix, |
190 Compiler compiler) { | 190 Compiler compiler) { |
| 191 // TODO(sigurdm,johnniwinter): These deferred constants should be created |
| 192 // by the constant evaluator. |
191 ConstantValue wrapper = new DeferredConstantValue(constant, prefix); | 193 ConstantValue wrapper = new DeferredConstantValue(constant, prefix); |
192 compiler.deferredLoadTask.registerConstantDeferredUse(wrapper, prefix); | 194 compiler.deferredLoadTask.registerConstantDeferredUse(wrapper, prefix); |
193 return addConstant(wrapper, compiler); | 195 return addConstant(wrapper, compiler); |
194 } | 196 } |
195 | 197 |
196 HConstant addConstantInt(int i, Compiler compiler) { | 198 HConstant addConstantInt(int i, Compiler compiler) { |
197 return addConstant(compiler.backend.constantSystem.createInt(i), compiler); | 199 return addConstant(compiler.backend.constantSystem.createInt(i), compiler); |
198 } | 200 } |
199 | 201 |
200 HConstant addConstantDouble(double d, Compiler compiler) { | 202 HConstant addConstantDouble(double d, Compiler compiler) { |
(...skipping 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3175 class HDynamicType extends HRuntimeType { | 3177 class HDynamicType extends HRuntimeType { |
3176 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3178 HDynamicType(DynamicType dartType, TypeMask instructionType) |
3177 : super(const <HInstruction>[], dartType, instructionType); | 3179 : super(const <HInstruction>[], dartType, instructionType); |
3178 | 3180 |
3179 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3181 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
3180 | 3182 |
3181 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3183 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
3182 | 3184 |
3183 bool typeEquals(HInstruction other) => other is HDynamicType; | 3185 bool typeEquals(HInstruction other) => other is HDynamicType; |
3184 } | 3186 } |
OLD | NEW |