RFR(s): 8222327: java_lang_Thread _thread_status_offset, remove pre 1.5 code paths

David Holmes david.holmes at oracle.com
Tue Apr 16 08:31:43 UTC 2019


Sorry didn't see this before reviewing v2 ...

On 16/04/2019 6:23 pm, Robbin Ehn wrote:
> Hi David,
> 
> On 4/15/19 10:23 PM, David Holmes wrote:
>> On 15/04/2019 9:34 pm, David Holmes wrote:
>>> On 15/04/2019 7:40 pm, Claes Redestad wrote:
>>>> Nice cleanup!
>>>>
>>>> Seems you could trivially do the same for _stackSize_offset
>>>
>>> Seems any of the checks for _foo_offset > 0 can be removed as all 
>>> fields must always be present.
>>
>> Except you'd have to be careful about access prior to initialization - 
>> for all of these "offset" fields.
> 
> Today we would return e.g. NULL or 0 which presumably show up when 
> asking for e.g. thread id. Most of them today do not have any checking 
> and I saw no issue in testing. So I don't think that is problem, 
> otherwise we should have problem today setting thread status could be 
> ignored.

If the offset is not initialized you will now crash (most likely) 
instead of getting a zero etc. This would only be a potential issue 
during VM initialization, and possibly only on initialization failures 
which makes this very hard to test.

Thanks,
David

> I sent out a v2.
> 
> Thanks, Robbin
> 
>>
>> David
>>
>>> David
>>>
>>>> Thanks!
>>>>
>>>> /Claes
>>>>
>>>> On 2019-04-15 11:04, Robbin Ehn wrote:
>>>>> Hi all, please review.
>>>>>
>>>>> Removing some dead code.
>>>>>
>>>>> Code:
>>>>> http://cr.openjdk.java.net/~rehn/8222327/webrev/
>>>>> Issue:
>>>>> https://bugs.openjdk.java.net/browse/JDK-8222327
>>>>>
>>>>> Passes t1-5.
>>>>>
>>>>> Thanks, Robbin


More information about the hotspot-runtime-dev mailing list