< prev index next >
src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassWriter.java
Print this page
@@ -1079,11 +1079,11 @@
} else { // s == primitive type or array
return newClassItem(t.getDescriptor());
}
} else if (cst instanceof Handle) {
Handle h = (Handle) cst;
- return newHandleItem(h.tag, h.owner, h.name, h.desc);
+ return newHandleItem(h.tag, h.owner, h.name, h.desc, h.intfs);
} else {
throw new IllegalArgumentException("value " + cst);
}
}
@@ -1214,24 +1214,26 @@
* the internal name of the field or method owner class.
* @param name
* the name of the field or method.
* @param desc
* the descriptor of the field or method.
+ * @param intfs
+ * the indicator of interface static method
* @return a new or an already existing method type reference item.
*/
Item newHandleItem(final int tag, final String owner, final String name,
- final String desc) {
+ final String desc, final boolean intfs) {
key4.set(HANDLE_BASE + tag, owner, name, desc);
Item result = get(key4);
if (result == null) {
if (tag <= Opcodes.H_PUTSTATIC) {
put112(HANDLE, tag, newField(owner, name, desc));
} else {
put112(HANDLE,
tag,
newMethod(owner, name, desc,
- tag == Opcodes.H_INVOKEINTERFACE));
+ tag == Opcodes.H_INVOKEINTERFACE || intfs));
}
result = new Item(index++, key4);
put(result);
}
return result;
@@ -1255,16 +1257,18 @@
* the internal name of the field or method owner class.
* @param name
* the name of the field or method.
* @param desc
* the descriptor of the field or method.
+ * @param intfs
+ * the indicator of interface static method
* @return the index of a new or already existing method type reference
* item.
*/
public int newHandle(final int tag, final String owner, final String name,
- final String desc) {
- return newHandleItem(tag, owner, name, desc).index;
+ final String desc, final boolean intfs) {
+ return newHandleItem(tag, owner, name, desc, intfs).index;
}
/**
* Adds an invokedynamic reference to the constant pool of the class being
* build. Does nothing if the constant pool already contains a similar item.
@@ -1292,11 +1296,11 @@
int position = bootstrapMethods.length; // record current position
int hashCode = bsm.hashCode();
bootstrapMethods.putShort(newHandle(bsm.tag, bsm.owner, bsm.name,
- bsm.desc));
+ bsm.desc, bsm.intfs));
int argsLength = bsmArgs.length;
bootstrapMethods.putShort(argsLength);
for (int i = 0; i < argsLength; i++) {
< prev index next >