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 Nov 15, 2023
2 parents 10dedb3 + 8998f6f commit 36606f2
Show file tree
Hide file tree
Showing 55 changed files with 1,071 additions and 275 deletions.
8 changes: 4 additions & 4 deletions make/langtools/tools/javacserver/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
public class Client {
private static final Log.Level LOG_LEVEL = Log.Level.INFO;

// Wait 2 seconds for response, before giving up on javac server.
private static final int CONNECTION_TIMEOUT = 2000;
private static final int MAX_CONNECT_ATTEMPTS = 3;
// Wait 4 seconds for response, before giving up on javac server.
private static final int CONNECTION_TIMEOUT = 4000;
private static final int MAX_CONNECT_ATTEMPTS = 10;
private static final int WAIT_BETWEEN_CONNECT_ATTEMPTS = 2000;

private final ClientConfiguration conf;
Expand Down Expand Up @@ -130,7 +130,7 @@ private Socket tryConnect() throws IOException, InterruptedException {
Log.error("Connection attempt failed: " + ex.getMessage());
if (attempt >= MAX_CONNECT_ATTEMPTS) {
Log.error("Giving up");
throw new IOException("Could not connect to server", ex);
throw new IOException("Could not connect to server after " + MAX_CONNECT_ATTEMPTS + " attempts with timeout " + CONNECTION_TIMEOUT, ex);
}
}
Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);
Expand Down
2 changes: 1 addition & 1 deletion make/test/JtregNativeJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ ifeq ($(call isTargetOs, linux), true)
BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libFib := -g
BUILD_JDK_JTREG_LIBRARIES_STRIP_SYMBOLS_libFib := false
# nio tests' libCreationTimeHelper native needs -ldl linker flag
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libCreationTimeHelper := -ldl
BUILD_JDK_JTREG_LIBRARIES_LIBS_libCreationTimeHelper := -ldl
endif

