# HG changeset patch # User Doug Simon # Date 1390931203 -3600 # Node ID eec9f21a40b75df26681b0cd9c43b0a68658baac # Parent 4d89f51eae9ea87cb3377b700f4fe63f2254a674 added documentation diff -r 4d89f51eae9e -r eec9f21a40b7 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 Tue Jan 28 18:34:04 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Tue Jan 28 18:46:43 2014 +0100 @@ -157,14 +157,18 @@ return getMetaspaceMethodConstant(); } - public int getRawModifiers() { + /** + * Gets the complete set of modifiers for this method which includes the JVM specification + * modifiers as well as the HotSpot internal modifiers. + */ + public int getAllModifiers() { HotSpotVMConfig config = runtime().getConfig(); return unsafe.getInt(metaspaceMethod + config.methodAccessFlagsOffset); } @Override public int getModifiers() { - return getRawModifiers() & Modifier.methodModifiers(); + return getAllModifiers() & Modifier.methodModifiers(); } @Override @@ -431,6 +435,8 @@ private static final int SYNTHETIC; static { try { + // Unfortunately, Modifier.SYNTHETIC is not public so we have + // to jump though hoops to get it. Field field = Modifier.class.getDeclaredField("SYNTHETIC"); field.setAccessible(true); SYNTHETIC = field.getInt(null); @@ -441,7 +447,7 @@ @Override public boolean isSynthetic() { - int modifiers = getRawModifiers(); + int modifiers = getAllModifiers(); return (SYNTHETIC & modifiers) != 0; }