Skip to content

Commit 3f517c6

Browse files
committed
Merge
2 parents 5cd9439 + 227d57e commit 3f517c6

82 files changed

Lines changed: 1541 additions & 670 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.hgtags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,4 @@ e84d8379815ba0d3e50fb096d28c25894cb50b8c jdk-14+18
596596
c16ac7a2eba4e73cb4f7ee9294dd647860eebff0 jdk-14+21
597597
83810b7d12e7ff761ad3dd91f323a22dad96f108 jdk-14+22
598598
15936b142f86731afa4b1a2c0fe4a01e806c4944 jdk-14+23
599+
438337c846fb071900ddb6922bddf8b3e895a514 jdk-14+24

make/data/fontconfig/aix.fontconfig.properties

Lines changed: 94 additions & 94 deletions
Large diffs are not rendered by default.

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ void MacroAssembler::rtm_inflated_locking(Register objReg, Register boxReg, Regi
15321532
Label L_rtm_retry, L_decrement_retry, L_on_abort;
15331533
int owner_offset = OM_OFFSET_NO_MONITOR_VALUE_TAG(owner);
15341534

1535-
// Without cast to int32_t a movptr will destroy r10 which is typically obj
1535+
// Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
15361536
movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value()));
15371537
movptr(boxReg, tmpReg); // Save ObjectMonitor address
15381538

@@ -1602,11 +1602,11 @@ void MacroAssembler::rtm_inflated_locking(Register objReg, Register boxReg, Regi
16021602

16031603
#endif // INCLUDE_RTM_OPT
16041604

1605-
// Fast_Lock and Fast_Unlock used by C2
1605+
// fast_lock and fast_unlock used by C2
16061606

16071607
// Because the transitions from emitted code to the runtime
16081608
// monitorenter/exit helper stubs are so slow it's critical that
1609-
// we inline both the stack-locking fast-path and the inflated fast path.
1609+
// we inline both the stack-locking fast path and the inflated fast path.
16101610
//
16111611
// See also: cmpFastLock and cmpFastUnlock.
16121612
//
@@ -1615,7 +1615,7 @@ void MacroAssembler::rtm_inflated_locking(Register objReg, Register boxReg, Regi
16151615
// option would be to emit TrySlowEnter and TrySlowExit methods
16161616
// at startup-time. These methods would accept arguments as
16171617
// (rax,=Obj, rbx=Self, rcx=box, rdx=Scratch) and return success-failure
1618-
// indications in the icc.ZFlag. Fast_Lock and Fast_Unlock would simply
1618+
// indications in the icc.ZFlag. fast_lock and fast_unlock would simply
16191619
// marshal the arguments and emit calls to TrySlowEnter and TrySlowExit.
16201620
// In practice, however, the # of lock sites is bounded and is usually small.
16211621
// Besides the call overhead, TrySlowEnter and TrySlowExit might suffer
@@ -1634,8 +1634,8 @@ void MacroAssembler::rtm_inflated_locking(Register objReg, Register boxReg, Regi
16341634
//
16351635
// TODO:
16361636
//
1637-
// * Arrange for C2 to pass "Self" into Fast_Lock and Fast_Unlock in one of the registers (scr).
1638-
// This avoids manifesting the Self pointer in the Fast_Lock and Fast_Unlock terminals.
1637+
// * Arrange for C2 to pass "Self" into fast_lock and fast_unlock in one of the registers (scr).
1638+
// This avoids manifesting the Self pointer in the fast_lock and fast_unlock terminals.
16391639
// Given TLAB allocation, Self is usually manifested in a register, so passing it into
16401640
// the lock operators would typically be faster than reifying Self.
16411641
//
@@ -1661,14 +1661,14 @@ void MacroAssembler::rtm_inflated_locking(Register objReg, Register boxReg, Regi
16611661
// * use jccb and jmpb instead of jcc and jmp to improve code density.
16621662
// But beware of excessive branch density on AMD Opterons.
16631663
//
1664-
// * Both Fast_Lock and Fast_Unlock set the ICC.ZF to indicate success
1665-
// or failure of the fast-path. If the fast-path fails then we pass
1666-
// control to the slow-path, typically in C. In Fast_Lock and
1667-
// Fast_Unlock we often branch to DONE_LABEL, just to find that C2
1664+
// * Both fast_lock and fast_unlock set the ICC.ZF to indicate success
1665+
// or failure of the fast path. If the fast path fails then we pass
1666+
// control to the slow path, typically in C. In fast_lock and
1667+
// fast_unlock we often branch to DONE_LABEL, just to find that C2
16681668
// will emit a conditional branch immediately after the node.
16691669
// So we have branches to branches and lots of ICC.ZF games.
16701670
// Instead, it might be better to have C2 pass a "FailureLabel"
1671-
// into Fast_Lock and Fast_Unlock. In the case of success, control
1671+
// into fast_lock and fast_unlock. In the case of success, control
16721672
// will drop through the node. ICC.ZF is undefined at exit.
16731673
// In the case of failure, the node will branch directly to the
16741674
// FailureLabel
@@ -1813,22 +1813,21 @@ void MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmpReg
18131813
movptr(Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), scrReg);
18141814
xorptr(boxReg, boxReg); // set icc.ZFlag = 1 to indicate success
18151815

1816-
// If the CAS fails we can either retry or pass control to the slow-path.
1816+
// If the CAS fails we can either retry or pass control to the slow path.
18171817
// We use the latter tactic.
18181818
// Pass the CAS result in the icc.ZFlag into DONE_LABEL
18191819
// If the CAS was successful ...
18201820
// Self has acquired the lock
18211821
// Invariant: m->_recursions should already be 0, so we don't need to explicitly set it.
18221822
// Intentional fall-through into DONE_LABEL ...
18231823
#else // _LP64
1824-
// It's inflated
1824+
// It's inflated and we use scrReg for ObjectMonitor* in this section.
18251825
movq(scrReg, tmpReg);
18261826
xorq(tmpReg, tmpReg);
1827-
18281827
lock();
18291828
cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
18301829
// Unconditionally set box->_displaced_header = markWord::unused_mark().
1831-
// Without cast to int32_t movptr will destroy r10 which is typically obj.
1830+
// Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
18321831
movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value()));
18331832
// Intentional fall-through into DONE_LABEL ...
18341833
// Propagate ICC.ZF from CAS above into DONE_LABEL.
@@ -1844,9 +1843,9 @@ void MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmpReg
18441843
bind(DONE_LABEL);
18451844

18461845
// At DONE_LABEL the icc ZFlag is set as follows ...
1847-
// Fast_Unlock uses the same protocol.
1846+
// fast_unlock uses the same protocol.
18481847
// ZFlag == 1 -> Success
1849-
// ZFlag == 0 -> Failure - force control through the slow-path
1848+
// ZFlag == 0 -> Failure - force control through the slow path
18501849
}
18511850

