8001107: @Stable annotation for constant folding of lazily evaluated variables

Co-authored-by: John Rose <john.r.rose@oracle.com>
Reviewed-by: rbackman, twisti, kvn
This commit is contained in:
Vladimir Ivanov 2013-09-10 14:51:48 -07:00
parent 19d50345e1
commit f0e77ac67f
25 changed files with 419 additions and 84 deletions

View file

@ -139,7 +139,10 @@ public:
// non-constant fields. These are java.lang.System.in
// and java.lang.System.out. Abomination.
//
// Note: the check for case 4 is not yet implemented.
// A field is also considered constant if it is marked @Stable
// and is non-null (or non-zero, if a primitive).
// For non-static fields, the null/zero check must be
// arranged by the user, as constant_value().is_null_or_zero().
bool is_constant() { return _is_constant; }
// Get the constant value of this field.
@ -173,6 +176,7 @@ public:
bool is_protected () { return flags().is_protected(); }
bool is_static () { return flags().is_static(); }
bool is_final () { return flags().is_final(); }
bool is_stable () { return flags().is_stable(); }
bool is_volatile () { return flags().is_volatile(); }
bool is_transient () { return flags().is_transient(); }