Skip to content

Commit

Permalink
Fix constant mapping in J9ConstantPoolCommand
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
  • Loading branch information
fengxue-IS authored and midronij committed May 24, 2023
1 parent 5aba640 commit b211882
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ J9JavaClassFlags.J9ClassRequiresPrePadding = 0
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_INJECTED_INTERFACE_INFO = 0
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_PERMITTEDSUBCLASSES_ATTRIBUTE = 0
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_RECORD_ATTRIBUTE = 0
J9NonbuilderConstants.J9DescriptionCpBsmIndexMask = 0
J9NonbuilderConstants.J9DescriptionCpTypeShift = 0

J9DescriptionBits.J9DescriptionCpBsmIndexMask = 0
J9DescriptionBits.J9DescriptionCpTypeShift = 0

J9Object.OBJECT_HEADER_LOCK_LEARNING = 0
J9Object.OBJECT_HEADER_LOCK_LEARNING_RECURSION_OFFSET = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import com.ibm.j9ddr.vm29.structure.J9Class;
import com.ibm.j9ddr.vm29.structure.J9ConstantPool;
import com.ibm.j9ddr.vm29.structure.J9Consts;
import com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants;
import com.ibm.j9ddr.vm29.structure.J9DescriptionBits;
import com.ibm.j9ddr.vm29.structure.J9VTableHeader;
import com.ibm.j9ddr.vm29.structure.J9VmconstantpoolConstants;
import com.ibm.j9ddr.vm29.types.UDATA;
Expand Down Expand Up @@ -131,8 +131,8 @@ public static boolean isSupported() {
&& (0 != J9Consts.J9_ITABLE_INDEX_SHIFT)
&& (0 != J9Consts.J9_ITABLE_INDEX_TAG_BITS)
&& (0 != J9Consts.J9_ITABLE_INDEX_UNRESOLVED)
&& (0 != J9NonbuilderConstants.J9DescriptionCpBsmIndexMask)
&& (0 != J9NonbuilderConstants.J9DescriptionCpTypeShift);
&& (0 != J9DescriptionBits.J9DescriptionCpBsmIndexMask)
&& (0 != J9DescriptionBits.J9DescriptionCpTypeShift);
}

private static J9ClassPointer findClassByName(J9JavaVMPointer vm, String name) throws CorruptDataException {
Expand Down Expand Up @@ -485,7 +485,7 @@ public void run(String command, String[] args, Context context, final PrintStrea
long callSiteCount = romClass.callSiteCount().longValue();
U16Pointer bsmIndicies = U16Pointer.cast(callSiteData.addOffset(4 * callSiteCount));
U16Pointer bsmData = bsmIndicies.add(callSiteCount);
long bsmIndex = romRef.bsmIndexAndCpType().rightShift((int)J9NonbuilderConstants.J9DescriptionCpTypeShift).bitAnd(J9NonbuilderConstants.J9DescriptionCpBsmIndexMask).longValue();
long bsmIndex = romRef.bsmIndexAndCpType().rightShift((int)J9DescriptionBits.J9DescriptionCpTypeShift).bitAnd(J9DescriptionBits.J9DescriptionCpBsmIndexMask).longValue();

long argCount;
for (long j = 0; j < bsmIndex; j++) {
Expand Down

0 comments on commit b211882

Please sign in to comment.