Tom Hughes wrote:

>>#17578

> Applied.


First of all, thank you for comitting these. I hate 3-way rediff's ;-)


>>#17193 necessary for imcc to write out PBC

> Applied. Like you I don't like it much but there aren't any other
> obviously better ways.


Yes, seems so.


> I missed that when it went through originally, but I don't like
> your first two suggestions as they have nasty speed and/or memory
> overhead issues. I don't really understand what you mean by the
> third one so I can't comment much on that...


imcc (when preparing the compiled code to run) produces a packed key 
structure (the bytecode of a _kc constant). This bytecode gets unpacked 
by the standard packfile.c, which generates the linked key structure for 
runtime.
For the reverse thing in packout.c I could provide above bytecode 
directly via some callback function:

opcode_t  (*packout_keys_helper)(Interp interp,
        opcode_t key_const_nr,
        opcode_t * byte_stream);

If packout.c find's a non null function pointer, it calls this function, 
which fills byte_stream with the appropriate bytes. This function could 
live in interpreters PackFile structure.

This solution could be used as an additional shortcut for packout users, 
that - like imcc - know, how to produce this bytestream. So the current 
hack should stay in place (for the general case) and above would save 
the linear search in the Constant_Table.

leo


> 
> Tom
> 
> 



Reply via email to