18521851
// obj: object to unlock
@@ -1855,7 +1854,7 @@ void MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmpReg
18551854
//
18561855
// Some commentary on balanced locking:
18571856
//
1858-
// Fast_Lock and Fast_Unlock are emitted only for provably balanced lock sites.
1857+
// fast_lock and fast_unlock are emitted only for provably balanced lock sites.
18591858
// Methods that don't have provably balanced locking are forced to run in the
18601859
// interpreter - such methods won't be compiled to use fast_lock and fast_unlock.
18611860
// The interpreter provides two properties:
@@ -1876,7 +1875,7 @@ void MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmpReg
18761875
// should not be unlocked by "normal" java-level locking and vice-versa. The specification
18771876
// doesn't specify what will occur if a program engages in such mixed-mode locking, however.
18781877
// Arguably given that the spec legislates the JNI case as undefined our implementation
1879-
// could reasonably *avoid* checking owner in Fast_Unlock().
1878+
// could reasonably *avoid* checking owner in fast_unlock().
18801879
// In the interest of performance we elide m->Owner==Self check in unlock.
18811880
// A perfectly viable alternative is to elide the owner check except when
18821881
// Xcheck:jni is enabled.
@@ -1941,7 +1940,7 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR
19411940
// a costly MEMBAR or CAS. See synchronizer.cpp for details on how
19421941
// we detect and recover from the race that the 1-0 exit admits.
19431942
//
1944-
// Conceptually Fast_Unlock() must execute a STST|LDST "release" barrier
1943+
// Conceptually fast_unlock() must execute a STST|LDST "release" barrier
19451944
// before it STs null into _owner, releasing the lock. Updates
19461945
// to data protected by the critical section must be visible before
19471946
// we drop the lock (and thus before any other thread could acquire
@@ -1990,6 +1989,7 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR
19901989
movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq)));
19911990
orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList)));
19921991
jccb (Assembler::notZero, CheckSucc);
1992+
// Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
19931993
movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), (int32_t)NULL_WORD);
19941994
jmpb (DONE_LABEL);
19951995

