Skip to content

Commit a680c71

Browse files
committed
8370886: [lworld] 8369296 partially reverted for resolving static get/put field
Reviewed-by: matsaave
1 parent f57d72f commit a680c71

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/hotspot/share/interpreter/interpreterRuntime.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -781,13 +781,7 @@ void InterpreterRuntime::resolve_get_put(Bytecodes::Code bytecode, int field_ind
781781

782782
Bytecodes::Code get_code = (Bytecodes::Code)0;
783783
Bytecodes::Code put_code = (Bytecodes::Code)0;
784-
if (!uninitialized_static) {
785-
get_code = ((is_static) ? Bytecodes::_getstatic : Bytecodes::_getfield);
786-
if ((is_put && !has_initialized_final_update) || !info.access_flags().is_final()) {
787-
put_code = ((is_static) ? Bytecodes::_putstatic : Bytecodes::_putfield);
788-
}
789-
assert(!info.is_strict_static_unset(), "after initialization, no unset flags");
790-
} else if (is_static && (info.is_strict_static_unset() || strict_static_final)) {
784+
if (uninitialized_static && (info.is_strict_static_unset() || strict_static_final)) {
791785
// During <clinit>, closely track the state of strict statics.
792786
// 1. if we are reading an uninitialized strict static, throw
793787
// 2. if we are writing one, clear the "unset" flag
@@ -799,6 +793,12 @@ void InterpreterRuntime::resolve_get_put(Bytecodes::Code bytecode, int field_ind
799793
assert(klass->is_reentrant_initialization(THREAD),
800794
"<clinit> must be running in current thread");
801795
klass->notify_strict_static_access(info.index(), is_put, CHECK);
796+
assert(!info.is_strict_static_unset(), "after initialization, no unset flags");
797+
} else if (!uninitialized_static || VM_Version::supports_fast_class_init_checks()) {
798+
get_code = ((is_static) ? Bytecodes::_getstatic : Bytecodes::_getfield);
799+
if ((is_put && !has_initialized_final_update) || !info.access_flags().is_final()) {
800+
put_code = ((is_static) ? Bytecodes::_putstatic : Bytecodes::_putfield);
801+
}
802802
}
803803

804804
ResolvedFieldEntry* entry = pool->resolved_field_entry_at(field_index);

0 commit comments

Comments
 (0)