Because CompiledMethod>>methodClass expects a classical literal binding
className->class

methodClass
    "answer the class that I am installed in"
    ^(self literalAt: self numLiterals) value.

But there ain't no binding for the metaclass which is accessible only
indirectly thru the class (you write Object class, not ObjectClass).
So it is a kind of hack to unify class and metaclass behavior...

Note that the hack is necessary and used by the VM for resolving super
send, so think twice if you want to come with a better hack, it's possible
but also and advanced topic.

2016-10-29 18:23 GMT+02:00 Henrik Nergaard <henrik.nerga...@uia.no>:

> Every method implemented in the class side includes a literal:
> “nil->theMetaClass”.
> Object class methods collect: [ :cm | cm literals last ].
>
> What is it used for?
>
> Best regards,
> Henrik
>
>

Reply via email to