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 visitBailoutTarget(HBailoutTarget node); | 9 R visitBailoutTarget(HBailoutTarget node); |
10 R visitBitAnd(HBitAnd node); | 10 R visitBitAnd(HBitAnd node); |
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2378 accept(HVisitor visitor) => visitor.visitInterceptor(this); | 2378 accept(HVisitor visitor) => visitor.visitInterceptor(this); |
2379 HInstruction get receiver => inputs[0]; | 2379 HInstruction get receiver => inputs[0]; |
2380 | 2380 |
2381 void prepareGvn(HTypeMap types) { | 2381 void prepareGvn(HTypeMap types) { |
2382 clearAllSideEffects(); | 2382 clearAllSideEffects(); |
2383 setUseGvn(); | 2383 setUseGvn(); |
2384 } | 2384 } |
2385 | 2385 |
2386 int typeCode() => HInstruction.INTERCEPTOR_TYPECODE; | 2386 int typeCode() => HInstruction.INTERCEPTOR_TYPECODE; |
2387 bool typeEquals(other) => other is HInterceptor; | 2387 bool typeEquals(other) => other is HInterceptor; |
2388 // We treat the data in a [HInterceptor] to always be equal to | |
2389 // another, even if the [interceptedClasses] set is different. That | |
2390 // is because we know the first [getInterceptor] call will fetch an | |
2391 // interceptor of the right kind. | |
ahe
2012/11/27 18:29:01
How do you know that?
floitsch
2012/11/27 18:51:38
Because the input is the same.
ahe
2012/11/27 19:03:36
I'm still not sure I understand. Don't worry, I'l
| |
2392 bool dataEquals(other) => true; | |
2388 } | 2393 } |
2389 | 2394 |
2390 /** An [HLazyStatic] is a static that is initialized lazily at first read. */ | 2395 /** An [HLazyStatic] is a static that is initialized lazily at first read. */ |
2391 class HLazyStatic extends HStatic { | 2396 class HLazyStatic extends HStatic { |
2392 HLazyStatic(Element element) : super(element); | 2397 HLazyStatic(Element element) : super(element); |
2393 | 2398 |
2394 void prepareGvn(HTypeMap types) { | 2399 void prepareGvn(HTypeMap types) { |
2395 // TODO(4931): The first access has side-effects, but we afterwards we | 2400 // TODO(4931): The first access has side-effects, but we afterwards we |
2396 // should be able to GVN. | 2401 // should be able to GVN. |
2397 setAllSideEffects(); | 2402 setAllSideEffects(); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2935 HBasicBlock get start => expression.start; | 2940 HBasicBlock get start => expression.start; |
2936 HBasicBlock get end { | 2941 HBasicBlock get end { |
2937 // We don't create a switch block if there are no cases. | 2942 // We don't create a switch block if there are no cases. |
2938 assert(!statements.isEmpty); | 2943 assert(!statements.isEmpty); |
2939 return statements.last.end; | 2944 return statements.last.end; |
2940 } | 2945 } |
2941 | 2946 |
2942 bool accept(HStatementInformationVisitor visitor) => | 2947 bool accept(HStatementInformationVisitor visitor) => |
2943 visitor.visitSwitchInfo(this); | 2948 visitor.visitSwitchInfo(this); |
2944 } | 2949 } |
OLD | NEW |