Skip to content

Commit

Permalink
Merge branch 'master' into REMOVE_TENURED_SPACE
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/hotspot/share/gc/serial/defNewGeneration.inline.hpp
  • Loading branch information
lgxbslgx committed Apr 23, 2024
2 parents f1bd351 + b07e153 commit d50cd33
Show file tree
Hide file tree
Showing 140 changed files with 1,866 additions and 789 deletions.
3 changes: 1 addition & 2 deletions make/hotspot/lib/CompileGtest.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
EXCLUDES := $(JVM_EXCLUDES), \
EXCLUDE_FILES := gtestLauncher.cpp, \
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
$(BUILD_LIBJVM_ALL_OBJS)), \
EXTRA_OBJECT_FILES := $(BUILD_LIBJVM_ALL_OBJS), \
DEFAULT_CFLAGS := false, \
CFLAGS := $(JVM_CFLAGS) \
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
Expand Down
8 changes: 0 additions & 8 deletions make/hotspot/lib/CompileJvm.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@ JVM_STRIPFLAGS ?= $(STRIPFLAGS)
# This source set is reused so save in cache.
$(call FillFindCache, $(JVM_SRC_DIRS))

# The global operator new functions defined in operator_new.cpp are intended
# to detect and prevent the VM code from calling them. See more details in
# operator_new.cpp. Exclude operator_new.o when statically linking the VM
# code with JDK natives, as the JDK natives might need to call the global
# operator new.
LIBJVM_STATIC_EXCLUDE_OBJS := operator_new.o

ifeq ($(call isTargetOs, windows), true)
ifeq ($(STATIC_LIBS), true)
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/static-win-exports.def
Expand Down Expand Up @@ -217,7 +210,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
RC_FILEDESC := $(HOTSPOT_VM_DISTRO) $(OPENJDK_TARGET_CPU_BITS)-Bit $(JVM_VARIANT) VM, \
PRECOMPILED_HEADER := $(JVM_PRECOMPILED_HEADER), \
PRECOMPILED_HEADER_EXCLUDE := $(JVM_PRECOMPILED_HEADER_EXCLUDE), \
STATIC_LIB_EXCLUDE_OBJS := $(LIBJVM_STATIC_EXCLUDE_OBJS), \
))

