Mercurial > hg > truffle
comparison graal/com.oracle.max.asmdis/src/com/sun/max/asm/gen/risc/RiscTemplate.java @ 4142:bc8527f3071c
Adjust code base to new level of warnings.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 18 Dec 2011 05:24:06 +0100 |
parents | e233f5660da4 |
children |
comparison
equal
deleted
inserted
replaced
4141:04d21be7a24f | 4142:bc8527f3071c |
---|---|
30 | 30 |
31 /** | 31 /** |
32 */ | 32 */ |
33 public class RiscTemplate extends Template implements RiscInstructionDescriptionVisitor { | 33 public class RiscTemplate extends Template implements RiscInstructionDescriptionVisitor { |
34 | 34 |
35 private final List<RiscField> allFields = new LinkedList<RiscField>(); | 35 private final List<RiscField> allFields = new LinkedList<>(); |
36 private final List<OperandField> operandFields = new LinkedList<OperandField>(); | 36 private final List<OperandField> operandFields = new LinkedList<>(); |
37 private final List<OptionField> optionFields = new LinkedList<OptionField>(); | 37 private final List<OptionField> optionFields = new LinkedList<>(); |
38 private final List<OperandField> parameters = new ArrayList<OperandField>(); | 38 private final List<OperandField> parameters = new ArrayList<>(); |
39 private final List<Option> options = new LinkedList<Option>(); | 39 private final List<Option> options = new LinkedList<>(); |
40 | 40 |
41 private int opcode; | 41 private int opcode; |
42 private int opcodeMask; | 42 private int opcodeMask; |
43 private RiscTemplate canonicalRepresentative; | 43 private RiscTemplate canonicalRepresentative; |
44 | 44 |
139 | 139 |
140 public int specificity() { | 140 public int specificity() { |
141 return Integer.bitCount(opcodeMask); | 141 return Integer.bitCount(opcodeMask); |
142 } | 142 } |
143 | 143 |
144 public void organizeOption(Option option, RiscTemplate canonicalRepresentative) { | 144 public void organizeOption(Option option, RiscTemplate newCanonicalRepresentative) { |
145 instructionDescription().setExternalName(externalName() + option.externalName()); | 145 instructionDescription().setExternalName(externalName() + option.externalName()); |
146 setInternalName(internalName() + option.name()); | 146 setInternalName(internalName() + option.name()); |
147 try { | 147 try { |
148 opcode |= option.field().bitRange().assembleUnsignedInt(option.value()); | 148 opcode |= option.field().bitRange().assembleUnsignedInt(option.value()); |
149 opcodeMask |= option.field().bitRange().instructionMask(); | 149 opcodeMask |= option.field().bitRange().instructionMask(); |
151 throw ProgramError.unexpected("Option: " + option.name() + " does not fit in field " + option.field().name()); | 151 throw ProgramError.unexpected("Option: " + option.name() + " does not fit in field " + option.field().name()); |
152 } | 152 } |
153 | 153 |
154 options.add(option); | 154 options.add(option); |
155 if (option.isRedundant()) { | 155 if (option.isRedundant()) { |
156 this.canonicalRepresentative = canonicalRepresentative; | 156 this.canonicalRepresentative = newCanonicalRepresentative; |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 @Override | 160 @Override |
161 public Template canonicalRepresentative() { | 161 public Template canonicalRepresentative() { |