Skip to content

Commit e5f8924

Browse files
Merge tag 'jdk-26+1' into labsjdk/adopt-jdk-26+1-master
Added tag jdk-26+1 for changeset 62fde68
2 parents eb65b4a + 62fde68 commit e5f8924

File tree

75 files changed

+1925
-125
lines changed

Some content is hidden

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

75 files changed

+1925
-125
lines changed

.jcheck/conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[general]
22
project=jdk
33
jbs=JDK
4-
version=25
4+
version=26
55

66
[checks]
77
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright

make/conf/version-numbers.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
# Default version, product, and vendor information to use,
2727
# unless overridden by configure
2828

29-
DEFAULT_VERSION_FEATURE=25
29+
DEFAULT_VERSION_FEATURE=26
3030
DEFAULT_VERSION_INTERIM=0
3131
DEFAULT_VERSION_UPDATE=0
3232
DEFAULT_VERSION_PATCH=0
3333
DEFAULT_VERSION_EXTRA1=0
3434
DEFAULT_VERSION_EXTRA2=0
3535
DEFAULT_VERSION_EXTRA3=0
36-
DEFAULT_VERSION_DATE=2025-09-16
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=69 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2026-03-17
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=70 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="24 25"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=25
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="24 25 26"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=26
4242
DEFAULT_PROMOTED_VERSION_PRE=ea

src/hotspot/share/c1/c1_Runtime1.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* current, jint trap_request))
818818
Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
819819

