Skip to content

Commit 17bdbc5

Browse files
author
corretto-github-robot
committed
Merge upstream-jdk
2 parents 667173e + f0a89c5 commit 17bdbc5

File tree

6 files changed

+47
-31
lines changed

6 files changed

+47
-31
lines changed

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
189189
} else {
190190
fn = CAST_FROM_FN_PTR(address, StubRoutines::dsin());
191191
}
192-
__ call(fn);
192+
__ rt_call(fn);
193193
__ mv(ra, x9);
194194
break;
195195
case Interpreter::java_lang_math_cos :
@@ -202,7 +202,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
202202
} else {
203203
fn = CAST_FROM_FN_PTR(address, StubRoutines::dcos());
204204
}
205-
__ call(fn);
205+
__ rt_call(fn);
206206
__ mv(ra, x9);
207207
break;
208208
case Interpreter::java_lang_math_tan :
@@ -215,7 +215,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
215215
} else {
216216
fn = CAST_FROM_FN_PTR(address, StubRoutines::dtan());
217217
}
218-
__ call(fn);
218+
__ rt_call(fn);
219219
__ mv(ra, x9);
220220
break;
221221
case Interpreter::java_lang_math_log :
@@ -228,7 +228,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
228228
} else {
229229
fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog());
230230
}
231-
__ call(fn);
231+
__ rt_call(fn);
232232
__ mv(ra, x9);
233233
break;
234234
case Interpreter::java_lang_math_log10 :
@@ -241,7 +241,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
241241
} else {
242242
fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog10());
243243
}
244-
__ call(fn);
244+
__ rt_call(fn);
245245
__ mv(ra, x9);
246246
break;
247247
case Interpreter::java_lang_math_exp :
@@ -254,7 +254,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
254254
} else {
255255
fn = CAST_FROM_FN_PTR(address, StubRoutines::dexp());
256256
}
257-
__ call(fn);
257+
__ rt_call(fn);
258258
__ mv(ra, x9);
259259
break;
260260
case Interpreter::java_lang_math_pow :
@@ -268,7 +268,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
268268
} else {
269269
fn = CAST_FROM_FN_PTR(address, StubRoutines::dpow());
270270
}
271-
__ call(fn);
271+
__ rt_call(fn);
272272
__ mv(ra, x9);
273273
break;
274274
case Interpreter::java_lang_math_fmaD :

src/hotspot/share/prims/jvmtiEventController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ JvmtiEventControllerPrivate::recompute_thread_enabled(JvmtiThreadState *state) {
598598
}
599599
// compute interp_only mode
600600
bool should_be_interp = (any_env_enabled & INTERP_EVENT_BITS) != 0 || has_frame_pops;
601-
bool is_now_interp = state->is_interp_only_mode();
601+
bool is_now_interp = state->is_interp_only_mode() || state->is_pending_interp_only_mode();
602602

