RFR (XS): 8065134: Need WhiteBox::allocateCodeBlob(long, int) method to be implemented

David Holmes david.holmes at oracle.com
Fri Dec 5 03:50:06 UTC 2014


On 5/12/2014 1:08 PM, Chris Plummer wrote:
> Why not do it from java?
>
> public  long    allocateCodeBlob(long size, int type) {
>      allocateCodeBlob((int)size, type);
> }
>
> It will make it a bit more obvious to the caller what is going on,
> rather than letting hidden C++ code implicitly truncate it.

Why is this even needed in the first place? It is simply an invitation 
for errors if you pass a long where only an int is expected. The caller 
of the API needs to know they should be passing an int.

David

> Chris
>
> On 12/4/14 5:23 PM, Vitaly Davidovich wrote:
>> This is just for convenience for calling from java code, it seems, and not
>> because code blob size actually needs to be larger than int (that would be
>> scary!).
>>
>> Sent from my phone
>> On Dec 4, 2014 8:12 PM, "David Holmes"<david.holmes at oracle.com>  wrote:
>>
>>> Hi Tatiana,
>>>
>>> On 5/12/2014 12:30 AM, Tatiana Pivovarova wrote:
>>>
>>>> Hi all,
>>>>
>>>> please review this small patch
>>>>
>>>> bugid:https://bugs.openjdk.java.net/browse/JDK-8065134
>>>> webrev:http://cr.openjdk.java.net/~iignatyev/tpivovarova/8065134/
>>>> webrev.00
>>>>
>>>> Problem:
>>>> Need WhiteBox::allocateCodeBlob(long, int), currently only
>>>> WhiteBox::allocateCodeBlob(int, int) exist.
>>>>
>>>> Solution:
>>>> Just change function signature WhiteBox::allocateCodeBlob(int, int) ->
>>>> WhiteBox::allocateCodeBlob(long, int)
>>>>
>>> But this gets truncated to an int again:
>>>
>>> CodeBlob* WhiteBox::allocate_code_blob(int size, int blob_type)
>>>
>>> David
>>>
>>>   Test: jprt
>>>> Thanks,
>>>> Tatiana
>>>>
>


More information about the hotspot-dev mailing list