Skip to content

Commit

Permalink
Merge pull request eclipse-openj9#19 from Graham-Chapman/ibm_sdk
Browse files Browse the repository at this point in the history
Allow Object methods in invokeinterface
  • Loading branch information
DanHeidinga authored and GitHub Enterprise committed Jan 15, 2018
2 parents 1dc52f9 + a71414f commit 947d72c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion runtime/vm/resolvesupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,18 @@ resolveInterfaceMethodRefInto(J9VMThread *vmStruct, J9ConstantPool *ramCP, UDATA
if (method != NULL) {
if (ramCPEntry != NULL) {
J9RAMInterfaceMethodRef *ramInterfaceMethodRef = (J9RAMInterfaceMethodRef *)&ramCP[cpIndex];
UDATA methodIndex = getITableIndexForMethod(method, interfaceClass) << 8;
J9Class *methodClass = J9_CLASS_FROM_METHOD(method);
UDATA methodIndex = 0;
UDATA oldArgCount = ramInterfaceMethodRef->methodIndexAndArgCount & 255;
/* Object methods may be invoked via invokeinterface. In that case, use Object
* for the interfaceClass in the ref. The methodIndex value doesn't matter as
* Object will never be found in an iTable.
*/
if (J9_ARE_ANY_BITS_SET(methodClass->romClass->modifiers, J9_JAVA_INTERFACE)) {
methodIndex = getITableIndexForMethod(method, interfaceClass) << 8;
} else {
interfaceClass = methodClass;
}
methodIndex |= oldArgCount;
ramCPEntry->methodIndexAndArgCount = methodIndex;
/* interfaceClass is used to indicate resolved. Make sure to write it last */
Expand Down

0 comments on commit 947d72c

Please sign in to comment.