RFR: 8188102: [JVMCI] Convert special JVMCI oops in nmethod to jweak values
doug.simon at oracle.com
Thu Nov 2 07:37:31 UTC 2017
> On 2 Nov 2017, at 04:47, Kim Barrett <kim.barrett at oracle.com> wrote:
>> On Nov 1, 2017, at 5:10 PM, Doug Simon <doug.simon at oracle.com> wrote:
>>> On 1 Nov 2017, at 18:57, Kim Barrett <kim.barrett at oracle.com> wrote:
>>>> On Nov 1, 2017, at 5:44 AM, Erik Österlund <erik.osterlund at oracle.com> wrote:
>>>> Hi Kim,
>>>> On 2017-11-01 06:03, Kim Barrett wrote:
>>>>>> On Oct 30, 2017, at 7:14 AM, Doug Simon <doug.simon at oracle.com> wrote:
>>>> JNIHandles::resolve with G1 should conditionally enqueue the oops if the SATB queue is activated, which it will not be after marking terminated. At this point, marking should have terminated already, and hence the resolve will not change the liveness of the oop. So I don't quite see how the resolve will change the oop to live here. Am I missing something?
>>> Does this nmethod pass get run during young collections? If not, then maybe you are right that it doesn’t matter.
>>> But I still think that a cleanup pass that is based on using weak references like this should just be properly ordered
>>> wrto weak reference processing, as it presumably already was. In which case the resolve and can_unload is
>>> effectively useless; either the jweak has been cleared and we won’t reach this clause, or the jweak has not been
>>> cleared because the referent is still live, in which case can_unload will always return false and there was no point
>>> in calling it.
>> I agree. As stated previously, my (defensive) code is based on assuming that nmethod unloading might happen before reference processing. If it never/rarely happens, then your suggested change is the right one. I did some extra testing and never saw it happen. Based on that, I'd like to adopt your solution. In the worst case, nmethod unloading will be delayed one full GC cycle if nmethod unloading precedes reference processing.
>> I've created another rev based on this:
> This looks good.
Can I please get sign off from someone in the compiler team. Thanks.
More information about the hotspot-gc-dev