# HG changeset patch # User Tom Rodriguez # Date 1475079743 25200 # Node ID c64c9fac1ab97322f82f403daecf693355ced99c # Parent e687b7d93805f5f58b2d5c50ea6811d90f670b6f Expose decompile counts in MDO diff -r e687b7d93805 -r c64c9fac1ab9 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java Wed Sep 28 14:01:41 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java Wed Sep 28 09:22:23 2016 -0700 @@ -107,6 +107,18 @@ return UNSAFE.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + config.deoptReasonOSROffset + reasonIndex) & 0xFF; } + public int getDecompileCount() { + return UNSAFE.getInt(metaspaceMethodData + config.methodDataDecompiles); + } + + public int getOverflowCompileCount() { + return UNSAFE.getInt(metaspaceMethodData + config.methodDataOverflowRecompiles); + } + + public int getOverflowTrapsCount() { + return UNSAFE.getInt(metaspaceMethodData + config.methodDataOverflowTraps); + } + public HotSpotMethodDataAccessor getNormalData(int position) { if (position >= normalDataSize()) { return null; diff -r e687b7d93805 -r c64c9fac1ab9 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java Wed Sep 28 14:01:41 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java Wed Sep 28 09:22:23 2016 -0700 @@ -57,6 +57,18 @@ return method.getCodeSize(); } + public int getDecompileCount() { + return methodData.getDecompileCount(); + } + + public int getOverflowCompileCount() { + return methodData.getOverflowCompileCount(); + } + + public int getOverflowTrapsCount() { + return methodData.getOverflowTrapsCount(); + } + @Override public JavaTypeProfile getTypeProfile(int bci) { if (!isMature) { diff -r e687b7d93805 -r c64c9fac1ab9 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java Wed Sep 28 14:01:41 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java Wed Sep 28 09:22:23 2016 -0700 @@ -239,6 +239,10 @@ final int methodDataOopTrapHistoryOffset = getFieldOffset("MethodData::_trap_hist._array[0]", Integer.class, "u1"); final int methodDataIRSizeOffset = getFieldOffset("MethodData::_jvmci_ir_size", Integer.class, "int"); + final int methodDataDecompiles = getFieldOffset("MethodData::_nof_decompiles", Integer.class, "uint"); + final int methodDataOverflowRecompiles = getFieldOffset("MethodData::_nof_overflow_recompiles", Integer.class, "uint"); + final int methodDataOverflowTraps = getFieldOffset("MethodData::_nof_overflow_traps", Integer.class, "uint"); + final int nmethodCompLevelOffset = getFieldOffset("nmethod::_comp_level", Integer.class, "int"); final int compilationLevelNone = getConstant("CompLevel_none", Integer.class);