Skip to content

Commit

Permalink
Merge upstream-jdk11u
Browse files Browse the repository at this point in the history
  • Loading branch information
Min Choi committed Feb 6, 2025
2 parents ece67a9 + 33d19c4 commit a5fa1ba
Show file tree
Hide file tree
Showing 23 changed files with 577 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ on:
jobs:
build-macos:
name: build
runs-on: macos-12
runs-on: macos-13

strategy:
fail-fast: false
Expand Down Expand Up @@ -98,6 +98,7 @@ jobs:
--with-jtreg=${{ steps.jtreg.outputs.path }}
--enable-jtreg-failure-handler
--with-zlib=system
--disable-warnings-as-errors
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-x64
xcode-toolset-version: '13.4.1'
xcode-toolset-version: '14.3.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.macos-x64 == 'true'
Expand All @@ -236,7 +236,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-aarch64
xcode-toolset-version: '13.4.1'
xcode-toolset-version: '14.3.1'
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
with:
platform: macos-x64
bootjdk-platform: macos-x64
runs-on: macos-12
runs-on: macos-13

test-windows-x64:
name: windows-x64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
run: |
# On macOS we need to install some dependencies for testing
brew install make
sudo xcode-select --switch /Applications/Xcode_13.4.1.app/Contents/Developer
sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
# This will make GNU make available as 'make' and not only as 'gmake'
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
if: runner.os == 'macOS'
Expand Down
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
version=11.0.26
version=11.0.27

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
6 changes: 3 additions & 3 deletions make/autoconf/version-numbers
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@

DEFAULT_VERSION_FEATURE=11
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=26
DEFAULT_VERSION_UPDATE=27
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2025-01-21
DEFAULT_VERSION_DATE=2025-04-15
DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"
DEFAULT_PROMOTED_VERSION_PRE=
DEFAULT_PROMOTED_VERSION_PRE=ea

LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
Expand Down
12 changes: 11 additions & 1 deletion make/data/lsrdata/language-subtag-registry.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File-Date: 2024-06-14
File-Date: 2024-11-19
%%
Type: language
Subtag: aa
Expand Down Expand Up @@ -47991,6 +47991,16 @@ Added: 2008-10-14
Prefix: kw
%%
Type: variant
Subtag: kleinsch
Description: Kleinschmidt orthography
Description: Allattaasitaamut
Added: 2024-07-20
Prefix: kl
Prefix: kl-tunumiit
Comments: Orthography for Greenlandic designed by Samuel Kleinschmidt,
used from 1851 to 1973.
%%
Type: variant
Subtag: kociewie
Description: The Kociewie dialect of Polish
Added: 2014-11-27
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ void CgroupV1Subsystem::print_version_specific_info(outputStream* st) {
jlong kmem_limit = kernel_memory_limit_in_bytes();
jlong kmem_max_usage = kernel_memory_max_usage_in_bytes();

OSContainer::print_container_helper(st, kmem_limit, "kernel_memory_limit_in_bytes");
OSContainer::print_container_helper(st, kmem_usage, "kernel_memory_usage_in_bytes");
OSContainer::print_container_helper(st, kmem_limit, "kernel_memory_max_usage_in_bytes");
OSContainer::print_container_helper(st, kmem_max_usage, "kernel_memory_limit_in_bytes");
OSContainer::print_container_helper(st, kmem_max_usage, "kernel_memory_max_usage_in_bytes");
}

