Skip to content

Commit c6b2d82

Browse files
[GR-50931] Merge in tag jdk-23+3
PullRequest: labsjdk-ce/46
2 parents 70c94b2 + 86ab368 commit c6b2d82

File tree

262 files changed

+2976
-1293
lines changed

Some content is hidden

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

262 files changed

+2976
-1293
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ local contains(str, needle) = std.findSubstr(needle, str) != [];
246246
# Downstream Graal branch to test against. If you change this value to anything but
247247
# "master", you must create an ol-jira issue to change it back to master once the
248248
# next JVMCI release has been made. Add the issue id as a comment here.
249-
local downstream_branch = "labsjdk/automation-12-20-2023-8874",
249+
local downstream_branch = "labsjdk/automation-12-26-2023-5475",
250250

251251
local clone_graal(defs) = {
252252
# Checkout the graal-enterprise repo to the "_gate" version of the

make/autoconf/spec.gmk.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ PRODUCT_NAME := @PRODUCT_NAME@
191191
PRODUCT_SUFFIX := @PRODUCT_SUFFIX@
192192
JDK_RC_PLATFORM_NAME := @JDK_RC_PLATFORM_NAME@
193193
JDK_RC_NAME := @JDK_RC_NAME@
194-
JDK_RC_COMPANY_NAME:=@JDK_RC_COMPANY_NAME@
194+
JDK_RC_COMPANY_NAME := @JDK_RC_COMPANY_NAME@
195195
COMPANY_NAME := @COMPANY_NAME@
196196
HOTSPOT_VM_DISTRO := @HOTSPOT_VM_DISTRO@
197197
MACOSX_BUNDLE_NAME_BASE := @MACOSX_BUNDLE_NAME_BASE@

make/data/hotspot-symbols/symbols-unix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ JVM_VirtualThreadEnd
223223
JVM_VirtualThreadMount
224224
JVM_VirtualThreadUnmount
225225
JVM_VirtualThreadHideFrames
226+
JVM_VirtualThreadDisableSuspend
226227

227228
# Scoped values
228229
JVM_EnsureMaterializedForStackWalk_func

make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2023, 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
@@ -32,6 +32,7 @@
3232
import java.io.FileOutputStream;
3333
import java.io.InputStream;
3434
import java.text.SimpleDateFormat;
35+
import java.util.Arrays;
3536
import java.util.Date;
3637
import java.util.HashMap;
3738
import java.util.Locale;
@@ -339,9 +340,15 @@ private static void buildOtherTables() {
339340
validCurrencyCodes.substring(i * 7 + 3, i * 7 + 6));
340341
checkCurrencyCode(currencyCode);
341342
int tableEntry = mainTable[(currencyCode.charAt(0) - 'A') * A_TO_Z + (currencyCode.charAt(1) - 'A')];
342-
if (tableEntry == INVALID_COUNTRY_ENTRY ||
343-
(tableEntry & SPECIAL_CASE_COUNTRY_MASK) != 0 ||
344-
(tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) != (currencyCode.charAt(2) - 'A')) {
343+
344+
// Do not allow a future currency to be classified as an otherCurrency,
345+
// otherwise it will leak out into Currency:getAvailableCurrencies
346+
boolean futureCurrency = Arrays.asList(specialCaseNewCurrencies).contains(currencyCode);
347+
boolean simpleCurrency = (tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) == (currencyCode.charAt(2) - 'A');
348+
349+
// If neither a simple currency, or one defined in the future
350+
// then the current currency is applicable to be added to the otherTable
351+
if (!futureCurrency && !simpleCurrency) {
345352
if (otherCurrenciesCount == maxOtherCurrencies) {
346353
throw new RuntimeException("too many other currencies");
347354
}

src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "code/compiledIC.hpp"
2929
#include "code/icBuffer.hpp"
3030
#include "code/nmethod.hpp"
31+
#include "logging/log.hpp"
3132
#include "memory/resourceArea.hpp"
3233
#include "runtime/mutexLocker.hpp"
3334
#include "runtime/safepoint.hpp"
@@ -90,9 +91,9 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
9091
address stub = find_stub();
9192
guarantee(stub != nullptr, "stub not found");
9293

93-
if (TraceICs) {
94+
{
9495
ResourceMark rm;
95-
tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
96+
log_trace(inlinecache)("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
9697
p2i(instruction_address()),
9798
callee->name_and_sig_as_C_string());
9899
}

src/hotspot/cpu/arm/compiledIC_arm.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "code/icBuffer.hpp"
2929
#include "code/nativeInst.hpp"
3030
#include "code/nmethod.hpp"
31+
#include "logging/log.hpp"
3132
#include "memory/resourceArea.hpp"
3233
#include "runtime/mutexLocker.hpp"
3334
#include "runtime/safepoint.hpp"
@@ -105,9 +106,9 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
105106
address stub = find_stub();
106107
guarantee(stub != nullptr, "stub not found");
107108

108-
if (TraceICs) {
109+
{
109110
ResourceMark rm;
110-
tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
111+
log_trace(inlinecache)("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
111112
p2i(instruction_address()),
112113
callee->name_and_sig_as_C_string());
113114
}

src/hotspot/cpu/ppc/compiledIC_ppc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
167167
address stub = find_stub();
168168
guarantee(stub != nullptr, "stub not found");
169169

170-
if (TraceICs) {
170+
{
171171
ResourceMark rm;
172-
tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
172+
log_trace(inlinecache)("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
173173
p2i(instruction_address()),
174174
callee->name_and_sig_as_C_string());
175175
}

src/hotspot/cpu/riscv/assembler_riscv.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ enum Aqrl {relaxed = 0b00, rl = 0b01, aq = 0b10, aqrl = 0b11};
758758
INSN(amomax_d , 0b0101111, 0b011, 0b10100);
759759
INSN(amominu_d, 0b0101111, 0b011, 0b11000);
760760
INSN(amomaxu_d, 0b0101111, 0b011, 0b11100);
761+
INSN(amocas_w, 0b0101111, 0b010, 0b00101);
762+
INSN(amocas_d, 0b0101111, 0b011, 0b00101);
761763
#undef INSN
762764

763765
enum operand_size { int8, int16, int32, uint32, int64 };
@@ -2940,6 +2942,17 @@ enum Nf {
29402942
return uabs(target - branch) < branch_range;
29412943
}
29422944

2945+
// Decode the given instruction, checking if it's a 16-bit compressed
2946+
// instruction and return the address of the next instruction.
2947+
static address locate_next_instruction(address inst) {
2948+
// Instruction wider than 16 bits has the two least-significant bits set.
2949+
if ((0x3 & *inst) == 0x3) {
2950+
return inst + instruction_size;
2951+
} else {
2952+
return inst + compressed_instruction_size;
2953+
}
2954+
}
2955+
29432956
Assembler(CodeBuffer* code) : AbstractAssembler(code), _in_compressible_region(true) {}
29442957
};
29452958

src/hotspot/cpu/riscv/compiledIC_riscv.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "code/compiledIC.hpp"
3030
#include "code/icBuffer.hpp"
3131
#include "code/nmethod.hpp"
32+
#include "logging/log.hpp"
3233
#include "memory/resourceArea.hpp"
3334
#include "runtime/mutexLocker.hpp"
3435
#include "runtime/safepoint.hpp"
@@ -88,9 +89,9 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
8889
address stub = find_stub();
8990
guarantee(stub != nullptr, "stub not found");
9091

91-
if (TraceICs) {
92+
{
9293
ResourceMark rm;
93-
tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
94+
log_trace(inlinecache)("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
9495
p2i(instruction_address()),
9596
callee->name_and_sig_as_C_string());
9697
}

src/hotspot/cpu/riscv/gc/x/x_riscv.ad

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ static void x_load_barrier_slow_path(MacroAssembler& _masm, const MachNode* node
5252
%}
5353

5454
// Load Pointer
55-
instruct xLoadP(iRegPNoSp dst, memory mem)
55+
instruct xLoadP(iRegPNoSp dst, memory mem, iRegPNoSp tmp)
5656
%{
5757
match(Set dst (LoadP mem));
5858
predicate(UseZGC && !ZGenerational && (n->as_Load()->barrier_data() != 0));
59-
effect(TEMP dst);
59+
effect(TEMP dst, TEMP tmp);
6060

6161
ins_cost(4 * DEFAULT_COST);
6262

@@ -65,17 +65,17 @@ instruct xLoadP(iRegPNoSp dst, memory mem)
6565
ins_encode %{
6666
const Address ref_addr (as_Register($mem$$base), $mem$$disp);
6767
__ ld($dst$$Register, ref_addr);
68-
x_load_barrier(_masm, this, ref_addr, $dst$$Register, t0 /* tmp */, barrier_data());
68+
x_load_barrier(_masm, this, ref_addr, $dst$$Register, $tmp$$Register /* tmp */, barrier_data());
6969
%}
7070

7171
ins_pipe(iload_reg_mem);
7272
%}
7373

74-
instruct xCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{
74+
instruct xCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp) %{
7575
match(Set res (CompareAndSwapP mem (Binary oldval newval)));
7676
match(Set res (WeakCompareAndSwapP mem (Binary oldval newval)));
7777
predicate(UseZGC && !ZGenerational && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == XLoadBarrierStrong);
78-
effect(KILL cr, TEMP_DEF res);
78+
effect(TEMP_DEF res, TEMP tmp);
7979

8080
ins_cost(2 * VOLATILE_REF_COST);
8181

@@ -86,17 +86,15 @@ instruct xCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newva
8686
Label failed;
8787
guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
8888
__ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64,
89-
Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register,
90-
true /* result_as_bool */);
91-
__ beqz($res$$Register, failed);
92-
__ mv(t0, $oldval$$Register);
93-
__ bind(failed);
89+
Assembler::relaxed /* acquire */, Assembler::rl /* release */, $tmp$$Register);
90+
__ sub(t0, $tmp$$Register, $oldval$$Register);
91+
__ seqz($res$$Register, t0);
9492
if (barrier_data() != XLoadBarrierElided) {
9593
Label good;
96-
__ ld(t1, Address(xthread, XThreadLocalData::address_bad_mask_offset()), t1 /* tmp */);
97-
__ andr(t1, t1, t0);
98-
__ beqz(t1, good);
99-
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), t0 /* ref */, t1 /* tmp */);
94+
__ ld(t0, Address(xthread, XThreadLocalData::address_bad_mask_offset()));
95+
__ andr(t0, t0, $tmp$$Register);
96+
__ beqz(t0, good);
97+
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), $tmp$$Register /* ref */, $res$$Register /* tmp */);
10098
__ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64,
10199
Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register,
102100
true /* result_as_bool */);
@@ -107,11 +105,11 @@ instruct xCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newva
107105
ins_pipe(pipe_slow);
108106
%}
109107

