< prev index next >

src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java

Print this page

        

*** 20,30 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.vm.ci.hotspot; ! import java.lang.reflect.Field; import jdk.vm.ci.code.BailoutException; import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.CompiledCode; --- 20,30 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.vm.ci.hotspot; ! import java.util.Map; import jdk.vm.ci.code.BailoutException; import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.CompiledCode;
*** 54,94 **** } @Override public String getMarkName(Mark mark) { int markId = (int) mark.id; ! Field[] fields = runtime.getConfig().getClass().getDeclaredFields(); ! for (Field f : fields) { ! if (f.getName().startsWith("MARKID_")) { ! f.setAccessible(true); ! try { ! if (f.getInt(runtime.getConfig()) == markId) { ! return f.getName(); ! } ! } catch (Exception e) { ! } } } return CodeCacheProvider.super.getMarkName(mark); } /** * Decodes a call target to a mnemonic if possible. */ @Override public String getTargetName(Call call) { ! Field[] fields = runtime.getConfig().getClass().getDeclaredFields(); ! for (Field f : fields) { ! if (f.getName().endsWith("Stub")) { ! f.setAccessible(true); ! Object address; ! try { ! address = f.get(runtime.getConfig()); ! if (address.equals(call.target)) { ! return f.getName() + ":0x" + Long.toHexString((Long) address); ! } ! } catch (IllegalArgumentException | IllegalAccessException e) { } } } return CodeCacheProvider.super.getTargetName(call); } --- 54,85 ---- } @Override public String getMarkName(Mark mark) { int markId = (int) mark.id; ! HotSpotVMConfigStore store = runtime.getConfigStore(); ! for (Map.Entry<String, Long> e : store.getConstants().entrySet()) { ! String name = e.getKey(); ! if (name.startsWith("MARKID_") && e.getValue() == markId) { ! return name; } } return CodeCacheProvider.super.getMarkName(mark); } /** * Decodes a call target to a mnemonic if possible. */ @Override public String getTargetName(Call call) { ! if (call.target instanceof HotSpotForeignCallTarget) { ! long address = ((HotSpotForeignCallTarget) call.target).address; ! HotSpotVMConfigStore store = runtime.getConfigStore(); ! for (Map.Entry<String, VMField> e : store.getFields().entrySet()) { ! VMField field = e.getValue(); ! if (field.isStatic() && field.value != null && field.value == address) { ! return e.getValue() + ":0x" + Long.toHexString(address); } } } return CodeCacheProvider.super.getTargetName(call); }
< prev index next >