|
From: Tim R. <ti...@su...> - 2004-04-08 22:05:51
|
In message <165...@ka...>
Bryce Kampjes <br...@ka...> wrote:
> It would probably be more worthwhile looking at at: and at:put:. Could
> Tim's improvements to primitives be used to create simple at:
> primitives that are quick to execute?
That's one of the aims; dispatch prims from a value cached in the
method lookup cache (I'm not actually doing that yet, but soon I hope)
so that specialized mini-prims can be used. It's an old trick and not
anything I thought up but it usually has benefits.
For example, one could have an at mini-prim that knows the rcvr is a
word array and so doesn't need to check the format, another for byte
arrays etc. The correct version is chosen and installed at lookup time.
For primPerform type code I imagine it is simpler to use the 'normal'
versions but perhaps it could be extended.
What I'd love to achieve is a send that goes something like:-
lookup message in cache
not found? do lookup & cache fill
find cache entry
branch to cached function addr
err, that's it. Oh, return!
Sadly we need to have the backup for if the prim function fails. I
considered making primfailure go via a tail call to the normal method
activation but that would require rewriting huge amounts of stuff.
Nobody is currently paying me enough to take on _that_ particular
labour. It would be nice though because instead of having a primIndex
of 0 we could have a pointer direct to methodActivate.
Current state is in
http://sumeru.stanford.edu/tim/pooters/SqFiles/packages/VMMaker/VMMaker3
-7b2.sar for what it's worth.
tim
--
Tim Rowledge, ti...@su..., http://sumeru.stanford.edu/tim
Strange OpCodes: SCEU: Simulate Correct Execution, Usually
|