dotgnu-libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libjit-developers] Patch for dpas-parser.y to implement array expressio


From: Avinash Atreya
Subject: [Libjit-developers] Patch for dpas-parser.y to implement array expressions
Date: Tue, 20 Dec 2005 14:58:27 +0530

Hi All,

Finally, I have the patch for implementing array expresions in dpas. Spent a few hours in the last three days trying to figure out some errors. Finally decided to submit it as it looked on Saturday :).

I have also attached the test file that i have used: array.pas.

A few things about the patch:

The documentation states that the fact that pointers can be used to access arrays in an unbounded fashion is a deviation from standard pascal and needs to be used carefully. Though I have got subscript expressions to work with pointers there are a few gotchas. I am not sure how exactly rhys wanted arrays to be assigned to pointers so that subscripts can be used with them.

pointer = @simple_array[i] seems to work only if i == low(simple_array). For all other offsets, the address gets screwed up during assignment. That is, it is not offset by the desired amount.
pointer = simple_array ( c style ) leads to weird errors. jit_function_compile returns 0 because _jit_cache_end_method returns JIT_CACHE_END_TOO_BIG. I couldn't do anything more with that.

When array indices are out of bounds, an exception is thrown. This seg-faults in jit mode as well as interpreted mode. Gopal was telling me that exceptions have not been implemented, that could be a possible reason. Also, i am throwing 0 along with the exception, not sure what would be a good value to throw. The index which was out of bounds?

Everything else works fine :P

Thanks
Regards
Avinash


Attachment: arrays.patch
Description: Binary data

Attachment: array.pas
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]