Skip to content

Commit

Permalink
Merge upstream-jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
corretto-github-robot committed Jan 9, 2025
2 parents 10d4ee8 + 33f9be8 commit fed5921
Show file tree
Hide file tree
Showing 134 changed files with 1,491 additions and 9,729 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -503,7 +503,7 @@ void InterpreterMacroAssembler::remove_activation(

// get method access flags
ldr(r1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
ldr(r2, Address(r1, Method::access_flags_offset()));
ldrh(r2, Address(r1, Method::access_flags_offset()));
tbz(r2, exact_log2(JVM_ACC_SYNCHRONIZED), unlocked);

// Don't unlock anything if the _do_not_unlock_if_synchronized flag
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Expand Down Expand Up @@ -760,7 +760,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;

{ // Bypass the barrier for non-static methods
__ ldrw(rscratch1, Address(rmethod, Method::access_flags_offset()));
__ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
__ br(Assembler::EQ, L_skip_barrier); // non-static
}
Expand Down
18 changes: 9 additions & 9 deletions src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -809,7 +809,7 @@ void TemplateInterpreterGenerator::lock_method() {
#ifdef ASSERT
{
Label L;
__ ldrw(r0, access_flags);
__ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_SYNCHRONIZED);
__ br(Assembler::NE, L);
__ stop("method doesn't need synchronization");
Expand All @@ -820,7 +820,7 @@ void TemplateInterpreterGenerator::lock_method() {
// get synchronization object
{
Label done;
__ ldrw(r0, access_flags);
__ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_STATIC);
// get receiver (assume this is frequent case)
__ ldr(r0, Address(rlocals, Interpreter::local_offset_in_bytes(0)));
Expand Down Expand Up @@ -1225,7 +1225,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {

// make sure method is native & not abstract
#ifdef ASSERT
__ ldrw(r0, access_flags);
__ ldrh(r0, access_flags);
{
Label L;
__ tst(r0, JVM_ACC_NATIVE);
Expand Down Expand Up @@ -1277,7 +1277,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
#ifdef ASSERT
{
Label L;
__ ldrw(r0, access_flags);
__ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_SYNCHRONIZED);
__ br(Assembler::EQ, L);
__ stop("method needs synchronization");
Expand Down Expand Up @@ -1354,7 +1354,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// pass mirror handle if static call
{
Label L;
__ ldrw(t, Address(rmethod, Method::access_flags_offset()));
__ ldrh(t, Address(rmethod, Method::access_flags_offset()));
__ tbz(t, exact_log2(JVM_ACC_STATIC), L);
// get mirror
__ load_mirror(t, rmethod, r10, rscratch2);
Expand Down Expand Up @@ -1564,7 +1564,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// do unlocking if necessary
{
Label L;
__ ldrw(t, Address(rmethod, Method::access_flags_offset()));
__ ldrh(t, Address(rmethod, Method::access_flags_offset()));
__ tbz(t, exact_log2(JVM_ACC_SYNCHRONIZED), L);
// the code below should be shared with interpreter macro
// assembler implementation
Expand Down Expand Up @@ -1695,7 +1695,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {

// make sure method is not native & not abstract
#ifdef ASSERT
__ ldrw(r0, access_flags);
__ ldrh(r0, access_flags);
{
Label L;
__ tst(r0, JVM_ACC_NATIVE);
Expand Down Expand Up @@ -1751,7 +1751,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
{
Label L;
__ ldrw(r0, access_flags);
__ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_SYNCHRONIZED);
__ br(Assembler::EQ, L);
__ stop("method needs synchronization");
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/arm/interp_masm_arm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -736,7 +736,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, Register ret_a
ldrb(Rflag, do_not_unlock_if_synchronized);

// get method access flags
ldr_u32(Raccess_flags, Address(Rmethod, Method::access_flags_offset()));
ldrh(Raccess_flags, Address(Rmethod, Method::access_flags_offset()));

strb(zero_register(Rtemp), do_not_unlock_if_synchronized); // reset the flag

Expand Down
16 changes: 8 additions & 8 deletions src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -579,7 +579,7 @@ void TemplateInterpreterGenerator::lock_method() {

#ifdef ASSERT
{ Label L;
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tbnz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
__ stop("method doesn't need synchronization");
__ bind(L);
Expand All @@ -588,7 +588,7 @@ void TemplateInterpreterGenerator::lock_method() {

// get synchronization object
{ Label done;
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tst(Rtemp, JVM_ACC_STATIC);
__ ldr(R0, Address(Rlocals, Interpreter::local_offset_in_bytes(0)), eq); // get receiver (assume this is frequent case)
__ b(done, eq);
Expand Down Expand Up @@ -851,7 +851,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {

// make sure method is native & not abstract
#ifdef ASSERT
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
{
Label L;
__ tbnz(Rtemp, JVM_ACC_NATIVE_BIT, L);
Expand Down Expand Up @@ -893,7 +893,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// no synchronization necessary
#ifdef ASSERT
{ Label L;
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
__ stop("method needs synchronization");
__ bind(L);
Expand Down Expand Up @@ -975,7 +975,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Pass JNIEnv and mirror for static methods
{
Label L;
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ add(R0, Rthread, in_bytes(JavaThread::jni_environment_offset()));
__ tbz(Rtemp, JVM_ACC_STATIC_BIT, L);
__ load_mirror(Rtemp, Rmethod, Rtemp);
Expand Down Expand Up @@ -1204,7 +1204,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {

// make sure method is not native & not abstract
#ifdef ASSERT
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
{
Label L;
__ tbz(Rtemp, JVM_ACC_NATIVE_BIT, L);
Expand Down Expand Up @@ -1249,7 +1249,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// no synchronization necessary
#ifdef ASSERT
{ Label L;
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
__ stop("method needs synchronization");
__ bind(L);
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -681,14 +681,14 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
// Check if synchronized method or unlocking prevented by
// JavaThread::do_not_unlock_if_synchronized flag.
lbz(Rdo_not_unlock_flag, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread);
lwz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method);
lhz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method);
li(R0, 0);
stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread); // reset flag

push(state);

// Skip if we don't have to unlock.
rldicl_(R0, Raccess_flags, 64-JVM_ACC_SYNCHRONIZED_BIT, 63); // Extract bit and compare to 0.
testbitdi(CCR0, R0, Raccess_flags, JVM_ACC_SYNCHRONIZED_BIT);
beq(CCR0, Lunlocked);

cmpwi(CCR0, Rdo_not_unlock_flag, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -1202,7 +1202,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;

{ // Bypass the barrier for non-static methods
__ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ andi_(R0, R0, JVM_ACC_STATIC);
__ beq(CCR0, L_skip_barrier); // non-static
}
Expand Down
16 changes: 8 additions & 8 deletions src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -144,9 +144,9 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
// TODO PPC port: requires change in shared code.
//assert(in_bytes(AccessFlags::flags_offset()) == 0,
// "MethodDesc._access_flags == MethodDesc._access_flags._flags");
// _access_flags must be a 32 bit value.
assert(sizeof(AccessFlags) == 4, "wrong size");
__ lwa(R11_scratch1/*access_flags*/, method_(access_flags));
// _access_flags must be a 16 bit value.
assert(sizeof(AccessFlags) == 2, "wrong size");
__ lhz(R11_scratch1/*access_flags*/, method_(access_flags));
// testbit with condition register.
__ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT);
__ btrue(CCR0, L);
Expand Down Expand Up @@ -823,7 +823,7 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc

{
if (!flags_preloaded) {
__ lwz(Rflags, method_(access_flags));
__ lhz(Rflags, method_(access_flags));
}

#ifdef ASSERT
Expand Down Expand Up @@ -1301,8 +1301,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
assert(__ nonvolatile_accross_vthread_preemtion(access_flags),
"access_flags not preserved");
// Type check.
assert(4 == sizeof(AccessFlags), "unexpected field size");
__ lwz(access_flags, method_(access_flags));
assert(2 == sizeof(AccessFlags), "unexpected field size");
__ lhz(access_flags, method_(access_flags));

// We don't want to reload R19_method and access_flags after calls
// to some helper functions.
Expand Down Expand Up @@ -1769,7 +1769,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
else {
Label Lok;
__ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ andi_(R0, R0, JVM_ACC_SYNCHRONIZED);
__ asm_assert_eq("method needs synchronization");
__ bind(Lok);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/interp_masm_riscv.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Expand Down Expand Up @@ -544,7 +544,7 @@ void InterpreterMacroAssembler::remove_activation(

// get method access flags
ld(x11, Address(fp, frame::interpreter_frame_method_offset * wordSize));
ld(x12, Address(x11, Method::access_flags_offset()));
load_unsigned_short(x12, Address(x11, Method::access_flags_offset()));
test_bit(t0, x12, exact_log2(JVM_ACC_SYNCHRONIZED));
beqz(t0, unlocked);

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Expand Down Expand Up @@ -641,7 +641,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;

{ // Bypass the barrier for non-static methods
__ lwu(t0, Address(xmethod, Method::access_flags_offset()));
__ load_unsigned_short(t0, Address(xmethod, Method::access_flags_offset()));
__ test_bit(t1, t0, exact_log2(JVM_ACC_STATIC));
__ beqz(t1, L_skip_barrier); // non-static
}
Expand Down
18 changes: 9 additions & 9 deletions src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Expand Down Expand Up @@ -714,14 +714,14 @@ void TemplateInterpreterGenerator::lock_method() {
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

#ifdef ASSERT
__ lwu(x10, access_flags);
__ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method doesn't need synchronization", false);
#endif // ASSERT

// get synchronization object
{
Label done;
__ lwu(x10, access_flags);
__ load_unsigned_short(x10, access_flags);
__ andi(t0, x10, JVM_ACC_STATIC);
// get receiver (assume this is frequent case)
__ ld(x10, Address(xlocals, Interpreter::local_offset_in_bytes(0)));
Expand Down Expand Up @@ -1028,7 +1028,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {

// make sure method is native & not abstract
#ifdef ASSERT
__ lwu(x10, access_flags);
__ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_NATIVE, "tried to execute non-native method as native", false);
__ verify_access_flags(x10, JVM_ACC_ABSTRACT, "tried to execute abstract method in interpreter");
#endif
Expand Down Expand Up @@ -1066,7 +1066,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
} else {
// no synchronization necessary
#ifdef ASSERT
__ lwu(x10, access_flags);
__ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method needs synchronization");
#endif
}
Expand Down Expand Up @@ -1130,7 +1130,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// pass mirror handle if static call
{
Label L;
__ lwu(t, Address(xmethod, Method::access_flags_offset()));
__ load_unsigned_short(t, Address(xmethod, Method::access_flags_offset()));
__ test_bit(t0, t, exact_log2(JVM_ACC_STATIC));
__ beqz(t0, L);
// get mirror
Expand Down Expand Up @@ -1346,7 +1346,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// do unlocking if necessary
{
Label L;
__ lwu(t, Address(xmethod, Method::access_flags_offset()));
__ load_unsigned_short(t, Address(xmethod, Method::access_flags_offset()));
__ test_bit(t0, t, exact_log2(JVM_ACC_SYNCHRONIZED));
__ beqz(t0, L);
// the code below should be shared with interpreter macro
Expand Down Expand Up @@ -1472,7 +1472,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {

// make sure method is not native & not abstract
#ifdef ASSERT
__ lwu(x10, access_flags);
__ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_NATIVE, "tried to execute native method as non-native");
__ verify_access_flags(x10, JVM_ACC_ABSTRACT, "tried to execute abstract method in interpreter");
#endif
Expand Down Expand Up @@ -1519,7 +1519,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
} else {
// no synchronization necessary
#ifdef ASSERT
__ lwu(x10, access_flags);
__ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method needs synchronization");
#endif
}
Expand Down
Loading

0 comments on commit fed5921

Please sign in to comment.