@@ -1998,13 +1998,14 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR
19981998
bind (CheckSucc);
19991999

20002000
// The following optional optimization can be elided if necessary
2001-
// Effectively: if (succ == null) goto SlowPath
2001+
// Effectively: if (succ == null) goto slow path
20022002
// The code reduces the window for a race, however,
20032003
// and thus benefits performance.
20042004
cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), (int32_t)NULL_WORD);
20052005
jccb (Assembler::zero, LGoSlowPath);
20062006

20072007
xorptr(boxReg, boxReg);
2008+
// Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
20082009
movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), (int32_t)NULL_WORD);
20092010

20102011
// Memory barrier/fence
@@ -2039,7 +2040,7 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR
20392040
// If that didn't work, then another thread grabbed the
20402041
// lock so we're done (and exit was a success).
20412042
jccb (Assembler::notEqual, LSuccess);
2042-
// Intentional fall-through into slow-path
2043+
// Intentional fall-through into slow path
20432044

20442045
bind (LGoSlowPath);
20452046
orl (boxReg, 1); // set ICC.ZF=0 to indicate failure

src/hotspot/os/bsd/os_bsd.cpp

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3205,14 +3205,14 @@ int os::active_processor_count() {
32053205
}
32063206

32073207
#ifdef __APPLE__
3208-
uint os::processor_id() {
3209-
static volatile int* volatile apic_to_cpu_mapping = NULL;
3210-
static volatile int next_cpu_id = 0;
3208+
static volatile int* volatile apic_to_processor_mapping = NULL;
3209+
static volatile int next_processor_id = 0;
32113210

3212-
volatile int* mapping = OrderAccess::load_acquire(&apic_to_cpu_mapping);
3211+
static inline volatile int* get_apic_to_processor_mapping() {
3212+
volatile int* mapping = OrderAccess::load_acquire(&apic_to_processor_mapping);
32133213
if (mapping == NULL) {
32143214
// Calculate possible number space for APIC ids. This space is not necessarily
3215-
// in the range [0, number_of_cpus).
3215+
// in the range [0, number_of_processors).
32163216
uint total_bits = 0;
32173217
for (uint i = 0;; ++i) {
32183218
uint eax = 0xb; // Query topology leaf
@@ -3238,33 +3238,39 @@ uint os::processor_id() {
32383238
mapping[i] = -1;
32393239
}
32403240

3241-
if (!Atomic::replace_if_null(mapping, &apic_to_cpu_mapping)) {
3241+
if (!Atomic::replace_if_null(mapping, &apic_to_processor_mapping)) {
32423242
FREE_C_HEAP_ARRAY(int, mapping);
3243-
mapping = OrderAccess::load_acquire(&apic_to_cpu_mapping);
3243+
mapping = OrderAccess::load_acquire(&apic_to_processor_mapping);
32443244
}
32453245
}
32463246

3247+
return mapping;
3248+
}
3249+
3250+
uint os::processor_id() {
3251+
volatile int* mapping = get_apic_to_processor_mapping();
3252+
32473253
uint eax = 0xb;
32483254
uint ebx;
32493255
uint ecx = 0;
32503256
uint edx;
32513257

3252-
asm ("cpuid\n\t" : "+a" (eax), "+b" (ebx), "+c" (ecx), "+d" (edx) : );
3258+
__asm__ ("cpuid\n\t" : "+a" (eax), "+b" (ebx), "+c" (ecx), "+d" (edx) : );
32533259

32543260
// Map from APIC id to a unique logical processor ID in the expected
32553261
// [0, num_processors) range.
32563262

32573263
uint apic_id = edx;
3258-
int cpu_id = Atomic::load(&mapping[apic_id]);
3264+
int processor_id = Atomic::load(&mapping[apic_id]);
32593265

3260-
while (cpu_id < 0) {
3266+
while (processor_id < 0) {
32613267
if (Atomic::cmpxchg(-2, &mapping[apic_id], -1)) {
3262-
Atomic::store(Atomic::add(1, &next_cpu_id) - 1, &mapping[apic_id]);
3268+
Atomic::store(Atomic::add(1, &next_processor_id) - 1, &mapping[apic_id]);
32633269
}
3264-
cpu_id = Atomic::load(&mapping[apic_id]);
3270+
processor_id = Atomic::load(&mapping[apic_id]);
32653271
}
32663272

3267-
return (uint)cpu_id;
3273+
return (uint)processor_id;
32683274
}
32693275
#endif
32703276

src/hotspot/share/classfile/systemDictionary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ void SystemDictionary::double_lock_wait(Handle lockObject, TRAPS) {
540540
assert(calledholdinglock,"must hold lock for notify");
541541
assert((lockObject() != _system_loader_lock_obj && !is_parallelCapable(lockObject)), "unexpected double_lock_wait");
542542
ObjectSynchronizer::notifyall(lockObject, THREAD);
543-
intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD);
543+
intx recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD);
544544
SystemDictionary_lock->wait();
545545
SystemDictionary_lock->unlock();
546546
ObjectSynchronizer::reenter(lockObject, recursions, THREAD);

src/hotspot/share/gc/epsilon/epsilonHeap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ void EpsilonHeap::do_full_collection(bool clear_all_soft_refs) {
290290
collect(gc_cause());
291291
}
292292

293-
void EpsilonHeap::safe_object_iterate(ObjectClosure *cl) {
294-
_space->safe_object_iterate(cl);
293+
void EpsilonHeap::object_iterate(ObjectClosure *cl) {
294+
_space->object_iterate(cl);
295295
}
296296

297297
void EpsilonHeap::print_on(outputStream *st) const {

src/hotspot/share/gc/epsilon/epsilonHeap.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ class EpsilonHeap : public CollectedHeap {
103103
virtual void do_full_collection(bool clear_all_soft_refs);
104104

105105
// Heap walking support
106-
virtual void safe_object_iterate(ObjectClosure* cl);
107-
virtual void object_iterate(ObjectClosure* cl) {
108-
safe_object_iterate(cl);
109-
}
106+
virtual void object_iterate(ObjectClosure* cl);
110107

111108
// Object pinning support: every object is implicitly pinned
112109
virtual bool supports_object_pinning() const { return true; }

src/hotspot/share/gc/g1/g1CollectedHeap.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,10 +1166,6 @@ class G1CollectedHeap : public CollectedHeap {
11661166
// Iterate over all objects, calling "cl.do_object" on each.
11671167
virtual void object_iterate(ObjectClosure* cl);
11681168

1169-
virtual void safe_object_iterate(ObjectClosure* cl) {
1170-
object_iterate(cl);
1171-
}
1172-
11731169
// Iterate over heap regions, in address order, terminating the
11741170
// iteration early if the "do_heap_region" method returns "true".
11751171
void heap_region_iterate(HeapRegionClosure* blk) const;

src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ class ParallelScavengeHeap : public CollectedHeap {
213213
size_t unsafe_max_tlab_alloc(Thread* thr) const;
214214

215215
void object_iterate(ObjectClosure* cl);
216-
void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); }
217216

218217
HeapWord* block_start(const void* addr) const;
219218
bool block_is_obj(const HeapWord* addr) const;

src/hotspot/share/gc/shared/collectedHeap.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ class CollectedHeap : public CHeapObj<mtInternal> {
387387
// Iterate over all objects, calling "cl.do_object" on each.
388388
virtual void object_iterate(ObjectClosure* cl) = 0;
389389

390-
// Similar to object_iterate() except iterates only
391-
// over live objects.
392-
virtual void safe_object_iterate(ObjectClosure* cl) = 0;
393-
394390
// Returns the longest time (in ms) that has elapsed since the last
395391
// time that any part of the heap was examined by a garbage collection.
396392
virtual jlong millis_since_last_gc() = 0;

0 commit comments

Comments
 (0)