[squeak-dev] CompiledBlocks are fascinating

Eliot Miranda eliot.miranda at gmail.com
Sat Apr 18 19:05:41 UTC 2020


On Sat, Apr 18, 2020 at 10:31 AM Thiede, Christoph <
Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:

> class := Object newSubclass.
>
> class addSelector: #foo: withMethod: (
>
> [:x | x squared * 2] method as: CompiledMethod).
>
> class new foo: 3. "18"
>
> And you can even debug it :D
>
>
> This one is really crazy
>
> class := Object newUniqueClassInstVars: 'state' classInstVars: ''.
> class addSelector: #foo withMethod: (
> [:x | gate] method as: CompiledMethod).
> class new foo "-1.2045729113346377e-38"
>
> What the ...? Am I accessing any private method literals here?
>

This may be a return address.  If you ran this in the simulator you'd be
able to see.  Also try running it on the StackInterpreter and see what you
get.


>

> Then we only need a mechanism that translates the #pushRcvr: bytecodes to
> another class.
>

I don't see you jumping to the metacircular interpreter in the above.  What
do you mean by "translates the #pushRcvr: bytecodes to another class"?


> Best,
>
> Christoph
>


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200418/79ac32d1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 1857 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200418/79ac32d1/attachment.png>


More information about the Squeak-dev mailing list