110-
instruct xCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{
108+
instruct xCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp) %{
111109
match(Set res (CompareAndSwapP mem (Binary oldval newval)));
112110
match(Set res (WeakCompareAndSwapP mem (Binary oldval newval)));
113111
predicate(UseZGC && !ZGenerational && needs_acquiring_load_reserved(n) && (n->as_LoadStore()->barrier_data() == XLoadBarrierStrong));
114-
effect(KILL cr, TEMP_DEF res);
112+
effect(TEMP_DEF res, TEMP tmp);
115113

116114
ins_cost(2 * VOLATILE_REF_COST);
117115

@@ -122,17 +120,15 @@ instruct xCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP ne
122120
Label failed;
123121
guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
124122
__ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64,
125-
Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register,
126-
true /* result_as_bool */);
127-
__ beqz($res$$Register, failed);
128-
__ mv(t0, $oldval$$Register);
129-
__ bind(failed);
123+
Assembler::aq /* acquire */, Assembler::rl /* release */, $tmp$$Register);
124+
__ sub(t0, $tmp$$Register, $oldval$$Register);
125+
__ seqz($res$$Register, t0);
130126
if (barrier_data() != XLoadBarrierElided) {
131127
Label good;
132-
__ ld(t1, Address(xthread, XThreadLocalData::address_bad_mask_offset()), t1 /* tmp */);
133-
__ andr(t1, t1, t0);
134-
__ beqz(t1, good);
135-
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), t0 /* ref */, t1 /* tmp */);
128+
__ ld(t0, Address(xthread, XThreadLocalData::address_bad_mask_offset()));
129+
__ andr(t0, t0, $tmp$$Register);
130+
__ beqz(t0, good);
131+
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), $tmp$$Register /* ref */, $res$$Register /* tmp */);
136132
__ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64,
137133
Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register,
138134
true /* result_as_bool */);
@@ -143,10 +139,10 @@ instruct xCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP ne
143139
ins_pipe(pipe_slow);
144140
%}
145141

