Skip to content

Commit

Permalink
Merge branch 'openjdk:master' into ikvm-jdk8u412-b07
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii authored Jul 24, 2024
2 parents 2678c7e + 18b3ca5 commit a86b9b4
Show file tree
Hide file tree
Showing 517 changed files with 6,073 additions and 1,494 deletions.
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=openjdk8u412
version=openjdk8u422

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
Expand Down
10 changes: 1 addition & 9 deletions common/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4440,7 +4440,7 @@ VS_TOOLSET_SUPPORTED_2022=true
#CUSTOM_AUTOCONF_INCLUDE

# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1704508692
DATE_WHEN_GENERATED=1705630975

###############################################################################
#
Expand Down Expand Up @@ -27586,13 +27586,6 @@ fi
as_fn_error $? "The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X" "$LINENO" 5
fi

# Fail-fast: verify we're building on a supported Xcode version
XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
if test "${XC_VERSION_PARTS[0]}" != "6" -a "${XC_VERSION_PARTS[0]}" != "9" -a "${XC_VERSION_PARTS[0]}" != "10" -a "${XC_VERSION_PARTS[0]}" != "11" -a "${XC_VERSION_PARTS[0]}" != "12" ; then
as_fn_error $? "Xcode 6, 9-12 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode or make Xcode active by using xcode-select." "$LINENO" 5
fi

# Some versions of Xcode command line tools install gcc and g++ as symlinks to
# clang and clang++, which will break the build. So handle that here if we need to.
if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then
Expand Down Expand Up @@ -57465,4 +57458,3 @@ fi
printf "\n"
fi
fi

7 changes: 0 additions & 7 deletions common/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
AC_MSG_ERROR([The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X])
fi
# Fail-fast: verify we're building on a supported Xcode version
XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
if test "${XC_VERSION_PARTS[[0]]}" != "6" -a "${XC_VERSION_PARTS[[0]]}" != "9" -a "${XC_VERSION_PARTS[[0]]}" != "10" -a "${XC_VERSION_PARTS[[0]]}" != "11" -a "${XC_VERSION_PARTS[[0]]}" != "12" ; then
AC_MSG_ERROR([Xcode 6, 9-12 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode or make Xcode active by using xcode-select.])
fi
# Some versions of Xcode command line tools install gcc and g++ as symlinks to
# clang and clang++, which will break the build. So handle that here if we need to.
if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then
Expand Down
4 changes: 2 additions & 2 deletions common/autoconf/version-numbers
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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 All @@ -26,7 +26,7 @@
JDK_MAJOR_VERSION=1
JDK_MINOR_VERSION=8
JDK_MICRO_VERSION=0
JDK_UPDATE_VERSION=412
JDK_UPDATE_VERSION=422
LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
PRODUCT_SUFFIX="Runtime Environment"
Expand Down
2 changes: 1 addition & 1 deletion hotspot/make/windows/makefiles/compile.make
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ CXX=cl.exe
# improving the quality of crash log stack traces involving jvm.dll.

# These are always used in all compiles
CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX
CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX /wd4800

