Okay, so it's method cache time.

First important note: I've never done this before (I think my antipathy towards objects might've given everyone just the tiniest clue :) so pointers to good docs and papers on this would be much appreciated.

My current thinking, based entirely on the "Hmmm, if I had no clue there was any history here, what would I do?" school of design, is to do this:

Method cache is an array of arrays of cache entries.

Top level index is the class number.

Second level index is bits 2-10 of the method name string (the actual string, mind--we use the bufstart address) shifted right two bits to give us a single byte offset.

Third is a set of structs that look like:

   bufaddr
   string (maybe)
   pmc ptr
   next

When we get to the list, we run through it looking for entries that match. If we find one, yay, we're done. If not, we do a slow search, find the entry, and put it in the cache.

This presupposes that the method names are all constant, shared strings. I think this is reasonable, and I'm OK adding in some code to the namespace store to make *sure* that it's the case.

This seems... too simple, so I'm sure I'm missing something besides the potential massive memory usage. So, by all means, have at it.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to