mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -627,7 +627,7 @@ bool Method::is_constant_getter() const {
|
|||
}
|
||||
|
||||
bool Method::is_initializer() const {
|
||||
return name() == vmSymbols::object_initializer_name() || is_static_initializer();
|
||||
return is_object_initializer() || is_static_initializer();
|
||||
}
|
||||
|
||||
bool Method::has_valid_initializer_flags() const {
|
||||
|
@ -643,6 +643,9 @@ bool Method::is_static_initializer() const {
|
|||
has_valid_initializer_flags();
|
||||
}
|
||||
|
||||
bool Method::is_object_initializer() const {
|
||||
return name() == vmSymbols::object_initializer_name();
|
||||
}
|
||||
|
||||
objArrayHandle Method::resolved_checked_exceptions_impl(Method* method, TRAPS) {
|
||||
int length = method->checked_exceptions_length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue