7168505: (bf) MappedByteBuffer.load does not load buffer's content into memory

Rémi Forax forax at univ-mlv.fr
Tue May 15 00:07:48 PDT 2012


On 05/14/2012 05:55 PM, Alan Bateman wrote:
> On 14/05/2012 16:32, Mike Duigou wrote:
>> Looks good. It's kind of amazing that the server compiler can figure 
>> out that unsafe.getByte() is side effect free.
>>
>> The comment on unsused could be javadoc.
>>
>> You could initialize x to unused and eliminate the conditional before 
>> assignment of unused from x
>>
>> Mike
>>
> Thanks Mike. The comment on the private fields in this code use // so 
> I just kept it consistent.
>
> I didn't get comment about x = unused.  The test if unused != 0 was 
> just to avoid storing to that field as it's a static. Performance wise 
> of course it doesn't matter what we do as touching each page will 
> typically result in lots of faulting and I/O.
>
> -Alan

I wonder if it's not better to have a fake method recognized by the VM 
for that,
because if the VM is smart enough, 'unused' is only used in load() so it 
doesn't really escape.
A VM/JIT that will generate assembly code for the whole class, by 
example when module is installed
in module repository, will see that easily.

Rémi






More information about the nio-dev mailing list