At this point we can compile all of the Tachyon code and initialize all of the code units. Our bootstrap is still not *quite* there yet, however.
I've been spending most of the day finishing up code intended to make all of our C extensions accessible under the bootstrapped Tachyon (eg: readFile, writeFile, shellCommand, allocMachineCodeBlock, etc.). At this point, all the code is written and compiles, although some of it is hard to test outside of the Tachyon bootstrap.
We still need two things to be done before Tachyon can truly execute once compiled:
1. Yesterday I discovered what appears to be a backend bug when compiling ptrToByteArray (runtime/ffi.js). This should hopefully be a minor fix.
2. Because we don't support byte arrays mapped to memory like V8 does, I made a wrapper to write bytes into a machine code block. We will need to change the backend code to write bytes using writeToMachineCodeBlock (see runtime/mcb.js). This should be a fairly trivial refactoring.
Once this is done, Tachyon should have everything it needs to run (and compile code) in bootstrapped mode. We will probably make Tachyon drop into its shell once the bootstrap is successfully completed.
What remains then is to eliminate the remaining bugs in our system. I suspect we will easily run out of memory (since our heap is currently fixed at 64MB), so I've added a heap limit pointer to the context (we will get an error if this limit is exceeded). The best we can do for now, in terms of debugging, is probably to add more assertions to our code, and use Marc's debugging traces. On this topic, Marc, did you have time to write code to log function returns? If we can know more precisely where Tachyon crashes, it will probably be a huge time saver.
I will be in the lab this Monday, doing my best to squash the remaining bugs.
- Maxime