# Let's add debug information when Full Debug Symbols is enabled
!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
Expand Down
8 changes: 5 additions & 3 deletions hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013, Red Hat Inc.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates.
* All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -150,8 +150,10 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
if (index->is_register()) {
// apply the shift and accumulate the displacement
if (shift > 0) {
LIR_Opr tmp = new_pointer_register();
__ shift_left(index, shift, tmp);
// Use long register to avoid overflow when shifting large index values left.
LIR_Opr tmp = new_register(T_LONG);
__ convert(Bytecodes::_i2l, index, tmp);
__ shift_left(tmp, shift, tmp);
index = tmp;
}
if (disp != 0) {
Expand Down
8 changes: 5 additions & 3 deletions hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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 @@ -156,8 +156,10 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
if (index->is_register()) {
// apply the shift and accumulate the displacement
if (shift > 0) {
LIR_Opr tmp = new_pointer_register();
__ shift_left(index, shift, tmp);
// Use long register to avoid overflow when shifting large index values left.
LIR_Opr tmp = new_register(T_LONG);
__ convert(Bytecodes::_i2l, index, tmp);
__ shift_left(tmp, shift, tmp);
index = tmp;
}
if (disp != 0) {
Expand Down
25 changes: 23 additions & 2 deletions hotspot/src/os/aix/vm/os_aix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -1452,7 +1452,7 @@ bool os::dll_address_to_library_name(address addr, char* buf,

// Loads .dll/.so and in case of error it checks if .dll/.so was built
// for the same architecture as Hotspot is running on.
void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
static void* dll_load_library(const char *filename, char *ebuf, int ebuflen) {

if (ebuf && ebuflen > 0) {
ebuf[0] = '\0';
Expand Down Expand Up @@ -1481,6 +1481,27 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
return NULL;
}

// Load library named <filename>
// If filename matches <name>.so, and loading fails, repeat with <name>.a.
void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
void* result = NULL;
char* const file_path = strdup(filename);
char* const pointer_to_dot = strrchr(file_path, '.');
const char old_extension[] = ".so";
const char new_extension[] = ".a";
STATIC_ASSERT(sizeof(old_extension) >= sizeof(new_extension));
// First try to load the existing file.
result = dll_load_library(filename, ebuf, ebuflen);
// If the load fails,we try to reload by changing the extension to .a for .so files only.
// Shared object in .so format dont have braces, hence they get removed for archives with members.
if (result == NULL && pointer_to_dot != NULL && strcmp(pointer_to_dot, old_extension) == 0) {
snprintf(pointer_to_dot, sizeof(old_extension), "%s", new_extension);
result = dll_load_library(file_path, ebuf, ebuflen);
}
FREE_C_HEAP_ARRAY(char, file_path, mtInternal);
return result;
}

// Glibc-2.0 libdl is not MT safe. If you are building with any glibc,
// chances are you might want to run the generated bits against glibc-2.0
// libdl.so, so always use locking for any version of glibc.
Expand Down
4 changes: 2 additions & 2 deletions hotspot/src/os/linux/vm/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2008,11 +2008,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
static Elf32_Half running_arch_code=EM_68K;
#elif (defined AARCH64)
static Elf32_Half running_arch_code=EM_AARCH64;
#elif (defined LOONGARCH)
#elif (defined LOONGARCH64)
static Elf32_Half running_arch_code=EM_LOONGARCH;
#else
#error Method os::dll_load requires that one of following is defined:\
IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH
IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64
#endif

// Identify compatability class for VM's architecture and library's architecture
Expand Down
2 changes: 2 additions & 0 deletions hotspot/src/share/vm/adlc/output_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3023,6 +3023,8 @@ static void define_fill_new_machnode(bool used, FILE *fp_cpp) {
fprintf(fp_cpp, " if( i != cisc_operand() ) \n");
fprintf(fp_cpp, " to[i] = _opnds[i]->clone(C);\n");
fprintf(fp_cpp, " }\n");
fprintf(fp_cpp, " // Do not increment node index counter, since node reuses my index\n");
fprintf(fp_cpp, " C->set_unique(C->unique() - 1);\n");
fprintf(fp_cpp, "}\n");
}
fprintf(fp_cpp, "\n");
Expand Down
14 changes: 7 additions & 7 deletions hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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 @@ -441,14 +441,14 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList

if (c) {
jint value = c->type()->as_IntConstant()->value();
if (value != min_jint) {
if (ao->op() == Bytecodes::_isub) {
value = -value;
}
if (ao->op() == Bytecodes::_iadd) {
base = java_add(base, value);
last_integer = base;
last_instruction = other;
} else {
assert(ao->op() == Bytecodes::_isub, "unexpected bytecode");
base = java_subtract(base, value);
}
last_integer = base;
last_instruction = other;
index = other;
} else {
break;
Expand Down
6 changes: 4 additions & 2 deletions hotspot/src/share/vm/c1/c1_Runtime1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "runtime/vframeArray.hpp"
#include "utilities/copy.hpp"
#include "utilities/events.hpp"
#include "utilities/exceptions.hpp"


// Implementation of StubAssembler
Expand Down Expand Up @@ -536,8 +537,9 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
if (TraceExceptions) {
ttyLocker ttyl;
ResourceMark rm;
tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
tty->print_cr("Exception <%.*s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
MAX_LEN, exception->print_value_string(),
p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
}
// for AbortVMOnException flag
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
Expand Down
13 changes: 6 additions & 7 deletions hotspot/src/share/vm/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,14 +1235,13 @@ oop java_lang_Throwable::message(Handle throwable) {
}


// Return Symbol for detailed_message or NULL
Symbol* java_lang_Throwable::detail_message(oop throwable) {
PRESERVE_EXCEPTION_MARK; // Keep original exception
oop detailed_message = java_lang_Throwable::message(throwable);
if (detailed_message != NULL) {
return java_lang_String::as_symbol(detailed_message, THREAD);
const char* java_lang_Throwable::message_as_utf8(oop throwable) {
oop msg = java_lang_Throwable::message(throwable);
const char* msg_utf8 = NULL;
if (msg != NULL) {
msg_utf8 = java_lang_String::as_utf8_string(msg);
}
return NULL;
return msg_utf8;
}

void java_lang_Throwable::set_message(oop throwable, oop value) {
Expand Down
4 changes: 2 additions & 2 deletions hotspot/src/share/vm/classfile/javaClasses.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,12 @@ class java_lang_Throwable: AllStatic {
static void set_backtrace(oop throwable, oop value);
// Needed by JVMTI to filter out this internal field.
static int get_backtrace_offset() { return backtrace_offset;}
static int get_detailMessage_offset() { return detailMessage_offset;}
// Message
static int get_detailMessage_offset() { return detailMessage_offset;}
static oop message(oop throwable);
static oop message(Handle throwable);
static const char* message_as_utf8(oop throwable);
static void set_message(oop throwable, oop value);
static Symbol* detail_message(oop throwable);
static void print_stack_element(outputStream *st, Handle mirror, int method,
int version, int bci, int cpref);
static void print_stack_element(outputStream *st, methodHandle method, int bci);
Expand Down
14 changes: 7 additions & 7 deletions hotspot/src/share/vm/classfile/resolutionErrors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// add new entry to the table
void ResolutionErrorTable::add_entry(int index, unsigned int hash,
constantPoolHandle pool, int cp_index,
Symbol* error, Symbol* message)
Symbol* error, const char* message)
{
assert_locked_or_safepoint(SystemDictionary_lock);
assert(!pool.is_null() && error != NULL, "adding NULL obj");
Expand Down Expand Up @@ -64,16 +64,14 @@ void ResolutionErrorEntry::set_error(Symbol* e) {
_error->increment_refcount();
}

void ResolutionErrorEntry::set_message(Symbol* c) {
assert(c != NULL, "must set a value");
_message = c;
_message->increment_refcount();
void ResolutionErrorEntry::set_message(const char* c) {
_message = c != NULL ? os::strdup(c) : NULL;
}

// create new error entry
ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, ConstantPool* pool,
int cp_index, Symbol* error,
Symbol* message)
const char* message)
{
ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::new_entry(hash, pool);
entry->set_cp_index(cp_index);
Expand All @@ -87,7 +85,9 @@ void ResolutionErrorTable::free_entry(ResolutionErrorEntry *entry) {
// decrement error refcount
assert(entry->error() != NULL, "error should be set");
entry->error()->decrement_refcount();
entry->message()->decrement_refcount();
if (entry->message() != NULL) {
FREE_C_HEAP_ARRAY(char, entry->message(), mtInternal);
}
Hashtable<ConstantPool*, mtClass>::free_entry(entry);
}

Expand Down
11 changes: 6 additions & 5 deletions hotspot/src/share/vm/classfile/resolutionErrors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ResolutionErrorTable : public Hashtable<ConstantPool*, mtClass> {
ResolutionErrorTable(int table_size);

ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index,
Symbol* error, Symbol* message);
Symbol* error, const char* message);
void free_entry(ResolutionErrorEntry *entry);

ResolutionErrorEntry* bucket(int i) {
Expand All @@ -56,7 +56,7 @@ class ResolutionErrorTable : public Hashtable<ConstantPool*, mtClass> {
}

void add_entry(int index, unsigned int hash,
constantPoolHandle pool, int which, Symbol* error, Symbol* message);
constantPoolHandle pool, int cp_index, Symbol* error, const char* error_msg);


// find error given the constant pool and constant pool index
Expand All @@ -80,7 +80,7 @@ class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> {
private:
int _cp_index;
Symbol* _error;
Symbol* _message;
const char* _message;

public:
ConstantPool* pool() const { return literal(); }
Expand All @@ -91,8 +91,9 @@ class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> {
Symbol* error() const { return _error; }
void set_error(Symbol* e);

Symbol* message() const { return _message; }
void set_message(Symbol* c);
const char* message() const { return _message; }
// The incoming message is copied to the C-Heap.
void set_message(const char* c);

ResolutionErrorEntry* next() const {
return (ResolutionErrorEntry*)HashtableEntry<ConstantPool*, mtClass>::next();
Expand Down
Loading

0 comments on commit a86b9b4

Please sign in to comment.