method dictionary lookups and walking up the inheritance tree

tim Rowledge tim at rowledge.org
Tue May 16 20:46:08 UTC 2006


On 16-May-06, at 12:43 PM, Andreas Raab wrote:

> Hi Tim -
>
>> VisualWorks (and probably other VMs at a guess) got some serious  
>> benefits out of polymorphic inline caches. I rather doubt inline  
>> caching is going to work in an interpreter but there might be some  
>> advantage in making the current global cache polymorphic. It could  
>> be a decent experiment to try out as a class exercise for example,  
>> since even if it turns out not to be beneficial it would be  
>> instructive and require all the usual investigative, analytical  
>> and explicative skills. I'd even volunteer to help with reviewing  
>> and grading, subject to time constraints.
>
> But isn't the global method cache polymorphic by definition? It  
> maps class+selector -> method (actual class of object; not class  
> where the method is defined in) and unless I got the meaning of the  
> word wrong this is polymorphic, is it not? ;-)

No, I think you got the word ok, I was being rather imprecise. I was  
thinking that maybe having the global cache be more like a bucket  
collection might be interesting (and I may be using a poor term here,  
think of a collection of collections)
becasue you could avoid (maybe) the hash-clash-cache-smash problem. I  
was perhaps recalling some of the details about the PICs in VW as  
explained to me a long time ago when I could still remember what day  
it was.

Using this 'bucket-cache' we could keep a plain list at each hash  
value and deal with multiple entries by having, er, multiple entries  
instead of 'yahay, smash the next entry in the list!' hooliganism.  
Sort of hanging the hash-chains off the side instead of squeezing  
them into the main toothpaste tube.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
CChheecckk yyoouurr dduupplleexx sswwiittcchh..





More information about the Vm-dev mailing list