mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8157181: Compilers accept modification of final fields outside initializer methods
Track initialized final field updates; disable constant folding if an update is detected. Enforce final field update rules introduced by JVMS-7 (but only for JDK 9). Reviewed-by: vlivanov, dnsimon, forax, never, kvn, coleenp
This commit is contained in:
parent
2ade029123
commit
cdc436922a
32 changed files with 284 additions and 75 deletions
|
@ -638,6 +638,9 @@ class Method : public Metadata {
|
|||
// valid static initializer flags.
|
||||
bool is_static_initializer() const;
|
||||
|
||||
// returns true if the method name is <init>
|
||||
bool is_object_initializer() const;
|
||||
|
||||
// compiled code support
|
||||
// NOTE: code() is inherently racy as deopt can be clearing code
|
||||
// simultaneously. Use with caution.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue