mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
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:
parent
19d50345e1
commit
f0e77ac67f
25 changed files with 419 additions and 84 deletions
|
@ -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(); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue