mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +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
|
@ -1600,7 +1600,7 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
|
|||
ValueType* type = as_ValueType(field_type);
|
||||
// call will_link again to determine if the field is valid.
|
||||
const bool needs_patching = !holder->is_loaded() ||
|
||||
!field->will_link(method()->holder(), code) ||
|
||||
!field->will_link(method(), code) ||
|
||||
PatchALot;
|
||||
|
||||
ValueStack* state_before = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue