Mercurial > hg > truffle
changeset 13787:eec9f21a40b7
added documentation
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 28 Jan 2014 18:46:43 +0100 |
parents | 4d89f51eae9e |
children | 6c5c17d0f57d |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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; }