[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libjit-developers] Patch to handle constants in jit-insn.c
From: |
Gopal V |
Subject: |
Re: [Libjit-developers] Patch to handle constants in jit-insn.c |
Date: |
Thu, 15 Dec 2005 20:24:09 +0530 |
User-agent: |
Mozilla Thunderbird 1.0.7-1.4.1.centos4 (X11/20051007) |
Avinash Atreya wrote:
On a brighter note, it does seem like I have a start on arrays for dpas.
Multidimensional arrays are also working. Need a little bit more work on
that ( bounds checking and all that). Should hopefully have a patch soon.
Trying to debug the segfault there.
a[2] := 10;
gets converted to -
i3 = 2
i14 = &s1
i16 = i3 * 4
i17 = i14 + i16
store_relative_int(i17, 10, 0)
So far so good ... But when run in the interpreter
this screws up badly.
From what I can see it is doing.
stacktop[0].int_value = 2;
stacktop--;
stacktop[0].ptr_value = <ptr>;
stacktop--;
stacktop[0].int_value = 4;
stacktop--;
stacktop[1].int_value = stacktop[0].int_value * stacktop[1].int_value;
stacktop++;
stacktop[1].int_value = stacktop[0].int_value + stacktop[1].int_value;
stacktop++;
*stacktop[0].ptr_value = 10
stacktop++;
The problem seems to be that it is doing
addr = (base_addr * size) + offset;
by doing the above operations. I cannot seem to find a real way in which
this can be fixed properly (after all both the modes should work
exactly the same in libjit). Any ideas ?
http://pastebin.com/465192
Cheers,
Gopal