Mercurial > hg > truffle
changeset 5230:333930100018
enhanced disassembly to decode stub addresses for runtime calls
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 11 Apr 2012 12:25:59 +0200 |
parents | e0f17fb3e7d2 |
children | 7564f0469116 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java |
diffstat | 1 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Wed Apr 11 11:37:24 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Wed Apr 11 12:25:59 2012 +0200 @@ -81,6 +81,22 @@ return compiler.getVMEntries().disassembleNative(code, address); } + private String getTargetName(Object target) { + Field[] fields = config.getClass().getDeclaredFields(); + for (Field f : fields) { + if (f.getName().endsWith("Stub")) { + f.setAccessible(true); + try { + if (f.get(config) == target) { + return f.getName(); + } + } catch (Exception e) { + } + } + } + return String.valueOf(target); + } + @Override public String disassemble(CiTargetMethod tm) { byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize()); @@ -96,7 +112,7 @@ if (call.debugInfo != null) { hcf.addComment(call.pcOffset + call.size, CiUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString()); } - addOperandComment(hcf, call.pcOffset, "{" + call.target + "}"); + addOperandComment(hcf, call.pcOffset, "{" + getTargetName(call.target) + "}"); } else { if (safepoint.debugInfo != null) { hcf.addComment(safepoint.pcOffset, CiUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString());