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 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2398 class HInterceptor extends HInstruction { | 2398 class HInterceptor extends HInstruction { |
2399 final Set<ClassElement> interceptedClasses; | 2399 final Set<ClassElement> interceptedClasses; |
2400 HInterceptor(this.interceptedClasses, HInstruction receiver) | 2400 HInterceptor(this.interceptedClasses, HInstruction receiver) |
2401 : super(<HInstruction>[receiver]); | 2401 : super(<HInstruction>[receiver]); |
2402 String toString() => 'interceptor on $interceptedClasses'; | 2402 String toString() => 'interceptor on $interceptedClasses'; |
2403 accept(HVisitor visitor) => visitor.visitInterceptor(this); | 2403 accept(HVisitor visitor) => visitor.visitInterceptor(this); |
2404 HInstruction get receiver => inputs[0]; | 2404 HInstruction get receiver => inputs[0]; |
2405 | 2405 |
2406 void prepareGvn(HTypeMap types) { | 2406 void prepareGvn(HTypeMap types) { |
2407 clearAllSideEffects(); | 2407 clearAllSideEffects(); |
2408 setUseGvn(); | |
2409 } | 2408 } |
2410 | 2409 |
2411 int typeCode() => HInstruction.INTERCEPTOR_TYPECODE; | 2410 int typeCode() => HInstruction.INTERCEPTOR_TYPECODE; |
2412 bool typeEquals(other) => other is HInterceptor; | |
2413 } | 2411 } |
2414 | 2412 |
2415 /** An [HLazyStatic] is a static that is initialized lazily at first read. */ | 2413 /** An [HLazyStatic] is a static that is initialized lazily at first read. */ |
2416 class HLazyStatic extends HStatic { | 2414 class HLazyStatic extends HStatic { |
2417 HLazyStatic(Element element) : super(element); | 2415 HLazyStatic(Element element) : super(element); |
2418 | 2416 |
2419 void prepareGvn(HTypeMap types) { | 2417 void prepareGvn(HTypeMap types) { |
2420 // TODO(4931): The first access has side-effects, but we afterwards we | 2418 // TODO(4931): The first access has side-effects, but we afterwards we |
2421 // should be able to GVN. | 2419 // should be able to GVN. |
2422 setAllSideEffects(); | 2420 setAllSideEffects(); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 HBasicBlock get start => expression.start; | 2958 HBasicBlock get start => expression.start; |
2961 HBasicBlock get end { | 2959 HBasicBlock get end { |
2962 // We don't create a switch block if there are no cases. | 2960 // We don't create a switch block if there are no cases. |
2963 assert(!statements.isEmpty); | 2961 assert(!statements.isEmpty); |
2964 return statements.last.end; | 2962 return statements.last.end; |
2965 } | 2963 } |
2966 | 2964 |
2967 bool accept(HStatementInformationVisitor visitor) => | 2965 bool accept(HStatementInformationVisitor visitor) => |
2968 visitor.visitSwitchInfo(this); | 2966 visitor.visitSwitchInfo(this); |
2969 } | 2967 } |
OLD | NEW |