Throwable types handled specially in the VM?

Ulf Zibis Ulf.Zibis at gmx.de
Fri Aug 20 03:19:28 PDT 2010


Oops, my last comment should have been for "review (M) for 4809552: 
Optimize Arrays.fill(...)"

-Ulf


Am 20.08.2010 11:27, schrieb Ulf Zibis:
> A comment aside:
> Having:
>     int[] ia = new int[SIZE];
>     Arrays.fill(ia, 1234);
>
> The 1st line causes the array to be first filled with zeroes according 
> the JLS.
> The 2nd line causes the array to be *again* filled with 1234's.
>
> This situation could be optimized by the JIT in skipping the 
> zero-filling.
> Maybe this is just done by HotSpot, then forget my 2 cents.
>
> 1 cent more:
> To give programmer better control of that and to enhance the 
> interpreter in the same way, we would need to have an additional 
> syntax, something like:
> int [] ia = new int[SIZE](1234); // Project Coin candidate!
>
> -Ulf
>
>
>
> Am 20.08.2010 04:03, schrieb Joe Darcy:
>> Hello.
>>
>> As part of Project Coin, try-with-resources/ARM blocks have recently 
>> been integrated into JDK 7.  Part of this feature is changes to 
>> java.lang.Throwable to support recording of suppressed exception 
>> information (6911258 "Project Coin: Add essential API support for 
>> Automatic Resource Management (ARM) blocks").  Subsequently, some 
>> more changes in Throwable were necessary to fix a regression in the 
>> ability to print the stack traces of specially handled 
>> OutOfMemoryErrors (6973831 "NPE when printing stack trace of OOME").
>>
>> Are there any other Throwable types which receive special handling or 
>> creation by the VM?  If there are any, I'd like to examine them to 
>> find and correct and additional issues.
>>
>> Thanks,
>>
>> -Joe
>>
>>
>
>
>



More information about the hotspot-dev mailing list