ifeq ($(call isTargetOs, windows), true)
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index,
} else if (index_size == sizeof(u4)) {
// assert(EnableInvokeDynamic, "giant index used only for JSR 292");
ldrw(index, Address(rbcp, bcp_offset));
// Check if the secondary index definition is still ~x, otherwise
// we have to change the following assembler code to calculate the
// plain index.
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
eonw(index, index, zr); // convert to plain index
} else if (index_size == sizeof(u1)) {
load_unsigned_byte(index, Address(rbcp, bcp_offset));
} else {
Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,9 +1519,9 @@ class StubGenerator: public StubCodeGenerator {
__ push(RegSet::of(d, count), sp);
}
{
// UnsafeCopyMemory page error: continue after ucm
// UnsafeMemoryAccess page error: continue after unsafe access
bool add_entry = !is_oop && (!aligned || sizeof(jlong) == size);
UnsafeCopyMemoryMark ucmm(this, add_entry, true);
UnsafeMemoryAccessMark umam(this, add_entry, true);
copy_memory(decorators, is_oop ? T_OBJECT : T_BYTE, aligned, s, d, count, size);
}

Expand Down Expand Up @@ -1590,9 +1590,9 @@ class StubGenerator: public StubCodeGenerator {
__ push(RegSet::of(d, count), sp);
}
{
// UnsafeCopyMemory page error: continue after ucm
// UnsafeMemoryAccess page error: continue after unsafe access
bool add_entry = !is_oop && (!aligned || sizeof(jlong) == size);
UnsafeCopyMemoryMark ucmm(this, add_entry, true);
UnsafeMemoryAccessMark umam(this, add_entry, true);
copy_memory(decorators, is_oop ? T_OBJECT : T_BYTE, aligned, s, d, count, -size);
}
if (is_oop) {
Expand Down Expand Up @@ -8378,8 +8378,8 @@ class StubGenerator: public StubCodeGenerator {
SharedRuntime::throw_delayed_StackOverflowError));

// Initialize table for copy memory (arraycopy) check.
if (UnsafeCopyMemory::_table == nullptr) {
UnsafeCopyMemory::create_table(8 + 4); // 8 for copyMemory; 4 for setMemory
if (UnsafeMemoryAccess::_table == nullptr) {
UnsafeMemoryAccess::create_table(8 + 4); // 8 for copyMemory; 4 for setMemory
}

if (UseCRC32Intrinsics) {
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/arm/interp_masm_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ void InterpreterMacroAssembler::get_index_at_bcp(Register index, int bcp_offset,
orr(index, tmp_reg, AsmOperand(index, lsl, BitsPerByte));
ldrb(tmp_reg, Address(Rbcp, bcp_offset));
orr(index, tmp_reg, AsmOperand(index, lsl, BitsPerByte));
// Check if the secondary index definition is still ~x, otherwise
// we have to change the following assembler code to calculate the
// plain index.
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
mvn_32(index, index); // convert to plain index
} else if (index_size == sizeof(u1)) {
ldrb(index, Address(Rbcp, bcp_offset));
} else {
Expand Down
34 changes: 17 additions & 17 deletions src/hotspot/cpu/arm/stubGenerator_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,8 @@ class StubGenerator: public StubCodeGenerator {
Label L_skip_pld;

{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark ucmm(this, unsafe_copy, true);
// UnsafeMemoryAccess page error: continue after unsafe access
UnsafeMemoryAccessMark umam(this, unsafe_copy, true);
// predecrease to exit when there is less than count_per_loop
__ sub_32(count, count, count_per_loop);

Expand Down Expand Up @@ -1105,8 +1105,8 @@ class StubGenerator: public StubCodeGenerator {
__ push(RegisterSet(R4,R10));

{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark ucmm(this, unsafe_copy, true);
// UnsafeMemoryAccess page error: continue after unsafe access
UnsafeMemoryAccessMark umam(this, unsafe_copy, true);
__ sub_32(count, count, count_per_loop);

const bool prefetch_before = pld_offset < 0;
Expand Down Expand Up @@ -1761,8 +1761,8 @@ class StubGenerator: public StubCodeGenerator {
assert_different_registers(from, to, count, tmp);

{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark ucmm(this, unsafe_copy, true);
// UnsafeMemoryAccess page error: continue after unsafe access
UnsafeMemoryAccessMark umam(this, unsafe_copy, true);
__ align(OptoLoopAlignment);
Label L_small_loop;
__ BIND(L_small_loop);
Expand Down Expand Up @@ -1900,8 +1900,8 @@ class StubGenerator: public StubCodeGenerator {
__ push(RegisterSet(R4,R10));

{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark ucmm(this, unsafe_copy, true);
// UnsafeMemoryAccess page error: continue after unsafe access
UnsafeMemoryAccessMark umam(this, unsafe_copy, true);
load_one(Rval, from, wordSize, forward);

switch (bytes_per_count) {
Expand Down Expand Up @@ -2058,8 +2058,8 @@ class StubGenerator: public StubCodeGenerator {

int count_required_to_align = 0;
{
// UnsafeCopyMemoryMark page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccessMark page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
count_required_to_align = from_is_aligned ? 0 : align_src(from, to, count, tmp1, bytes_per_count, forward);
assert (small_copy_limit >= count_required_to_align, "alignment could exhaust count");
}
Expand Down Expand Up @@ -2092,9 +2092,9 @@ class StubGenerator: public StubCodeGenerator {

int min_copy;
if (forward) {
min_copy = generate_forward_aligned_copy_loop(from, to, count, bytes_per_count, !aligned /*add UnsafeCopyMemory entry*/);
min_copy = generate_forward_aligned_copy_loop(from, to, count, bytes_per_count, !aligned /*add UnsafeMemoryAccess entry*/);
} else {
min_copy = generate_backward_aligned_copy_loop(from, to, count, bytes_per_count, !aligned /*add UnsafeCopyMemory entry*/);
min_copy = generate_backward_aligned_copy_loop(from, to, count, bytes_per_count, !aligned /*add UnsafeMemoryAccess entry*/);
}
assert(small_copy_limit >= count_required_to_align + min_copy, "first loop might exhaust count");

Expand All @@ -2105,7 +2105,7 @@ class StubGenerator: public StubCodeGenerator {
__ ret();

{
copy_small_array(from, to, count, tmp1, tmp2, bytes_per_count, forward, L_small_array /* entry */, !aligned /*add UnsafeCopyMemory entry*/);
copy_small_array(from, to, count, tmp1, tmp2, bytes_per_count, forward, L_small_array /* entry */, !aligned /*add UnsafeMemoryAccess entry*/);

if (status) {
__ mov(R0, 0); // OK
Expand All @@ -2116,7 +2116,7 @@ class StubGenerator: public StubCodeGenerator {

if (! to_is_aligned) {
__ BIND(L_unaligned_dst);
int min_copy_shifted = align_dst_and_generate_shifted_copy_loop(from, to, count, bytes_per_count, forward, !aligned /*add UnsafeCopyMemory entry*/);
int min_copy_shifted = align_dst_and_generate_shifted_copy_loop(from, to, count, bytes_per_count, forward, !aligned /*add UnsafeMemoryAccess entry*/);
assert (small_copy_limit >= count_required_to_align + min_copy_shifted, "first loop might exhaust count");

if (status) {
Expand Down Expand Up @@ -2862,7 +2862,7 @@ class StubGenerator: public StubCodeGenerator {
#endif

address ucm_common_error_exit = generate_unsafecopy_common_error_exit();
UnsafeCopyMemory::set_common_exit_stub_pc(ucm_common_error_exit);
UnsafeMemoryAccess::set_common_exit_stub_pc(ucm_common_error_exit);

// these need always status in case they are called from generic_arraycopy
StubRoutines::_jbyte_disjoint_arraycopy = generate_primitive_copy(false, "jbyte_disjoint_arraycopy", true, 1, true);
Expand Down Expand Up @@ -3134,8 +3134,8 @@ class StubGenerator: public StubCodeGenerator {
// stub for throwing stack overflow error used both by interpreter and compiler
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));

if (UnsafeCopyMemory::_table == nullptr) {
UnsafeCopyMemory::create_table(32 + 4); // 32 for copyMemory; 4 for setMemory
if (UnsafeMemoryAccess::_table == nullptr) {
UnsafeMemoryAccess::create_table(32 + 4); // 32 for copyMemory; 4 for setMemory
}

// integer division used both by interpreter and compiler
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of
} else {
lwa(Rdst, bcp_offset, R14_bcp);
}
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
nand(Rdst, Rdst, Rdst); // convert to plain index
} else if (index_size == sizeof(u1)) {
lbz(Rdst, bcp_offset, R14_bcp);
} else {
Expand Down
40 changes: 20 additions & 20 deletions src/hotspot/cpu/ppc/stubGenerator_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ class StubGenerator: public StubCodeGenerator {
// need to copy backwards
}

// This is common errorexit stub for UnsafeCopyMemory.
// This is common errorexit stub for UnsafeMemoryAccess.
address generate_unsafecopy_common_error_exit() {
address start_pc = __ pc();
Register tmp1 = R6_ARG4;
Expand Down Expand Up @@ -1013,8 +1013,8 @@ class StubGenerator: public StubCodeGenerator {

Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8, l_9, l_10;
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);

// Don't try anything fancy if arrays don't have many elements.
__ li(tmp3, 0);
Expand Down Expand Up @@ -1195,8 +1195,8 @@ class StubGenerator: public StubCodeGenerator {
// that we don't have to optimize it.
Label l_1, l_2;
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
__ b(l_2);
__ bind(l_1);
__ stbx(tmp1, R4_ARG2, R5_ARG3);
Expand Down Expand Up @@ -1282,8 +1282,8 @@ class StubGenerator: public StubCodeGenerator {

Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8, l_9;
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
// don't try anything fancy if arrays don't have many elements
__ li(tmp3, 0);
__ cmpwi(CCR0, R5_ARG3, 9);
Expand Down Expand Up @@ -1466,8 +1466,8 @@ class StubGenerator: public StubCodeGenerator {

Label l_1, l_2;
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
__ sldi(tmp1, R5_ARG3, 1);
__ b(l_2);
__ bind(l_1);
Expand Down Expand Up @@ -1625,8 +1625,8 @@ class StubGenerator: public StubCodeGenerator {
address start = __ function_entry();
assert_positive_int(R5_ARG3);
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
generate_disjoint_int_copy_core(aligned);
}
__ li(R3_RET, 0); // return 0
Expand Down Expand Up @@ -1777,8 +1777,8 @@ class StubGenerator: public StubCodeGenerator {

array_overlap_test(nooverlap_target, 2);
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
generate_conjoint_int_copy_core(aligned);
}

Expand Down Expand Up @@ -1903,8 +1903,8 @@ class StubGenerator: public StubCodeGenerator {
address start = __ function_entry();
assert_positive_int(R5_ARG3);
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
generate_disjoint_long_copy_core(aligned);
}
__ li(R3_RET, 0); // return 0
Expand Down Expand Up @@ -2034,8 +2034,8 @@ class StubGenerator: public StubCodeGenerator {

array_overlap_test(nooverlap_target, 3);
{
// UnsafeCopyMemory page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
// UnsafeMemoryAccess page error: continue at UnsafeMemoryAccess common_error_exit
UnsafeMemoryAccessMark umam(this, !aligned, false);
generate_conjoint_long_copy_core(aligned);
}
__ li(R3_RET, 0); // return 0
Expand Down Expand Up @@ -3129,7 +3129,7 @@ class StubGenerator: public StubCodeGenerator {
// the conjoint stubs use them.

address ucm_common_error_exit = generate_unsafecopy_common_error_exit();
UnsafeCopyMemory::set_common_exit_stub_pc(ucm_common_error_exit);
UnsafeMemoryAccess::set_common_exit_stub_pc(ucm_common_error_exit);

// non-aligned disjoint versions
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(false, "jbyte_disjoint_arraycopy");
Expand Down Expand Up @@ -4745,8 +4745,8 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_call_stub_entry = generate_call_stub(StubRoutines::_call_stub_return_address);
StubRoutines::_catch_exception_entry = generate_catch_exception();

if (UnsafeCopyMemory::_table == nullptr) {
UnsafeCopyMemory::create_table(8 + 4); // 8 for copyMemory; 4 for setMemory
if (UnsafeMemoryAccess::_table == nullptr) {
UnsafeMemoryAccess::create_table(8 + 4); // 8 for copyMemory; 4 for setMemory
}

// Build this early so it's available for the interpreter.
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/cpu/riscv/interp_masm_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index,
}
} else if (index_size == sizeof(u4)) {
load_int_misaligned(index, Address(xbcp, bcp_offset), tmp, false);

// Check if the secondary index definition is still ~x, otherwise
// we have to change the following assembler code to calculate the
// plain index.
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
xori(index, index, -1);
sign_extend(index, index, 32);
} else if (index_size == sizeof(u1)) {
load_unsigned_byte(index, Address(xbcp, bcp_offset));
} else {
Expand Down
16 changes: 6 additions & 10 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,16 @@ void MacroAssembler::check_and_handle_popframe(Register java_thread) {}
// has to be reset to 0. This is required to allow proper stack traversal.
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
Register last_java_fp,
Register last_java_pc,
Register tmp) {
Register last_java_pc) {

if (last_java_pc->is_valid()) {
sd(last_java_pc, Address(xthread,
JavaThread::frame_anchor_offset() +
JavaFrameAnchor::last_Java_pc_offset()));
sd(last_java_pc, Address(xthread,
JavaThread::frame_anchor_offset() +
JavaFrameAnchor::last_Java_pc_offset()));
}

// determine last_java_sp register
if (last_java_sp == sp) {
mv(tmp, sp);
last_java_sp = tmp;
} else if (!last_java_sp->is_valid()) {
if (!last_java_sp->is_valid()) {
last_java_sp = esp;
}

Expand All @@ -262,7 +258,7 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
la(tmp, last_java_pc);
sd(tmp, Address(xthread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset()));

set_last_Java_frame(last_java_sp, last_java_fp, noreg, tmp);
set_last_Java_frame(last_java_sp, last_java_fp, noreg);
}

void MacroAssembler::set_last_Java_frame(Register last_java_sp,
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MacroAssembler: public Assembler {
// last Java Frame (fills frame anchor)
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, address last_java_pc, Register tmp);
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, Label &last_java_pc, Register tmp);
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, Register last_java_pc, Register tmp);
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, Register last_java_pc);

// thread in the default location (xthread)
void reset_last_Java_frame(bool clear_fp);
Expand Down
Loading

0 comments on commit d50cd33

Please sign in to comment.