harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][performance] @Inline and @NoBoundsCheck annotation support
Date Tue, 29 Apr 2008 08:17:40 GMT
Xiao-Feng Li wrote:
> On Tue, Apr 29, 2008 at 10:11 AM, Nathan Beyer <nbeyer@gmail.com> wrote:
>>  Additionally, these annotations scare me a bit. What if the annotation is
>>  wrong? Does the VM just crash in this case?
> Valid concern. You can think annotation as part of code. But basically
> it's only a hint, so much less dangerous than wrong code.

The JIT is free to ignore the hint, in which case you get regular rules 
applied, but if the hint is taken it can be more dangerous than wrong 
Java code -- though not so wrong native code I agree.

> If wrong code can cause VM crash, it is possible for annotation as
> well. Annotation can be completely ignored normally, and only
> respected when aggressive optimizations are desirable.

With these annotations it is possible to get new and creative ways to 
crash too :-)  Class library developers will have to understand the 
annotations and ensure they are maintained alongside the body of the 
method so that they still hold true.  They are real code, not just hints 
to the class library developer.


View raw message