Skip to content

Add j.l.Thread.setCurrentThread() inline & fast jni natives - #15428

Merged
gacholio merged 1 commit into
eclipse-openj9:masterfrom
JasonFengJ9:loomfastjni
Jun 30, 2022
Merged

Add j.l.Thread.setCurrentThread() inline & fast jni natives#15428
gacholio merged 1 commit into
eclipse-openj9:masterfrom
JasonFengJ9:loomfastjni

Conversation

@JasonFengJ9

@JasonFengJ9 JasonFengJ9 commented Jun 24, 2022

Copy link
Copy Markdown
Member

Add j.l.Thread.setCurrentThread() inline & fast jni natives.

related #15176

FYI @tajila

Signed-off-by: Jason Feng fengj@ca.ibm.com

@JasonFengJ9 JasonFengJ9 added comp:vm jdk19 project:loom Used to track Project Loom related work labels Jun 24, 2022
@JasonFengJ9
JasonFengJ9 requested a review from gacholio June 24, 2022 20:09
Comment thread runtime/vm/BytecodeInterpreter.hpp Outdated
Comment thread runtime/vm/BytecodeInterpreter.hpp Outdated
@gacholio

Copy link
Copy Markdown
Contributor

@amicic @dmitripivkine This is the first time we've modified the threadObject field of J9VMThread after initial creation. Are there any barriers required?

@gacholio

Copy link
Copy Markdown
Contributor

Please add a comment describing why the liveness check can be omitted. I also want to hear back from the GC guys before merging - we're changing a thread root field from another thread, so there may be barrier implications.

@JasonFengJ9

Copy link
Copy Markdown
Member Author

Please add a comment describing why the liveness check can be omitted

Missed the initial request for the comment, added it.

@amicic

amicic commented Jun 29, 2022

Copy link
Copy Markdown
Contributor

I don't think we need a barrier on (strong) roots mutation, even if they are done by another thread.

For some concurrent GCs, based on card dirtying barrier, like Concurrent Mark in Gencon and Concurrent Scavenge, we will rescan thread roots at the final STW phase and pick up those mutations.
For others, we will not rescan, like SATB (Snapshot-At-The-Beginning) based ones, but that's because roots are there to determine only the snapshot of live objects as seen at the start of GC and mutation of roots after initial scan are irrelevant (there are other mechanisms that maintain overall GC consistency, that care about heap object mutations and newly allocated objects)

@gacholio

Copy link
Copy Markdown
Contributor

jenkins compile win jdknext

@gacholio

Copy link
Copy Markdown
Contributor
14:57:00  jclse.def : error LNK2001: unresolved external symbol Java_java_lang_Thread_setCurrentThread

Comment thread runtime/vm/BytecodeInterpreter.hpp Outdated
@gacholio

Copy link
Copy Markdown
Contributor

exports.cmake need updating as well.

Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@JasonFengJ9

Copy link
Copy Markdown
Member Author

exports.cmake need updating as well.

Fixed, please re-launch the PR build.

@gacholio

Copy link
Copy Markdown
Contributor

jenkins compile win,xlinux jdknext

@gacholio

Copy link
Copy Markdown
Contributor

jenkins compile zlinux jdk8

@gacholio
gacholio merged commit 2d9318c into eclipse-openj9:master Jun 30, 2022
@JasonFengJ9
JasonFengJ9 deleted the loomfastjni branch June 30, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:vm jdk19 project:loom Used to track Project Loom related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants