hello there (and especially the JIT team),

is anybody working on JIT-enabling the Win32 platform?

I've done some work on this (using MASM as an assembler
and VisualC's DUMPBIN as a disassembler instead of the
GNU as and objdump). 

I have a somewhat-working Parrot/Jit/MSWin32-x86.pm that
generates a somewhat-correct jit_struct.h.

there's still nothing implemented in .jit files (only 
Parrot_noop and Parrot_end in core.jit right now), so
every opcode is just a Parrot::Jit->call output.

I tested examples/assembly/fact.pasm and with the -j 
option it goes as far as saying: 'fact of 0'.
it missed the constant 'is: ', because 
  if (s && string_length(s)) {
in core_ops.c was not true, and then it blows up on the
pasm line:
  set I0,I1
which core_ops.c implements as:
  interpreter->string_reg.registers[cur_opcode[1]] 
  = string_from_int(interpreter, cur_opcode[2]);

the problem is that when it comes to this instruction,
cur_opcode[1] contains a totally unrelated value
(-41485056, or 0xfd86fd00), but cur_opcode[2] contains
0 as it should.

I have no idea why my opcodes are broken. the jitted code
actually looks like this:

    55                   push        ebp
    8B E5                mov         esp,ebp
    68 30 3C 2F 00       push        2F3C30h
    68 C0 EA 2F 00       push        2FEAC0h
    E8 7F 3F 10 00       call        Parrot_set_i_ic (00402da9)
    83 C4 08             add         esp,8
    68 30 3C 2F 00       push        2F3C30h
    68 CC EA 2F 00       push        2FEACCh
    E8 7D 34 10 00       call        Parrot_print_sc (004022b9)
    83 C4 08             add         esp,8
    68 30 3C 2F 00       push        2F3C30h
    68 D4 EA 2F 00       push        2FEAD4h
    E8 8E 33 10 00       call        Parrot_print_i (004021dc)
    83 C4 08             add         esp,8
    68 30 3C 2F 00       push        2F3C30h
    68 DC EA 2F 00       push        2FEADCh
    E8 59 34 10 00       call        Parrot_print_sc (004022b9)
    83 C4 08             add         esp,8
    68 30 3C 2F 00       push        2F3C30h
    68 E4 EA 2F 00       push        2FEAE4h
    E8 1D 3F 10 00       call        Parrot_set_i_i (00402d8f)
    83 C4 08             add         esp,8

which seems fine to me. so, I'm lost :-(


cheers,
Aldo

__END__
$_=q,just perl,,s, , another ,,s,$, hacker,,print;


Reply via email to