Skip to content

Commit 928ff00

Browse files
committed
Merge branch 'master' into JDK-8378319_obsolete_maxram
2 parents f0f8d72 + e8dadf4 commit 928ff00

File tree

216 files changed

+19760
-20587
lines changed

Some content is hidden

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

216 files changed

+19760
-20587
lines changed

src/hotspot/cpu/s390/compiledIC_s390.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -29,17 +29,13 @@
2929
#include "memory/resourceArea.hpp"
3030
#include "runtime/mutexLocker.hpp"
3131
#include "runtime/safepoint.hpp"
32-
#ifdef COMPILER2
33-
#include "opto/matcher.hpp"
34-
#endif
3532

3633
// ----------------------------------------------------------------------------
3734

3835
#undef __
3936
#define __ masm->
4037

4138
address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address mark/* = nullptr*/) {
42-
#ifdef COMPILER2
4339
// Stub is fixed up when the corresponding call is converted from calling
4440
// compiled code to calling interpreted code.
4541
if (mark == nullptr) {
@@ -55,7 +51,7 @@ address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address ma
5551
__ relocate(static_stub_Relocation::spec(mark));
5652

5753
AddressLiteral meta = __ allocate_metadata_address(nullptr);
58-
bool success = __ load_const_from_toc(as_Register(Matcher::inline_cache_reg_encode()), meta);
54+
bool success = __ load_const_from_toc(Z_inline_cache, meta);
5955

6056
__ set_inst_mark();
6157
AddressLiteral a((address)-1);
@@ -67,10 +63,6 @@ address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address ma
6763
__ z_br(Z_R1);
6864
__ end_a_stub(); // Update current stubs pointer and restore insts_end.
6965
return stub;
70-
#else
71-
ShouldNotReachHere();
72-
return nullptr;
73-
#endif
7466
}
7567

7668
#undef __

src/hotspot/cpu/zero/bytecodeInterpreter_zero.inline.hpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#ifndef CPU_ZERO_BYTECODEINTERPRETER_ZERO_INLINE_HPP
2727
#define CPU_ZERO_BYTECODEINTERPRETER_ZERO_INLINE_HPP
2828

29+
#include "sanitizers/ub.hpp"
30+
2931
// Inline interpreter functions for zero
3032

3133
inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
@@ -40,6 +42,7 @@ inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) {
4042
return op1 * op2;
4143
}
4244

45+
ATTRIBUTE_NO_UBSAN // IEEE-754 division by zero is well-defined
4346
inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) {
4447
return op1 / op2;
4548
}
@@ -68,7 +71,7 @@ inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2],
6871
}
6972

7073
inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) {
71-
return op1 + op2;
74+
return java_add(op1, op2);
7275
}
7376

7477
inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) {
@@ -82,15 +85,15 @@ inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) {
8285
}
8386

8487
inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) {
85-
return op1 * op2;
88+
return java_multiply(op1, op2);
8689
}
8790

8891
inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) {
8992
return op1 | op2;
9093
}
9194

9295
inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) {
93-
return op1 - op2;
96+
return java_subtract(op1, op2);
9497
}
9598

9699
inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) {
@@ -104,19 +107,19 @@ inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) {
104107
}
105108

106109
inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) {
107-
return ((unsigned long long) op1) >> (op2 & 0x3F);
110+
return java_shift_right_unsigned(op1, op2);
108111
}
109112

110113
inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) {
111-
return op1 >> (op2 & 0x3F);
114+
return java_shift_right(op1, op2);
112115
}
113116

114117
inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) {
115-
return op1 << (op2 & 0x3F);
118+
return java_shift_left(op1, op2);
116119
}
117120

118121
inline jlong BytecodeInterpreter::VMlongNeg(jlong op) {
119-
return -op;
122+
return java_negate(op);
120123
}
121124

122125
inline jlong BytecodeInterpreter::VMlongNot(jlong op) {
@@ -183,8 +186,8 @@ inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) {
183186
return op1 + op2;
184187
}
185188

189+
ATTRIBUTE_NO_UBSAN // IEEE-754 division by zero is well-defined
186190
inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) {
187-
// Divide by zero... QQQ
188191
return op1 / op2;
189192
}
190193

@@ -228,7 +231,7 @@ inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) {
228231
// Integer Arithmetic
229232

230233
inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) {
231-
return op1 + op2;
234+
return java_add(op1, op2);
232235
}
233236

234237
inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) {
@@ -242,11 +245,11 @@ inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) {
242245
}
243246

244247
inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) {
245-
return op1 * op2;
248+
return java_multiply(op1, op2);
246249
}
247250

248251
inline jint BytecodeInterpreter::VMintNeg(jint op) {
249-
return -op;
252+
return java_negate(op);
250253
}
251254

252255
inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) {
@@ -260,19 +263,19 @@ inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
260263
}
261264

