@Nonnull private BuilderInstruction31t newBuilderInstruction31t(@Nonnull MethodLocation location, int[] codeAddressToIndex, @Nonnull Instruction31t instruction) { int codeAddress = location.getCodeAddress(); Label newLabel; if (instruction.getOpcode() != Opcode.FILL_ARRAY_DATA) { // if it's a sparse switch or packed switch newLabel = newSwitchPayloadReferenceLabel(location, codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } else { newLabel = newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } return new BuilderInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), newLabel); }
@Override public Op create(MethodLocation location, TIntObjectMap<MethodLocation> addressToLocation, VirtualMachine vm) { MethodLocation child = Utils.getNextLocation(location, addressToLocation); int address = location.getCodeAddress(); int branchOffset = ((OffsetInstruction) location.getInstruction()).getCodeOffset(); int targetAddress = address + branchOffset; MethodLocation target = addressToLocation.get(targetAddress); Instruction31t instr = (Instruction31t) location.getInstruction(); int register = instr.getRegisterA(); return new SwitchOp(location, child, target, register); }
targetOffset = endOffset; effectiveInstructions.set(i, new ImmutableInstruction31t(opcode, ((Instruction31t)instruction).getRegisterA(), targetOffset-codeOffset)); effectiveInstructions.add(payloadInstruction); endOffset += payloadInstruction.getCodeUnits(); targetOffset = endOffset; effectiveInstructions.set(i, new ImmutableInstruction31t(opcode, ((Instruction31t)instruction).getRegisterA(), targetOffset-codeOffset)); effectiveInstructions.add(payloadInstruction); endOffset += payloadInstruction.getCodeUnits();
@Override public Op create(MethodLocation location, TIntObjectMap<MethodLocation> addressToLocation, VirtualMachine vm) { BuilderInstruction instruction = (BuilderInstruction) location.getInstruction(); int address = instruction.getLocation().getCodeAddress(); int returnAddress = address + instruction.getCodeUnits(); MethodLocation returnLocation = addressToLocation.get(returnAddress); int branchOffset = ((OffsetInstruction) instruction).getCodeOffset(); int childAddress = address + branchOffset; MethodLocation child = addressToLocation.get(childAddress); Instruction31t instr = (Instruction31t) location.getInstruction(); int register = instr.getRegisterA(); return new FillArrayDataOp(location, child, returnLocation, register); } }
int destRegister = fillArrayInstr.getRegisterA(); int offset = fillArrayInstr.getCodeOffset(); int targetAddress = codeAddress + offset;
public static ImmutableInstruction31t of(Instruction31t instruction) { if (instruction instanceof ImmutableInstruction31t) { return (ImmutableInstruction31t)instruction; } return new ImmutableInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getCodeOffset()); }
public static ImmutableInstruction31t of(Instruction31t instruction) { if (instruction instanceof ImmutableInstruction31t) { return (ImmutableInstruction31t)instruction; } return new ImmutableInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getCodeOffset()); }
public static ImmutableInstruction31t of(Instruction31t instruction) { if (instruction instanceof ImmutableInstruction31t) { return (ImmutableInstruction31t)instruction; } return new ImmutableInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getCodeOffset()); }
public void write(@Nonnull Instruction31t instruction) { try { writer.write(instruction.getOpcode().value); writer.write(instruction.getRegisterA()); writer.writeInt(instruction.getCodeOffset()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction31t instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(instruction.getRegisterA()); writer.writeInt(instruction.getCodeOffset()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction31t instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(instruction.getRegisterA()); writer.writeInt(instruction.getCodeOffset()); } catch (IOException ex) { throw new RuntimeException(ex); } }
@Nonnull private BuilderInstruction31t newBuilderInstruction31t(@Nonnull MethodLocation location , int[] codeAddressToIndex, @Nonnull Instruction31t instruction) { int codeAddress = location.getCodeAddress(); Label newLabel; if (instruction.getOpcode() != Opcode.FILL_ARRAY_DATA) { // if it's a sparse switch or packed switch newLabel = newSwitchPayloadReferenceLabel(location, codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } else { newLabel = newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } return new BuilderInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), newLabel); }
@Nonnull private BuilderInstruction31t newBuilderInstruction31t(@Nonnull MethodLocation location , int[] codeAddressToIndex, @Nonnull Instruction31t instruction) { int codeAddress = location.getCodeAddress(); Label newLabel; if (instruction.getOpcode() != Opcode.FILL_ARRAY_DATA) { // if it's a sparse switch or packed switch newLabel = newSwitchPayloadReferenceLabel(location, codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } else { newLabel = newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } return new BuilderInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), newLabel); }
@Nonnull private BuilderInstruction31t newBuilderInstruction31t(@Nonnull MethodLocation location , int[] codeAddressToIndex, @Nonnull Instruction31t instruction) { int codeAddress = location.getCodeAddress(); Label newLabel; if (instruction.getOpcode() != Opcode.FILL_ARRAY_DATA) { // if it's a sparse switch or packed switch newLabel = newSwitchPayloadReferenceLabel(location, codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } else { newLabel = newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } return new BuilderInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), newLabel); }
@Nonnull private BuilderInstruction31t newBuilderInstruction31t(@Nonnull MethodLocation location, int[] codeAddressToIndex, @Nonnull Instruction31t instruction) { int codeAddress = location.getCodeAddress(); Label newLabel; if (instruction.getOpcode() != Opcode.FILL_ARRAY_DATA) { // if it's a sparse switch or packed switch newLabel = newSwitchPayloadReferenceLabel(location, codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } else { newLabel = newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset()); } return new BuilderInstruction31t( instruction.getOpcode(), instruction.getRegisterA(), newLabel); }
int interestingRegister = arrayFill.getRegisterA(); int curCounter = instCounter - 1;
int interestingRegister = arrayFill.getRegisterA(); int curCounter = instCounter - 1;
targetOffset = endOffset; effectiveInstructions.set(i, new ImmutableInstruction31t(opcode, ((Instruction31t)instruction).getRegisterA(), targetOffset-codeOffset)); effectiveInstructions.add(payloadInstruction); endOffset += payloadInstruction.getCodeUnits(); targetOffset = endOffset; effectiveInstructions.set(i, new ImmutableInstruction31t(opcode, ((Instruction31t)instruction).getRegisterA(), targetOffset-codeOffset)); effectiveInstructions.add(payloadInstruction); endOffset += payloadInstruction.getCodeUnits();
targetOffset = endOffset; effectiveInstructions.set(i, new ImmutableInstruction31t(opcode, ((Instruction31t) instruction).getRegisterA(), targetOffset - codeOffset)); effectiveInstructions.add(payloadInstruction); endOffset += payloadInstruction.getCodeUnits(); targetOffset = endOffset; effectiveInstructions.set(i, new ImmutableInstruction31t(opcode, ((Instruction31t) instruction).getRegisterA(), targetOffset - codeOffset)); effectiveInstructions.add(payloadInstruction); endOffset += payloadInstruction.getCodeUnits();
instructions.add(new ArrayFill(instLoc, ((Instruction31t)inst).getRegisterA(), ((Instruction31t)inst).getCodeOffset(), TypeReference.findOrCreate(myClass.getClassLoader().getReference(), arrayElementType.getName().toString()), inst.getOpcode(), this)); break; instructions.add(new Switch(instLoc, ((Instruction31t)inst).getRegisterA(), ((Instruction31t)inst).getCodeOffset(), inst.getOpcode(), this)); break;