public Instruction shrink() { // Do we need a short index or a long index? if (requiredConstantIndexSize() == 1) { // Can we replace the long instruction by a short instruction? if (opcode == InstructionConstants.OP_LDC_W) { opcode = InstructionConstants.OP_LDC; } } else { // Should we replace the short instruction by a long instruction? if (opcode == InstructionConstants.OP_LDC) { opcode = InstructionConstants.OP_LDC_W; } } return this; }
public Instruction shrink() { // Do we need a short index or a long index? if (requiredConstantIndexSize() == 1) { // Can we replace the long instruction by a short instruction? if (opcode == InstructionConstants.OP_LDC_W) { opcode = InstructionConstants.OP_LDC; } } else { // Should we replace the short instruction by a long instruction? if (opcode == InstructionConstants.OP_LDC) { opcode = InstructionConstants.OP_LDC_W; } } return this; }
public Instruction shrink() { // Do we need a short index or a long index? if (requiredConstantIndexSize() == 1) { // Can we replace the long instruction by a short instruction? if (opcode == InstructionConstants.OP_LDC_W) { opcode = InstructionConstants.OP_LDC; } } else { // Should we replace the short instruction by a long instruction? if (opcode == InstructionConstants.OP_LDC) { opcode = InstructionConstants.OP_LDC_W; } } return this; }
public Instruction shrink() { // Do we need a short index or a long index? if (requiredConstantIndexSize() == 1) { // Can we replace the long instruction by a short instruction? if (opcode == InstructionConstants.OP_LDC_W) { opcode = InstructionConstants.OP_LDC; } } else { // Should we replace the short instruction by a long instruction? if (opcode == InstructionConstants.OP_LDC) { opcode = InstructionConstants.OP_LDC_W; } } return this; }
protected void writeInfo(byte[] code, int offset) { int constantIndexSize = constantIndexSize(); int constantSize = constantSize(); if (requiredConstantIndexSize() > constantIndexSize) { throw new IllegalArgumentException("Instruction has invalid constant index size ("+this.toString(offset)+")"); } writeValue(code, offset, constantIndex, constantIndexSize); offset += constantIndexSize; writeValue(code, offset, constant, constantSize); }
protected void writeInfo(byte[] code, int offset) { int constantIndexSize = constantIndexSize(); int constantSize = constantSize(); if (requiredConstantIndexSize() > constantIndexSize) { throw new IllegalArgumentException("Instruction has invalid constant index size ("+this.toString(offset)+")"); } writeValue(code, offset, constantIndex, constantIndexSize); offset += constantIndexSize; writeValue(code, offset, constant, constantSize); }
protected void writeInfo(byte[] code, int offset) { int constantIndexSize = constantIndexSize(); int constantSize = constantSize(); if (requiredConstantIndexSize() > constantIndexSize) { throw new IllegalArgumentException("Instruction has invalid constant index size ("+this.toString(offset)+")"); } writeValue(code, offset, constantIndex, constantIndexSize); offset += constantIndexSize; writeValue(code, offset, constant, constantSize); }
protected void writeInfo(byte[] code, int offset) { int constantIndexSize = constantIndexSize(); int constantSize = constantSize(); if (requiredConstantIndexSize() > constantIndexSize) { throw new IllegalArgumentException("Instruction has invalid constant index size ("+this.toString(offset)+")"); } writeValue(code, offset, constantIndex, constantIndexSize); offset += constantIndexSize; writeValue(code, offset, constant, constantSize); }