| 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 /** | 887 /** |
| 888 * Type of the unstruction. | 888 * Type of the unstruction. |
| 889 */ | 889 */ |
| 890 HType instructionType = HType.UNKNOWN; | 890 HType instructionType = HType.UNKNOWN; |
| 891 | 891 |
| 892 bool isInBasicBlock() => block != null; | 892 bool isInBasicBlock() => block != null; |
| 893 | 893 |
| 894 String inputsToString() { | 894 String inputsToString() { |
| 895 void addAsCommaSeparated(StringBuffer buffer, List<HInstruction> list) { | 895 void addAsCommaSeparated(StringBuffer buffer, List<HInstruction> list) { |
| 896 for (int i = 0; i < list.length; i++) { | 896 for (int i = 0; i < list.length; i++) { |
| 897 if (i != 0) buffer.add(', '); | 897 if (i != 0) buffer.write(', '); |
| 898 buffer.add("@${list[i].id}"); | 898 buffer.write("@${list[i].id}"); |
| 899 } | 899 } |
| 900 } | 900 } |
| 901 | 901 |
| 902 StringBuffer buffer = new StringBuffer(); | 902 StringBuffer buffer = new StringBuffer(); |
| 903 buffer.add('('); | 903 buffer.write('('); |
| 904 addAsCommaSeparated(buffer, inputs); | 904 addAsCommaSeparated(buffer, inputs); |
| 905 buffer.add(') - used at ['); | 905 buffer.write(') - used at ['); |
| 906 addAsCommaSeparated(buffer, usedBy); | 906 addAsCommaSeparated(buffer, usedBy); |
| 907 buffer.add(']'); | 907 buffer.write(']'); |
| 908 return buffer.toString(); | 908 return buffer.toString(); |
| 909 } | 909 } |
| 910 | 910 |
| 911 bool gvnEquals(HInstruction other) { | 911 bool gvnEquals(HInstruction other) { |
| 912 assert(useGvn() && other.useGvn()); | 912 assert(useGvn() && other.useGvn()); |
| 913 // Check that the type and the flags match. | 913 // Check that the type and the flags match. |
| 914 bool hasSameType = typeEquals(other); | 914 bool hasSameType = typeEquals(other); |
| 915 assert(hasSameType == (typeCode() == other.typeCode())); | 915 assert(hasSameType == (typeCode() == other.typeCode())); |
| 916 if (!hasSameType) return false; | 916 if (!hasSameType) return false; |
| 917 if (flags != other.flags) return false; | 917 if (flags != other.flags) return false; |
| (...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 HBasicBlock get start => expression.start; | 2552 HBasicBlock get start => expression.start; |
| 2553 HBasicBlock get end { | 2553 HBasicBlock get end { |
| 2554 // We don't create a switch block if there are no cases. | 2554 // We don't create a switch block if there are no cases. |
| 2555 assert(!statements.isEmpty); | 2555 assert(!statements.isEmpty); |
| 2556 return statements.last.end; | 2556 return statements.last.end; |
| 2557 } | 2557 } |
| 2558 | 2558 |
| 2559 bool accept(HStatementInformationVisitor visitor) => | 2559 bool accept(HStatementInformationVisitor visitor) => |
| 2560 visitor.visitSwitchInfo(this); | 2560 visitor.visitSwitchInfo(this); |
| 2561 } | 2561 } |
| OLD | NEW |