Unused code in prims/methodComparator

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Fri Feb 5 18:15:57 UTC 2016


Suspected that. :)
Nice archeology!

Thanks,
Serguei


On 2/5/16 06:26, Daniel D. Daugherty wrote:
> MethodComparator::methods_switchable() appears to be a day zero
> function added by Misha Dmitriev back on 2000.10.23.
>
>
> $ sgv src/share/vm/prims/methodComparator.cpp | grep 
> MethodComparator::methods_switchable
> 1.17
> 1.1     bool MethodComparator::methods_switchable(methodOop 
> old_method, methodOop new_method,
> 383 lines
> No id keywords (cm7)
>
> $ sp -r1.1 src/share/vm/prims/methodComparator.cpp
> src/share/vm/prims/SCCS/s.methodComparator.cpp:
>
> D 1.1 00/10/23 18:11:25 dmitriev 1 0    00366/00000/00000
> MRs:
> COMMENTS:
> Class redefinition support - comparing methods of
> class versions
>
> Dan
>
>
> On 2/4/16 8:30 PM, serguei.spitsyn at oracle.com wrote:
>> Hi Thomas,
>>
>> The function MethodComparator::methods_switchable() was not used even 
>> in the jdk 7.
>> I do not know the history of this function and why its usage was 
>> dropped.
>> Most likely, it was used initially as a part of the methods_EMCP() 
>> algorithm.
>> The SCCS history of the old changes was dropped when the repo was 
>> moved under the Mercurial control.
>>
>> It seems safe to just remove it.
>> We always can restore it from the hg history if necessary.
>>
>> Thanks,
>> Serguei
>>
>>
>> On 2/4/16 18:05, David Holmes wrote:
>>> HI Thomas,
>>>
>>> Ultimately this is part of JVMTI so adding the serviceability folk.
>>>
>>> On 20/01/2016 6:31 PM, Thomas Stüfe wrote:
>>>> Hi all,
>>>>
>>>> when investigating a warning about unchecked realloc() usage in
>>>> methodComparator.hpp, I found that the offending function
>>>> (BciMap::store_fragment_location) is not callable anymore.
>>>>
>>>> BciMap::store_fragment_location is called
>>>> by MethodComparator::methods_switchable, which is not called anywhere.
>>>>
>>>> Is there any reason we should keep this?
>>>
>>> Certainly seems to be dead code. Unclear when/why redefinition 
>>> dropped the notion of "switchable".
>>>
>>> Thanks,
>>> David
>>>
>>>> Regards, Thomas
>>>>
>>
>



More information about the hotspot-runtime-dev mailing list