RFR: 8305425: Thread.isAlive0 doesn't need to call into the VM [v8]
    David Holmes 
    dholmes at openjdk.org
       
    Wed Apr  5 08:37:26 UTC 2023
    
    
  
> We have the strange situation where calling `t.isAlive()` on a `java.lang.Thread` `t`, will call into the VM (via `alive()` then `isAlive0()`) where the VM then examines the `eetop` field of `t` to extract its `JavaThread` pointer and compare it to null. We can simply read `eetop` directly in `Thread.alive()`:
> 
> boolean alive() {
>   return eetop != 0;
> } 
> 
> I also updated a comment in relation to `eetop`.
> 
> Testing: tiers 1-3
> 
> Thanks
David Holmes has updated the pull request incrementally with one additional commit since the last revision:
  Test tweaks
-------------
Changes:
  - all: https://git.openjdk.org/jdk/pull/13287/files
  - new: https://git.openjdk.org/jdk/pull/13287/files/8e662cdf..dbb9a91a
Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13287&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13287&range=06-07
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/13287.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13287/head:pull/13287
PR: https://git.openjdk.org/jdk/pull/13287
    
    
More information about the hotspot-runtime-dev
mailing list