Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dragonwell
Browse files Browse the repository at this point in the history
Summary: Merge upstream code

Testing: CICD

Reviewers: kuaiwei, yuleil

Issue: #301
  • Loading branch information
Accelerator1996 committed Jan 22, 2025
2 parents 42df6c2 + 129290d commit 27e2a25
Show file tree
Hide file tree
Showing 58 changed files with 3,059 additions and 743 deletions.
1,270 changes: 1,270 additions & 0 deletions .github/workflows/submit.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk8u
jbs=JDK
version=openjdk8u432
version=openjdk8u442

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
Expand Down
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion THIRD_PARTY_README
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ THE SOFTWARE.

-------------------------------------------------------------------------------

%% This notice is provided with respect to Little CMS 2.11, which may be
%% This notice is provided with respect to Little CMS 2.12, which may be
included with JRE 8, JDK 8, and OpenJDK 8.

--- begin of LICENSE ---
Expand Down
2 changes: 1 addition & 1 deletion common/autoconf/version-numbers
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
JDK_MAJOR_VERSION=1
JDK_MINOR_VERSION=8
JDK_MICRO_VERSION=0
JDK_UPDATE_VERSION=432
JDK_UPDATE_VERSION=442
LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
PRODUCT_SUFFIX="Runtime Environment"
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os/posix/vm/os_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ bool os::ThreadCrashProtection::call(os::CrashProtectionCallback& cb) {

Thread::muxAcquire(&_crash_mux, "CrashProtection");

_protected_thread = ThreadLocalStorage::thread();
_protected_thread = Thread::current_or_null();
assert(_protected_thread != NULL, "Cannot crash protect a NULL thread");

// we cannot rely on sigsetjmp/siglongjmp to save/restore the signal mask
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os/windows/vm/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4891,7 +4891,7 @@ bool os::ThreadCrashProtection::call(os::CrashProtectionCallback& cb) {

Thread::muxAcquire(&_crash_mux, "CrashProtection");

_protected_thread = ThreadLocalStorage::thread();
_protected_thread = Thread::current_or_null();
assert(_protected_thread != NULL, "Cannot crash protect a NULL thread");

bool success = true;
Expand Down
4 changes: 4 additions & 0 deletions hotspot/src/share/vm/opto/superword.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include "opto/vectornode.hpp"
#include "utilities/growableArray.hpp"

#ifdef AIX
#include "cstdlib"
#endif

//
// S U P E R W O R D T R A N S F O R M
//
Expand Down
5 changes: 3 additions & 2 deletions hotspot/src/share/vm/prims/forte.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
return;
}

// !important! make sure all to call thread->set_in_asgct(false) before every return
// !important! make sure all to call thread->set_in_asgct(saved_in_asgct) before every return
bool saved_in_asgct = thread->in_asgct();
thread->set_in_asgct(true);

switch (thread->thread_state()) {
Expand Down Expand Up @@ -613,7 +614,7 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
trace->num_frames = ticks_unknown_state; // -7
break;
}
thread->set_in_asgct(false);
thread->set_in_asgct(saved_in_asgct);
}


Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/share/vm/runtime/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) {

// Since os::malloc can be called when the libjvm.{dll,so} is
// first loaded and we don't have a thread yet we must accept NULL also here.
assert(!os::ThreadCrashProtection::is_crash_protected(ThreadLocalStorage::thread()),
assert(!os::ThreadCrashProtection::is_crash_protected(Thread::current_or_null()),
"malloc() not allowed when crash protection is set");

if (size == 0) {
Expand Down
11 changes: 5 additions & 6 deletions hotspot/src/share/vm/runtime/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,17 +867,16 @@ oop Reflection::new_field(fieldDescriptor* fd, bool intern_name, TRAPS) {

oop Reflection::new_parameter(Handle method, int index, Symbol* sym,
int flags, TRAPS) {
Handle name;

// A null symbol here translates to the empty string
Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL);

if(NULL != sym) {
name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
Handle name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
java_lang_reflect_Parameter::set_name(rh(), name());
} else {
name = java_lang_String::create_from_str("", CHECK_NULL);
java_lang_reflect_Parameter::set_name(rh(), NULL);
}

Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL);
java_lang_reflect_Parameter::set_name(rh(), name());
java_lang_reflect_Parameter::set_modifiers(rh(), flags);
java_lang_reflect_Parameter::set_executable(rh(), method());
java_lang_reflect_Parameter::set_index(rh(), index);
Expand Down
4 changes: 2 additions & 2 deletions hotspot/test/compiler/6891750/Test6891750.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2018, 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 @@ -27,7 +27,7 @@
* @bug 6891750
* @summary deopt blob kills values in O5
*
* @run main Test6891750
* @run main/othervm Test6891750
*/

abstract class Base6891750 extends Thread {
Expand Down
28 changes: 7 additions & 21 deletions hotspot/test/compiler/8009761/Test8009761.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
* questions.
*/

import com.sun.management.HotSpotDiagnosticMXBean;
import com.sun.management.VMOption;
import sun.hotspot.WhiteBox;
import sun.management.ManagementFactoryHelper;

import java.lang.reflect.Method;

/*
Expand All @@ -41,6 +37,7 @@
public class Test8009761 {

private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
private static int COMP_LEVEL_SIMPLE = 1;
private static int COMP_LEVEL_FULL_OPTIMIZATION = 4;
private static Method m3 = null;

Expand Down Expand Up @@ -237,7 +234,7 @@ static Object m3(boolean overflow_stack, boolean deopt) {

static public void main(String[] args) {
// Make sure background compilation is disabled
if (backgroundCompilationEnabled()) {
if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) {
throw new RuntimeException("Background compilation enabled");
}

Expand All @@ -257,7 +254,11 @@ static public void main(String[] args) {
c1 = count;

// Force the compilation of m3() that will inline m1()
WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION);
if(!WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION)) {
// C2 compiler not available, compile with C1
WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_SIMPLE);
}

// Because background compilation is disabled, method should now be compiled
if(!WHITE_BOX.isMethodCompiled(m3)) {
throw new RuntimeException(m3 + " not compiled");
Expand All @@ -279,19 +280,4 @@ static public void main(String[] args) {
System.out.println("PASSED " + c1);
}
}

/**
* Checks if background compilation (-XX:+BackgroundCompilation) is enabled.
* @return True if background compilation is enabled, false otherwise
*/
private static boolean backgroundCompilationEnabled() {
HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
VMOption backgroundCompilation;
try {
backgroundCompilation = diagnostic.getVMOption("BackgroundCompilation");
} catch (IllegalArgumentException e) {
return false;
}
return Boolean.valueOf(backgroundCompilation.getValue());
}
}
23 changes: 22 additions & 1 deletion jdk/src/share/classes/sun/tools/jar/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ class Main {
* iflag: generate jar index
* nflag: Perform jar normalization at the end
* pflag: preserve/don't strip leading slash and .. component from file name
* kflag: keep existing file
*
*/
boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag, nflag, pflag;
boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag, nflag, pflag, kflag;

static final String MANIFEST_DIR = "META-INF/";
static final String VERSION = "1.0";
Expand Down Expand Up @@ -397,6 +398,9 @@ boolean parseArgs(String args[]) {
case '0':
flag0 = true;
break;
case 'k':
kflag = true;
break;
case 'i':
if (cflag || uflag || xflag || tflag) {
usageError();
Expand Down Expand Up @@ -431,6 +435,10 @@ boolean parseArgs(String args[]) {
usageError();
return false;
}
if (kflag && !xflag) {
warn(formatMsg("warn.option.is.ignored", "k"));
}

/* parse file arguments */
int n = args.length - count;
if (n > 0) {
Expand Down Expand Up @@ -1058,6 +1066,12 @@ ZipEntry extractFile(InputStream is, ZipEntry e) throws IOException {
output(formatMsg("out.create", name));
}
} else {
if (f.exists() && kflag) {
if (vflag) {
output(formatMsg("out.kept", name));
}
return rc;
}
if (f.getParent() != null) {
File d = new File(f.getParent());
if (!d.exists() && !d.mkdirs() || !d.isDirectory()) {
Expand Down Expand Up @@ -1280,6 +1294,13 @@ protected void error(String s) {
err.println(s);
}

/**
* Print a warning message
*/
void warn(String s) {
err.println(s);
}

/**
* Main routine to start program.
*/
Expand Down
18 changes: 16 additions & 2 deletions jdk/src/share/classes/sun/tools/jar/resources/jar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ error.incorrect.length=\
incorrect length while processing: {0}
error.create.tempfile=\
Could not create a temporary file
warn.option.is.ignored=\
Warning: The {0} option is not valid with current usage, will be ignored.
out.added.manifest=\
added manifest
out.update.manifest=\
Expand All @@ -62,17 +64,22 @@ out.create=\
\ \ created: {0}
out.extracted=\
extracted: {0}
out.kept=\
\ \ skipped: {0} exists
out.inflated=\
\ inflated: {0}
out.size=\
(in = {0}) (out= {1})

usage=\
Usage: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\
Usage: jar {ctxui}[vfmn0PMek] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\
Options:\n\
\ \ -c create new archive\n\
\ \ -t list table of contents for archive\n\
\ \ -x extract named (or all) files from archive\n\
\ \ -x, Extract named (or all) files from the archive.\n\
\ \ If a file with the same name appears more than once in\n\
\ \ the archive, each copy will be extracted, with later copies\n\
\ \ overwriting (replacing) earlier copies unless 'k' is specified.\n\
\ \ -u update existing archive\n\
\ \ -v generate verbose output on standard output\n\
\ \ -f specify archive file name\n\
Expand All @@ -85,6 +92,13 @@ Options:\n\
\ \ -M do not create a manifest file for the entries\n\
\ \ -i generate index information for the specified jar files\n\
\ \ -C change to the specified directory and include the following file\n\
Operation modifiers valid only in extract mode:\n\
\ \ -k Do not overwrite existing files.\n\
\ \ If a Jar file entry with the same name exists in the target\n\
\ \ directory, the existing file will not be overwritten.\n\
\ \ As a result, if a file appears more than once in an\n\
\ \ archive, later copies will not overwrite earlier copies.\n\
\ \ Also note that some file system can be case insensitive.\n\
If any file is a directory then it is processed recursively.\n\
The manifest file name, the archive file name and the entry point name are\n\
specified in the same order as the 'm', 'f' and 'e' flags.\n\n\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ out.extracted=extrahiert: {0}
out.inflated=\ vergr\u00F6\u00DFert: {0}
out.size=(ein = {0}) (aus = {1})

usage=Verwendung: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien...\nOptionen:\n -c Neues Archiv erstellen\n -t Inhaltsverzeichnis f\u00FCr Archiv anzeigen\n -x Benannte (oder alle) Dateien aus dem Archiv extrahieren\n -u Vorhandenes Archiv aktualisieren\n -v Ausgabe im Verbose-Modus aus Standard-Ausgabe generieren\n -f Dateinamen f\u00FCr Archiv angeben\n -m Manifestinformationen aus angegebener Manifestdatei einschlie\u00DFen\n -n Pack200-Normalisierung nach Erstellung eines neuen Archivs ausf\u00FChren\n -e Anwendungseinstiegspunkt f\u00FCr Standalone-Anwendung angeben \n in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelt\n -0 Nur speichern; keine ZIP-Komprimierung verwenden\n -P Komponenten mit vorangestelltem "/" (absoluter Pfad) und ".." (\u00FCbergeordnetes Verzeichnis) aus Dateinamen beibehalten\n -M Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n -i Indexinformationen f\u00FCr die angegebenen JAR-Dateien erstellen\n -C Zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifestdatei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifestdatei "mymanifest", und archivieren Sie alle\n Dateien im Verzeichnis foo/ directory in "classes.jar": \n jar cvfm classes.jar mymanifest -C foo/ .\n
usage=Verwendung: jar {ctxui}[vfmn0PMek] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien...\nOptionen:\n -c Neues Archiv erstellen\n -t Inhaltsverzeichnis f\u00FCr Archiv anzeigen\n -x Benannte (oder alle) Dateien aus dem Archiv extrahieren\n -u Vorhandenes Archiv aktualisieren\n -v Ausgabe im Verbose-Modus aus Standard-Ausgabe generieren\n -f Dateinamen f\u00FCr Archiv angeben\n -m Manifestinformationen aus angegebener Manifestdatei einschlie\u00DFen\n -n Pack200-Normalisierung nach Erstellung eines neuen Archivs ausf\u00FChren\n -e Anwendungseinstiegspunkt f\u00FCr Standalone-Anwendung angeben \n in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelt\n -0 Nur speichern; keine ZIP-Komprimierung verwenden\n -P Komponenten mit vorangestelltem "/" (absoluter Pfad) und ".." (\u00FCbergeordnetes Verzeichnis) aus Dateinamen beibehalten\n -M Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n -i Indexinformationen f\u00FCr die angegebenen JAR-Dateien erstellen\n -C Zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifestdatei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifestdatei "mymanifest", und archivieren Sie alle\n Dateien im Verzeichnis foo/ directory in "classes.jar": \n jar cvfm classes.jar mymanifest -C foo/ .\n
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ out.extracted=extra\u00EDdo: {0}
out.inflated=\ inflado: {0}
out.size=(entrada = {0}) (salida = {1})

usage=Sintaxis: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\nOpciones:\n -c crear nuevo archivo\n -t crear la tabla de contenido del archivo\n -x extraer el archivo mencionado (o todos) del archivo\n -u actualizar archivo existente\n -v generar salida detallada de los datos de salida est\u00E1ndar\n -f especificar nombre de archivo de almacenamiento\n -m incluir informaci\u00F3n de manifiesto del archivo de manifiesto especificado\n -e especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n que se incluye dentro de un archivo jar ejecutable\n -0 s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n -P conservar componentes iniciales '/' (ruta absoluta) y ".." (directorio principal) en los nombres de archivo\n -M no crear un archivo de manifiesto para las entradas\n -i generar informaci\u00F3n de \u00EDndice para los archivos jar especificados\n -C cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n archivos del directorio foo/ en 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n
usage=Sintaxis: jar {ctxui}[vfmn0PMek] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\nOpciones:\n -c crear nuevo archivo\n -t crear la tabla de contenido del archivo\n -x extraer el archivo mencionado (o todos) del archivo\n -u actualizar archivo existente\n -v generar salida detallada de los datos de salida est\u00E1ndar\n -f especificar nombre de archivo de almacenamiento\n -m incluir informaci\u00F3n de manifiesto del archivo de manifiesto especificado\n -e especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n que se incluye dentro de un archivo jar ejecutable\n -0 s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n -P conservar componentes iniciales '/' (ruta absoluta) y ".." (directorio principal) en los nombres de archivo\n -M no crear un archivo de manifiesto para las entradas\n -i generar informaci\u00F3n de \u00EDndice para los archivos jar especificados\n -C cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n archivos del directorio foo/ en 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n
Loading

0 comments on commit 27e2a25

Please sign in to comment.