Integrated: 8261585: Restore HandleArea used in Deoptimization::uncommon_trap

Hui Shi hshi at openjdk.java.net
Sat Feb 13 02:50:42 UTC 2021


On Thu, 11 Feb 2021 14:42:59 GMT, Hui Shi <hshi at openjdk.org> wrote:

> Add HandleMark in Deoptimization::uncommon_trap before Deoptimization::fetch_unroll_info_helper, avoid reference hold in HandleArea increase object lifetime. Then object lifetime will be consistent with/without uncommon trap.
> 
> For test case in commit, WeakReference is expected cleared after GC, but it fails with option "-XX:-Inline -XX:-TieredCompilation -XX:CompileCommand=compileonly,UncommonTrapLeak.foo -XX:CompileThreshold=100 -XX:-BackgroundCompilation". Reference's referent object is still alive after "foo" finish, because with uncommon trap, oops are recorded in HandleArea and HandleArea is not poped when uncommon trap process finish.
> 
> When Deoptimization::fetch_unroll_info_helper return, all oops in deoptimized frames are saved in Deoptimization::UnrollBlock or Thread data structure, HandleArea can be poped safely.
> 1. local and expression oops raw address is stored in vframeArrayElement _locals/_expressions as intptr
> 2. return value restore, raw oop recoreded in frame // (oop *)map->location(rax->as_VMReg());
> 3. exception object, raw oop recorded on Thread._exception_oop
> 
> In deoptimize blob entry, JRT_BLOCK_ENTRY(Deoptimization::fetch_unroll_info) has HandleMarkCleaner, HandleArea is restored after Deoptimization::fetch_unroll_info_helper finish. So it's also safe to add HandleMark in Deoptimization::uncommon_trap before fetch_unroll_info_helper.

This pull request has now been integrated.

Changeset: 95d73129
Author:    Hui Shi <hshi at openjdk.org>
Committer: Jie Fu <jiefu at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/95d73129
Stats:     64 lines in 2 files changed: 64 ins; 0 del; 0 mod

8261585: Restore HandleArea used in Deoptimization::uncommon_trap

Reviewed-by: coleenp, jiefu

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

PR: https://git.openjdk.java.net/jdk/pull/2526


More information about the hotspot-dev mailing list