262265
inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
263-
return op1 << (op2 & 0x1F);
266+
return java_shift_left(op1, op2);
264267
}
265268

266269
inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
267-
return op1 >> (op2 & 0x1F);
270+
return java_shift_right(op1, op2);
268271
}
269272

270273
inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
271-
return op1 - op2;
274+
return java_subtract(op1, op2);
272275
}
273276

274277
inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
275-
return ((juint) op1) >> (op2 & 0x1F);
278+
return java_shift_right_unsigned(op1, op2);
276279
}
277280

278281
inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {

src/hotspot/cpu/zero/zeroInterpreter_zero.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,15 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
368368
goto unlock_unwind_and_return;
369369

370370
void **arguments;
371-
void *mirror; {
371+
// These locals must remain on stack until call completes
372+
void *mirror;
373+
void *env;
374+
{
372375
arguments =
373376
(void **) stack->alloc(handler->argument_count() * sizeof(void **));
374377
void **dst = arguments;
375378

376-
void *env = thread->jni_environment();
379+
env = thread->jni_environment();
377380
*(dst++) = &env;
378381

379382
if (method->is_static()) {

src/hotspot/os/aix/globals_aix.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
2+
* Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2012, 2026 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -61,10 +61,6 @@
6161
product(bool, OptimizePollingPageLocation, true, DIAGNOSTIC, \
6262
"Optimize the location of the polling page used for Safepoints") \
6363
\
64-
/* Use 64K pages for virtual memory (shmat). */ \
65-
product(bool, Use64KPages, true, DIAGNOSTIC, \
66-
"Use 64K pages if available.") \
67-
\
6864
/* Normally AIX commits memory on touch, but sometimes it is helpful to have */ \
6965
/* explicit commit behaviour. This flag, if true, causes the VM to touch */ \
7066
/* memory on os::commit_memory() (which normally is a noop). */ \
@@ -79,7 +75,6 @@
7975
//
8076

8177
// UseLargePages means nothing, for now, on AIX.
82-
// Use Use64KPages or Use16MPages instead.
8378
define_pd_global(size_t, PreTouchParallelChunkSize, 1 * G);
8479
define_pd_global(bool, UseLargePages, false);
8580
define_pd_global(bool, UseLargePagesIndividualAllocation, false);

src/hotspot/os/aix/os_aix.cpp

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,46 +2142,12 @@ void os::init(void) {
21422142
// 64k no --- AIX 5.2 ? ---
21432143
// 64k yes 64k new systems and standard java loader (we set datapsize=64k when linking)
21442144

2145-
// We explicitly leave no option to change page size, because only upgrading would work,
2146-
// not downgrading (if stack page size is 64k you cannot pretend its 4k).
2147-
2148-
if (g_multipage_support.datapsize == 4*K) {
2149-
// datapsize = 4K. Data segment, thread stacks are 4K paged.
2150-
if (g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages) {
2151-
// .. but we are able to use 64K pages dynamically.
2152-
// This would be typical for java launchers which are not linked
2153-
// with datapsize=64K (like, any other launcher but our own).
2154-
//
2155-
// In this case it would be smart to allocate the java heap with 64K
2156-
// to get the performance benefit, and to fake 64k pages for the
2157-
// data segment (when dealing with thread stacks).
2158-
//
2159-
// However, leave a possibility to downgrade to 4K, using
2160-
// -XX:-Use64KPages.
2161-
if (Use64KPages) {
2162-
trcVerbose("64K page mode (faked for data segment)");
2163-
set_page_size(64*K);
2164-
} else {
2165-
trcVerbose("4K page mode (Use64KPages=off)");
2166-
set_page_size(4*K);
2167-
}
2168-
} else {
2169-
// .. and not able to allocate 64k pages dynamically. Here, just
2170-
// fall back to 4K paged mode and use mmap for everything.
2171-
trcVerbose("4K page mode");
2172-
set_page_size(4*K);
2173-
FLAG_SET_ERGO(Use64KPages, false);
2174-
}
2175-
} else {
2176-
// datapsize = 64k. Data segment, thread stacks are 64k paged.
2177-
// This normally means that we can allocate 64k pages dynamically.
2178-
// (There is one special case where this may be false: EXTSHM=on.
2179-
// but we decided to not support that mode).
2180-
assert0(g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages);
2181-
set_page_size(64*K);
2182-
trcVerbose("64K page mode");
2183-
FLAG_SET_ERGO(Use64KPages, true);
2184-
}
2145+
// datapsize = 64k. Data segment, thread stacks are 64k paged.
2146+
// This normally means that we can allocate 64k pages dynamically.
2147+
// (There is one special case where this may be false: EXTSHM=on.
2148+
// but we decided to not support that mode).
2149+
assert0(g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages);
2150+
set_page_size(64*K);
21852151

21862152
// For now UseLargePages is just ignored.
21872153
FLAG_SET_ERGO(UseLargePages, false);

src/hotspot/share/cds/aotMetaspace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ void AOTMetaspace::dump_static_archive_impl(StaticArchiveBuilder& builder, TRAPS
11481148
if (CDSConfig::is_dumping_full_module_graph()) {
11491149
ClassLoaderDataShared::ensure_module_entry_tables_exist();
11501150
ClassLoaderDataShared::build_tables(CHECK);
1151-
HeapShared::reset_archived_object_states(CHECK);
1151+
HeapShared::prepare_for_archiving(CHECK);
11521152
}
11531153

11541154
AOTReferenceObjSupport::initialize(CHECK);

src/hotspot/share/cds/heapShared.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,28 @@ void HeapShared::reset_archived_object_states(TRAPS) {
247247
reset_states(boot_loader(), CHECK);
248248
}
249249

250+
void HeapShared::ensure_determinism(TRAPS) {
251+
TempNewSymbol class_name = SymbolTable::new_symbol("jdk/internal/util/WeakReferenceKey");
252+
TempNewSymbol method_name = SymbolTable::new_symbol("ensureDeterministicAOTCache");
253+
254+
Klass* weak_ref_key_class = SystemDictionary::resolve_or_fail(class_name, true, CHECK);
255+
precond(weak_ref_key_class != nullptr);
256+
257+
log_debug(aot)("Calling WeakReferenceKey::ensureDeterministicAOTCache(Object.class)");
258+
JavaValue result(T_BOOLEAN);
259+
JavaCalls::call_static(&result,
260+
weak_ref_key_class,
261+
method_name,
262+
vmSymbols::void_boolean_signature(),
263+
CHECK);
264+
assert(result.get_jboolean() == false, "sanity");
265+
}
266+
267+
void HeapShared::prepare_for_archiving(TRAPS) {
268+
reset_archived_object_states(CHECK);
269+
ensure_determinism(CHECK);
270+
}
271+
250272
HeapShared::ArchivedObjectCache* HeapShared::_archived_object_cache = nullptr;
251273

252274
bool HeapShared::is_archived_heap_in_use() {

src/hotspot/share/cds/heapShared.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,10 @@ class HeapShared: AllStatic {
382382
static bool walk_one_object(PendingOopStack* stack, int level, KlassSubGraphInfo* subgraph_info,
383383
oop orig_obj, oop referrer);
384384

385-
public:
386385
static void reset_archived_object_states(TRAPS);
386+
static void ensure_determinism(TRAPS);
387+
public:
388+
static void prepare_for_archiving(TRAPS);
387389
static void create_archived_object_cache() {
388390
_archived_object_cache =
389391
new (mtClass)ArchivedObjectCache(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE);

src/hotspot/share/gc/shared/gc_globals.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@
202202
"(Deprecated) Enable parallel reference processing " \
203203
"whenever possible") \
204204
\
205-
product(bool, ParallelRefProcBalancingEnabled, true, \
206-
"(Deprecated) Enable balancing of reference processing queues") \
207-
\
208205
product(size_t, ReferencesPerThread, 1000, EXPERIMENTAL, \
209206
"Ergonomically start one thread for this amount of " \
210207
"references for reference processing if " \

src/hotspot/share/gc/shared/referenceProcessor.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -586,33 +586,9 @@ void ReferenceProcessor::set_active_mt_degree(uint v) {
586586
_next_id = 0;
587587
}
588588

589-
bool ReferenceProcessor::need_balance_queues(DiscoveredList refs_lists[]) {
590-
assert(processing_is_mt(), "why balance non-mt processing?");
591-
// _num_queues is the processing degree. Only list entries up to
592-
// _num_queues will be processed, so any non-empty lists beyond
593-
// that must be redistributed to lists in that range. Even if not
594-
// needed for that, balancing may be desirable to eliminate poor
595-
// distribution of references among the lists.
596-
if (ParallelRefProcBalancingEnabled) {
597-
return true; // Configuration says do it.
598-
} else {
599-
// Configuration says don't balance, but if there are non-empty
600-
// lists beyond the processing degree, then must ignore the
601-
// configuration and balance anyway.
602-
for (uint i = _num_queues; i < _max_num_queues; ++i) {
603-
if (!refs_lists[i].is_empty()) {
604-
return true; // Must balance despite configuration.
605-
}
606-
}
607-
return false; // Safe to obey configuration and not balance.
608-
}
609-
}
610-
611589
void ReferenceProcessor::maybe_balance_queues(DiscoveredList refs_lists[]) {
612590
assert(processing_is_mt(), "Should not call this otherwise");
613-
if (need_balance_queues(refs_lists)) {
614-
balance_queues(refs_lists);
615-
}
591+
balance_queues(refs_lists);
616592
}
617593

618594
// Balances reference queues.

0 commit comments

Comments
 (0)