146-
instruct xCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval) %{
142+
instruct xCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp) %{
147143
match(Set res (CompareAndExchangeP mem (Binary oldval newval)));
148144
predicate(UseZGC && !ZGenerational && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == XLoadBarrierStrong);
149-
effect(TEMP_DEF res);
145+
effect(TEMP_DEF res, TEMP tmp);
150146

151147
ins_cost(2 * VOLATILE_REF_COST);
152148

@@ -161,7 +157,7 @@ instruct xCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP n
161157
__ ld(t0, Address(xthread, XThreadLocalData::address_bad_mask_offset()));
162158
__ andr(t0, t0, $res$$Register);
163159
__ beqz(t0, good);
164-
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, t0 /* tmp */);
160+
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, $tmp$$Register /* tmp */);
165161
__ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64,
166162
Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register);
167163
__ bind(good);
@@ -171,10 +167,10 @@ instruct xCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP n
171167
ins_pipe(pipe_slow);
172168
%}
173169

174-
instruct xCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval) %{
170+
instruct xCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp) %{
175171
match(Set res (CompareAndExchangeP mem (Binary oldval newval)));
176172
predicate(UseZGC && !ZGenerational && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == XLoadBarrierStrong);
177-
effect(TEMP_DEF res);
173+
effect(TEMP_DEF res, TEMP tmp);
178174

179175
ins_cost(2 * VOLATILE_REF_COST);
180176

@@ -189,7 +185,7 @@ instruct xCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iReg
189185
__ ld(t0, Address(xthread, XThreadLocalData::address_bad_mask_offset()));
190186
__ andr(t0, t0, $res$$Register);
191187
__ beqz(t0, good);
192-
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, t0 /* tmp */);
188+
x_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, $tmp$$Register /* tmp */);
193189
__ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64,
194190
Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register);
195191
__ bind(good);
@@ -199,35 +195,35 @@ instruct xCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iReg
199195
ins_pipe(pipe_slow);
200196
%}
201197

