CompileMethod limits

Milan Zimmermann milan.zimmermann at sympatico.ca
Tue Feb 27 05:43:29 UTC 2007


Hi Klaus,

On 2007 February 24 20:14, Klaus D. Witzel wrote:
<<>>

>
> No :) There is but one CompiledMethod class so the way you compile doesn't
> matter.
>

ok thanks that makes sense, i will also play with just pasting the same method 
content into browser

> > Also, I
> > wonder how other VMs handle this, is it a performance reason that Squeak
> > (apparently) allocates fixed space to CompileMethod header (instead of
> > maybe
> > making it a linked list)?
>
> You can see the four parts of CompiledMethod better than I can describe
> them here, in a debugger inspect the thisContext item in the bottom right
> pane (second from right); in that inspector inspect the CompiledMethod.
> For example ('abc' at: 0) will start you the debugger, select the line
> which says UndefinedObject>>DoIt.

ah that is interesting, I never drilled in thisContext in debugger (or looked 
at the bytecodes).

>
> The part you refer to is the literals array which is directly indexed by
> bit quantities in the bytecode; there's no time for chasing a slow linked
> list ;-)

Thanks for the tips, (much Squeak to learn still),

Milan

>
> /Klaus
>
> > Milan
> >
> >> >   -# So I ended up "manually serializing" the ByteArray, esentially
> >>
> >> as a
> >>
> >> > literal String such as '80 75 3 4 20 0 0 0 0 0 76 134 203' in the
> >>
> >> small
> >>
> >> > example above. Then deserialized after the method answered.
> >>
> >> Correct. This way you have only one literal in the CompiledMethod,
> >> instead
> >> of one literals for each value less than -1 or greater than 2 :)
> >>
> >> /Klaus



More information about the Squeak-dev mailing list