# HG changeset patch # User Tom Rodriguez # Date 1412272623 25200 # Node ID 0563b652c05294ea790b1f99813334701f9d965e # Parent fa821ca2611a8004748f90d9bd0d9ceb1903882f Unify parsing of graal and hotspot Stable annotations diff -r fa821ca2611a -r 0563b652c052 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java Thu Oct 02 10:54:54 2014 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java Thu Oct 02 10:57:03 2014 -0700 @@ -338,8 +338,11 @@ * @return true if field has {@link Stable} annotation, false otherwise */ public boolean isStable() { - Annotation annotation = getAnnotation(Stable.class); - return annotation != null; + if ((runtime().getConfig().jvmAccFieldStable & modifiers) != 0) { + return true; + } + assert getAnnotation(Stable.class) == null; + return false; } @Override diff -r fa821ca2611a -r 0563b652c052 src/share/vm/classfile/classFileParser.cpp --- a/src/share/vm/classfile/classFileParser.cpp Thu Oct 02 10:54:54 2014 -0700 +++ b/src/share/vm/classfile/classFileParser.cpp Thu Oct 02 10:57:03 2014 -0700 @@ -1787,6 +1787,12 @@ if (_location != _in_method) break; // only allow for methods if (!privileged) break; // only allow in privileged code return _method_LambdaForm_Hidden; +#ifdef GRAAL + case vmSymbols::VM_SYMBOL_ENUM_NAME(com_oracle_graal_hotspot_Stable_signature): + if (_location != _in_field) break; // only allow for fields + // Ignore privilged for now + return _field_Stable; +#endif case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_Stable_signature): if (_location != _in_field) break; // only allow for fields if (!privileged) break; // only allow in privileged code diff -r fa821ca2611a -r 0563b652c052 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Thu Oct 02 10:54:54 2014 -0700 +++ b/src/share/vm/classfile/vmSymbols.hpp Thu Oct 02 10:57:03 2014 -0700 @@ -356,6 +356,7 @@ GRAAL_ONLY(template(compileMetaspaceMethod_name, "compileMetaspaceMethod")) \ GRAAL_ONLY(template(compileMetaspaceMethod_signature, "(JIJI)V")) \ GRAAL_ONLY(template(graal_mirror_name, "graal_mirror")) \ + GRAAL_ONLY(template(com_oracle_graal_hotspot_Stable_signature, "Lcom/oracle/graal/hotspot/Stable;")) \ \ /* common method and field names */ \ template(object_initializer_name, "") \