Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
/ jdk22u Public archive

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravi Reddy authored and Rob McKenna committed Jun 4, 2024
2 parents 6308078 + e1b620e commit 8153097
Show file tree
Hide file tree
Showing 32 changed files with 227 additions and 159 deletions.
2 changes: 1 addition & 1 deletion make/devkit/createJMHBundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rm -f *
fetchJar() {
url="https://repo.maven.apache.org/maven2/$1/$2/$3/$2-$3.jar"
if command -v curl > /dev/null; then
curl -O --fail $url
curl -OL --fail $url
elif command -v wget > /dev/null; then
wget $url
else
Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/cpu/aarch64/gc/x/xGlobals_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@
// * 63-48 Fixed (16-bits, always zero)
//

// Default value if probing is not implemented for a certain platform: 128TB
static const size_t DEFAULT_MAX_ADDRESS_BIT = 47;
// Minimum value returned, if probing fails: 64GB
// Default value if probing is not implemented for a certain platform
// Max address bit is restricted by implicit assumptions in the code, for instance
// the bit layout of XForwardingEntry or Partial array entry (see XMarkStackEntry) in mark stack
static const size_t DEFAULT_MAX_ADDRESS_BIT = 46;
// Minimum value returned, if probing fails
static const size_t MINIMUM_MAX_ADDRESS_BIT = 36;

static size_t probe_valid_max_address_bit() {
Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
#include <sys/mman.h>
#endif // LINUX

// Default value if probing is not implemented for a certain platform: 128TB
static const size_t DEFAULT_MAX_ADDRESS_BIT = 47;
// Minimum value returned, if probing fails: 64GB
// Default value if probing is not implemented for a certain platform
// Max address bit is restricted by implicit assumptions in the code, for instance
// the bit layout of ZForwardingEntry or Partial array entry (see ZMarkStackEntry) in mark stack
static const size_t DEFAULT_MAX_ADDRESS_BIT = 46;
// Minimum value returned, if probing fail
static const size_t MINIMUM_MAX_ADDRESS_BIT = 36;

static size_t probe_valid_max_address_bit() {
Expand Down
7 changes: 2 additions & 5 deletions src/hotspot/share/gc/shared/memAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,15 @@ HeapWord* MemAllocator::mem_allocate_inside_tlab_slow(Allocation& allocation) co
PTR_FORMAT " min: " SIZE_FORMAT ", desired: " SIZE_FORMAT,
p2i(mem), min_tlab_size, new_tlab_size);

// ...and clear or zap just allocated TLAB, if needed.
if (ZeroTLAB) {
// ..and clear it.
Copy::zero_to_words(mem, allocation._allocated_tlab_size);
} else {
// ...and zap just allocated object.
#ifdef ASSERT
} else if (ZapTLAB) {
// Skip mangling the space corresponding to the object header to
// ensure that the returned space is not considered parsable by
// any concurrent GC thread.
size_t hdr_size = oopDesc::header_size();
Copy::fill_to_words(mem + hdr_size, allocation._allocated_tlab_size - hdr_size, badHeapWordVal);
#endif // ASSERT
}

tlab.fill(mem, mem + _word_size, allocation._allocated_tlab_size);
Expand Down
12 changes: 3 additions & 9 deletions src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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 @@ -39,14 +39,8 @@ inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) {
invariants();
HeapWord* obj = top();
if (pointer_delta(end(), obj) >= size) {
// successful thread-local allocation
#ifdef ASSERT
// Skip mangling the space corresponding to the object header to
// ensure that the returned space is not considered parsable by
// any concurrent GC thread.
size_t hdr_size = oopDesc::header_size();
Copy::fill_to_words(obj + hdr_size, size - hdr_size, badHeapWordVal);
#endif // ASSERT
// Successful thread-local allocation.

// This addition is safe because we know that top is
// at least size below end, so the add can't wrap.
set_top(obj + size);
Expand Down
9 changes: 6 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ class ShenandoahPrepareForCompactionObjectClosure : public ObjectClosure {
_compact_point = _to_region->bottom();
}

// Object fits into current region, record new location:
// Object fits into current region, record new location, if object does not move:
assert(_compact_point + obj_size <= _to_region->end(), "must fit");
shenandoah_assert_not_forwarded(nullptr, p);
_preserved_marks->push_if_necessary(p, p->mark());
p->forward_to(cast_to_oop(_compact_point));
if (_compact_point != cast_from_oop<HeapWord*>(p)) {
_preserved_marks->push_if_necessary(p, p->mark());
p->forward_to(cast_to_oop(_compact_point));
}
_compact_point += obj_size;
}
};
Expand Down Expand Up @@ -845,6 +847,7 @@ class ShenandoahCompactObjectsClosure : public ObjectClosure {
if (p->is_forwarded()) {
HeapWord* compact_from = cast_from_oop<HeapWord*>(p);
HeapWord* compact_to = cast_from_oop<HeapWord*>(p->forwardee());
assert(compact_from != compact_to, "Forwarded object should move");
Copy::aligned_conjoint_words(compact_from, compact_to, size);
oop new_obj = cast_to_oop(compact_to);

Expand Down
7 changes: 2 additions & 5 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,18 +818,15 @@ HeapWord* ShenandoahHeap::allocate_from_gclab_slow(Thread* thread, size_t size)

assert (size <= actual_size, "allocation should fit");

// ...and clear or zap just allocated TLAB, if needed.
if (ZeroTLAB) {
// ..and clear it.
Copy::zero_to_words(gclab_buf, actual_size);
} else {
// ...and zap just allocated object.
#ifdef ASSERT
} else if (ZapTLAB) {
// Skip mangling the space corresponding to the object header to
// ensure that the returned space is not considered parsable by
// any concurrent GC thread.
size_t hdr_size = oopDesc::header_size();
Copy::fill_to_words(gclab_buf + hdr_size, actual_size - hdr_size, badHeapWordVal);
#endif // ASSERT
}
gclab->set_buf(gclab_buf, actual_size);
return gclab->allocate(size);
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/gc/z/z_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
\
product(double, ZYoungCompactionLimit, 25.0, \
"Maximum allowed garbage in young pages") \
range(0, 100) \
\
product(double, ZCollectionIntervalMinor, -1, \
"Force Minor GC at a fixed time interval (in seconds)") \
Expand Down
10 changes: 4 additions & 6 deletions src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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 @@ -1991,11 +1991,9 @@ void BytecodeInterpreter::run(interpreterState istate) {
size_t obj_size = ik->size_helper();
HeapWord* result = THREAD->tlab().allocate(obj_size);
if (result != nullptr) {
// Initialize object field block:
// - if TLAB is pre-zeroed, we can skip this path
// - in debug mode, ThreadLocalAllocBuffer::allocate mangles
// this area, and we still need to initialize it
if (DEBUG_ONLY(true ||) !ZeroTLAB) {
// Initialize object field block.
if (!ZeroTLAB) {
// The TLAB was not pre-zeroed, we need to clear the memory here.
size_t hdr_size = oopDesc::header_size();
Copy::fill_to_words(result + hdr_size, obj_size - hdr_size, 0);
}
Expand Down
17 changes: 9 additions & 8 deletions src/hotspot/share/oops/instanceKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,16 +1634,17 @@ void InstanceKlass::call_class_initializer(TRAPS) {

void InstanceKlass::mask_for(const methodHandle& method, int bci,
InterpreterOopMap* entry_for) {
// Lazily create the _oop_map_cache at first request
// Lock-free access requires load_acquire.
// Lazily create the _oop_map_cache at first request.
// Load_acquire is needed to safely get instance published with CAS by another thread.
OopMapCache* oop_map_cache = Atomic::load_acquire(&_oop_map_cache);
if (oop_map_cache == nullptr) {
MutexLocker x(OopMapCacheAlloc_lock);
// Check if _oop_map_cache was allocated while we were waiting for this lock
if ((oop_map_cache = _oop_map_cache) == nullptr) {
oop_map_cache = new OopMapCache();
// Ensure _oop_map_cache is stable, since it is examined without a lock
Atomic::release_store(&_oop_map_cache, oop_map_cache);
// Try to install new instance atomically.
oop_map_cache = new OopMapCache();
OopMapCache* other = Atomic::cmpxchg(&_oop_map_cache, (OopMapCache*)nullptr, oop_map_cache);
if (other != nullptr) {
// Someone else managed to install before us, ditch local copy and use the existing one.
delete oop_map_cache;
oop_map_cache = other;
}
}
// _oop_map_cache is constant after init; lookup below does its own locking.
Expand Down
20 changes: 12 additions & 8 deletions src/hotspot/share/opto/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4174,24 +4174,24 @@ const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst, const T
//
assert(loaded->ptr() != TypePtr::Null, "insanity check");
//
if (loaded->ptr() == TypePtr::TopPTR) { return unloaded; }
if (loaded->ptr() == TypePtr::TopPTR) { return unloaded->with_speculative(speculative); }
else if (loaded->ptr() == TypePtr::AnyNull) { return make(ptr, unloaded->klass(), interfaces, false, nullptr, off, instance_id, speculative, depth); }
else if (loaded->ptr() == TypePtr::BotPTR) { return TypeInstPtr::BOTTOM; }
else if (loaded->ptr() == TypePtr::BotPTR) { return TypeInstPtr::BOTTOM->with_speculative(speculative); }
else if (loaded->ptr() == TypePtr::Constant || loaded->ptr() == TypePtr::NotNull) {
if (unloaded->ptr() == TypePtr::BotPTR) { return TypeInstPtr::BOTTOM; }
else { return TypeInstPtr::NOTNULL; }
if (unloaded->ptr() == TypePtr::BotPTR) { return TypeInstPtr::BOTTOM->with_speculative(speculative); }
else { return TypeInstPtr::NOTNULL->with_speculative(speculative); }
}
else if (unloaded->ptr() == TypePtr::TopPTR) { return unloaded; }
else if (unloaded->ptr() == TypePtr::TopPTR) { return unloaded->with_speculative(speculative); }

return unloaded->cast_to_ptr_type(TypePtr::AnyNull)->is_instptr();
return unloaded->cast_to_ptr_type(TypePtr::AnyNull)->is_instptr()->with_speculative(speculative);
}

// Both are unloaded, not the same class, not Object
// Or meet unloaded with a different loaded class, not java/lang/Object
if (ptr != TypePtr::BotPTR) {
return TypeInstPtr::NOTNULL;
return TypeInstPtr::NOTNULL->with_speculative(speculative);
}
return TypeInstPtr::BOTTOM;
return TypeInstPtr::BOTTOM->with_speculative(speculative);
}


Expand Down Expand Up @@ -4594,6 +4594,10 @@ const TypeInstPtr* TypeInstPtr::remove_speculative() const {
_instance_id, nullptr, _inline_depth);
}

const TypeInstPtr* TypeInstPtr::with_speculative(const TypePtr* speculative) const {
return make(_ptr, klass(), _interfaces, klass_is_exact(), const_oop(), _offset, _instance_id, speculative, _inline_depth);
}

const TypePtr* TypeInstPtr::with_inline_depth(int depth) const {
if (!UseInlineDepthForSpeculativeTypes) {
return this;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/opto/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,7 @@ class TypeInstPtr : public TypeOopPtr {

// Speculative type helper methods.
virtual const TypeInstPtr* remove_speculative() const;
const TypeInstPtr* with_speculative(const TypePtr* speculative) const;
virtual const TypePtr* with_inline_depth(int depth) const;
virtual const TypePtr* with_instance_id(int instance_id) const;

Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/prims/downcallLinker.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, 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
Expand Down Expand Up @@ -41,7 +41,8 @@ class DowncallLinker: AllStatic {
int captured_state_mask,
bool needs_transition);

static void capture_state(int32_t* value_ptr, int captured_state_mask);
// This is defined as JVM_LEAF which adds the JNICALL modifier.
static void JNICALL capture_state(int32_t* value_ptr, int captured_state_mask);

class StubGenerator : public StubCodeGenerator {
BasicType* _signature;
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ const int ObjectAlignmentInBytes = 8;
develop(bool, ZapFillerObjects, trueInDebug, \
"Zap filler objects") \
\
develop(bool, ZapTLAB, trueInDebug, \
"Zap allocated TLABs") \
\
product(bool, ExecutingUnitTests, false, \
"Whether the JVM is running unit tests or not") \
\
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/runtime/mutexLocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ Mutex* tty_lock = nullptr;
Mutex* RawMonitor_lock = nullptr;
Mutex* PerfDataMemAlloc_lock = nullptr;
Mutex* PerfDataManager_lock = nullptr;
Mutex* OopMapCacheAlloc_lock = nullptr;

Mutex* FreeList_lock = nullptr;
Mutex* OldSets_lock = nullptr;
Expand Down Expand Up @@ -349,7 +348,6 @@ void mutex_init() {
MUTEX_DEFL(PSOldGenExpand_lock , PaddedMutex , Heap_lock, true);
}
#endif
MUTEX_DEFL(OopMapCacheAlloc_lock , PaddedMutex , Threads_lock, true);
MUTEX_DEFL(Module_lock , PaddedMutex , ClassLoaderDataGraph_lock);
MUTEX_DEFL(SystemDictionary_lock , PaddedMonitor, Module_lock);
MUTEX_DEFL(JNICritical_lock , PaddedMonitor, AdapterHandlerLibrary_lock); // used for JNI critical regions
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/runtime/mutexLocker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ extern Mutex* FullGCALot_lock; // a lock to make FullGCALot MT
extern Mutex* RawMonitor_lock;
extern Mutex* PerfDataMemAlloc_lock; // a lock on the allocator for PerfData memory for performance data
extern Mutex* PerfDataManager_lock; // a long on access to PerfDataManager resources
extern Mutex* OopMapCacheAlloc_lock; // protects allocation of oop_map caches

extern Mutex* FreeList_lock; // protects the free region list during safepoints
extern Mutex* OldSets_lock; // protects the old region sets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1140,9 +1140,7 @@ public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
boolean isCommon = (pool.workerNamePrefix == null);
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm == null)
return new ForkJoinWorkerThread(null, pool, true, false);
else if (isCommon)
if (sm != null && isCommon)
return newCommonWithACC(pool);
else
return newRegularWithACC(pool);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, 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
Expand Down Expand Up @@ -681,10 +681,6 @@ public static long mismatch(MemorySegment srcSegment, long srcFromOffset, long s
long dstBytes = dstToOffset - dstFromOffset;
srcImpl.checkAccess(srcFromOffset, srcBytes, true);
dstImpl.checkAccess(dstFromOffset, dstBytes, true);
if (dstImpl == srcImpl) {
srcImpl.checkValidState();
return -1;
}

long bytes = Math.min(srcBytes, dstBytes);
long i = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/legal/zlib.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## zlib v1.3
## zlib v1.3.1

### zlib License
<pre>

Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@
*
* @compile TestMHUnloaded.java TestMHUnloadedHelper.java
* @run driver jdk.test.lib.helpers.ClassFileInstaller compiler.runtime.unloaded.TestMHUnloadedHelper
*
* @run main/othervm -Xbootclasspath/a:.
* -Xbatch -XX:-TieredCompilation -XX:CompileCommand=exclude,*::test
* -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation -XX:+PrintInlining
* compiler.runtime.unloaded.TestMHUnloaded
*
* @run main/othervm -Xbootclasspath/a:.
* -Xbatch -XX:-TieredCompilation -XX:CompileCommand=exclude,*::test
* -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation -XX:+PrintInlining
* -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
* compiler.runtime.unloaded.TestMHUnloaded
*/

Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/gc/arguments/TestG1HeapSizeFlags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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 @@ -28,7 +28,7 @@
* @bug 8006088
* @summary Tests argument processing for initial and maximum heap size for the G1 collector
* @key flag-sensitive
* @requires vm.gc.G1 & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @requires vm.gc.G1 & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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 @@ -27,7 +27,7 @@
* @test TestHeapFreeRatio
* @bug 8025661
* @summary Test parsing of -Xminf and -Xmaxf
* @requires vm.opt.x.Xminf == null & vm.opt.x.Xmaxf == null & vm.opt.MinHeapFreeRatio == null & vm.opt.MaxHeapFreeRatio == null
* @requires vm.opt.MinHeapFreeRatio == null & vm.opt.MaxHeapFreeRatio == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
Loading

4 comments on commit 8153097

@robm-openjdk
Copy link
Member

Choose a reason for hiding this comment

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

/skara tag jdk-22.0.2-ga

@openjdk
Copy link

@openjdk openjdk bot commented on 8153097 Jul 16, 2024

Choose a reason for hiding this comment

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

@robm-openjdk The tag jdk-22.0.2-ga was successfully created.

@robm-openjdk
Copy link
Member

Choose a reason for hiding this comment

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

/skara tag jdk-22.0.2+9

@openjdk
Copy link

@openjdk openjdk bot commented on 8153097 Jul 16, 2024

Choose a reason for hiding this comment

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

@robm-openjdk The tag jdk-22.0.2+9 was successfully created.

Please sign in to comment.