[master] RFR: Simplify stable_mark() routine [v3]
Roman Kennke
rkennke at openjdk.java.net
Thu Apr 14 09:47:42 UTC 2022
> The code in ObjectSynchronizer::stable_mark() is a bit over-complicated: it has a 'fast' path (which really isn't a fast-path, because the really-fast path is already in the various oopDesc::klass() methods), and for the slow-path loop dives into ObjectSynchronizer::safe_load_mark(). This change proposes to remove the stable_mark() method, and rename safe_load_mark() to stable_mark() instead.
>
> I also propose a small improvement: we can use read_stable_mark() to deal with INFLATING mark properly, and handle the remaining cases in the loop: monitor and stack-locked are the most common - deal with them first. Stack-locked can safely access the mark when current thread is owning thread of the lock - avoid CASing INFLATING into the header in this case. Neutral and Marked cases go last, because they should not be very common (neutral is already caught in oopDesc::klass() variants, marked should only happen during full GCs by GC internal code).
>
> Testing:
> - [x] tier1
> - [x] tier2
> - [x] tier3
> - [x] tier4
Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
Replace guarantee with assert
-------------
Changes:
- all: https://git.openjdk.java.net/lilliput/pull/46/files
- new: https://git.openjdk.java.net/lilliput/pull/46/files/36eebf49..2f059418
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=lilliput&pr=46&range=02
- incr: https://webrevs.openjdk.java.net/?repo=lilliput&pr=46&range=01-02
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/lilliput/pull/46.diff
Fetch: git fetch https://git.openjdk.java.net/lilliput pull/46/head:pull/46
PR: https://git.openjdk.java.net/lilliput/pull/46
More information about the lilliput-dev
mailing list