Hi,

DO you think that this will do as an initial patch to wip-rtl in order to
introduce the possibility to
execute native code or JIT:ed code. We reserve the first two indexes in the
ip text area to fit
a pointer to native code to be executed.

There is changes to two parts of the code
1.  module/system/vm/rtl.scm, we wrap the make-asm record constructor to
initiate the first
two slots to 0 and advance the index pointer.

2. We add code in libguile/cm-engine.c rtl function execution stubs to
include a check for 0 at the initial
two/one positions in ip. depending on architecture this will lead to a
nonzero value in the case native code should be executed. Currently the
code will abort if the head is nonzero but this will change of cause as we
introduce more code. When the head is zero the ip is incremented two steps
and the code executes as usual.

A cavet could be if writing compiled code out to disk is done lately when
native code have been compiled in. In this case we should clean the native
part (In the jit case). I did not find where the code that does this is
located so I left it open for now.

/Stefan

Attachment: native-wip-rtl.diff
Description: Binary data

Reply via email to