提交 48160f7a 编写于 作者: K kvn

6892186: SA does not dump debug info for scalar replaced objects

Summary: Implement scalar replaced objects debug info dump in SA.
Reviewed-by: twisti
上级 344b0e97
...@@ -48,8 +48,16 @@ if [ "$OS" = "Linux" ]; then ...@@ -48,8 +48,16 @@ if [ "$OS" = "Linux" ]; then
CPU=i386 CPU=i386
fi fi
else else
LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so # configure audit helper library if SA_ALTROOT is set
export LD_AUDIT_32 if [ -n "$SA_ALTROOT" ]; then
LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so
export LD_AUDIT_32
if [ ! -f $LD_AUDIT_32 ]; then
echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
echo "Make sure to build it with 'make natives'."
exit 1
fi
fi
SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p` SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
CPU=sparc CPU=sparc
......
...@@ -43,8 +43,16 @@ else ...@@ -43,8 +43,16 @@ else
fi fi
fi fi
LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so # configure audit helper library if SA_ALTROOT is set
export LD_AUDIT_64 if [ -n "$SA_ALTROOT" ]; then
LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so
export LD_AUDIT_64
if [ ! -f $LD_AUDIT_64 ]; then
echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
echo "Make sure to build it with 'make natives'."
exit 1
fi
fi
SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU
OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
......
...@@ -926,6 +926,28 @@ public class CommandProcessor { ...@@ -926,6 +926,28 @@ public class CommandProcessor {
} }
} }
}, },
new Command("dumpcodecache", "dumpcodecache", false) {
public void doit(Tokens t) {
if (t.countTokens() != 0) {
usage();
} else {
final PrintStream fout = out;
final HTMLGenerator gen = new HTMLGenerator(false);
CodeCacheVisitor v = new CodeCacheVisitor() {
public void prologue(Address start, Address end) {
}
public void visit(CodeBlob blob) {
fout.println(gen.genHTML(blob.instructionsBegin()));
}
public void epilogue() {
}
};
VM.getVM().getCodeCache().iterate(v);
}
}
},
new Command("where", "where { -a | id }", false) { new Command("where", "where { -a | id }", false) {
public void doit(Tokens t) { public void doit(Tokens t) {
if (t.countTokens() != 1) { if (t.countTokens() != 1) {
......
...@@ -173,7 +173,8 @@ public class CodeCache { ...@@ -173,7 +173,8 @@ public class CodeCache {
CodeBlob lastBlob = null; CodeBlob lastBlob = null;
while (ptr != null && ptr.lessThan(end)) { while (ptr != null && ptr.lessThan(end)) {
try { try {
CodeBlob blob = findBlobUnsafe(ptr); // Use findStart to get a pointer inside blob other findBlob asserts
CodeBlob blob = findBlobUnsafe(heap.findStart(ptr));
if (blob != null) { if (blob != null) {
visitor.visit(blob); visitor.visit(blob);
if (blob == lastBlob) { if (blob == lastBlob) {
......
...@@ -42,7 +42,7 @@ public class NMethod extends CodeBlob { ...@@ -42,7 +42,7 @@ public class NMethod extends CodeBlob {
/** To support simple linked-list chaining of nmethods */ /** To support simple linked-list chaining of nmethods */
private static AddressField osrLinkField; private static AddressField osrLinkField;
private static AddressField scavengeRootLinkField; private static AddressField scavengeRootLinkField;
private static CIntegerField scavengeRootStateField; private static JByteField scavengeRootStateField;
/** Offsets for different nmethod parts */ /** Offsets for different nmethod parts */
private static CIntegerField exceptionOffsetField; private static CIntegerField exceptionOffsetField;
...@@ -92,7 +92,7 @@ public class NMethod extends CodeBlob { ...@@ -92,7 +92,7 @@ public class NMethod extends CodeBlob {
entryBCIField = type.getCIntegerField("_entry_bci"); entryBCIField = type.getCIntegerField("_entry_bci");
osrLinkField = type.getAddressField("_osr_link"); osrLinkField = type.getAddressField("_osr_link");
scavengeRootLinkField = type.getAddressField("_scavenge_root_link"); scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
scavengeRootStateField = type.getCIntegerField("_scavenge_root_state"); scavengeRootStateField = type.getJByteField("_scavenge_root_state");
exceptionOffsetField = type.getCIntegerField("_exception_offset"); exceptionOffsetField = type.getCIntegerField("_exception_offset");
deoptOffsetField = type.getCIntegerField("_deoptimize_offset"); deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
...@@ -274,7 +274,7 @@ public class NMethod extends CodeBlob { ...@@ -274,7 +274,7 @@ public class NMethod extends CodeBlob {
if (Assert.ASSERTS_ENABLED) { if (Assert.ASSERTS_ENABLED) {
Assert.that(pd != null, "scope must be present"); Assert.that(pd != null, "scope must be present");
} }
return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getReexecute()); return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute());
} }
/** This is only for use by the debugging system, and is only /** This is only for use by the debugging system, and is only
...@@ -306,11 +306,11 @@ public class NMethod extends CodeBlob { ...@@ -306,11 +306,11 @@ public class NMethod extends CodeBlob {
public ScopeDesc getScopeDescNearDbg(Address pc) { public ScopeDesc getScopeDescNearDbg(Address pc) {
PCDesc pd = getPCDescNearDbg(pc); PCDesc pd = getPCDescNearDbg(pc);
if (pd == null) return null; if (pd == null) return null;
return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getReexecute()); return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute());
} }
public Map/*<Address, PcDesc>*/ getSafepoints() { public Map/*<Address, PCDesc>*/ getSafepoints() {
Map safepoints = new HashMap(); // Map<Address, PcDesc> Map safepoints = new HashMap(); // Map<Address, PCDesc>
sun.jvm.hotspot.debugger.Address p = null; sun.jvm.hotspot.debugger.Address p = null;
for (p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); for (p = scopesPCsBegin(); p.lessThan(scopesPCsEnd());
p = p.addOffsetTo(pcDescSize)) { p = p.addOffsetTo(pcDescSize)) {
......
...@@ -36,6 +36,7 @@ import sun.jvm.hotspot.types.*; ...@@ -36,6 +36,7 @@ import sun.jvm.hotspot.types.*;
public class PCDesc extends VMObject { public class PCDesc extends VMObject {
private static CIntegerField pcOffsetField; private static CIntegerField pcOffsetField;
private static CIntegerField scopeDecodeOffsetField; private static CIntegerField scopeDecodeOffsetField;
private static CIntegerField objDecodeOffsetField;
private static CIntegerField pcFlagsField; private static CIntegerField pcFlagsField;
static { static {
...@@ -51,6 +52,7 @@ public class PCDesc extends VMObject { ...@@ -51,6 +52,7 @@ public class PCDesc extends VMObject {
pcOffsetField = type.getCIntegerField("_pc_offset"); pcOffsetField = type.getCIntegerField("_pc_offset");
scopeDecodeOffsetField = type.getCIntegerField("_scope_decode_offset"); scopeDecodeOffsetField = type.getCIntegerField("_scope_decode_offset");
objDecodeOffsetField = type.getCIntegerField("_obj_decode_offset");
pcFlagsField = type.getCIntegerField("_flags"); pcFlagsField = type.getCIntegerField("_flags");
} }
...@@ -68,6 +70,10 @@ public class PCDesc extends VMObject { ...@@ -68,6 +70,10 @@ public class PCDesc extends VMObject {
return ((int) scopeDecodeOffsetField.getValue(addr)); return ((int) scopeDecodeOffsetField.getValue(addr));
} }
public int getObjDecodeOffset() {
return ((int) objDecodeOffsetField.getValue(addr));
}
public Address getRealPC(NMethod code) { public Address getRealPC(NMethod code) {
return code.instructionsBegin().addOffsetTo(getPCOffset()); return code.instructionsBegin().addOffsetTo(getPCOffset());
} }
......
...@@ -51,11 +51,10 @@ public class ScopeDesc { ...@@ -51,11 +51,10 @@ public class ScopeDesc {
/** Scalar replaced bjects pool */ /** Scalar replaced bjects pool */
private List objects; // ArrayList<ScopeValue> private List objects; // ArrayList<ScopeValue>
private ScopeDesc(NMethod code, int decodeOffset, List objects, boolean reexecute) {
public ScopeDesc(NMethod code, int decodeOffset, boolean reexecute) {
this.code = code; this.code = code;
this.decodeOffset = decodeOffset; this.decodeOffset = decodeOffset;
this.objects = decodeObjectValues(DebugInformationRecorder.SERIALIZED_NULL); this.objects = objects;
this.reexecute = reexecute; this.reexecute = reexecute;
// Decode header // Decode header
...@@ -108,7 +107,7 @@ public class ScopeDesc { ...@@ -108,7 +107,7 @@ public class ScopeDesc {
return decodeMonitorValues(monitorsDecodeOffset); return decodeMonitorValues(monitorsDecodeOffset);
} }
/** Returns a List&lt;MonitorValue&gt; */ /** Returns a List&lt;ObjectValue&gt; */
public List getObjects() { public List getObjects() {
return objects; return objects;
} }
...@@ -119,7 +118,7 @@ public class ScopeDesc { ...@@ -119,7 +118,7 @@ public class ScopeDesc {
return null; return null;
} }
return new ScopeDesc(code, senderDecodeOffset, false); return new ScopeDesc(code, senderDecodeOffset, objects, false);
} }
/** Returns where the scope was decoded */ /** Returns where the scope was decoded */
......
...@@ -807,6 +807,9 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -807,6 +807,9 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
Interpreter interp = VM.getVM().getInterpreter(); Interpreter interp = VM.getVM().getInterpreter();
if (interp.contains(pc)) { if (interp.contains(pc)) {
InterpreterCodelet codelet = interp.getCodeletContaining(pc); InterpreterCodelet codelet = interp.getCodeletContaining(pc);
if (codelet == null) {
return "Unknown location in the Interpreter: " + pc;
}
return genHTML(codelet); return genHTML(codelet);
} }
return genHTML(blob); return genHTML(blob);
...@@ -969,16 +972,24 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -969,16 +972,24 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
} }
protected String genSafepointInfo(NMethod nm, PCDesc pcDesc) { protected String genSafepointInfo(NMethod nm, PCDesc pcDesc) {
ScopeDesc sd = nm.getScopeDescAt(pcDesc.getRealPC(nm)); ScopeDesc sd = nm.getScopeDescAt(pcDesc.getRealPC(nm));
Formatter buf = new Formatter(genHTML); Formatter buf = new Formatter(genHTML);
Formatter tabs = new Formatter(genHTML); Formatter tabs = new Formatter(genHTML);
tabs.append(tab + tab + tab); // Initial indent for debug info
buf.beginTag("pre"); buf.beginTag("pre");
genScope(buf, tabs, sd); genScope(buf, tabs, sd);
buf.endTag("pre");
buf.append(genOopMapInfo(nm, pcDesc));
return buf.toString(); // Reset indent for scalar replaced objects
tabs = new Formatter(genHTML);
tabs.append(tab + tab + tab); // Initial indent for debug info
genScObjInfo(buf, tabs, sd);
buf.endTag("pre");
buf.append(genOopMapInfo(nm, pcDesc));
return buf.toString();
} }
protected void genScope(Formatter buf, Formatter tabs, ScopeDesc sd) { protected void genScope(Formatter buf, Formatter tabs, ScopeDesc sd) {
...@@ -1022,8 +1033,95 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1022,8 +1033,95 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append(genHTMLForMonitors(sd, monitors)); buf.append(genHTMLForMonitors(sd, monitors));
} }
tabs.append(tab);
buf.br(); buf.br();
tabs.append(tab);
}
protected void genScObjInfo(Formatter buf, Formatter tabs, ScopeDesc sd) {
if (sd == null) {
return;
}
List objects = sd.getObjects();
if (objects == null) {
return;
}
int length = objects.size();
for (int i = 0; i < length; i++) {
buf.append(tabs);
ObjectValue ov = (ObjectValue)objects.get(i);
buf.append("ScObj" + i);
ScopeValue sv = ov.getKlass();
if (Assert.ASSERTS_ENABLED) {
Assert.that(sv.isConstantOop(), "scalar replaced object klass must be constant oop");
}
ConstantOopReadValue klv = (ConstantOopReadValue)sv;
OopHandle klHandle = klv.getValue();
if (Assert.ASSERTS_ENABLED) {
Assert.that(klHandle != null, "scalar replaced object klass must be not NULL");
}
Oop obj = VM.getVM().getObjectHeap().newOop(klHandle);
if (obj instanceof InstanceKlass) {
InstanceKlass kls = (InstanceKlass) obj;
buf.append(" " + kls.getName().asString() + "={");
int flen = ov.fieldsSize();
TypeArray klfields = kls.getFields();
int klen = (int) klfields.getLength();
ConstantPool cp = kls.getConstants();
int findex = 0;
for (int index = 0; index < klen; index += kls.NEXT_OFFSET) {
int accsFlags = klfields.getShortAt(index + kls.ACCESS_FLAGS_OFFSET);
int nameIndex = klfields.getShortAt(index + kls.NAME_INDEX_OFFSET);
AccessFlags access = new AccessFlags(accsFlags);
if (!access.isStatic()) {
ScopeValue svf = ov.getFieldAt(findex++);
String fstr = scopeValueAsString(sd, svf);
Symbol f_name = cp.getSymbolAt(nameIndex);
buf.append(" [" + f_name.asString() + " :"+ index + "]=(#" + fstr + ")");
}
}
buf.append(" }");
} else {
buf.append(" ");
int flen = ov.fieldsSize();
if (obj instanceof TypeArrayKlass) {
TypeArrayKlass kls = (TypeArrayKlass) obj;
buf.append(kls.getElementTypeName() + "[" + flen + "]");
} else if (obj instanceof ObjArrayKlass) {
ObjArrayKlass kls = (ObjArrayKlass) obj;
Klass elobj = kls.getBottomKlass();
if (elobj instanceof InstanceKlass) {
buf.append(elobj.getName().asString());
} else if (elobj instanceof TypeArrayKlass) {
TypeArrayKlass elkls = (TypeArrayKlass) elobj;
buf.append(elkls.getElementTypeName());
} else {
if (Assert.ASSERTS_ENABLED) {
Assert.that(false, "unknown scalar replaced object klass!");
}
}
buf.append("[" + flen + "]");
int ndim = (int) kls.getDimension();
while (--ndim > 0) {
buf.append("[]");
}
} else {
if (Assert.ASSERTS_ENABLED) {
Assert.that(false, "unknown scalar replaced object klass!");
}
}
buf.append("={");
for (int findex = 0; findex < flen; findex++) {
ScopeValue svf = ov.getFieldAt(findex);
String fstr = scopeValueAsString(sd, svf);
buf.append(" [" + findex + "]=(#" + fstr + ")");
}
buf.append(" }");
}
buf.br();
}
} }
protected String genHTMLForOopMap(OopMap map) { protected String genHTMLForOopMap(OopMap map) {
...@@ -1037,8 +1135,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1037,8 +1135,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
tmpBuf.beginTag("tr"); tmpBuf.beginTag("tr");
tmpBuf.beginTag("td"); tmpBuf.beginTag("td");
tmpBuf.append(type); tmpBuf.append(type);
tmpBuf.endTag("td");
tmpBuf.endTag("tr");
for (; ! oms.isDone(); oms.next()) { for (; ! oms.isDone(); oms.next()) {
OopMapValue omv = oms.getCurrent(); OopMapValue omv = oms.getCurrent();
if (omv == null) { if (omv == null) {
...@@ -1048,7 +1144,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1048,7 +1144,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
VMReg vmReg = omv.getReg(); VMReg vmReg = omv.getReg();
int reg = vmReg.getValue(); int reg = vmReg.getValue();
if (reg < stack0) { if (reg < stack0) {
tmpBuf.append(VMRegImpl.getRegisterName(vmReg.getValue())); tmpBuf.append(VMRegImpl.getRegisterName(reg));
} else { } else {
tmpBuf.append('['); tmpBuf.append('[');
tmpBuf.append(Integer.toString((reg - stack0) * 4)); tmpBuf.append(Integer.toString((reg - stack0) * 4));
...@@ -1058,7 +1154,13 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1058,7 +1154,13 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
tmpBuf.append(" = "); tmpBuf.append(" = ");
VMReg vmContentReg = omv.getContentReg(); VMReg vmContentReg = omv.getContentReg();
int contentReg = vmContentReg.getValue(); int contentReg = vmContentReg.getValue();
tmpBuf.append(VMRegImpl.getRegisterName(vmContentReg.getValue())); if (contentReg < stack0) {
tmpBuf.append(VMRegImpl.getRegisterName(contentReg));
} else {
tmpBuf.append('[');
tmpBuf.append(Integer.toString((contentReg - stack0) * 4));
tmpBuf.append(']');
}
} }
tmpBuf.append(spaces); tmpBuf.append(spaces);
} }
...@@ -1072,19 +1174,19 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1072,19 +1174,19 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
OopMapValueIterator omvIterator = new OopMapValueIterator(); OopMapValueIterator omvIterator = new OopMapValueIterator();
OopMapStream oms = new OopMapStream(map, OopMapValue.OopTypes.OOP_VALUE); OopMapStream oms = new OopMapStream(map, OopMapValue.OopTypes.OOP_VALUE);
buf.append(omvIterator.iterate(oms, "Oop:", false)); buf.append(omvIterator.iterate(oms, "Oops:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.VALUE_VALUE);
buf.append(omvIterator.iterate(oms, "Value:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.NARROWOOP_VALUE); oms = new OopMapStream(map, OopMapValue.OopTypes.NARROWOOP_VALUE);
buf.append(omvIterator.iterate(oms, "Oop:", false)); buf.append(omvIterator.iterate(oms, "narrowOops:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.VALUE_VALUE);
buf.append(omvIterator.iterate(oms, "Values:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.CALLEE_SAVED_VALUE); oms = new OopMapStream(map, OopMapValue.OopTypes.CALLEE_SAVED_VALUE);
buf.append(omvIterator.iterate(oms, "Callee saved:", true)); buf.append(omvIterator.iterate(oms, "Callee saved:", true));
oms = new OopMapStream(map, OopMapValue.OopTypes.DERIVED_OOP_VALUE); oms = new OopMapStream(map, OopMapValue.OopTypes.DERIVED_OOP_VALUE);
buf.append(omvIterator.iterate(oms, "Derived oop:", true)); buf.append(omvIterator.iterate(oms, "Derived oops:", true));
buf.endTag("table"); buf.endTag("table");
return buf.toString(); return buf.toString();
...@@ -1093,6 +1195,8 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1093,6 +1195,8 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
protected String genOopMapInfo(NMethod nmethod, PCDesc pcDesc) { protected String genOopMapInfo(NMethod nmethod, PCDesc pcDesc) {
OopMapSet mapSet = nmethod.getOopMaps(); OopMapSet mapSet = nmethod.getOopMaps();
if (mapSet == null || (mapSet.getSize() <= 0))
return "";
int pcOffset = pcDesc.getPCOffset(); int pcOffset = pcDesc.getPCOffset();
OopMap map = mapSet.findMapAtOffset(pcOffset, VM.getVM().isDebugging()); OopMap map = mapSet.findMapAtOffset(pcOffset, VM.getVM().isDebugging());
if (map == null) { if (map == null) {
...@@ -1106,6 +1210,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1106,6 +1210,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
Formatter buf = new Formatter(genHTML); Formatter buf = new Formatter(genHTML);
buf.beginTag("pre"); buf.beginTag("pre");
buf.append("OopMap: "); buf.append("OopMap: ");
buf.br();
buf.append(genHTMLForOopMap(map)); buf.append(genHTMLForOopMap(map));
buf.endTag("pre"); buf.endTag("pre");
...@@ -1154,7 +1259,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1154,7 +1259,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
return buf.toString(); return buf.toString();
} }
private String scopeValueAsString(ScopeValue sv) { private String scopeValueAsString(ScopeDesc sd, ScopeValue sv) {
Formatter buf = new Formatter(genHTML); Formatter buf = new Formatter(genHTML);
if (sv.isConstantInt()) { if (sv.isConstantInt()) {
buf.append("int "); buf.append("int ");
...@@ -1187,6 +1292,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1187,6 +1292,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
} else { } else {
buf.append("null"); buf.append("null");
} }
} else if (sv.isObject()) {
ObjectValue ov = (ObjectValue)sv;
buf.append("#ScObj" + sd.getObjects().indexOf(ov));
} else {
buf.append("unknown scope value " + sv);
} }
return buf.toString(); return buf.toString();
} }
...@@ -1219,7 +1329,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1219,7 +1329,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
} }
buf.append(", "); buf.append(", ");
buf.append(scopeValueAsString(sv)); buf.append(scopeValueAsString(sd, sv));
buf.append(") "); buf.append(") ");
} }
...@@ -1246,7 +1356,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1246,7 +1356,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append("(owner = "); buf.append("(owner = ");
ScopeValue owner = mv.owner(); ScopeValue owner = mv.owner();
if (owner != null) { if (owner != null) {
buf.append(scopeValueAsString(owner)); buf.append(scopeValueAsString(sd, owner));
} else { } else {
buf.append("null"); buf.append("null");
} }
...@@ -1324,11 +1434,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants { ...@@ -1324,11 +1434,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append(instr.asString(currentPc, symFinder)); buf.append(instr.asString(currentPc, symFinder));
} }
buf.br();
if (isSafepoint && !prevWasCall) { if (isSafepoint && !prevWasCall) {
buf.append(genSafepointInfo(nmethod, pcDesc)); buf.append(genSafepointInfo(nmethod, pcDesc));
} }
buf.br();
prevWasCall = instr.isCall(); prevWasCall = instr.isCall();
} }
......
...@@ -1047,7 +1047,7 @@ while (tmp.itr.hasNext()) { ...@@ -1047,7 +1047,7 @@ while (tmp.itr.hasNext()) {
} else { } else {
// some type names have ':'. replace to make it as a // some type names have ':'. replace to make it as a
// JavaScript identifier // JavaScript identifier
tmp.name = tmp.name.replace(':', '_'); tmp.name = tmp.name.replace(':', '_').replace('<', '_').replace('>', '_').replace('*', '_').replace(' ', '_');
eval("function read" + tmp.name + "(addr) {" + eval("function read" + tmp.name + "(addr) {" +
" return readVMType('" + tmp.name + "', addr);}"); " return readVMType('" + tmp.name + "', addr);}");
eval("function print" + tmp.name + "(addr) {" + eval("function print" + tmp.name + "(addr) {" +
......
...@@ -421,21 +421,23 @@ void JVMState::format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st) ...@@ -421,21 +421,23 @@ void JVMState::format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st)
iklass = cik->as_instance_klass(); iklass = cik->as_instance_klass();
} else if (cik->is_type_array_klass()) { } else if (cik->is_type_array_klass()) {
cik->as_array_klass()->base_element_type()->print_name_on(st); cik->as_array_klass()->base_element_type()->print_name_on(st);
st->print("[%d]=", spobj->n_fields()); st->print("[%d]", spobj->n_fields());
} else if (cik->is_obj_array_klass()) { } else if (cik->is_obj_array_klass()) {
ciType* cie = cik->as_array_klass()->base_element_type(); ciKlass* cie = cik->as_obj_array_klass()->base_element_klass();
int ndim = 1; if (cie->is_instance_klass()) {
while (cie->is_obj_array_klass()) { cie->print_name_on(st);
ndim += 1; } else if (cie->is_type_array_klass()) {
cie = cie->as_array_klass()->base_element_type(); cie->as_array_klass()->base_element_type()->print_name_on(st);
} else {
ShouldNotReachHere();
} }
cie->print_name_on(st); st->print("[%d]", spobj->n_fields());
int ndim = cik->as_array_klass()->dimension() - 1;
while (ndim-- > 0) { while (ndim-- > 0) {
st->print("[]"); st->print("[]");
} }
st->print("[%d]=", spobj->n_fields());
} }
st->print("{"); st->print("={");
uint nf = spobj->n_fields(); uint nf = spobj->n_fields();
if (nf > 0) { if (nf > 0) {
uint first_ind = spobj->first_index(); uint first_ind = spobj->first_index();
......
...@@ -594,6 +594,7 @@ static inline uint64_t cast_uint64_t(size_t x) ...@@ -594,6 +594,7 @@ static inline uint64_t cast_uint64_t(size_t x)
\ \
nonstatic_field(PcDesc, _pc_offset, int) \ nonstatic_field(PcDesc, _pc_offset, int) \
nonstatic_field(PcDesc, _scope_decode_offset, int) \ nonstatic_field(PcDesc, _scope_decode_offset, int) \
nonstatic_field(PcDesc, _obj_decode_offset, int) \
nonstatic_field(PcDesc, _flags, PcDesc::PcDescFlags) \ nonstatic_field(PcDesc, _flags, PcDesc::PcDescFlags) \
\ \
/***************************************************/ \ /***************************************************/ \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册