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

Zoltán Majó zoltan.majo at oracle.com
Fri Jun 10 15:53:17 UTC 2016


Hi Vladimir,


On 06/10/2016 05:20 PM, Zoltán Majó wrote:
> [...]
>
> Here is the updated webrev:
> http://cr.openjdk.java.net/~zmajo/8157181/webrev.10/
>

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()).

Here is the updated webrev:
http://cr.openjdk.java.net/~zmajo/8157181/webrev.11/

JPRT is in progress.

Thank you and best regards,


Zoltan

> JPRT is in progress.
>
> Thank you and best regards,
>
>
> Zoltan
>
>>
>> Best regards,
>> Vladimir Ivanov
>



More information about the hotspot-compiler-dev mailing list