Daniel Grunblatt wrote:
> Don't implement any print op yet, if I didn't understood wrong they are
> going to be updated to use the IO system.

ok, I draw back them then.

but I found another use for the emit_call_abs() function to implement some
string stuff in JIT. as I already said, the speed increase isn't at all
dramatic, but OTOH I have no idea how to do complicate stuff like allocating
memory natively in asm. these are the string ops that I've implemented in
JIT:

    Parrot_set_s_s {
      emitm_movl_m_r(NATIVECODE, emit_EAX, emit_None, emit_None, emit_None,
      (long) &STRING_REG[2]);
      emitm_movl_r_m(NATIVECODE, emit_EAX, emit_None, emit_None, emit_None,
      (long) &STRING_REG[1]);
    }

    Parrot_set_s_sc {
      NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None, emit_None,
      (long) &STRING_CONST[2]);
      emitm_pushl_i(NATIVECODE, (long) interpreter);
      emit_call_abs(jit_info, (long) string_copy, 8);
      emitm_movl_r_m(NATIVECODE, emit_EAX, emit_None, emit_None, emit_None,
      (long) &STRING_REG[1]);
    }

    Parrot_concat_s_s {
      emitm_pushl_i(NATIVECODE, 1);
      NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None, emit_None,
      (long) &STRING_REG[2]);
      NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None, emit_None,
      (long) &STRING_REG[1]);
      emitm_pushl_i(NATIVECODE, (long) interpreter);
      emit_call_abs(jit_info, (long) string_concat, 16);
      emitm_movl_r_m(NATIVECODE, emit_EAX, emit_None, emit_None, emit_None,
      (long) &STRING_REG[1]);
    }

    Parrot_concat_s_sc {
       emitm_pushl_i(NATIVECODE, 1);
       NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None,
emit_None,
       (long) &STRING_CONST[2]);
       NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None,
emit_None,
       (long) &STRING_REG[1]);
       emitm_pushl_i(NATIVECODE, (long) interpreter);
       emit_call_abs(jit_info, (long) string_concat, 16);
       emitm_movl_r_m(NATIVECODE, emit_EAX, emit_None, emit_None, emit_None,
       (long) &STRING_REG[1]);
    }

    Parrot_concat_s_s_s {
      emitm_pushl_i(NATIVECODE, 1);
      NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None, emit_None,
      (long) &STRING_REG[3]);
      NATIVECODE = emit_pushl_m(NATIVECODE, emit_None, emit_None, emit_None,
      (long) &STRING_REG[2]);
      emitm_pushl_i(NATIVECODE, (long) interpreter);
      emit_call_abs(jit_info, (long) string_concat, 16);
      emitm_movl_r_m(NATIVECODE, emit_EAX, emit_None, emit_None, emit_None,
      (long) &STRING_REG[1]);
    }

I haven't made extensive testing, but it seems there's a gain of about 10
generations per second with the lifetest. if these changes are welcome, I
will submit a (hopefully proper ;-) patch including other string stuff too.

> The -d flag will be use for the parrot debugger, Can't you stop your
> debugger at runops_jit?


well, not so easily with MSVC, but maybe it's just me (I haven't much
experience with the Visual Studio stuff).

I can't get MSVC to attach the parrot process (even with the -. option), so
the only chance I have to debug it is to press 'Cancel' when the program
blows up...

cheers,
Aldo

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

Reply via email to