ifeq ($(ASAN_ENABLED), true)
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void InterpreterMacroAssembler::remove_activation(
// Check that all monitors are unlocked
{
Label loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Address monitor_block_top(
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {

// monitor entry size: see picture of stack set
// (generate_method_entry) and frame_amd64.hpp
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

// total overhead size: entry_size + (saved rbp through expr stack
// bottom). be sure to change this if you add/subtract anything
Expand Down Expand Up @@ -769,7 +769,7 @@ void TemplateInterpreterGenerator::lock_method() {
const Address monitor_block_top(
rfp,
frame::interpreter_frame_monitor_block_top_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

#ifdef ASSERT
{
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ void TemplateTable::monitorenter()
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

Label allocated;

Expand Down Expand Up @@ -3916,7 +3916,7 @@ void TemplateTable::monitorexit()
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

Label found;

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/interp_masm_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, Register ret_a
{
Label loop;

const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Register Rbottom = R3;
const Register Rcur_obj = Rtemp;

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
const Register RmaxStack = R2;

// monitor entry size
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

// total overhead size: entry_size + (saved registers, thru expr stack bottom).
// be sure to change this if you add/subtract anything to/from the overhead area
Expand Down Expand Up @@ -569,7 +569,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
void TemplateInterpreterGenerator::lock_method() {
// synchronize method

const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
assert ((entry_size % StackAlignmentInBytes) == 0, "should keep stack alignment");

#ifdef ASSERT
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/arm/templateTable_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4270,7 +4270,7 @@ void TemplateTable::monitorenter() {
// check for null object
__ null_check(Robj, Rtemp);

const int entry_size = (frame::interpreter_frame_monitor_size() * wordSize);
const int entry_size = (frame::interpreter_frame_monitor_size_in_bytes());
assert (entry_size % StackAlignmentInBytes == 0, "keep stack alignment");
Label allocate_monitor, allocated;

Expand Down Expand Up @@ -4381,7 +4381,7 @@ void TemplateTable::monitorexit() {
// check for null object
__ null_check(Robj, Rtemp);

const int entry_size = (frame::interpreter_frame_monitor_size() * wordSize);
const int entry_size = (frame::interpreter_frame_monitor_size_in_bytes());
Label found, throw_exception;

// find matching slot
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/ppc/frame_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,6 @@
template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);

// Size of a monitor in bytes.
static int interpreter_frame_monitor_size_in_bytes();

// The size of a cInterpreter object.
static inline int interpreter_frame_cinterpreterstate_size_in_bytes();

Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/cpu/ppc/frame_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@ inline int frame::interpreter_frame_monitor_size() {
WordsPerLong); // number of stack slots for a Java long
}

inline int frame::interpreter_frame_monitor_size_in_bytes() {
return frame::interpreter_frame_monitor_size() * wordSize;
}

// entry frames

inline intptr_t* frame::entry_frame_argument_at(int offset) const {
Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4146,7 +4146,7 @@ void TemplateTable::monitorenter() {

// Pre-load topmost slot.
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());
// The search loop.
__ bind(Lloop);
// Found free slot?
Expand All @@ -4160,7 +4160,7 @@ void TemplateTable::monitorenter() {
__ bgt(reached_limit, Lallocate_new);
// Check if last allocated BasicLockObj reached.
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());
// Next iteration if unchecked BasicObjectLocks exist on the stack.
__ b(Lloop);
}
Expand All @@ -4169,8 +4169,8 @@ void TemplateTable::monitorenter() {
// Check if we found a free slot.
__ bind(Lexit);

__ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size() * wordSize) - in_bytes(BasicObjectLock::obj_offset()));
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size_in_bytes()) - in_bytes(BasicObjectLock::obj_offset()));
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size_in_bytes());
__ b(Lfound);

// We didn't find a free BasicObjLock => allocate one.
Expand Down Expand Up @@ -4228,7 +4228,7 @@ void TemplateTable::monitorexit() {
__ addi(Rcurrent_obj_addr, R26_monitor, in_bytes(BasicObjectLock::obj_offset()));
__ addi(Rlimit, Rlimit, in_bytes(BasicObjectLock::obj_offset()));
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());

__ bind(Lloop);
// Is this entry for same obj?
Expand All @@ -4239,7 +4239,7 @@ void TemplateTable::monitorexit() {

__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ cmpld(CCR0, Rcurrent_obj_addr, Rlimit);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());

// Next iteration if unchecked BasicObjectLocks exist on the stack.
__ ble(CCR0, Lloop);
Expand All @@ -4253,7 +4253,7 @@ void TemplateTable::monitorexit() {
__ align(32, 12);
__ bind(Lfound);
__ addi(Rcurrent_monitor, Rcurrent_obj_addr,
-(frame::interpreter_frame_monitor_size() * wordSize) - in_bytes(BasicObjectLock::obj_offset()));
-(frame::interpreter_frame_monitor_size_in_bytes()) - in_bytes(BasicObjectLock::obj_offset()));
__ unlock_object(Rcurrent_monitor);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/interp_masm_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void InterpreterMacroAssembler::remove_activation(
// Check that all monitors are unlocked
{
Label loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Address monitor_block_top(
fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {

// monitor entry size: see picture of stack set
// (generate_method_entry) and frame_amd64.hpp
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

// total overhead size: entry_size + (saved fp through expr stack
// bottom). be sure to change this if you add/subtract anything
Expand Down Expand Up @@ -673,7 +673,7 @@ void TemplateInterpreterGenerator::lock_method() {
// synchronize method
const Address access_flags(xmethod, Method::access_flags_offset());
const Address monitor_block_top(fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

#ifdef ASSERT
__ lwu(x10, access_flags);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/templateTable_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3739,7 +3739,7 @@ void TemplateTable::monitorenter() {
fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
fp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

Label allocated;

Expand Down Expand Up @@ -3837,7 +3837,7 @@ void TemplateTable::monitorexit() {
fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
fp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

Label found;

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox
assert(LockingMode != LM_MONITOR, "LM_MONITOR is already handled, by emit_lock()");

if (LockingMode == LM_LIGHTWEIGHT) {
fast_lock(Roop, Rmark, tmp, slow_case);
lightweight_lock(Roop, Rmark, tmp, slow_case);
} else if (LockingMode == LM_LEGACY) {
NearLabel done;
// and mark it as unlocked.
Expand Down Expand Up @@ -171,7 +171,7 @@ void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rb
z_lgr(tmp, Rmark);
z_nill(tmp, markWord::monitor_value);
z_brnz(slow_case);
fast_unlock(Roop, Rmark, tmp, slow_case);
lightweight_unlock(Roop, Rmark, tmp, slow_case);
} else if (LockingMode == LM_LEGACY) {
// Test if object header is pointing to the displaced header, and if so, restore
// the displaced header in the object. If the object header is not pointing to
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/s390/frame_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,6 @@
template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);

// Additional interface for interpreter frames:
static int interpreter_frame_interpreterstate_size_in_bytes();
static int interpreter_frame_monitor_size_in_bytes();


// template interpreter state
inline z_ijava_state* ijava_state_unchecked() const;

Expand Down
9 changes: 0 additions & 9 deletions src/hotspot/cpu/s390/frame_s390.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,6 @@ inline int frame::interpreter_frame_monitor_size() {
WordsPerLong /* Number of stack slots for a Java long. */);
}

inline int frame::interpreter_frame_monitor_size_in_bytes() {
// Number of bytes for a monitor.
return frame::interpreter_frame_monitor_size() * wordSize;
}

inline int frame::interpreter_frame_interpreterstate_size_in_bytes() {
return z_ijava_state_size;
}

inline Method** frame::interpreter_frame_method_addr() const {
return (Method**)&(ijava_state()->method);
}
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/cpu/s390/interp_masm_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
// Check that all monitors are unlocked.
{
NearLabel loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
// We use Z_ARG2 so that if we go slow path it will be the correct
// register for unlock_object to pass to VM directly.
Register R_current_monitor = Z_ARG2;
Expand Down Expand Up @@ -1028,7 +1028,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
}

if (LockingMode == LM_LIGHTWEIGHT) {
fast_lock(object, /* mark word */ header, tmp, slow_case);
lightweight_lock(object, /* mark word */ header, tmp, slow_case);
} else if (LockingMode == LM_LEGACY) {

// Set header to be (markWord of object | UNLOCK_VALUE).
Expand Down Expand Up @@ -1086,7 +1086,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
// slow case of monitor enter.
bind(slow_case);
if (LockingMode == LM_LIGHTWEIGHT) {
// for fast locking we need to use monitorenter_obj, see interpreterRuntime.cpp
// for lightweight locking we need to use monitorenter_obj, see interpreterRuntime.cpp
call_VM(noreg,
CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter_obj),
object);
Expand Down Expand Up @@ -1185,7 +1185,7 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, Register object)
z_nill(tmp, markWord::monitor_value);
z_brne(slow_case);

fast_unlock(object, header, tmp, slow_case);
lightweight_unlock(object, header, tmp, slow_case);

z_bru(done);
} else {
Expand Down Expand Up @@ -2087,7 +2087,7 @@ void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty,

const Register Rcurr_slot = Rtemp1;
const Register Rlimit = Rtemp2;
const jint delta = -frame::interpreter_frame_monitor_size() * wordSize;
const jint delta = -frame::interpreter_frame_monitor_size_in_bytes();

assert((delta & LongAlignmentMask) == 0,
"sizeof BasicObjectLock must be even number of doublewords");
Expand Down
Loading

0 comments on commit 36606f2

Please sign in to comment.