Syndicate the Cosmos Blog Feed.

Two-phase compiling

We modified our compiler to compile in two stages. First stage is doing analysis, the second stage the actual compiling.

This helps us in several ways (in order of importance, when we did the changes):

  1. LocAlloc can be implemented. Localloc is a way to allocate memory in the local heap. On method exit, the allocated memory is freed again. This means we have to put the memory pointers on the stack. This involves reserving space in the method header, and cleaning up the space (and freeing the memory) in the method footer.
    Now during analysis stage, we check to see how many LocAllocs are performed (and we keep track of which localloc is at which position), and during compiling, we use that information to make it work.
  2. Accuracy of the progress bar during compilation. In the past the progress bar in the compilation window wasn't really accurate (read: was unreliable to see the actual state). Now after the first state, the compiler knows what methods, fields, types, etc are to be compiled, so after that, the progress bar is reliable.
  3. Speed. This is not yet implemented, but will be at some point. This two-phase compilation stage will help us implement some performance enhancements in the compiler:

Lately, our kernel became tick-less. This means, when idling (waiting for a readline or so) it only consumes like 3Mhz.


Things the team is working on:

Networking (RTL8139, UDP, ICMP, TCP?): Chad and Frode
GC: Ralf
ATA/Ext2/Compiler bugfixes: Matthijs



Comments:

-- No Comments --

Post a comment