space profiling

Stephen Weeks MLton@sourcelight.com
Tue, 28 Aug 2001 09:32:22 -0700


> Yes, that's no problem.  I now believe that we can do space profiling with
> no impact on register allocation and without extraneous help from the
> linker (at the expense of an insane number of symbols in the resulting
> executable). 
...
> O.k.  New proposal (although this puts more burden on the output routine).
> Instead of gensyming new symbols, we just keep a counter of the number of
> allocation points seen.  Each bin is now a constant offset from the start
> of the bins.  We still need symbols to store the PC somewhere.  With this
> method, I'd suggest two static arrays.  One of just bins and one of just
> PC addresses.  (The one of just bins could be put in .bss section, which
> saves a little space in the final executable.)  The output routine needs
> to walk both arrays in tandem, but that shouldn't be a big problem.

I prefer this to the insane number of symbols approach.

Does it make sense to move any of this into MachineOutput?