|
|
|
@ -853,22 +853,29 @@ public class CodeArray implements InstructionVisitor, Opcode { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stackHeight += 2; |
|
|
|
|
|
|
|
|
|
} else if (operand instanceof String) { |
|
|
|
|
final int index = constants.addConstant(Constant.STRING, operand); |
|
|
|
|
int index = constants.addConstant(Constant.STRING, operand); |
|
|
|
|
createLDC(index); |
|
|
|
|
} else if (operand instanceof Type) { |
|
|
|
|
// JDK5+ class literal
|
|
|
|
|
int index = constants.addConstant(Constant.CLASS, operand); |
|
|
|
|
createLDC(index); |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (index < 256) { |
|
|
|
|
addOpcode(Opcode.opc_ldc); |
|
|
|
|
addByte(index); |
|
|
|
|
} else { |
|
|
|
|
addOpcode(Opcode.opc_ldc_w); |
|
|
|
|
addShort(index); |
|
|
|
|
} |
|
|
|
|
private void createLDC(int index) { |
|
|
|
|
|
|
|
|
|
stackHeight++; |
|
|
|
|
if (index < 256) { |
|
|
|
|
addOpcode(Opcode.opc_ldc); |
|
|
|
|
addByte(index); |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(); |
|
|
|
|
addOpcode(Opcode.opc_ldc_w); |
|
|
|
|
addShort(index); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stackHeight++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|