Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
gnu-andrew committed Jan 18, 2023
2 parents 014f21f + 056d5a7 commit ddb9a5c
Show file tree
Hide file tree
Showing 83 changed files with 1,966 additions and 1,899 deletions.
Expand Up @@ -317,6 +317,8 @@ public static int makePersistent( int scid )
public static final String DYNAMIC_STUB_FACTORY_FACTORY_CLASS =
SUN_PREFIX + "ORBDynamicStubFactoryFactoryClass" ;

public static final String ALLOW_DESERIALIZE_OBJECT = SUN_PREFIX + "ORBAllowDeserializeObject" ;

// Constants for NameService properties ************************************

public static final int DEFAULT_INITIAL_PORT = 900;
Expand Down
Expand Up @@ -342,6 +342,11 @@ protected void writeSerializationMethods ()
stream.println (" private void readObject (java.io.ObjectInputStream s) throws java.io.IOException");
stream.println (" {");
stream.println (" String str = s.readUTF ();");
if ("DynAnyFactory".equals (i.name ())) {
stream.println (" if (!str.startsWith(com.sun.corba.se.impl.orbutil.ORBConstants.STRINGIFY_PREFIX) &&");
stream.println (" !Boolean.getBoolean(com.sun.corba.se.impl.orbutil.ORBConstants.ALLOW_DESERIALIZE_OBJECT))");
stream.println (" throw new java.io.InvalidObjectException(\"IOR: expected\");");
}
stream.println (" String[] args = null;");
stream.println (" java.util.Properties props = null;");
stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);");
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
Expand Up @@ -214,7 +214,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
// SafeFetch 32 handling:
// - make it work if _thread is null
// - make it use the standard os::...::ucontext_get/set_pc APIs
if (uc) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc) {
address const pc = os::Aix::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Aix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
12 changes: 6 additions & 6 deletions hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
Expand Up @@ -462,13 +462,13 @@ JVM_handle_bsd_signal(int sig,
if (info != NULL && uc != NULL && thread != NULL) {
pc = (address) os::Bsd::ucontext_get_pc(uc);

if (StubRoutines::is_safefetch_fault(pc)) {
uc->context_pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
return 1;
}

// Handle ALL stack overflow variations here
if (sig == SIGSEGV || sig == SIGBUS) {
if (StubRoutines::is_safefetch_fault(pc)) {
uc->context_pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
return 1;
}

// Handle ALL stack overflow variations here
address addr = (address) info->si_addr;

// check if fault address is within thread stack
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
Expand Up @@ -251,7 +251,7 @@ JVM_handle_linux_signal(int sig,
if (info != NULL && uc != NULL && thread != NULL) {
pc = (address) os::Linux::ucontext_get_pc(uc);

if (StubRoutines::is_safefetch_fault(pc)) {
if ((sig == SIGSEGV || sig == SIGBUS) && StubRoutines::is_safefetch_fault(pc)) {
uc->uc_mcontext.pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
Expand Up @@ -214,7 +214,7 @@ JVM_handle_linux_signal(int sig,

// Moved SafeFetch32 handling outside thread!=NULL conditional block to make
// it work if no associated JavaThread object exists.
if (uc) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc) {
address const pc = os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
uc->uc_mcontext.regs->nip = (unsigned long)StubRoutines::continuation_for_safefetch_fault(pc);
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
Expand Up @@ -602,7 +602,7 @@ JVM_handle_linux_signal(int sig,
return 1;
}

if (checkPrefetch(uc, pc)) {
if ((sig == SIGSEGV || sig == SIGBUS) && checkPrefetch(uc, pc)) {
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
Expand Up @@ -277,7 +277,7 @@ JVM_handle_linux_signal(int sig,
if (info != NULL && uc != NULL && thread != NULL) {
pc = (address) os::Linux::ucontext_get_pc(uc);

if (StubRoutines::is_safefetch_fault(pc)) {
if ((sig == SIGSEGV || sig == SIGBUS) && StubRoutines::is_safefetch_fault(pc)) {
uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
Expand Up @@ -378,7 +378,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
npc = (address) uc->uc_mcontext.gregs[REG_nPC];

// SafeFetch() support
if (StubRoutines::is_safefetch_fault(pc)) {
if ((sig == SIGSEGV || sig == SIGBUS) && StubRoutines::is_safefetch_fault(pc)) {
uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
uc->uc_mcontext.gregs[REG_nPC] = uc->uc_mcontext.gregs[REG_PC] + 4;
return 1;
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
Expand Up @@ -433,7 +433,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
// factor me: getPCfromContext
pc = (address) uc->uc_mcontext.gregs[REG_PC];

if (StubRoutines::is_safefetch_fault(pc)) {
if ((sig == SIGSEGV || sig == SIGBUS) && StubRoutines::is_safefetch_fault(pc)) {
uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
return true;
}
Expand Down
Expand Up @@ -156,7 +156,9 @@ bool JfrCheckpointManager::is_locked() const {
}

static void assert_free_lease(const BufferPtr buffer) {
assert(buffer != NULL, "invariant");
if (buffer == NULL) {
return;
}
assert(buffer->acquired_by_self(), "invariant");
assert(buffer->lease(), "invariant");
}
Expand Down
8 changes: 5 additions & 3 deletions hotspot/src/share/vm/jfr/recorder/storage/jfrBuffer.cpp
Expand Up @@ -38,11 +38,13 @@ JfrBuffer::JfrBuffer() : _next(NULL),
_top(NULL),
_flags(0),
_header_size(0),
_size(0) {}
_size(0)
LP64_ONLY(COMMA _pad(0)) {}

bool JfrBuffer::initialize(size_t header_size, size_t size, const void* id /* NULL */) {
_header_size = (u2)header_size;
_size = (u4)(size / BytesPerWord);
assert(header_size <= max_jushort, "invariant");
_header_size = static_cast<u2>(header_size);
_size = size;
assert(_identity == NULL, "invariant");
_identity = id;
set_pos(start());
Expand Down
7 changes: 4 additions & 3 deletions hotspot/src/share/vm/jfr/recorder/storage/jfrBuffer.hpp
Expand Up @@ -52,9 +52,10 @@ class JfrBuffer {
const void* volatile _identity;
u1* _pos;
mutable const u1* volatile _top;
u2 _flags;
size_t _size;
u2 _header_size;
u4 _size;
u2 _flags;
LP64_ONLY(const u4 _pad;)

const u1* stable_top() const;

Expand Down Expand Up @@ -124,7 +125,7 @@ class JfrBuffer {
}

size_t size() const {
return _size * BytesPerWord;
return _size;
}

size_t total_size() const {
Expand Down
14 changes: 11 additions & 3 deletions hotspot/src/share/vm/jfr/recorder/storage/jfrMemorySpace.hpp
Expand Up @@ -108,19 +108,27 @@ class JfrMemorySpace : public JfrCHeapObj {
};

// allocations are even multiples of the mspace min size
inline u8 align_allocation_size(u8 requested_size, size_t min_elem_size) {
inline size_t align_allocation_size(size_t requested_size, size_t min_elem_size) {
assert((int)min_elem_size % os::vm_page_size() == 0, "invariant");
if (requested_size > static_cast<size_t>(min_intx)) {
assert(false, err_msg("requested size: " SIZE_FORMAT " is too large", requested_size));
return 0;
}
u8 alloc_size_bytes = min_elem_size;
while (requested_size > alloc_size_bytes) {
alloc_size_bytes <<= 1;
}
assert((int)alloc_size_bytes % os::vm_page_size() == 0, "invariant");
return alloc_size_bytes;
assert(alloc_size_bytes <= static_cast<size_t>(min_intx), "invariant");
return static_cast<size_t>(alloc_size_bytes);
}

template <typename T, template <typename> class RetrievalType, typename Callback>
T* JfrMemorySpace<T, RetrievalType, Callback>::allocate(size_t size) {
const u8 aligned_size_bytes = align_allocation_size(size, _min_elem_size);
const size_t aligned_size_bytes = align_allocation_size(size, _min_elem_size);
if (size != 0 && aligned_size_bytes == 0) {
return NULL;
}
void* const allocation = JfrCHeapObj::new_array<u1>(aligned_size_bytes + sizeof(T));
if (allocation == NULL) {
return NULL;
Expand Down
6 changes: 4 additions & 2 deletions hotspot/src/share/vm/jfr/writers/jfrWriterHost.inline.hpp
Expand Up @@ -70,6 +70,7 @@ template <typename T>
inline void WriterHost<BE, IE, WriterPolicyImpl>::write(const T* value, size_t len) {
assert(value != NULL, "invariant");
assert(len > 0, "invariant");
assert(len <= max_jint, "invariant");
// Might need T + 1 size
u1* const pos = ensure_size(sizeof(T) * len + len);
if (pos) {
Expand Down Expand Up @@ -125,8 +126,9 @@ template <typename T>
inline void WriterHost<BE, IE, WriterPolicyImpl>::be_write(const T* value, size_t len) {
assert(value != NULL, "invariant");
assert(len > 0, "invariant");
// Might need T + 1 size
u1* const pos = ensure_size(sizeof(T) * len + len);
assert(len <= max_jint, "invariant");
// Big endian writes map one-to-one for length, so no extra space is needed.
u1* const pos = ensure_size(sizeof(T) * len);
if (pos) {
this->set_current_pos(BE::be_write(value, len, pos));
}
Expand Down
2 changes: 0 additions & 2 deletions hotspot/src/share/vm/prims/jni.cpp
Expand Up @@ -191,8 +191,6 @@ static jint CurrentVersion = JNI_VERSION_1_8;
#define FP_SELECT(TypeName, intcode, fpcode) \
FP_SELECT_##TypeName(intcode, fpcode)

#define COMMA ,

// Choose DT_RETURN_MARK macros based on the type: float/double -> void
// (dtrace doesn't do FP yet)
#ifndef USDT2
Expand Down
3 changes: 3 additions & 0 deletions hotspot/src/share/vm/utilities/macros.hpp
Expand Up @@ -34,6 +34,9 @@
// Makes a string of the macro expansion of a
#define XSTR(a) STR(a)

// Allow commas in macro arguments.
#define COMMA ,

// -DINCLUDE_<something>=0 | 1 can be specified on the command line to include
// or exclude functionality.

Expand Down
2 changes: 1 addition & 1 deletion jdk/make/data/tzdata/VERSION
Expand Up @@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2022e
tzdata2022g

1 comment on commit ddb9a5c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.