Leopold Toetsch wrote:

So it seems, that for multiple code segments, we'll have to take the PackFile_ConstTable out of the structure and include file/line/debug/whatever information. This would look like:

packfile aka interpreter->code:
- constants
- code_segment[]
- byte_code
- byte_code_size
- [ more of current packfile ]
- filename
- lines[]
- [ more aditional stuff ]
- prederefed_code
- jit_info (jitted code)
- fixups

The debug stuff should have its own segment, linked to the corresponding code segment.


The return value of B<compile> would then be a pointer to such a code_segment.

BTW a PackFile_Constant should be a union IMHO, currently each type has its own storage.

As a first step towards multiple code segments I did apply locally Juergen Boemmels Patch #18056. With little rediffing and twigging, this runs all tests, imcc's packout() for writing pbc files is working too. Only packdump is broken, but this didn't do very much anyway.

So people please have a look at this patch and the description.
With this patch in place, it shouldn't be too hard, to have multiple code segments, currently only in memory and with extending the PBC file also external.


leo





Reply via email to