Skip to content

Commit e6c3ebe

Browse files
committed
8374145: Remove legacy locking remnants from markWord
Reviewed-by: aboldtch, kbarrett, coleenp
1 parent 3579c75 commit e6c3ebe

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ uint ShenandoahHeap::get_object_age(oop obj) {
344344
}
345345
if (w.has_monitor()) {
346346
w = w.monitor()->header();
347-
} else if (w.is_being_inflated() || w.has_displaced_mark_helper()) {
348-
// Informs caller that we aren't able to determine the age
349-
return markWord::max_age + 1; // sentinel
350347
}
351348
assert(w.age() <= markWord::max_age, "Impossible!");
352349
return w.age();

src/hotspot/share/oops/markWord.hpp

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@
6060
// [ptr | 10] monitor inflated lock (header is swapped out, UseObjectMonitorTable == false)
6161
// [header | 10] monitor inflated lock (UseObjectMonitorTable == true)
6262
// [ptr | 11] marked used to mark an object
63-
// [0 ............ 0| 00] inflating inflation in progress (stack-locking in use)
64-
//
65-
// We assume that stack/thread pointers have the lowest two bits cleared.
66-
//
67-
// - INFLATING() is a distinguished markword value of all zeros that is
68-
// used when inflating an existing stack-lock into an ObjectMonitor.
69-
// See below for is_being_inflated() and INFLATING().
7063

7164
class BasicLock;
7265
class ObjectMonitor;
@@ -173,19 +166,6 @@ class markWord {
173166
return (mask_bits(value(), lock_mask_in_place) == unlocked_value);
174167
}
175168

176-
// Special temporary state of the markWord while being inflated.
177-
// Code that looks at mark outside a lock need to take this into account.
178-
bool is_being_inflated() const { return (value() == 0); }
179-
180-
// Distinguished markword value - used when inflating over
181-
// an existing stack-lock. 0 indicates the markword is "BUSY".
182-
// Lockword mutators that use a LD...CAS idiom should always
183-
// check for and avoid overwriting a 0 value installed by some
184-
// other thread. (They should spin or block instead. The 0 value
185-
// is transient and *should* be short-lived).
186-
// Fast-locking does not use INFLATING.
187-
static markWord INFLATING() { return zero(); } // inflate-in-progress
188-
189169
// Should this header be preserved during GC?
190170
bool must_be_preserved() const {
191171
return (!is_unlocked() || !has_no_hash());
@@ -226,16 +206,7 @@ class markWord {
226206
tmp |= ((hash & hash_mask) << hash_shift);
227207
return markWord(tmp);
228208
}
229-
// it is only used to be stored into BasicLock as the
230-
// indicator that the lock is using heavyweight monitor
231-
static markWord unused_mark() {
232-
return markWord(marked_value);
233-
}
234-
// the following two functions create the markWord to be
235-
// stored into object header, it encodes monitor info
236-
static markWord encode(BasicLock* lock) {
237-
return from_pointer(lock);
238-
}
209+
239210
static markWord encode(ObjectMonitor* monitor) {
240211
assert(!UseObjectMonitorTable, "Locking with OM table does not use markWord for monitors");
241212
uintptr_t tmp = (uintptr_t) monitor;

0 commit comments

Comments
 (0)