603603
if (should_be_interp != is_now_interp) {
604604
if (should_be_interp) {

src/hotspot/share/runtime/continuationFreezeThaw.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,6 +2603,7 @@ void ThawBase::recurse_thaw_compiled_frame(const frame& hf, frame& caller, int n
26032603
|| (stub_caller && f.cb()->as_nmethod()->is_marked_for_deoptimization())) {
26042604
// The caller of the safepoint stub when the continuation is preempted is not at a call instruction, and so
26052605
// cannot rely on nmethod patching for deopt.
2606+
assert(_thread->is_interp_only_mode() || stub_caller, "expected a stub-caller");
26062607

26072608
log_develop_trace(continuations)("Deoptimizing thawed frame");
26082609
DEBUG_ONLY(ContinuationHelper::Frame::patch_pc(f, nullptr));

src/hotspot/share/runtime/synchronizer.cpp

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 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
@@ -1264,36 +1264,49 @@ static bool monitors_used_above_threshold(MonitorList* list) {
12641264
if (MonitorUsedDeflationThreshold == 0) { // disabled case is easy
12651265
return false;
12661266
}
1267-
// Start with ceiling based on a per-thread estimate:
1268-
size_t ceiling = ObjectSynchronizer::in_use_list_ceiling();
1269-
size_t old_ceiling = ceiling;
1270-
if (ceiling < list->max()) {
1271-
// The max used by the system has exceeded the ceiling so use that:
1272-
ceiling = list->max();
1273-
}
12741267
size_t monitors_used = list->count();
12751268
if (monitors_used == 0) { // empty list is easy
12761269
return false;
12771270
}
1278-
if (NoAsyncDeflationProgressMax != 0 &&
1279-
_no_progress_cnt >= NoAsyncDeflationProgressMax) {
1280-
double remainder = (100.0 - MonitorUsedDeflationThreshold) / 100.0;
1281-
size_t new_ceiling = ceiling + (size_t)((double)ceiling * remainder) + 1;
1282-
ObjectSynchronizer::set_in_use_list_ceiling(new_ceiling);
1283-
log_info(monitorinflation)("Too many deflations without progress; "
1284-
"bumping in_use_list_ceiling from " SIZE_FORMAT
1285-
" to " SIZE_FORMAT, old_ceiling, new_ceiling);
1286-
_no_progress_cnt = 0;
1287-
ceiling = new_ceiling;
1288-
}
1271+
size_t old_ceiling = ObjectSynchronizer::in_use_list_ceiling();
1272+
// Make sure that we use a ceiling value that is not lower than
1273+
// previous, not lower than the recorded max used by the system, and
1274+
// not lower than the current number of monitors in use (which can
1275+
// race ahead of max). The result is guaranteed > 0.
1276+
size_t ceiling = MAX3(old_ceiling, list->max(), monitors_used);
12891277

12901278
// Check if our monitor usage is above the threshold:
12911279
size_t monitor_usage = (monitors_used * 100LL) / ceiling;
12921280
if (int(monitor_usage) > MonitorUsedDeflationThreshold) {
1281+
// Deflate monitors if over the threshold percentage, unless no
1282+
// progress on previous deflations.
1283+
bool is_above_threshold = true;
1284+
1285+
// Check if it's time to adjust the in_use_list_ceiling up, due
1286+
// to too many async deflation attempts without any progress.
1287+
if (NoAsyncDeflationProgressMax != 0 &&
1288+
_no_progress_cnt >= NoAsyncDeflationProgressMax) {
1289+
double remainder = (100.0 - MonitorUsedDeflationThreshold) / 100.0;
1290+
size_t delta = (size_t)(ceiling * remainder) + 1;
1291+
size_t new_ceiling = (ceiling > SIZE_MAX - delta)
1292+
? SIZE_MAX // Overflow, let's clamp new_ceiling.
1293+
: ceiling + delta;
1294+
1295+
ObjectSynchronizer::set_in_use_list_ceiling(new_ceiling);
1296+
log_info(monitorinflation)("Too many deflations without progress; "
1297+
"bumping in_use_list_ceiling from " SIZE_FORMAT
1298+
" to " SIZE_FORMAT, old_ceiling, new_ceiling);
1299+
_no_progress_cnt = 0;
1300+
ceiling = new_ceiling;
1301+
1302+
// Check if our monitor usage is still above the threshold:
1303+
monitor_usage = (monitors_used * 100LL) / ceiling;
1304+
is_above_threshold = int(monitor_usage) > MonitorUsedDeflationThreshold;
1305+
}
12931306
log_info(monitorinflation)("monitors_used=" SIZE_FORMAT ", ceiling=" SIZE_FORMAT
12941307
", monitor_usage=" SIZE_FORMAT ", threshold=%d",
12951308
monitors_used, ceiling, monitor_usage, MonitorUsedDeflationThreshold);
1296-
return true;
1309+
return is_above_threshold;
12971310
}
12981311

12991312
return false;

src/jdk.jfr/share/classes/jdk/jfr/internal/query/FieldBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,10 @@ record WildcardElement(String name, String label, ValueDescriptor field) {
353353
var subFields = we.field().getFields().reversed();
354354
if (!subFields.isEmpty() && !KNOWN_TYPES.contains(we.field().getTypeName())) {
355355
for (ValueDescriptor subField : subFields) {
356-
String n = we.name + "." + subField.getName();
357-
String l = we.label + " : " + makeLabel(subField, false);
358-
if (stack.size() < 2) { // Limit depth to 2
356+
// Limit depth to 2
357+
if (!we.name.contains(".")) {
358+
String n = we.name + "." + subField.getName();
359+
String l = we.label + " : " + makeLabel(subField, false);
359360
stack.push(new WildcardElement(n, l, subField));
360361
}
361362
}

test/hotspot/jtreg/testlibrary/ctw/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ WB_CLASS_FILES := $(subst $(TESTLIBRARY_DIR)/,,$(WB_SRC_FILES))
5353
WB_CLASS_FILES := $(patsubst %.java,%.class,$(WB_CLASS_FILES))
5454
EXPORTS=--add-exports java.base/jdk.internal.jimage=ALL-UNNAMED \
5555
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
56+
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
5657
--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED \
5758
--add-exports java.base/jdk.internal.access=ALL-UNNAMED
5859

0 commit comments

Comments
 (0)