[9] RFR (S): 8157181: Compilers accept modification of final fields outside initializer methods

David Holmes david.holmes at oracle.com
Mon Jun 13 22:05:08 UTC 2016


<trimming>

On 13/06/2016 10:24 PM, Coleen Phillimore wrote:
> One more question.
>>>> Why have a global flag if it's an error?
>>>
>>> We are enforcing a rule that has not been enforced before. To deal
>>> with compatibility issues we have provided, as is customary for
>>> non-security issues, a flag that allows the enforcement to be turned
>>> off, if it causes a problem. (Though that is more likely needed for
>>> JDK 7/8 compatibility than for 9).
>>
>> thank you for clarifying that!
>
> Can we time-bomb this option, so we can remove it in 10?

I think it would have to follow a staged deprecation process: deprecate 
in 10 and remove in 11.

To some extent it depends on whether the systems that currently produce 
this non-compliant bytecode can be modified in the JDK 9 and 10 
timeframes so that the problem disappears. It may be this becomes a 
non-issue even before 9 GA ...

David


> thanks,
> Coleen
>
>>
>> Best regards,
>>
>>
>> Zoltan
>>
>>>
>>> David
>>>
>>>> Thanks,
>>>> Coleen
>>>>
>>>>
>>>>
>>>> On 6/10/16 1:40 PM, Zoltán Majó wrote:
>>>>> Hi Vladimir,
>>>>>
>>>>>
>>>>> On 06/10/2016 06:05 PM, Vladimir Ivanov wrote:
>>>>>>
>>>>>>> Please note an additional small change in rewriter.cpp:
>>>>>>>
>>>>>>> +if (!reverse) {
>>>>>>> // Check if any final field of the class given as parameter is
>>>>>>> modified
>>>>>>> // outside of initializer methods of the class. Fields that are
>>>>>>> modified
>>>>>>>    ...
>>>>>>> +}
>>>>>>>
>>>>>>> It's sufficient to check fields during rewriting (i.e., we're coming
>>>>>>> from Rewriter::rewrite_bytecodes()). We do not need to do the
>>>>>>> checks if
>>>>>>> the class has already been rewritten but we're reversing changes
>>>>>>> due to
>>>>>>> some failure that appeared during rewriting (in that case
>>>>>>> scan_method()
>>>>>>> is called from Rewriter::restore_bytecodes()).
>>>>>>
>>>>>> Ok.
>>>>>>
>>>>>>> Here is the updated webrev:
>>>>>>> http://cr.openjdk.java.net/~zmajo/8157181/webrev.11/
>>>>>>
>>>>>> Looks good.
>>>>>>
>>>>>> src/share/vm/runtime/globals.hpp
>>>>>>
>>>>>> +          "for classfile version >= 51")
>>>>>>
>>>>>> s/51/53/ (no need to send new webrev).
>>>>>
>>>>> OK, I've corrected the code in-situ (in webrev.11). I also have the
>>>>> JPRT results now, all tests pass.
>>>>>
>>>>> Thank you!
>>>>>
>>>>> Best regards,
>>>>>
>>>>>
>>>>> Zoltan
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>> Vladimir Ivanov
>>>>>
>>>>
>>
>


More information about the hotspot-dev mailing list