RFR (XS): 8066497: Update c.o.j.t.ByteCodeLoader to be able really reload given class

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Dec 11 22:04:20 UTC 2014


Pavel,

I am resending it to whole hotspot so you can get more help/explanations.

Thanks,
Vladimir

On 12/10/14 4:03 AM, Pavel Chistyakov wrote:
> Hi David,
>
> Thanks for review.
>
> The intent was:
>
>   * be able to get */new/* instance of Class w/ given name and given bytecode for every /*new*/ instance of
>     ByteCodeLoader even if this class was already loaded by parent loader. For this reason, I overrided loadClass to
>     break delegation to parent loader for given className;
>   * make single class definition for ByteCodeLoader instance. Here holder field appears and DCL for it's thread safe
>     initialization.
>
>
> -------------
> Pavel
>
> On 09.12.2014 23:49, David Chase wrote:
>> I agree with your changes to loadClass, but I am not sure that this will allow you to redefine an existing class.  My understanding of how this would work is that it will allow you re-obtain the class that was already loaded (but not to fail at this).  Actually redefining a class requires use of JVMTI (or so I think).
>>
>> Was that your intent?
>>
>> David
>>
>>
>> On 2014-12-09, at 11:50 AM, Pavel Chistyakov<pavel.chistyakov at oracle.com>  wrote:
>>
>>> Hi all,
>>>
>>> please review changes for:https://bugs.openjdk.java.net/browse/JDK-8066497
>>> webrev:http://cr.openjdk.java.net/~iignatyev/pchistyakov/8066497/webrev.00/  <http://cr.openjdk.java.net/%7Eiignatyev/pchistyakov/8066497/webrev.00/>
>>>
>>> Problem:
>>> ByteCodeLoader allows one to load class with given name from existing bytecode. But if this class is already loaded by e.g. system classloader it cannot be redefined using another bytecode array because of delegation of loadClass call to parent classloader.
>>>
>>> Solution:
>>> override loadClass to break delegation for given className.
>>>
>>> Testing: manual
>>>
>>> -------------------
>>> Thanks,
>>> Pavel
>


More information about the hotspot-dev mailing list