# HG changeset patch # User Christian Haeubl # Date 1328583858 28800 # Node ID 00efac2934d3911b395c86066c1cdc0bcd3102a6 # Parent f400f9554f09966c6da55edb6dd97ced022d09a9 methodData bugfix diff -r f400f9554f09 -r 00efac2934d3 graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java Mon Feb 06 18:32:30 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java Mon Feb 06 19:04:18 2012 -0800 @@ -71,6 +71,10 @@ return extraDataSize > 0; } + public int getExtraDataBeginOffset() { + return normalDataSize; + } + public boolean isMature() { // TODO (ch) maturity of profiling information is an issue in general. Not all optimizations require mature data as long as the code // does deoptimize/recompile on violations (might decrease startup and increase peak performance). @@ -93,7 +97,7 @@ return null; } - HotSpotMethodDataAccessor result = getData(position, 0); + HotSpotMethodDataAccessor result = getData(position); assert result != null : "NO_DATA tag is not allowed"; return result; } @@ -102,16 +106,16 @@ if (position >= extraDataSize) { return null; } - return getData(position, normalDataSize); + return getData(position); } public static HotSpotMethodDataAccessor getNoMethodData() { return NO_DATA_ACCESSOR; } - private HotSpotMethodDataAccessor getData(int position, int displacement) { + private HotSpotMethodDataAccessor getData(int position) { assert position >= 0 : "out of bounds"; - int tag = AbstractMethodData.readTag(this, displacement + position); + int tag = AbstractMethodData.readTag(this, position); assert tag >= 0 && tag < PROFILE_DATA_ACCESSORS.length : "illegal tag"; return PROFILE_DATA_ACCESSORS[tag]; } diff -r f400f9554f09 -r 00efac2934d3 graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java Mon Feb 06 18:32:30 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java Mon Feb 06 19:04:18 2012 -0800 @@ -96,7 +96,7 @@ } if (searchExtraData && methodData.hasExtraData()) { - int currentPosition = 0; + int currentPosition = methodData.getExtraDataBeginOffset(); HotSpotMethodDataAccessor currentAccessor; while ((currentAccessor = methodData.getExtraData(currentPosition)) != null) { int currentBCI = currentAccessor.getBCI(methodData, currentPosition); @@ -108,6 +108,8 @@ } } + // TODO (ch) getExceptionSeen() should return UNKNOWN if not enough extra data + noDataFound(); }