[squeak-dev] Two new questions about VM machinery :-)

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Sep 5 11:34:33 UTC 2020


Hi Tobias,


are you sure about that?

[Compiler evaluate: 'self identityHash' for: ProtoObject new] answers a me a SmallInteger. Compiler >> #evaluate:[...] returns the last stack value automatically, just a like a printIt. See senders of #returnSelfIfNoOther: in Parser. :-)


Best,

Christoph

<http://www.hpi.de/>
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Tobias Pape <Das.Linux at gmx.de>
Gesendet: Samstag, 5. September 2020 13:25:26
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Two new questions about VM machinery :-)


> On 05.09.2020, at 13:10, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
>
> What would you expect the following to return?
> x := Compiler evaluate: 'super identityHash' for: ProtoObject new.
> thisContext objectClass: x.
> I would have guessed that either the VM crashes or ProtoObject >> #cannotInterpret: is called.
> But actually, it answers you the ProtoObject instance, which I find very interesting because it means that if a message cannot be looked up, it is simply and silently skipped.

No. you're just missing the return, that's why it answers self…
-t

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200905/27e77409/attachment.html>


More information about the Squeak-dev mailing list