[lilliput-jdk17u:lilliput] RFR: 8308956: [Lilliput/JDK17] Fix some object initialization paths

Aleksey Shipilev shade at openjdk.org
Sat May 27 10:06:47 UTC 2023


On Fri, 26 May 2023 12:35:33 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> In some object initialization paths I got the conditions wrong, especial wrt to biased-locking. Let's fix them.
> 
> Testing:
>  - [x] tier1
>  - [x] tier2

Changes requested by shade (Reviewer).

Changes requested by shade (Reviewer).

Looks fine.

Also in `bytecodeInterpreter.cpp`:


1958 #ifdef _LP64
1959               oopDesc::release_set_mark(result, ik->prototype_header());
1960 #else
1961               obj->set_mark(markWord::prototype());

1962               obj->set_klass(ik);
1963 #endif

src/hotspot/share/cds/heapShared.cpp line 429:

> 427:   {
> 428:     // This is copied from MemAllocator::finish
> 429:     if (UseBiasedLocking || UseCompactObjectHeaders) {

This misses klass store on `UseBiasedLocking` path.

src/hotspot/share/gc/shared/memAllocator.cpp line 388:

> 386:   assert(mem != NULL, "NULL object pointer");
> 387:   if (UseBiasedLocking) {
> 388:     oopDesc::set_mark(mem, _klass->prototype_header());

Not enough, I think, because there is a `oopDesc::set_mark` in the block below that would overwrite it.

-------------

PR Review: https://git.openjdk.org/lilliput-jdk17u/pull/28#pullrequestreview-1446180748
PR Review: https://git.openjdk.org/lilliput-jdk17u/pull/28#pullrequestreview-1446379853
Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/lilliput-jdk17u/pull/28#pullrequestreview-1447024723
PR Comment: https://git.openjdk.org/lilliput-jdk17u/pull/28#issuecomment-1564535169
PR Review Comment: https://git.openjdk.org/lilliput-jdk17u/pull/28#discussion_r1206887145
PR Review Comment: https://git.openjdk.org/lilliput-jdk17u/pull/28#discussion_r1206745051


More information about the lilliput-dev mailing list