[squeak-dev] About typeOfClass

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] About typeOfClass

Stéphane Ducasse-3
I was happily browsing code when I suddenly encountered that method
Does anybody know what it measn to return #compiledMethod?

typeOfClass
        "Answer a symbol uniquely describing the type of the receiver"
        self instSpec = CompiledMethod instSpec ifTrue:[^#compiledMethod].  
"Very special!"
        self isBytes ifTrue:[^#bytes].
        (self isWords and:[self isPointers not]) ifTrue:[^#words].
        self isWeak ifTrue:[^#weak].
        self isVariable ifTrue:[^#variable].
        ^#normal.

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: About typeOfClass

Paolo Bonzini-2
Stéphane Ducasse wrote:
> I was happily browsing code when I suddenly encountered that method
> Does anybody know what it measn to return #compiledMethod?

That you have half literals (pointers) and half bytecodes (bytes) in the
indexed instance variables.  This was probably done in the blue book for
size optimization, but it is much less relevant today.

> typeOfClass
>     "Answer a symbol uniquely describing the type of the receiver"
>     self instSpec = CompiledMethod instSpec ifTrue:[^#compiledMethod].
> "Very special!"
>     self isBytes ifTrue:[^#bytes].
>     (self isWords and:[self isPointers not]) ifTrue:[^#words].
>     self isWeak ifTrue:[^#weak].
>     self isVariable ifTrue:[^#variable].
>     ^#normal.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: About typeOfClass

Eliot Miranda-2


On Fri, Jul 25, 2008 at 2:46 AM, Paolo Bonzini <[hidden email]> wrote:
Stéphane Ducasse wrote:
I was happily browsing code when I suddenly encountered that method
Does anybody know what it measn to return #compiledMethod?

That you have half literals (pointers) and half bytecodes (bytes) in the indexed instance variables.  This was probably done in the blue book for size optimization, but it is much less relevant today.

I disagree that its less relevant.  These hybrid things are more compact and faster to interpret.  That can still be useful, e.g. on pocket phones.  See my blog post that discusses this in some detail.

 


typeOfClass
   "Answer a symbol uniquely describing the type of the receiver"
   self instSpec = CompiledMethod instSpec ifTrue:[^#compiledMethod]. "Very special!"
   self isBytes ifTrue:[^#bytes].
   (self isWords and:[self isPointers not]) ifTrue:[^#words].
   self isWeak ifTrue:[^#weak].
   self isVariable ifTrue:[^#variable].
   ^#normal.







Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: About typeOfClass

Paolo Bonzini-2

>         I was happily browsing code when I suddenly encountered that method
>         Does anybody know what it measn to return #compiledMethod?
>
>     That you have half literals (pointers) and half bytecodes (bytes) in
>     the indexed instance variables.  This was probably done in the blue
>     book for size optimization, but it is much less relevant today.
>
> I disagree that its less relevant.  These hybrid things are more compact
> and faster to interpret.

I guess we're bound to disagree on this. :-)

Paolo