Skip to content

8242152: SA does not include StackMapTables when dumping .class files #14556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -109,8 +109,7 @@ public ConstMethod(Address addr) {

// Fields
private static MetadataField constants;
// Raw stackmap data for the method (#entries + entries)
private static AddressField stackMapData;
private static AddressField stackMapData; // Raw stackmap data for the method (#entries + entries)
private static CIntField constMethodSize;
private static CIntField flags;
private static CIntField codeSize;
Original file line number Diff line number Diff line change
@@ -170,7 +170,7 @@ else if(cpConstType == JVM_CONSTANT_Long ||

// Code attributes
Short stackMapTableIndex = utf8ToIndex.get("StackMapTable");
_stackMapTableIndex = (stackMapTableIndex != null)?
_stackMapTableIndex = (stackMapTableIndex != null) ?
stackMapTableIndex.shortValue() : 0;
if (DEBUG) debugMessage("StackMapTable index = " + _stackMapTableIndex);

@@ -526,20 +526,20 @@ protected void writeMethod(Method m) throws IOException {
int stackMapAttrLen = 0;

if (hasStackMapTable) {
if (DEBUG) debugMessage("\tmethod has stack map table");
stackMapData = m.getStackMapData();
if (DEBUG) debugMessage("\t\tstack map table length = " + stackMapData.length());
if (DEBUG) debugMessage("\tmethod has stack map table");
stackMapData = m.getStackMapData();
if (DEBUG) debugMessage("\t\tstack map table length = " + stackMapData.length());

stackMapAttrLen = stackMapData.length();
stackMapAttrLen = stackMapData.length();

codeSize += 2 /* stack map table attr index */ +
4 /* stack map table attr length */ +
stackMapAttrLen;
codeSize += 2 /* stack map table attr index */ +
4 /* stack map table attr length */ +
stackMapAttrLen;

if (DEBUG) debugMessage("\t\tstack map table attr size = " +
stackMapAttrLen);
if (DEBUG) debugMessage("\t\tstack map table attr size = " +
stackMapAttrLen);

codeAttrCount++;
codeAttrCount++;
}

boolean hasLineNumberTable = m.hasLineNumberTable();
@@ -630,13 +630,13 @@ protected void writeMethod(Method m) throws IOException {

// write StackMapTable, if available
if (hasStackMapTable) {
writeIndex(_stackMapTableIndex);
dos.writeInt(stackMapAttrLen);
// We write bytes directly as stackMapData is
// raw data (#entries + entries)
for (int i = 0; i < stackMapData.length(); i++) {
dos.writeByte(stackMapData.at(i));
}
writeIndex(_stackMapTableIndex);
dos.writeInt(stackMapAttrLen);
// We write bytes directly as stackMapData is
// raw data (#entries + entries)
for (int i = 0; i < stackMapData.length(); i++) {
dos.writeByte(stackMapData.at(i));
}
}

// write LineNumberTable, if available.