DalvInsn instances into
streams of code units, as well as human-oriented listing strings
representing such translations.
| Modifier and Type | Field and Description |
|---|---|
| public static boolean | ALLOW_EXTENDED_OPCODES
flag to enable/disable the new extended opcode formats; meant as a temporary measure until VM support for the salient opcodes is added. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected static int | |
| protected static String | Returns: non-null; the commentnon-null; the instruction in questionHelper method to return the comment for a branch. |
| public boolean | Returns: true iff the instruction's branch offset is
appropriate for this instance, or false if notnon-null; the instruction to checkReturns whether or not the given instruction's branch offset will fit in this instance's format. |
| protected static String | Returns: non-null; the string form of the instruction's
branch targetnon-null; the instruction in questionHelper method to return a branch address string. |
| public abstract int | Returns: >= 0; the instruction length in 16-bit code unitsGets the code size of instructions that use this format. |
| protected static short | Returns: combined value0..255; low byte0..255; high byteHelper method to combine two bytes into a code unit. |
| protected static short | Returns: combined value0..15; low nibble0..15; medium-low nibble0..15; medium-high nibble0..15; high nibbleHelper method to combine four nibbles into a code unit. |
| public BitSet | Returns: non-null; a BitSet flagging registers in the
register list that are compatible to this formatnon-null; the instruction to checkReturns which of a given instruction's registers will fit in this instance's format. |
| protected static String | Returns: non-null; comment string representing the constantnon-null; a constant-bearing instructionHelper method to return an instruction comment for a constant. |
| protected static String | |
| public abstract String | Returns: non-null; the string formnon-null; the instructionReturns the string form of the arguments to the given instruction. |
| public abstract String | Returns: non-null; the string formnon-null; the instructionwhether to include an explicit notation of
constant pool indices noteIndices)Returns the associated comment for the given instruction, if any. |
| public abstract boolean | Returns: true iff the instruction's arguments are
appropriate for this instance, or false if notnon-null; the instruction to checkReturns whether or not the given instruction's arguments will fit in this instance's format. |
| protected static boolean | Returns: true iff the list is sequentially orderednon-null; the list of registersHelper method to determine if a list of registers are sequential, including degenerate cases for empty or single-element lists. |
| public final String | Returns: non-null; the string formnon-null; the instructionwhether to include an explicit notation of
constant pool indices noteIndices)Returns the string form, suitable for inclusion in a listing dump, of the given instruction. |
| protected static String | Returns: non-null; the commentthe value value, int the width of the constant, in bits (used for displaying
the uninterpreted bits; one of: width)4 8 16 32 64Helper method to return a literal bits comment string. |
| protected static String | Returns: non-null; the string formthe value value)Helper method to return a literal bits argument string. |
| protected static int | Returns: 0..255; combined value0..15; low nibble0..15; high nibbleHelper method to combine two nibbles into a byte. |
| protected static short | Returns: combined valuenon-null; the instruction containing the opcode0..255; arbitrary other byte valueHelper method to combine an opcode and a second byte of data into the appropriate form for emitting into a code buffer. |
| protected static short | Returns: the opcode as a code unitnon-null; the instruction containing the
extended opcodeHelper method to get an extended (16-bit) opcode out of an instruction, returning it as a code unit. |
| protected static String | Returns: non-null; the string formnon-null; the list of registersHelper method to return a register list string. |
| protected static String | Returns: non-null; the string formnon-null; the list of registers (which must be
sequential)Helper method to return a register range string. |
| protected static boolean | Returns: true iff it's in the range -0x80..+0x7fthe value in question value)Helper method to determine if a signed int value fits in a byte. |
| protected static boolean | Returns: true iff it's in the range -8..+7the value in question value)Helper method to determine if a signed int value fits in a nibble. |
| protected static boolean | Returns: true iff it's in the range -0x8000..+0x7fffthe value in question value)Helper method to determine if a signed int value fits in a short. |
| protected static boolean | Returns: true iff it's in the range 0..0xffthe value in question value)Helper method to determine if an unsigned int value fits in a byte. |
| protected static boolean | Returns: true iff it's in the range 0..0xfthe value in question value)Helper method to determine if an unsigned int value fits in a nibble. |
| protected static boolean | Returns: true iff it's in the range 0..0xffffthe value in question value)Helper method to determine if an unsigned int value fits in a short. |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0)Writes one code unit to the given output destination. |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, short code unit to write c1)Writes two code units to the given output destination. |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, short code unit to write c1, short code unit to write c2)Writes three code units to the given output destination. |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, short code unit to write c1, short code unit to write c2, short code unit to write c3)Writes four code units to the given output destination. |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, short code unit to write c1, short code unit to write c2, short code unit to write c3, short code unit to write c4)Writes five code units to the given output destination. |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, int code unit pair to write c1c2)Writes three code units to the given output destination, where the
second and third are represented as single |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, int code unit pair to write c1c2, short code unit to write c3)Writes four code units to the given output destination, where the
second and third are represented as single |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, int code unit pair to write c1c2, short code unit to write c3, short code unit to write c4)Writes five code units to the given output destination, where the
second and third are represented as single |
| protected static void | write(AnnotatedOutput
non-null; where to write tocode unit to write c0, long code unit quad to write c1c2c3c4)Writes five code units to the given output destination, where the
second through fifth are represented as single |
| public abstract void | writeTo(AnnotatedOutput
non-null; the output destination to write tonon-null; the instruction to writeWrites the code units for the given instruction to the given output destination. |
| ALLOW_EXTENDED_OPCODES | back to summary |
|---|---|
| public static boolean ALLOW_EXTENDED_OPCODES flag to enable/disable the new extended opcode formats; meant as a temporary measure until VM support for the salient opcodes is added. Todo Remove this declaration when the VM can deal. | |
| InsnFormat | back to summary |
|---|---|
| public InsnFormat() | |
| argIndex | back to summary |
|---|---|
| protected static int argIndex(DalvInsn insn) Helper method to extract the callout-argument index from an appropriate instruction.
| |
| branchComment | back to summary |
|---|---|
| protected static String branchComment(DalvInsn insn) Helper method to return the comment for a branch. | |
| branchFits | back to summary |
|---|---|
| public boolean branchFits(TargetInsn insn) Returns whether or not the given instruction's branch offset will
fit in this instance's format. This always returns The default implementation of this method always returns
| |
| branchString | back to summary |
|---|---|
| protected static String branchString(DalvInsn insn) Helper method to return a branch address string. | |
| codeSize | back to summary |
|---|---|
| public abstract int codeSize() Gets the code size of instructions that use this format. The size is a number of 16-bit code units, not bytes. This should throw an exception if this format is of variable size.
| |
| codeUnit | back to summary |
|---|---|
| protected static short codeUnit(int low, int high) Helper method to combine two bytes into a code unit.
| |
| codeUnit | back to summary |
|---|---|
| protected static short codeUnit(int n0, int n1, int n2, int n3) Helper method to combine four nibbles into a code unit.
| |
| compatibleRegs | back to summary |
|---|---|
| public BitSet compatibleRegs(DalvInsn insn) Returns which of a given instruction's registers will fit in this instance's format. The default implementation of this method always returns an empty BitSet. Subclasses must override this method if they have registers. | |
| cstComment | back to summary |
|---|---|
| protected static String cstComment(DalvInsn insn) Helper method to return an instruction comment for a constant. | |
| cstString | back to summary |
|---|---|
| protected static String cstString(DalvInsn insn) Helper method to return the constant string for a | |
| insnArgString | back to summary |
|---|---|
| public abstract String insnArgString(DalvInsn insn) Returns the string form of the arguments to the given instruction.
The instruction must be of this instance's format. If the instruction
has no arguments, then the result should be Subclasses must override this method. | |
| insnCommentString | back to summary |
|---|---|
| public abstract String insnCommentString(DalvInsn insn, boolean noteIndices) Returns the associated comment for the given instruction, if any.
The instruction must be of this instance's format. If the instruction
has no comment, then the result should be Subclasses must override this method. | |
| isCompatible | back to summary |
|---|---|
| public abstract boolean isCompatible(DalvInsn insn) Returns whether or not the given instruction's arguments will fit in this instance's format. This includes such things as counting register arguments, checking register ranges, and making sure that additional arguments are of appropriate types and are in-range. If this format has a branch target but the instruction's branch offset is unknown, this method will simply not check the offset. Subclasses must override this method.
| |
| isRegListSequential | back to summary |
|---|---|
| protected static boolean isRegListSequential(RegisterSpecList list) Helper method to determine if a list of registers are sequential, including degenerate cases for empty or single-element lists.
| |
| listingString | back to summary |
|---|---|
| public final String listingString(DalvInsn insn, boolean noteIndices) Returns the string form, suitable for inclusion in a listing dump, of the given instruction. The instruction must be of this instance's format for proper operation. | |
| literalBitsComment | back to summary |
|---|---|
| protected static String literalBitsComment(CstLiteralBits value, int width) Helper method to return a literal bits comment string.
| |
| literalBitsString | back to summary |
|---|---|
| protected static String literalBitsString(CstLiteralBits value) Helper method to return a literal bits argument string.
| |
| makeByte | back to summary |
|---|---|
| protected static int makeByte(int low, int high) Helper method to combine two nibbles into a byte.
| |
| opcodeUnit | back to summary |
|---|---|
| protected static short opcodeUnit(DalvInsn insn, int arg) Helper method to combine an opcode and a second byte of data into the appropriate form for emitting into a code buffer.
| |
| opcodeUnit | back to summary |
|---|---|
| protected static short opcodeUnit(DalvInsn insn) Helper method to get an extended (16-bit) opcode out of an instruction, returning it as a code unit. The opcode must be an extended opcode.
| |
| regListString | back to summary |
|---|---|
| protected static String regListString(RegisterSpecList list) Helper method to return a register list string.
| |
| regRangeString | back to summary |
|---|---|
| protected static String regRangeString(RegisterSpecList list) Helper method to return a register range string.
| |
| signedFitsInByte | back to summary |
|---|---|
| protected static boolean signedFitsInByte(int value) Helper method to determine if a signed int value fits in a byte.
| |
| signedFitsInNibble | back to summary |
|---|---|
| protected static boolean signedFitsInNibble(int value) Helper method to determine if a signed int value fits in a nibble.
| |
| signedFitsInShort | back to summary |
|---|---|
| protected static boolean signedFitsInShort(int value) Helper method to determine if a signed int value fits in a short.
| |
| unsignedFitsInByte | back to summary |
|---|---|
| protected static boolean unsignedFitsInByte(int value) Helper method to determine if an unsigned int value fits in a byte.
| |
| unsignedFitsInNibble | back to summary |
|---|---|
| protected static boolean unsignedFitsInNibble(int value) Helper method to determine if an unsigned int value fits in a nibble.
| |
| unsignedFitsInShort | back to summary |
|---|---|
| protected static boolean unsignedFitsInShort(int value) Helper method to determine if an unsigned int value fits in a short.
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0) Writes one code unit to the given output destination.
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, short c1) Writes two code units to the given output destination.
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, short c1, short c2) Writes three code units to the given output destination.
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, short c1, short c2, short c3) Writes four code units to the given output destination.
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, short c1, short c2, short c3, short c4) Writes five code units to the given output destination.
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, int c1c2) Writes three code units to the given output destination, where the
second and third are represented as single
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, int c1c2, short c3) Writes four code units to the given output destination, where the
second and third are represented as single
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, int c1c2, short c3, short c4) Writes five code units to the given output destination, where the
second and third are represented as single
| |
| write | back to summary |
|---|---|
| protected static void write(AnnotatedOutput out, short c0, long c1c2c3c4) Writes five code units to the given output destination, where the
second through fifth are represented as single
| |
| writeTo | back to summary |
|---|---|
| public abstract void writeTo(AnnotatedOutput out, DalvInsn insn) Writes the code units for the given instruction to the given output destination. The instruction must be of this instance's format. Subclasses must override this method.
| |