freenode/#clasp - IRC Chatlog
Search
22:57:01
drmeister
The current approach generates code to build objects at load time. The objects are built as a side effect of evaluating the toplevel forms. For instance - a defclass generates code that builds a class. But we need the class definitions earlier at startup - to represent AST's for inlining for instance.
22:57:42
drmeister
I'd like a fasl that runs in an environment where all of the classes that would be constructed by the fasl are available at the beginning of evaluating the toplevel forms of the fasl.
22:58:18
drmeister
Our fasls evaluate every toplevel form in the order that they are found in the source code.
22:59:43
drmeister
Yeah - it's like a core dump - but I'm thinking something more selective. Where we can specify what goes into the core dump.
23:05:57
drmeister
If we reload a core - we wouldn't evaluate the top level forms at startup anymore - right?
23:06:50
drmeister
But we have a lot of side-effects that we will need to track down so that we can regenerate them at startup. C++ code that gets evaluated.
23:08:56
drmeister
I thought we could do something more selective - like save the memory effects of defclass in separate pools and write them out into the core/fasl file - then at load-time recreate the classes from the core data and then run the top-level forms in that environment while we eliminate the side-effects of 'defclass' at load time.
23:09:52
stassats
the only proper solution is to write to disk whatever you want to be in memory when you start up
23:12:44
stassats
drmeister: mps is probably not using a contiguous and amorphous blob of memory, so you need to identify all the regions and their respective metadata
23:16:35
drmeister
mps has these things called pools. I can specify the pools and the tables of roots.
23:20:07
drmeister
There are inter-pool pointers. There is an AMC pool for general objects, an AMCZ pool for objects that don't have internal pointers like strings - I think that's all that we really need.
23:23:39
drmeister
Then what? Write them out to a file descriptor? I think giving me back a start pointer and a size for a block of memory that I can use to write into an llvm Module - that would be ideal.
23:25:29
drmeister
Then I can write it into the Module as a big blob of bytes and when I reload the module I can call an mps function with the start and the size and it ... what? treats it like a block of read only MPS memory? Relocates the objects out into MPS memory? It would be good not to have this big useless block of memory around.