More Profiling

Tim Rowledge tim at sumeru.stanford.edu
Fri Sep 28 04:59:59 UTC 2001


>      Scott Crosby wrote:
> 
>                                       >
> 
>                                       >QUERY: Can I write my caching code
>                                       into a seperate class, yet have the
>                                       >C-translater still inline all of
>                                       the methods? It'd help a lot;
>                                       Interpreter
>                                       >is pretty unwieldy to browse&alter.
The problem is that you would have to modify Interpreter in order to
make it use any such extra class!

You could subclass Interpreter and override the appropriate methods
which would at least gather you oen changes into a single place. This
would work nicely for simulating your changes but unfortunately you
would also have to modify the CCodeGenerator a bit since it currently
barfs on overridden messages; it can't cope with subclassing in any way
that is useful to you. I think it probably could be made to do so, but
not without some head scratching; it must be three years since I last
tried extending it noticably.

One CCodeGenerator change that really deserves some thought is making
use of the C compiler's inlining abilities if they exist. I suspect that
it would be more useful (when generating code for gcc, for example) to
forget the simple textual inlining done by Squeak and simply stick the
appropriate inlining pragma in ths generated text. 

tim





More information about the Squeak-dev mailing list