# HG changeset patch # User Doug Simon # Date 1355409750 -3600 # Node ID 3fbde10a77b0ef5a2f1495452c1fdcb2224d30f1 # Parent 7915888f5db578f0f275dc1dc2627fa5b89c5f2e replaced usage of Unsafe.get(Object object, long offset) where object == null with Unsafe.get(long address) diff -r 7915888f5db5 -r 3fbde10a77b0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java Thu Dec 13 14:27:37 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java Thu Dec 13 15:42:30 2012 +0100 @@ -82,7 +82,7 @@ public int getDeoptimizationCount(DeoptimizationReason reason) { int reasonIndex = HotSpotGraalRuntime.getInstance().getRuntime().convertDeoptReason(reason); - return unsafe.getByte(null, metaspaceMethodData + config.methodDataOopTrapHistoryOffset + reasonIndex) & 0xFF; + return unsafe.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + reasonIndex) & 0xFF; } public HotSpotMethodDataAccessor getNormalData(int position) { @@ -119,17 +119,17 @@ private int readUnsignedByte(int position, int offsetInBytes) { long fullOffsetInBytes = computeFullOffset(position, offsetInBytes); - return unsafe.getByte(null, metaspaceMethodData + fullOffsetInBytes) & 0xFF; + return unsafe.getByte(metaspaceMethodData + fullOffsetInBytes) & 0xFF; } private int readUnsignedShort(int position, int offsetInBytes) { long fullOffsetInBytes = computeFullOffset(position, offsetInBytes); - return unsafe.getShort(null, metaspaceMethodData + fullOffsetInBytes) & 0xFFFF; + return unsafe.getShort(metaspaceMethodData + fullOffsetInBytes) & 0xFFFF; } private long readUnsignedInt(int position, int offsetInBytes) { long fullOffsetInBytes = computeFullOffset(position, offsetInBytes); - return unsafe.getInt(null, metaspaceMethodData + fullOffsetInBytes) & 0xFFFFFFFFL; + return unsafe.getInt(metaspaceMethodData + fullOffsetInBytes) & 0xFFFFFFFFL; } private int readUnsignedIntAsSignedInt(int position, int offsetInBytes) { @@ -139,7 +139,7 @@ private int readInt(int position, int offsetInBytes) { long fullOffsetInBytes = computeFullOffset(position, offsetInBytes); - return unsafe.getInt(null, metaspaceMethodData + fullOffsetInBytes); + return unsafe.getInt(metaspaceMethodData + fullOffsetInBytes); } private long readWord(int position, int offsetInBytes) { diff -r 7915888f5db5 -r 3fbde10a77b0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Thu Dec 13 14:27:37 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Thu Dec 13 15:42:30 2012 +0100 @@ -74,7 +74,7 @@ @Override public int getModifiers() { HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig(); - return unsafe.getInt(null, metaspaceMethod + config.methodAccessFlagsOffset) & Modifier.methodModifiers(); + return unsafe.getInt(metaspaceMethod + config.methodAccessFlagsOffset) & Modifier.methodModifiers(); } @Override @@ -129,13 +129,13 @@ @Override public int getMaxLocals() { HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig(); - return unsafe.getShort(null, metaspaceMethod + config.methodMaxLocalsOffset) & 0xFFFF; + return unsafe.getShort(metaspaceMethod + config.methodMaxLocalsOffset) & 0xFFFF; } @Override public int getMaxStackSize() { HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig(); - return config.extraStackEntries + (unsafe.getShort(null, metaspaceMethod + config.methodMaxStackOffset) & 0xFFFF); + return config.extraStackEntries + (unsafe.getShort(metaspaceMethod + config.methodMaxStackOffset) & 0xFFFF); } @Override diff -r 7915888f5db5 -r 3fbde10a77b0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Thu Dec 13 14:27:37 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Thu Dec 13 15:42:30 2012 +0100 @@ -144,7 +144,7 @@ public int getAccessFlags() { HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig(); - return unsafe.getInt(null, metaspaceKlass + config.klassAccessFlagsOffset); + return unsafe.getInt(metaspaceKlass + config.klassAccessFlagsOffset); } @Override @@ -466,7 +466,7 @@ public int superCheckOffset() { HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig(); - return unsafe.getInt(null, metaspaceKlass + config.superCheckOffsetOffset); + return unsafe.getInt(metaspaceKlass + config.superCheckOffsetOffset); } public long prototypeMarkWord() {