202-
instruct xGetAndSetP(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{
198+
instruct xGetAndSetP(indirect mem, iRegP newv, iRegPNoSp prev, iRegPNoSp tmp) %{
203199
match(Set prev (GetAndSetP mem newv));
204200
predicate(UseZGC && !ZGenerational && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0);
205-
effect(TEMP_DEF prev, KILL cr);
201+
effect(TEMP_DEF prev, TEMP tmp);
206202

207203
ins_cost(2 * VOLATILE_REF_COST);
208204

209205
format %{ "atomic_xchg $prev, $newv, [$mem], #@zGetAndSetP" %}
210206

211207
ins_encode %{
212208
__ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base));
213-
x_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, t0 /* tmp */, barrier_data());
209+
x_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, $tmp$$Register /* tmp */, barrier_data());
214210
%}
215211

216212
ins_pipe(pipe_serial);
217213
%}
218214

219-
instruct xGetAndSetPAcq(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{
215+
instruct xGetAndSetPAcq(indirect mem, iRegP newv, iRegPNoSp prev, iRegPNoSp tmp) %{
220216
match(Set prev (GetAndSetP mem newv));
221217
predicate(UseZGC && !ZGenerational && needs_acquiring_load_reserved(n) && (n->as_LoadStore()->barrier_data() != 0));
222-
effect(TEMP_DEF prev, KILL cr);
218+
effect(TEMP_DEF prev, TEMP tmp);
223219

224220
ins_cost(VOLATILE_REF_COST);
225221

226222
format %{ "atomic_xchg_acq $prev, $newv, [$mem], #@zGetAndSetPAcq" %}
227223

228224
ins_encode %{
229225
__ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base));
230-
x_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, t0 /* tmp */, barrier_data());
226+
x_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, $tmp$$Register /* tmp */, barrier_data());
231227
%}
232228
ins_pipe(pipe_serial);
233229
%}

0 commit comments

Comments
 (0)