| 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 HVisitor<R> { | 5 abstract class HVisitor<R> { |
| 6 R visitAdd(HAdd node); | 6 R visitAdd(HAdd node); |
| 7 R visitBailoutTarget(HBailoutTarget node); | 7 R visitBailoutTarget(HBailoutTarget node); |
| 8 R visitBitAnd(HBitAnd node); | 8 R visitBitAnd(HBitAnd node); |
| 9 R visitBitNot(HBitNot node); | 9 R visitBitNot(HBitNot node); |
| 10 R visitBitOr(HBitOr node); | 10 R visitBitOr(HBitOr node); |
| (...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2360 | 2360 |
| 2361 class HThrow extends HControlFlow { | 2361 class HThrow extends HControlFlow { |
| 2362 final bool isRethrow; | 2362 final bool isRethrow; |
| 2363 HThrow(value, [this.isRethrow = false]) : super(<HInstruction>[value]); | 2363 HThrow(value, [this.isRethrow = false]) : super(<HInstruction>[value]); |
| 2364 toString() => 'throw'; | 2364 toString() => 'throw'; |
| 2365 accept(HVisitor visitor) => visitor.visitThrow(this); | 2365 accept(HVisitor visitor) => visitor.visitThrow(this); |
| 2366 } | 2366 } |
| 2367 | 2367 |
| 2368 class HStatic extends HInstruction { | 2368 class HStatic extends HInstruction { |
| 2369 final Element element; | 2369 final Element element; |
| 2370 HStatic(this.element) : super(<HInstruction>[]) { assert(element !== null); } | 2370 HStatic(this.element) : super(<HInstruction>[]) { |
| 2371 assert(element !== null); |
| 2372 assert(element.isDeclaration); |
| 2373 } |
| 2371 | 2374 |
| 2372 void prepareGvn(HTypeMap types) { | 2375 void prepareGvn(HTypeMap types) { |
| 2373 if (!element.isAssignable()) { | 2376 if (!element.isAssignable()) { |
| 2374 clearAllSideEffects(); | 2377 clearAllSideEffects(); |
| 2375 setUseGvn(); | 2378 setUseGvn(); |
| 2376 } | 2379 } |
| 2377 } | 2380 } |
| 2378 toString() => 'static ${element.name}'; | 2381 toString() => 'static ${element.name}'; |
| 2379 accept(HVisitor visitor) => visitor.visitStatic(this); | 2382 accept(HVisitor visitor) => visitor.visitStatic(this); |
| 2380 | 2383 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2897 HBasicBlock get start => expression.start; | 2900 HBasicBlock get start => expression.start; |
| 2898 HBasicBlock get end { | 2901 HBasicBlock get end { |
| 2899 // We don't create a switch block if there are no cases. | 2902 // We don't create a switch block if there are no cases. |
| 2900 assert(!statements.isEmpty()); | 2903 assert(!statements.isEmpty()); |
| 2901 return statements.last().end; | 2904 return statements.last().end; |
| 2902 } | 2905 } |
| 2903 | 2906 |
| 2904 bool accept(HStatementInformationVisitor visitor) => | 2907 bool accept(HStatementInformationVisitor visitor) => |
| 2905 visitor.visitSwitchInfo(this); | 2908 visitor.visitSwitchInfo(this); |
| 2906 } | 2909 } |
| OLD | NEW |