harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: [drlvm][jit] array bounds check implementation
Date Thu, 21 Sep 2006 02:43:18 GMT

On Sep 20, 2006, at 10:40 PM, Naveen Neelakantam wrote:

> Very clever!  It seems like an array bounds check is converted into  
> an unsigned comparison followed by a JNB on Ia32.  This single  
> compare-and-branch sequence correctly implements both the upper  
> bound and lower bound checks.  Because the comparison is unsigned,  
> a negative index will look like a very large positive index and  
> will fail the check.

Isn't that really just "faith based"?  What if you really do have a  
very large upper bound?

>
> Naveen
>
> On Sep 20, 2006, at 4:06 PM, Naveen Neelakantam wrote:
>
>> Hello,
>>
>> It seems that the Op_TauCheckBounds opcode in the HIR is converted  
>> into an upper bounds check during HIR->LIR conversion (see  
>> CodeGenerator.cpp and Ia32InstCodeSelector.cpp).  It does not seem  
>> that the corresponding lower bounds check is ever generated.
>>
>> Am I misunderstanding the code somehow?  It doesn't seem correct  
>> to me.
>>
>> Thanks,
>> Naveen
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev- 
>> help@incubator.apache.org
>>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message