char * CgroupV1Subsystem::cpu_cpuset_cpus() {
Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,10 @@ void os::win32::print_windows_version(outputStream* st) {
// - 2016 GA 10/2016 build: 14393
// - 2019 GA 11/2018 build: 17763
// - 2022 GA 08/2021 build: 20348
if (build_number > 20347) {
// - 2025 Preview build : 26040
if (build_number > 26039) {
st->print("Server 2025");
} else if (build_number > 20347) {
st->print("Server 2022");
} else if (build_number > 17762) {
st->print("Server 2019");
Expand Down
24 changes: 15 additions & 9 deletions src/hotspot/share/classfile/classLoaderData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,21 @@ void ClassLoaderData::unload() {
// after erroneous classes are released.
classes_do(InstanceKlass::notify_unload_class);

// Method::clear_jmethod_ids only sets the jmethod_ids to NULL without
// releasing the memory for related JNIMethodBlocks and JNIMethodBlockNodes.
// This is done intentionally because native code (e.g. JVMTI agent) holding
// jmethod_ids may access them after the associated classes and class loader
// are unloaded. The Java Native Interface Specification says "method ID
// does not prevent the VM from unloading the class from which the ID has
// been derived. After the class is unloaded, the method or field ID becomes
// invalid". In real world usages, the native code may rely on jmethod_ids
// being NULL after class unloading. Hence, it is unsafe to free the memory
// from the VM side without knowing when native code is going to stop using
// them.
if (_jmethod_ids != NULL) {
Method::clear_jmethod_ids(this);
}

// Clean up global class iterator for compiler
static_klass_iterator.adjust_saved_class(this);
}
Expand Down Expand Up @@ -749,15 +764,6 @@ ClassLoaderData::~ClassLoaderData() {
_metaspace = NULL;
delete m;
}
// Clear all the JNI handles for methods
// These aren't deallocated and are going to look like a leak, but that's
// needed because we can't really get rid of jmethodIDs because we don't
// know when native code is going to stop using them. The spec says that
// they're "invalid" but existing programs likely rely on their being
// NULL after class unloading.
if (_jmethod_ids != NULL) {
Method::clear_jmethod_ids(this);
}
// Delete lock
delete _metaspace_lock;

Expand Down
9 changes: 7 additions & 2 deletions src/hotspot/share/oops/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2191,10 +2191,15 @@ bool Method::is_method_id(jmethodID mid) {
Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
if (mid == NULL) return NULL;
Method* o = resolve_jmethod_id(mid);
if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
if (o == NULL || o == JNIMethodBlock::_free_method) {
return NULL;
}
return o;
// Method should otherwise be valid. Assert for testing.
assert(is_valid_method(o), "should be valid jmethodid");
// If the method's class holder object is unreferenced, but not yet marked as
// unloaded, we need to return NULL here too because after a safepoint, its memory
// will be reclaimed.
return o->method_holder()->is_loader_alive() ? o : NULL;
};

void Method::set_on_stack(const bool value) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,8 +1455,8 @@ Node* Node::last_out(DUIterator_Last& i) const {
class SimpleDUIterator : public StackObj {
private:
Node* node;
DUIterator_Fast i;
DUIterator_Fast imax;
DUIterator_Fast i;
public:
SimpleDUIterator(Node* n): node(n), i(n->fast_outs(imax)) {}
bool has_next() { return i < imax; }
Expand Down
9 changes: 7 additions & 2 deletions src/java.base/windows/native/libjava/java_props_md.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -486,6 +486,8 @@ GetJavaProperties(JNIEnv* env)
* where (buildNumber > 17762)
* Windows Server 2022 10 0 (!VER_NT_WORKSTATION)
* where (buildNumber > 20347)
* Windows Server 2025 10 0 (!VER_NT_WORKSTATION)
* where (buildNumber > 26039)
*
* This mapping will presumably be augmented as new Windows
* versions are released.
Expand Down Expand Up @@ -569,7 +571,10 @@ GetJavaProperties(JNIEnv* env)
case 0:
/* Windows server 2019 GA 10/2018 build number is 17763 */
/* Windows server 2022 build number is 20348 */
if (buildNumber > 20347) {
/* Windows server 2025 Preview build is 26040 */
if (buildNumber > 26039) {
sprops.os_name = "Windows Server 2025";
} else if (buildNumber > 20347) {
sprops.os_name = "Windows Server 2022";
} else if (buildNumber > 17676) {
sprops.os_name = "Windows Server 2019";
Expand Down
7 changes: 5 additions & 2 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
// keyboard layout
static NSString *kbdLayout;

// Constant for keyman layouts
#define KEYMAN_LAYOUT "keyman"

@interface AWTView()
@property (retain) CDropTarget *_dropTarget;
@property (retain) CDragSource *_dragSource;
Expand Down Expand Up @@ -281,7 +284,7 @@ - (void) scrollWheel: (NSEvent*) event {

- (void) keyDown: (NSEvent *)event {
fProcessingKeystroke = YES;
fKeyEventsNeeded = YES;
fKeyEventsNeeded = ![(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT];

// Allow TSM to look at the event and potentially send back NSTextInputClient messages.
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
Expand Down Expand Up @@ -989,7 +992,7 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

if ((utf16Length > 2) ||
((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) ||
((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) {
[(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT]) {
aStringIsComplex = YES;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,6 @@ private List<JCTree> collect(JCTree tree, List<JCTree> res) {
return res.append(tree);
}

/**
* If the type is not accessible from current context, try to figure out the
* sharpest accessible supertype.
*
* @param originalType type to sharpen
* @return sharped type
*/
Type sharpestAccessible(Type originalType) {
if (originalType.hasTag(ARRAY)) {
return types.makeArrayType(sharpestAccessible(types.elemtype(originalType)));
}

Type type = originalType;
while (!rs.isAccessible(gen.getAttrEnv(), type.asElement())) {
type = types.supertype(type);
}
return type;
}

/**
* "Legacy" bytecode flavor: emit the StringBuilder.append chains for string
* concatenation.
Expand Down Expand Up @@ -303,6 +284,14 @@ protected List<List<JCTree>> split(List<JCTree> args) {

return splits.toList();
}

/**
* Returns true if the argument should be converted to a string eagerly, to preserve
* possible side-effects.
*/
protected boolean shouldConvertToStringEagerly(Type argType) {
return !types.unboxedTypeOrType(argType).isPrimitive() && argType.tsym != syms.stringType.tsym;
}
}

/**
Expand Down Expand Up @@ -331,14 +320,18 @@ protected void emit(JCDiagnostic.DiagnosticPosition pos, List<JCTree> args, bool
for (JCTree arg : t) {
Object constVal = arg.type.constValue();
if ("".equals(constVal)) continue;
if (arg.type == syms.botType) {
dynamicArgs.add(types.boxedClass(syms.voidType).type);
} else {
dynamicArgs.add(sharpestAccessible(arg.type));
Type argType = arg.type;
if (argType == syms.botType) {
argType = types.boxedClass(syms.voidType).type;
}
if (!first || generateFirstArg) {
gen.genExpr(arg, arg.type).load();
}
if (shouldConvertToStringEagerly(argType)) {
gen.callMethod(pos, syms.stringType, names.valueOf, List.of(syms.objectType), true);
argType = syms.stringType;
}
dynamicArgs.add(argType);
first = false;
}
doCall(type, pos, dynamicArgs.toList());
Expand Down Expand Up @@ -438,10 +431,15 @@ protected void emit(JCDiagnostic.DiagnosticPosition pos, List<JCTree> args, bool
} else {
// Ordinary arguments come through the dynamic arguments.
recipe.append(TAG_ARG);
dynamicArgs.add(sharpestAccessible(arg.type));
Type argType = arg.type;
if (!first || generateFirstArg) {
gen.genExpr(arg, arg.type).load();
}
if (shouldConvertToStringEagerly(argType)) {
gen.callMethod(pos, syms.stringType, names.valueOf, List.of(syms.objectType), true);
argType = syms.stringType;
}
dynamicArgs.add(argType);
first = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
* after the module read edge is added.
* @compile ModuleLibrary.java
* p2/c2.java
* p5/c5.java
* p7/c7.java
* p5/c5.jasm
* p7/c7.jasm
* @run main/othervm MethodAccessReadTwice
*/

Expand Down
Loading

0 comments on commit a5fa1ba

Please sign in to comment.