本文整理汇总了Java中jdk.internal.org.objectweb.asm.Opcodes.AASTORE属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.AASTORE属性的具体用法?Java Opcodes.AASTORE怎么用?Java Opcodes.AASTORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类jdk.internal.org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.AASTORE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: arrayInsnOpcode
private int arrayInsnOpcode(byte tcode, int aaop) throws InternalError {
assert(aaop == Opcodes.AASTORE || aaop == Opcodes.AALOAD);
int xas;
switch (tcode) {
case Opcodes.T_BOOLEAN: xas = Opcodes.BASTORE; break;
case Opcodes.T_BYTE: xas = Opcodes.BASTORE; break;
case Opcodes.T_CHAR: xas = Opcodes.CASTORE; break;
case Opcodes.T_SHORT: xas = Opcodes.SASTORE; break;
case Opcodes.T_INT: xas = Opcodes.IASTORE; break;
case Opcodes.T_LONG: xas = Opcodes.LASTORE; break;
case Opcodes.T_FLOAT: xas = Opcodes.FASTORE; break;
case Opcodes.T_DOUBLE: xas = Opcodes.DASTORE; break;
case 0: xas = Opcodes.AASTORE; break;
default: throw new InternalError();
}
return xas - Opcodes.AASTORE + aaop;
}
示例2: emitNewArray
void emitNewArray(Name name) throws InternalError {
Class<?> rtype = name.function.methodType().returnType();
if (name.arguments.length == 0) {
// The array will be a constant.
Object emptyArray;
try {
emptyArray = name.function.resolvedHandle().invoke();
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(java.lang.reflect.Array.getLength(emptyArray) == 0);
assert(emptyArray.getClass() == rtype); // exact typing
mv.visitLdcInsn(constantPlaceholder(emptyArray));
emitReferenceCast(rtype, emptyArray);
return;
}
Class<?> arrayElementType = rtype.getComponentType();
assert(arrayElementType != null);
emitIconstInsn(name.arguments.length);
int xas = Opcodes.AASTORE;
if (!arrayElementType.isPrimitive()) {
mv.visitTypeInsn(Opcodes.ANEWARRAY, getInternalName(arrayElementType));
} else {
byte tc = arrayTypeCode(Wrapper.forPrimitiveType(arrayElementType));
xas = arrayInsnOpcode(tc, xas);
mv.visitIntInsn(Opcodes.NEWARRAY, tc);
}
// store arguments
for (int i = 0; i < name.arguments.length; i++) {
mv.visitInsn(Opcodes.DUP);
emitIconstInsn(i);
emitPushArgument(name, i);
mv.visitInsn(xas);
}
// the array is left on the stack
assertStaticType(rtype, name);
}