Mercurial > hg > truffle
changeset 4476:00efac2934d3
methodData bugfix
author | Christian Haeubl <christian.haeubl@oracle.com> |
---|---|
date | Mon, 06 Feb 2012 19:04:18 -0800 |
parents | f400f9554f09 |
children | 95802b2cec42 7d6490436b57 0e1f15ec0e94 |
files | graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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]; }
--- 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(); }