Skip to content

Commit 8b602b4

Browse files
committed
Merge branch 'master' into jdk-8347334-jimage-diff-gen-cleanup
2 parents c9cbb9a + 1f45797 commit 8b602b4

File tree

322 files changed

+3728
-10718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+3728
-10718
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,6 @@ jobs:
325325
bootjdk-platform: linux-x64
326326
runs-on: ubuntu-22.04
327327

328-
test-macos-x64:
329-
name: macos-x64
330-
needs:
331-
- build-macos-x64
332-
uses: ./.github/workflows/test.yml
333-
with:
334-
platform: macos-x64
335-
bootjdk-platform: macos-x64
336-
runs-on: macos-13
337-
xcode-toolset-version: '14.3.1'
338-
339328
test-macos-aarch64:
340329
name: macos-aarch64
341330
needs:

make/autoconf/flags-cflags.m4

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,22 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
830830
831831
FLAGS_SETUP_BRANCH_PROTECTION
832832
833+
if test "x$FLAGS_CPU" = xriscv64; then
834+
AC_MSG_CHECKING([if RVV/vector sigcontext supported])
835+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <linux/ptrace.h>],
836+
[
837+
return (int)sizeof(struct __riscv_v_ext_state);
838+
])],
839+
[
840+
AC_MSG_RESULT([yes])
841+
],
842+
[
843+
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -DNO_RVV_SIGCONTEXT"
844+
AC_MSG_RESULT([no])
845+
]
846+
)
847+
fi
848+
833849
# EXPORT to API
834850
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
835851
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -503,7 +503,7 @@ void InterpreterMacroAssembler::remove_activation(
503503

504504
// get method access flags
505505
ldr(r1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
506-
ldr(r2, Address(r1, Method::access_flags_offset()));
506+
ldrh(r2, Address(r1, Method::access_flags_offset()));
507507
tbz(r2, exact_log2(JVM_ACC_SYNCHRONIZED), unlocked);
508508

509509
// Don't unlock anything if the _do_not_unlock_if_synchronized flag

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
44
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -760,7 +760,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
760760
Label L_skip_barrier;
761761

762762
{ // Bypass the barrier for non-static methods
763-
__ ldrw(rscratch1, Address(rmethod, Method::access_flags_offset()));
763+
__ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
764764
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
765765
__ br(Assembler::EQ, L_skip_barrier); // non-static
766766
}

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -809,7 +809,7 @@ void TemplateInterpreterGenerator::lock_method() {
809809
#ifdef ASSERT
810810
{
811811
Label L;
812-
__ ldrw(r0, access_flags);
812+
__ ldrh(r0, access_flags);
813813
__ tst(r0, JVM_ACC_SYNCHRONIZED);
814814
__ br(Assembler::NE, L);
815815
__ stop("method doesn't need synchronization");
@@ -820,7 +820,7 @@ void TemplateInterpreterGenerator::lock_method() {
820820
// get synchronization object
821821
{
822822
Label done;
823-
__ ldrw(r0, access_flags);
823+
__ ldrh(r0, access_flags);
824824
__ tst(r0, JVM_ACC_STATIC);
825825
// get receiver (assume this is frequent case)
826826
__ ldr(r0, Address(rlocals, Interpreter::local_offset_in_bytes(0)));
@@ -1225,7 +1225,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
12251225

12261226
// make sure method is native & not abstract
12271227
#ifdef ASSERT
1228-
__ ldrw(r0, access_flags);
1228+
__ ldrh(r0, access_flags);
12291229
{
12301230
Label L;
12311231
__ tst(r0, JVM_ACC_NATIVE);
@@ -1277,7 +1277,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
12771277
#ifdef ASSERT
12781278
{
12791279
Label L;
1280-
__ ldrw(r0, access_flags);
1280+
__ ldrh(r0, access_flags);
12811281
__ tst(r0, JVM_ACC_SYNCHRONIZED);
12821282
__ br(Assembler::EQ, L);
12831283
__ stop("method needs synchronization");
@@ -1354,7 +1354,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
13541354
// pass mirror handle if static call
13551355
{
13561356
Label L;
1357-
__ ldrw(t, Address(rmethod, Method::access_flags_offset()));
1357+
__ ldrh(t, Address(rmethod, Method::access_flags_offset()));
13581358
__ tbz(t, exact_log2(JVM_ACC_STATIC), L);
13591359
// get mirror
13601360
__ load_mirror(t, rmethod, r10, rscratch2);
@@ -1564,7 +1564,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
15641564
// do unlocking if necessary
15651565
{
15661566
Label L;
1567-
__ ldrw(t, Address(rmethod, Method::access_flags_offset()));
1567+
__ ldrh(t, Address(rmethod, Method::access_flags_offset()));
15681568
__ tbz(t, exact_log2(JVM_ACC_SYNCHRONIZED), L);
15691569
// the code below should be shared with interpreter macro
15701570
// assembler implementation
@@ -1695,7 +1695,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
16951695

16961696
// make sure method is not native & not abstract
16971697
#ifdef ASSERT
1698-
__ ldrw(r0, access_flags);
1698+
__ ldrh(r0, access_flags);
16991699
{
17001700
Label L;
17011701
__ tst(r0, JVM_ACC_NATIVE);
@@ -1751,7 +1751,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
17511751
#ifdef ASSERT
17521752
{
17531753
Label L;
1754-
__ ldrw(r0, access_flags);
1754+
__ ldrh(r0, access_flags);
17551755
__ tst(r0, JVM_ACC_SYNCHRONIZED);
17561756
__ br(Assembler::EQ, L);
17571757
__ stop("method needs synchronization");

src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ void VM_Version::initialize() {
158158
if (FLAG_IS_DEFAULT(OnSpinWaitInstCount)) {
159159
FLAG_SET_DEFAULT(OnSpinWaitInstCount, 2);
160160
}
161+
if (FLAG_IS_DEFAULT(CodeEntryAlignment) &&
162+
(_model == CPU_MODEL_AMPERE_1A || _model == CPU_MODEL_AMPERE_1B)) {
163+
FLAG_SET_DEFAULT(CodeEntryAlignment, 32);
164+
}
161165
}
162166

163167
// ThunderX

src/hotspot/cpu/arm/interp_masm_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -736,7 +736,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, Register ret_a
736736
ldrb(Rflag, do_not_unlock_if_synchronized);
737737

738738
// get method access flags
739-
ldr_u32(Raccess_flags, Address(Rmethod, Method::access_flags_offset()));
739+
ldrh(Raccess_flags, Address(Rmethod, Method::access_flags_offset()));
740740

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

src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -579,7 +579,7 @@ void TemplateInterpreterGenerator::lock_method() {
579579

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

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

852852
// make sure method is native & not abstract
853853
#ifdef ASSERT
854-
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
854+
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
855855
{
856856
Label L;
857857
__ tbnz(Rtemp, JVM_ACC_NATIVE_BIT, L);
@@ -893,7 +893,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
893893
// no synchronization necessary
894894
#ifdef ASSERT
895895
{ Label L;
896-
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
896+
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
897897
__ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
898898
__ stop("method needs synchronization");
899899
__ bind(L);
@@ -975,7 +975,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
975975
// Pass JNIEnv and mirror for static methods
976976
{
977977
Label L;
978-
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
978+
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
979979
__ add(R0, Rthread, in_bytes(JavaThread::jni_environment_offset()));
980980
__ tbz(Rtemp, JVM_ACC_STATIC_BIT, L);
981981
__ load_mirror(Rtemp, Rmethod, Rtemp);
@@ -1204,7 +1204,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
12041204

12051205
// make sure method is not native & not abstract
12061206
#ifdef ASSERT
1207-
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
1207+
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
12081208
{
12091209
Label L;
12101210
__ tbz(Rtemp, JVM_ACC_NATIVE_BIT, L);
@@ -1249,7 +1249,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
12491249
// no synchronization necessary
12501250
#ifdef ASSERT
12511251
{ Label L;
1252-
__ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
1252+
__ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
12531253
__ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
12541254
__ stop("method needs synchronization");
12551255
__ bind(L);

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -681,14 +681,14 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
681681
// Check if synchronized method or unlocking prevented by
682682
// JavaThread::do_not_unlock_if_synchronized flag.
683683
lbz(Rdo_not_unlock_flag, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread);
684-
lwz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method);
684+
lhz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method);
685685
li(R0, 0);
686686
stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread); // reset flag
687687

688688
push(state);
689689

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

694694
cmpwi(CCR0, Rdo_not_unlock_flag, 0);

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -1202,7 +1202,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
12021202
Label L_skip_barrier;
12031203

12041204
{ // Bypass the barrier for non-static methods
1205-
__ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
1205+
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
12061206
__ andi_(R0, R0, JVM_ACC_STATIC);
12071207
__ beq(CCR0, L_skip_barrier); // non-static
12081208
}

src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2015, 2024 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -144,9 +144,9 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
144144
// TODO PPC port: requires change in shared code.
145145
//assert(in_bytes(AccessFlags::flags_offset()) == 0,
146146
// "MethodDesc._access_flags == MethodDesc._access_flags._flags");
147-
// _access_flags must be a 32 bit value.
148-
assert(sizeof(AccessFlags) == 4, "wrong size");
149-
__ lwa(R11_scratch1/*access_flags*/, method_(access_flags));
147+
// _access_flags must be a 16 bit value.
148+
assert(sizeof(AccessFlags) == 2, "wrong size");
149+
__ lhz(R11_scratch1/*access_flags*/, method_(access_flags));
150150
// testbit with condition register.
151151
__ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT);
152152
__ btrue(CCR0, L);
@@ -823,7 +823,7 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc
823823

824824
{
825825
if (!flags_preloaded) {
826-
__ lwz(Rflags, method_(access_flags));
826+
__ lhz(Rflags, method_(access_flags));
827827
}
828828

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

13071307
// We don't want to reload R19_method and access_flags after calls
13081308
// to some helper functions.
@@ -1769,7 +1769,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
17691769
#ifdef ASSERT
17701770
else {
17711771
Label Lok;
1772-
__ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
1772+
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
17731773
__ andi_(R0, R0, JVM_ACC_SYNCHRONIZED);
17741774
__ asm_assert_eq("method needs synchronization");
17751775
__ bind(Lok);

src/hotspot/cpu/riscv/assembler_riscv.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,10 +2015,10 @@ enum Nf {
20152015
}
20162016

20172017
INSN(add_uw, 0b0111011, 0b000, 0b0000100);
2018-
INSN(rol, 0b0110011, 0b001, 0b0110000);
2019-
INSN(rolw, 0b0111011, 0b001, 0b0110000);
2020-
INSN(ror, 0b0110011, 0b101, 0b0110000);
2021-
INSN(rorw, 0b0111011, 0b101, 0b0110000);
2018+
INSN(rolr, 0b0110011, 0b001, 0b0110000);
2019+
INSN(rolrw, 0b0111011, 0b001, 0b0110000);
2020+
INSN(rorr, 0b0110011, 0b101, 0b0110000);
2021+
INSN(rorrw, 0b0111011, 0b101, 0b0110000);
20222022
INSN(sh1add, 0b0110011, 0b010, 0b0010000);
20232023
INSN(sh2add, 0b0110011, 0b100, 0b0010000);
20242024
INSN(sh3add, 0b0110011, 0b110, 0b0010000);

src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void LIR_Assembler::arraycopy_type_check(Register src, Register src_pos, Registe
211211
Label cont, slow;
212212

213213
#define PUSH(r1, r2) \
214-
__ addi(sp, sp, -2 * wordSize); \
214+
__ subi(sp, sp, 2 * wordSize); \
215215
__ sd(r1, Address(sp, 1 * wordSize)); \
216216
__ sd(r2, Address(sp, 0));
217217

@@ -337,10 +337,10 @@ void LIR_Assembler::arraycopy_prepare_params(Register src, Register src_pos, Reg
337337
Register dst, Register dst_pos, BasicType basic_type) {
338338
int scale = array_element_size(basic_type);
339339
__ shadd(c_rarg0, src_pos, src, t0, scale);
340-
__ add(c_rarg0, c_rarg0, arrayOopDesc::base_offset_in_bytes(basic_type));
340+
__ addi(c_rarg0, c_rarg0, arrayOopDesc::base_offset_in_bytes(basic_type));
341341
assert_different_registers(c_rarg0, dst, dst_pos, length);
342342
__ shadd(c_rarg1, dst_pos, dst, t0, scale);
343-
__ add(c_rarg1, c_rarg1, arrayOopDesc::base_offset_in_bytes(basic_type));
343+
__ addi(c_rarg1, c_rarg1, arrayOopDesc::base_offset_in_bytes(basic_type));
344344
assert_different_registers(c_rarg1, dst, length);
345345
__ mv(c_rarg2, length);
346346
assert_different_registers(c_rarg2, dst);

0 commit comments

Comments
 (0)