Mercurial > hg > truffle
changeset 17398:9e1ec84d2899
fix privileged check for Stable
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 09 Oct 2014 11:32:21 -0700 |
parents | 0c8442b0d4c4 |
children | 5787218bad91 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/Stable.java src/share/vm/classfile/classFileParser.cpp |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/Stable.java Thu Oct 09 16:30:49 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/Stable.java Thu Oct 09 11:32:21 2014 -0700 @@ -25,7 +25,10 @@ import java.lang.annotation.*; -// TODO remove this annotation after we moved to JDK 8 and use sun.invoke.Stable instead +/** + * This annotation functions as an alias for the sun.invoke.Stable annotation within Graal code. It + * is specially recognized during class file parsing in the same way as that annotation. + */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME)
--- a/src/share/vm/classfile/classFileParser.cpp Thu Oct 09 16:30:49 2014 +0200 +++ b/src/share/vm/classfile/classFileParser.cpp Thu Oct 09 11:32:21 2014 -0700 @@ -1790,7 +1790,7 @@ #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 + if (!privileged && loader_data->class_loader() != SystemDictionary::graal_loader()) break; // only allow in privileged code return _field_Stable; #endif case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_Stable_signature):