On Mon, 2009-01-12 at 11:59 +0200, Pekka Enberg wrote:
> The current blocker bug for a simple "hello, world" application is in
> the way  Jato handles mimic stack on basic block boundaries. The problem
> is that a mimic stack can be non-empty at the end of a basic block
> because of, for example, the ternary operator.

There's commit 5cf876d9fbd7ea1d2ba6f5d679d9e24a43002a1d ("jit: mimic
stack spilling and reloading") in topic/ostack now that fixes up the new
regression test. Unfortunately I missed the fact that there's another
case we need to take care of.

In the first case, we have a basic block A with two _successors_ B and C
(we handle this case now). In the second one, we have a basic block X
with _predecessor_ Y and Z. The problem with the current patch is that
we don't use the same temporaries in Y and Z which makes the new inverse
case of the original regression test to fail.

There's also some "interesting" things going on in the generated
assembly:

  TRACE: jamvm/ObjectStackTest.assertIsGreaterThanOne(I)V
  Length: 14
  Code: 1a 04 a4 00 07 04 a7 00 04 03 b8 00 0d b1

  Disassembler Listing:

    0x09339000:   57                         push   %edi
    0x09339001:   56                         push   %esi
    0x09339002:   53                         push   %ebx
    0x09339003:   55                         push   %ebp
    0x09339004:   89 e5                      mov    %esp,%ebp
    0x09339006:   8b 45 14                   mov    0x14(%ebp),%eax
    0x09339009:   83 f8 01                   cmp    $0x1,%eax
    0x0933900c:   0f 8e 0c 00 00 00          jle    0x000000000933901e
    ---
    0x09339012:   e9 0e 00 00 00             jmp    0x0000000009339025 # (1)
    0x09339017:   b8 01 00 00 00             mov    $0x1,%eax
    0x0933901c:   89 c3                      mov    %eax,%ebx
    ---
    0x0933901e:   b8 00 00 00 00             mov    $0x0,%eax
    0x09339023:   89 c1                      mov    %eax,%ecx # (2)
    ----
    0x09339025:   53                         push   %ebx
    0x09339026:   e8 d5 bf fe ff             call   0x0000000009325000
    0x0933902b:   83 c4 04                   add    $0x4,%esp
    0x0933902e:   e9 00 00 00 00             jmp    0x0000000009339033

    0x09339033:   5d                         pop    %ebp
    0x09339034:   5b                         pop    %ebx
    0x09339035:   5e                         pop    %esi
    0x09339036:   5f                         pop    %edi
    0x09339037:   c3                         ret

So in (1), we're adding the store instructions *after* the jmp from the
basic block and in (2) we should be using "ebx" just like in the other
predecessor of the basic block.

                Pekka


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to