820820
if (action == Deoptimization::Action_make_not_entrant) {
821-
if (nm->make_not_entrant("C1 deoptimize")) {
821+
if (nm->make_not_entrant(nmethod::ChangeReason::C1_deoptimize)) {
822822
if (reason == Deoptimization::Reason_tenured) {
823823
MethodData* trap_mdo = Deoptimization::get_method_data(current, method, true /*create_if_missing*/);
824824
if (trap_mdo != nullptr) {
@@ -1110,7 +1110,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, C1StubId stub_id ))
11101110
// safepoint, but if it's still alive then make it not_entrant.
11111111
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
11121112
if (nm != nullptr) {
1113-
nm->make_not_entrant("C1 code patch");
1113+
nm->make_not_entrant(nmethod::ChangeReason::C1_codepatch);
11141114
}
11151115

11161116
Deoptimization::deoptimize_frame(current, caller_frame.id());
@@ -1358,7 +1358,7 @@ void Runtime1::patch_code(JavaThread* current, C1StubId stub_id) {
13581358
// Make sure the nmethod is invalidated, i.e. made not entrant.
13591359
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
13601360
if (nm != nullptr) {
1361-
nm->make_not_entrant("C1 deoptimize for patching");
1361+
nm->make_not_entrant(nmethod::ChangeReason::C1_deoptimize_for_patching);
13621362
}
13631363
}
13641364

@@ -1486,7 +1486,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* current))
14861486

14871487
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
14881488
assert (nm != nullptr, "no more nmethod?");
1489-
nm->make_not_entrant("C1 predicate failed trap");
1489+
nm->make_not_entrant(nmethod::ChangeReason::C1_predicate_failed_trap);
14901490

14911491
methodHandle m(current, nm->method());
14921492
MethodData* mdo = m->method_data();

src/hotspot/share/ci/ciReplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ class CompileReplay : public StackObj {
802802
// Make sure the existence of a prior compile doesn't stop this one
803803
nmethod* nm = (entry_bci != InvocationEntryBci) ? method->lookup_osr_nmethod_for(entry_bci, comp_level, true) : method->code();
804804
if (nm != nullptr) {
805-
nm->make_not_entrant("CI replay");
805+
nm->make_not_entrant(nmethod::ChangeReason::CI_replay);
806806
}
807807
replay_state = this;
808808
CompileBroker::compile_method(methodHandle(THREAD, method), entry_bci, comp_level,

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@
154154

155155
#define JAVA_25_VERSION 69
156156

157+
#define JAVA_26_VERSION 70
158+
157159
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
158160
assert((bad_constant == JVM_CONSTANT_Module ||
159161
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

src/hotspot/share/code/codeCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ void CodeCache::make_marked_nmethods_deoptimized() {
13611361
while(iter.next()) {
13621362
nmethod* nm = iter.method();
13631363
if (nm->is_marked_for_deoptimization() && !nm->has_been_deoptimized() && nm->can_be_deoptimized()) {
1364-
nm->make_not_entrant("marked for deoptimization");
1364+
nm->make_not_entrant(nmethod::ChangeReason::marked_for_deoptimization);
13651365
nm->make_deoptimized();
13661366
}
13671367
}

src/hotspot/share/code/nmethod.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,14 +1975,12 @@ void nmethod::invalidate_osr_method() {
19751975
}
19761976
}
19771977

1978-
void nmethod::log_state_change(const char* reason) const {
1979-
assert(reason != nullptr, "Must provide a reason");
1980-
1978+
void nmethod::log_state_change(ChangeReason change_reason) const {
19811979
if (LogCompilation) {
19821980
if (xtty != nullptr) {
19831981
ttyLocker ttyl; // keep the following output all in one block
19841982
xtty->begin_elem("make_not_entrant thread='%zu' reason='%s'",
1985-
os::current_thread_id(), reason);
1983+
os::current_thread_id(), change_reason_to_string(change_reason));
19861984
log_identity(xtty);
19871985
xtty->stamp();
19881986
xtty->end_elem();
@@ -1991,7 +1989,7 @@ void nmethod::log_state_change(const char* reason) const {
19911989

19921990
ResourceMark rm;
19931991
stringStream ss(NEW_RESOURCE_ARRAY(char, 256), 256);
1994-
ss.print("made not entrant: %s", reason);
1992+
ss.print("made not entrant: %s", change_reason_to_string(change_reason));
19951993

19961994
CompileTask::print_ul(this, ss.freeze());
19971995
if (PrintCompilation) {
@@ -2006,9 +2004,7 @@ void nmethod::unlink_from_method() {
20062004
}
20072005

20082006
// Invalidate code
2009-
bool nmethod::make_not_entrant(const char* reason) {
2010-
assert(reason != nullptr, "Must provide a reason");
2011-
2007+
bool nmethod::make_not_entrant(ChangeReason change_reason) {
20122008
// This can be called while the system is already at a safepoint which is ok
20132009
NoSafepointVerifier nsv;
20142010

@@ -2077,7 +2073,7 @@ bool nmethod::make_not_entrant(const char* reason) {
20772073
assert(success, "Transition can't fail");
20782074

20792075
// Log the transition once
2080-
log_state_change(reason);
2076+
log_state_change(change_reason);
20812077

20822078
// Remove nmethod from method.
20832079
unlink_from_method();

src/hotspot/share/code/nmethod.hpp

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,85 @@ class nmethod : public CodeBlob {
471471
void oops_do_set_strong_done(nmethod* old_head);
472472

473473
public:
474+
enum class ChangeReason : u1 {
475+
C1_codepatch,
476+
C1_deoptimize,
477+
C1_deoptimize_for_patching,
478+
C1_predicate_failed_trap,
479+
CI_replay,
480+
JVMCI_invalidate_nmethod,
481+
JVMCI_invalidate_nmethod_mirror,
482+
JVMCI_materialize_virtual_object,
483+
JVMCI_new_installation,
484+
JVMCI_register_method,
485+
JVMCI_replacing_with_new_code,
486+
JVMCI_reprofile,
487+
marked_for_deoptimization,
488+
missing_exception_handler,
489+
not_used,
490+
OSR_invalidation_back_branch,
491+
OSR_invalidation_for_compiling_with_C1,
492+
OSR_invalidation_of_lower_level,
493+
set_native_function,
494+
uncommon_trap,
495+
whitebox_deoptimization,
496+
zombie,
497+
};
498+
499+
500+
static const char* change_reason_to_string(ChangeReason change_reason) {
501+
switch (change_reason) {
502+
case ChangeReason::C1_codepatch:
503+
return "C1 code patch";
504+
case ChangeReason::C1_deoptimize:
505+
return "C1 deoptimized";
506+
case ChangeReason::C1_deoptimize_for_patching:
507+
return "C1 deoptimize for patching";
508+
case ChangeReason::C1_predicate_failed_trap:
509+
return "C1 predicate failed trap";
510+
case ChangeReason::CI_replay:
511+
return "CI replay";
512+
case ChangeReason::JVMCI_invalidate_nmethod:
513+
return "JVMCI invalidate nmethod";
514+
case ChangeReason::JVMCI_invalidate_nmethod_mirror:
515+
return "JVMCI invalidate nmethod mirror";
516+
case ChangeReason::JVMCI_materialize_virtual_object:
517+
return "JVMCI materialize virtual object";
518+
case ChangeReason::JVMCI_new_installation:
519+
return "JVMCI new installation";
520+
case ChangeReason::JVMCI_register_method:
521+
return "JVMCI register method";
522+
case ChangeReason::JVMCI_replacing_with_new_code:
523+
return "JVMCI replacing with new code";
524+
case ChangeReason::JVMCI_reprofile:
525+
return "JVMCI reprofile";
526+
case ChangeReason::marked_for_deoptimization:
527+
return "marked for deoptimization";
528+
case ChangeReason::missing_exception_handler:
529+
return "missing exception handler";
530+
case ChangeReason::not_used:
531+
return "not used";
532+
case ChangeReason::OSR_invalidation_back_branch:
533+
return "OSR invalidation back branch";
534+
case ChangeReason::OSR_invalidation_for_compiling_with_C1:
535+
return "OSR invalidation for compiling with C1";
536+
case ChangeReason::OSR_invalidation_of_lower_level:
537+
return "OSR invalidation of lower level";
538+
case ChangeReason::set_native_function:
539+
return "set native function";
540+
case ChangeReason::uncommon_trap:
541+
return "uncommon trap";
542+
case ChangeReason::whitebox_deoptimization:
543+
return "whitebox deoptimization";
544+
case ChangeReason::zombie:
545+
return "zombie";
546+
default: {
547+
assert(false, "Unhandled reason");
548+
return "Unknown";
549+
}
550+
}
551+
}
552+
474553
// create nmethod with entry_bci
475554
static nmethod* new_nmethod(const methodHandle& method,
476555
int compile_id,
@@ -633,8 +712,8 @@ class nmethod : public CodeBlob {
633712
// alive. It is used when an uncommon trap happens. Returns true
634713
// if this thread changed the state of the nmethod or false if
635714
// another thread performed the transition.
636-
bool make_not_entrant(const char* reason);
637-
bool make_not_used() { return make_not_entrant("not used"); }
715+
bool make_not_entrant(ChangeReason change_reason);
716+
bool make_not_used() { return make_not_entrant(ChangeReason::not_used); }
638717

639718
bool is_marked_for_deoptimization() const { return deoptimization_status() != not_marked; }
640719
bool has_been_deoptimized() const { return deoptimization_status() == deoptimize_done; }
@@ -947,7 +1026,7 @@ class nmethod : public CodeBlob {
9471026
// Logging
9481027
void log_identity(xmlStream* log) const;
9491028
void log_new_nmethod() const;
950-
void log_state_change(const char* reason) const;
1029+
void log_state_change(ChangeReason change_reason) const;
9511030

9521031
// Prints block-level comments, including nmethod specific block labels:
9531032
void print_nmethod_labels(outputStream* stream, address block_begin, bool print_section_labels=true) const;

src/hotspot/share/compiler/compilationPolicy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ void CompilationPolicy::compile(const methodHandle& mh, int bci, CompLevel level
924924
nmethod* osr_nm = mh->lookup_osr_nmethod_for(bci, CompLevel_simple, false);
925925
if (osr_nm != nullptr && osr_nm->comp_level() > CompLevel_simple) {
926926
// Invalidate the existing OSR nmethod so that a compile at CompLevel_simple is permitted.
927-
osr_nm->make_not_entrant("OSR invalidation for compiling with C1");
927+
osr_nm->make_not_entrant(nmethod::ChangeReason::OSR_invalidation_for_compiling_with_C1);
928928
}
929929
compile(mh, bci, CompLevel_simple, THREAD);
930930
}
@@ -1516,7 +1516,7 @@ void CompilationPolicy::method_back_branch_event(const methodHandle& mh, const m
15161516
int osr_bci = nm->is_osr_method() ? nm->osr_entry_bci() : InvocationEntryBci;
15171517
print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level);
15181518
}
1519-
nm->make_not_entrant("OSR invalidation, back branch");
1519+
nm->make_not_entrant(nmethod::ChangeReason::OSR_invalidation_back_branch);
15201520
}
15211521
}
15221522
// Fix up next_level if necessary to avoid deopts

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "classfile/symbolTable.hpp"
2828
#include "classfile/systemDictionary.hpp"
2929
#include "classfile/vmClasses.hpp"
30+
#include "code/nmethod.hpp"
3031
#include "code/scopeDesc.hpp"
3132
#include "compiler/compileBroker.hpp"
3233
#include "compiler/compilerEvent.hpp"
@@ -1206,7 +1207,7 @@ C2V_VMENTRY_0(jint, installCode0, (JNIEnv *env, jobject,
12061207
assert(JVMCIENV->isa_HotSpotNmethod(installed_code_handle), "wrong type");
12071208
// Clear the link to an old nmethod first
12081209
JVMCIObject nmethod_mirror = installed_code_handle;
1209-
JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, true, JVMCI_CHECK_0);
1210+
JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, true, nmethod::ChangeReason::JVMCI_replacing_with_new_code, JVMCI_CHECK_0);
12101211
} else {
12111212
assert(JVMCIENV->isa_InstalledCode(installed_code_handle), "wrong type");
12121213
}
@@ -1382,7 +1383,7 @@ C2V_VMENTRY(void, reprofile, (JNIEnv* env, jobject, ARGUMENT_PAIR(method)))
13821383

13831384
nmethod* code = method->code();
13841385
if (code != nullptr) {
1385-
code->make_not_entrant("JVMCI reprofile");
1386+
code->make_not_entrant(nmethod::ChangeReason::JVMCI_reprofile);
13861387
}
13871388

13881389
MethodData* method_data = method->method_data();
@@ -1397,7 +1398,7 @@ C2V_END
13971398

13981399
C2V_VMENTRY(void, invalidateHotSpotNmethod, (JNIEnv* env, jobject, jobject hs_nmethod, jboolean deoptimize))
13991400
JVMCIObject nmethod_mirror = JVMCIENV->wrap(hs_nmethod);
1400-
JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, deoptimize, JVMCI_CHECK);
1401+
JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, deoptimize, nmethod::ChangeReason::JVMCI_invalidate_nmethod, JVMCI_CHECK);
14011402
C2V_END
14021403

14031404
C2V_VMENTRY_NULL(jlongArray, collectCounters, (JNIEnv* env, jobject))
@@ -1822,7 +1823,7 @@ C2V_VMENTRY(void, materializeVirtualObjects, (JNIEnv* env, jobject, jobject _hs_
18221823
if (!fst.current()->is_compiled_frame()) {
18231824
JVMCI_THROW_MSG(IllegalStateException, "compiled stack frame expected");
18241825
}
1825-
fst.current()->cb()->as_nmethod()->make_not_entrant("JVMCI materialize virtual objects");
1826+
fst.current()->cb()->as_nmethod()->make_not_entrant(nmethod::ChangeReason::JVMCI_materialize_virtual_object);
18261827
}
18271828
Deoptimization::deoptimize(thread, *fst.current(), Deoptimization::Reason_none);
18281829
// look for the frame again as it has been updated by deopt (pc, deopt state...)

0 commit comments

Comments
 (0)