RFR: 8159590: Remove deprecated methods from jdk.internal.misc.VM

Claes Redestad claes.redestad at oracle.com
Thu Jun 16 22:20:40 UTC 2016


Hi David,

On 2016-06-16 23:11, David Holmes wrote:
> On 16/06/2016 10:52 PM, Claes Redestad wrote:
>> On 06/16/2016 02:48 PM, Chris Hegarty wrote:
>>> Apologies, you corrected me off-line,   TG.allowThreadSuspension calls
>>> VM.unsuspendSomeThreads ( which is a no-op ) and not VM.unsuspendThreads
>>> ( which I thought it did ).   In which case I am ok with the change.
>>
>> Ok, thanks! :-)
>
> Isn't this variable unused now:
>
>   63     boolean vmAllowSuspension;

Interestingly enough there are hooks in hotspot to compute offsets of 
various fields in j.l.ThreadGroup, so even though the vmAllowSuspension 
field is unused (on both sides), removing the field would require 
changing code in hotspot.

Tumbled down that rabbit hole to see how deep it goes, and was 
pleasantly surprised that it didn't go very far at all:

HS: http://cr.openjdk.java.net/~redestad/8159590/hotspot.02/
JDK: http://cr.openjdk.java.net/~redestad/8159590/jdk.02/

I think the cleanup on the vm side might be trivial enough to be wrapped 
into this change. What do you think?

Thanks!

/Claes

>
> Thanks,
> David
>
>>>
>>> I think we should add ‘forRemoval = true’ while here.
>>
>> I'm good with that, but does modifying the way in which something is
>> deprecated require a CCC request?
>>
>> /Claes
>>
>>>
>>> -Chris.
>>>
>>>
>>>> On 16 Jun 2016, at 13:39, Chris Hegarty <chris.hegarty at oracle.com>
>>>> wrote:
>>>>
>>>> On 15 Jun 2016, at 14:30, Claes Redestad <claes.redestad at oracle.com>
>>>> wrote:
>>>>> Hi,
>>>>>
>>>>> after VM.java was encapsulated and moved from sun.misc to
>>>>> jdk.internal.misc, the rationale for keeping a number of deprecated
>>>>> methods and constants no longer applies and these methods should be
>>>>> removed:
>>>>>
>>>>> Webrev: http://cr.openjdk.java.net/~redestad/8159590/webrev.01/
>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8159590
>>>> I had forgotten that there was a public API, ThreadGroup, that
>>>> exposed some
>>>> of this functionality.  Sadly I think that we may have to keep this,
>>>> for now, and
>>>> remove it in 10.
>>>>
>>>> ThreadGroup::allowThreadSuspension should, however, have its
>>>> @Deprecated
>>>> annotation updated with ‘forRemoval = true’, then removed early in 10.
>>>>
>>>> I can’t remember if this was on Stuarts list or not, but I think it
>>>> is ok to do it
>>>> separately anyway.
>>>>
>>>> -Chris.
>>


More information about the core-libs-dev mailing list