[kaffe] Kaffe JIT on Alpha

Kapil Vaswani kapil@csa.iisc.ernet.in
Tue Apr 22 12:43:02 2003


--------------050408090004040707020304
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi Dalibor,

Thanks for your response. I actually managed to compile rt.jar on an x86 
and use it to proceed in the build. This has atleast allowed me to try 
and understand the problem.

There is something I came across during debugging the code generated by 
the JIT. Here is a sample prolog generated by the jit.

0:      lda     gp,0(pv)
4:      lda     sp,0(sp)
8:      stq     ra,0(sp)
...
24:     stq     fp,56(sp)
...
48:     lda     fp,0(sp)

My question is: shouldnt the stack pointer be decremented with the 
framesize before various registers are saved? The relevent piece of code 
I attach below seems to not update sp at all. I find this to be the case 
on mips as well. The push instructions on x86 take care of updating the 
sp there. Or am I missing something here??

        /* Calling Standard for Alpha Systems
         * 3.2.6.1    Entry Code Sequence
         * 2. If stack space is allocated (PDSC_RPD_FRAME_SIZE is not 
0), set
         *    register SP to SP - PDSC_RPD_FRAME_SIZE.
         *    After any necessary calculations and stack limit checks, this
         *    step must be completed in exactly one instruction that 
modifies
         *    SP.  This instruction must be the one specified by
         *    PDSC_RPD_SP_SET.  */

        alpha_jit_info.sp_set = CODEPC / 4;
        L->type = Lnegframe|Labsolute|Lgeneral;
        L->at = (uintp)CODEPC;
        op_lda(REG_sp, REG_sp, 0);

Thanks again....

Kapil

Dalibor Topic wrote:

>Hi Kapil,
>
>--- Kapil Vaswani <kapil@csa.iisc.ernet.in> wrote:
>
>  
>
>>config.frag still seems to be using libexec; wonder whats the status on 
>>this.
>>    
>>
>
>It should use libexc only if you say --with-libexc to ./configure.
>
>On a side note, last time I looked into getting kaffe to run on Alphas, I saw a
>very high number of compiler warnings. See 
>http://www.kaffe.org/pipermail/kaffe/2003-February/028813.html
>
>  
>
>>>I'm busy dealing with non-Java, non-kaffe stuff for the next several
>>>weeks, but I'll be watching this with some interest.
>>>
>>>Note that Dalibor has been able to get the MIPS JIT under IRIX
>>>from CVS sources past the @essential files build failure by using
>>>Jikes instead of kaffe to build the class libraries. 
>>>      
>>>
>>Not sure if using Jikes is an option for me. Any recourse?? I would love 
>>to get the kaffe jit going one way or the other.
>>    
>>
>
>I'll make a jikes-compiled class library jar file available online and post a
>link to it. Then you can use --with-precompiled-rt-jar to tell kaffe not to
>bother compiling the class library, and concentrate on fixing the regression
>test failures.
>
>cheers,
>dalibor topic
>
>__________________________________________________
>Do you Yahoo!?
>The New Yahoo! Search - Faster. Easier. Bingo
>http://search.yahoo.com
>
>_______________________________________________
>kaffe mailing list
>kaffe@kaffe.org
>http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>
>  
>


--------------050408090004040707020304
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
Hi Dalibor,<br>
<br>
Thanks for your response. I actually managed to compile rt.jar on an x86
and use it to proceed in the build. This has atleast allowed me to try and
understand the problem.<br>
<br>
There is something I came across during debugging the code generated by the
JIT. Here is a sample prolog generated by the jit.<br>
<br>
0:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lda&nbsp;&nbsp;&nbsp;&nbsp; gp,0(pv)<br>
4:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lda&nbsp;&nbsp;&nbsp;&nbsp; sp,0(sp)<br>
8:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stq&nbsp;&nbsp;&nbsp;&nbsp; ra,0(sp)<br>
...<br>
24:&nbsp;&nbsp;&nbsp;&nbsp; stq&nbsp;&nbsp;&nbsp;&nbsp; fp,56(sp)<br>
...<br>
48:&nbsp;&nbsp;&nbsp;&nbsp; lda&nbsp;&nbsp;&nbsp;&nbsp; fp,0(sp)<br>
<br>
My question is: shouldnt the stack pointer be decremented with the framesize
before various registers are saved? The relevent piece of code I attach below
seems to not update sp at all. I find this to be the case on mips as well.
The push instructions on x86 take care of updating the sp there. Or am I
missing something here??<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Calling Standard for Alpha Systems<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 3.2.6.1&nbsp;&nbsp;&nbsp; Entry Code Sequence<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 2. If stack space is allocated (PDSC_RPD_FRAME_SIZE is not 0),
set<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp; register SP to SP - PDSC_RPD_FRAME_SIZE.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp; After any necessary calculations and stack limit checks, this<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp; step must be completed in exactly one instruction that modifies<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp; SP.&nbsp; This instruction must be the one specified by<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp; PDSC_RPD_SP_SET.&nbsp; */<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alpha_jit_info.sp_set = CODEPC / 4;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; L-&gt;type = Lnegframe|Labsolute|Lgeneral;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; L-&gt;at = (uintp)CODEPC;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; op_lda(REG_sp, REG_sp, 0);<br>
<br>
Thanks again....<br>
<br>
Kapil<br>
<br>
Dalibor Topic wrote:<br>
<blockquote type="cite"
 cite="mid20030422141926.71928.qmail@web10001.mail.yahoo.com">
  <pre wrap="">Hi Kapil,

--- Kapil Vaswani <a class="moz-txt-link-rfc2396E" href="mailto:kapil@csa.iisc.ernet.in">&lt;kapil@csa.iisc.ernet.in&gt;</a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">config.frag still seems to be using libexec; wonder whats the status on 
this.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
It should use libexc only if you say --with-libexc to ./configure.

On a side note, last time I looked into getting kaffe to run on Alphas, I saw a
very high number of compiler warnings. See 
<a class="moz-txt-link-freetext" href="http://www.kaffe.org/pipermail/kaffe/2003-February/028813.html">http://www.kaffe.org/pipermail/kaffe/2003-February/028813.html</a>

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">I'm busy dealing with non-Java, non-kaffe stuff for the next several
weeks, but I'll be watching this with some interest.

Note that Dalibor has been able to get the MIPS JIT under IRIX
from CVS sources past the @essential files build failure by using
Jikes instead of kaffe to build the class libraries. 
      </pre>
    </blockquote>
    <pre wrap="">Not sure if using Jikes is an option for me. Any recourse?? I would love 
to get the kaffe jit going one way or the other.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I'll make a jikes-compiled class library jar file available online and post a
link to it. Then you can use --with-precompiled-rt-jar to tell kaffe not to
bother compiling the class library, and concentrate on fixing the regression
test failures.

cheers,
dalibor topic

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
<a class="moz-txt-link-freetext" href="http://search.yahoo.com">http://search.yahoo.com</a>

_______________________________________________
kaffe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:kaffe@kaffe.org">kaffe@kaffe.org</a>
<a class="moz-txt-link-freetext" href="http://kaffe.org/cgi-bin/mailman/listinfo/kaffe">http://kaffe.org/cgi-bin/mailman/listinfo/kaffe</a>

  </pre>
</blockquote>
<br>
</body>
</html>

--------------050408090004040707020304--