RFR(S) : 8011971 : WB API doesn't accept j.l.reflect.Constructor

Igor Ignatyev igor.ignatyev at oracle.com
Sun Apr 14 10:04:24 PDT 2013


> Please, do. Especially for methods and tests classes.
i'm really not very good in code's commentation, but i did my best.

in addition to changes according to your suggestions, i added ability to 
specify comp_level in WB::makeMethodNotCompilable() and found some 
strange behavior of 'CompilationPolicy::can_be_compiled':

124   if (comp_level == CompLevel_all) {
125     return !m->is_not_compilable(CompLevel_simple) && 
!m->is_not_compilable(CompLevel_full_optimization);
126   }

if method is 'not_compilable' in C1 or C2, method 'can_be_compiled' will 
return false for 'CompLevel_all' even it is compilable in another level. 
is it expected behavior or it is a bug?

updated webrev: http://cr.openjdk.java.net/~iignatyev/8011971/webrev.01/

Best regards,
Igor Ignatyev

On 04/13/2013 12:59 AM, Vladimir Kozlov wrote:
> On 4/12/13 1:14 PM, Igor Ignatyev wrote:
>>  > Could you explain why you need j.l.reflect.Constructor in WB compiler
>>  > tests? As java coding exercise it may be good (I am lost in it).
>> But how
>>  > it helps to JIT compiler testing?
>
> Here is a good comment ;) :
>
>> we have plan to create replacement of current CTW. main goal is to make
>> available using CTW in product build. but it must be equals to current
>> implementation in terms of functionality. since CTW compile constructor,
>> we also must to compile constructor. so we need api for that.
>>
>>  > Do you know about 'comments' in a code? :)
>> yes. i know, but i think that all is clear and self-documented :)
>> but if you insist, i can add javadoc to all public and protected
>> methods/fields.
>
> Please, do. Especially for methods and tests classes.
>
>>
>>  > Why do you need to set dontinline in costructor?
>>  > Would be better explicitly call new method from CompilerWhiteBoxTest
>>  > class when needed:
>>  >
>>  > setDontInlineMethod() {
>>  >    WHITE_BOX.testSetDontInlineMethod(method, true);
>>  > }
>> i need to set dontinline in constructor to prevent inlining of 'method'
>> into others methods (fix for 8008211).
>
> I meant, why you need to do it in 'super' constructor?
> You can call setDontInlineMethod() in local constructor. Test methods
> will be executed only after constructor executed.
>
> Thanks,
> Vladimir
>
>>
>> Best regards,
>> Igor Ignatyev
>>
>> On 04/12/2013 11:39 PM, Vladimir Kozlov wrote:
>>> Igor,
>>>
>>> Could you explain why you need j.l.reflect.Constructor in WB compiler
>>> tests? As java coding exercise it may be good (I am lost in it). But how
>>> it helps to JIT compiler testing?
>>>
>>> Do you know about 'comments' in a code? :)
>>>
>>> Using argument 'true' say nothing what it does since the corresponding
>>> code is in different class file:
>>>
>>> +        super(testCase, true);
>>>
>>> Why do you need to set dontinline in costructor?
>>> Would be better explicitly call new method from CompilerWhiteBoxTest
>>> class when needed:
>>>
>>> setDontInlineMethod() {
>>>    WHITE_BOX.testSetDontInlineMethod(method, true);
>>> }
>>>
>>> Regards,
>>> Vladimir
>>>
>>> On 4/12/13 8:29 AM, Igor Ignatyev wrote:
>>>> Hi all,
>>>>
>>>> Please review patch.
>>>>
>>>> 1. changed signature of all methods where j.l.reflect.Method is used
>>>> 2. added tests which use j.l.reflect.Constructor
>>>>
>>>> webrev: http://cr.openjdk.java.net/~iignatyev/8011971/webrev.00/
>>>> jbs: https://jbs.oracle.com/bugs/browse/JDK-8011971


More information about the hotspot-compiler-dev mailing list