This commit is contained in:
Ravi Reddy 2024-10-08 16:29:54 +00:00
commit d33912a939
10 changed files with 84 additions and 21 deletions

View File

@ -350,6 +350,7 @@ jobs:
- build-windows-aarch64
- test-linux-x64
- test-macos-x64
- test-macos-aarch64
- test-windows-x64
steps:

3
SECURITY.md Normal file
View File

@ -0,0 +1,3 @@
# JDK Vulnerabilities
Please follow the process outlined in the [OpenJDK Vulnerability Policy](https://openjdk.org/groups/vulnerability/report) to disclose vulnerabilities in the JDK.

View File

@ -614,10 +614,9 @@ be accepted by <code>configure</code>.</p>
<code>--with-toolchain-type=clang</code>.</p>
<h3 id="apple-xcode">Apple Xcode</h3>
<p>The oldest supported version of Xcode is 13.0.</p>
<p>You will need the Xcode command line developer tools to be able to
build the JDK. (Actually, <em>only</em> the command line tools are
needed, not the IDE.) The simplest way to install these is to run:</p>
<pre><code>xcode-select --install</code></pre>
<p>You will need to download Xcode either from the App Store or specific
versions can be easily located via the <a
href="https://xcodereleases.com">Xcode Releases</a> website.</p>
<p>When updating Xcode, it is advisable to keep an older version for
building the JDK. To use a specific version of Xcode you have multiple
options:</p>

View File

@ -422,13 +422,9 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
The oldest supported version of Xcode is 13.0.
You will need the Xcode command line developer tools to be able to build the
JDK. (Actually, *only* the command line tools are needed, not the IDE.) The
simplest way to install these is to run:
```
xcode-select --install
```
You will need to download Xcode either from the App Store or specific versions
can be easily located via the [Xcode Releases](https://xcodereleases.com)
website.
When updating Xcode, it is advisable to keep an older version for building the
JDK. To use a specific version of Xcode you have multiple options:

View File

@ -1934,7 +1934,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");
@ -4068,6 +4071,39 @@ int os::win32::_build_minor = 0;
bool os::win32::_processor_group_warning_displayed = false;
bool os::win32::_job_object_processor_group_warning_displayed = false;
void getWindowsInstallationType(char* buffer, int bufferSize) {
HKEY hKey;
const char* subKey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
const char* valueName = "InstallationType";
DWORD valueLength = bufferSize;
// Initialize buffer with empty string
buffer[0] = '\0';
// Open the registry key
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) {
// Return empty buffer if key cannot be opened
return;
}
// Query the value
if (RegQueryValueExA(hKey, valueName, NULL, NULL, (LPBYTE)buffer, &valueLength) != ERROR_SUCCESS) {
RegCloseKey(hKey);
buffer[0] = '\0';
return;
}
RegCloseKey(hKey);
}
bool isNanoServer() {
const int BUFFER_SIZE = 256;
char installationType[BUFFER_SIZE];
getWindowsInstallationType(installationType, BUFFER_SIZE);
return (strcmp(installationType, "Nano Server") == 0);
}
void os::win32::initialize_windows_version() {
assert(_major_version == 0, "windows version already initialized.");
@ -4085,7 +4121,13 @@ void os::win32::initialize_windows_version() {
warning("Attempt to determine system directory failed: %s", buf_len != 0 ? error_msg_buffer : "<unknown error>");
return;
}
strncat(kernel32_path, "\\kernel32.dll", MAX_PATH - ret);
if (isNanoServer()) {
// On Windows Nanoserver the kernel32.dll is located in the forwarders subdirectory
strncat(kernel32_path, "\\forwarders\\kernel32.dll", MAX_PATH - ret);
} else {
strncat(kernel32_path, "\\kernel32.dll", MAX_PATH - ret);
}
DWORD version_size = GetFileVersionInfoSize(kernel32_path, nullptr);
if (version_size == 0) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, 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
@ -315,7 +315,9 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met
int invoke_count = caller_method->interpreter_invocation_count();
assert(invoke_count != 0, "require invocation count greater than zero");
double freq = (double)call_site_count / (double)invoke_count;
double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / CompilationPolicy::min_invocations());
// avoid division by 0, set divisor to at least 1
int cp_min_inv = MAX2(1, CompilationPolicy::min_invocations());
double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / cp_min_inv);
if (freq < min_freq) {
set_msg("low call site frequency");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, 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
@ -444,6 +444,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.
@ -527,7 +529,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 > 17762) {
sprops.os_name = "Windows Server 2019";

View File

@ -317,8 +317,9 @@ public class PPC64Frame extends Frame {
//------------------------------------------------------------------------------
// frame::adjust_unextended_sp
private void adjustUnextendedSP() {
raw_unextendedSP = getFP();
// Nothing to do. senderForInterpreterFrame finds the correct unextendedSP.
}
private Frame senderForInterpreterFrame(PPC64RegisterMap map) {
if (DEBUG) {
System.out.println("senderForInterpreterFrame");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 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
@ -22,6 +22,8 @@
*/
import java.io.IOException;
import java.net.InetAddress;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -52,11 +54,21 @@ public abstract class AbstractServer extends AbstractPeer implements Server {
public static abstract class Builder extends AbstractPeer.Builder {
private InetAddress listenInterface = InetAddress.getLoopbackAddress();
private int port;
// Indicates if requires client authentication.
private boolean clientAuth = true;
public InetAddress getListenInterface() {
return listenInterface;
}
public Builder setListenInterface(InetAddress listenInterface) {
this.listenInterface = listenInterface;
return this;
}
public int getPort() {
return port;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 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
@ -22,6 +22,7 @@
*/
import java.io.IOException;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.List;
@ -53,7 +54,8 @@ public class JdkServer extends AbstractServer {
context = Utilities.createSSLContext(builder.getCertTuple());
SSLServerSocketFactory serverFactory = context.getServerSocketFactory();
serverSocket
= (SSLServerSocket) serverFactory.createServerSocket(builder.getPort());
= (SSLServerSocket) serverFactory.createServerSocket(builder.getPort(),
0, builder.getListenInterface());
configServerSocket(builder);
}