[squeak-dev] [Please Review] Refactoring for #literalsDo: etc.

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Jun 24 08:55:53 UTC 2019


Hi Marcel,
beware, there are specialSelectors and inlined selectors too (do: ifTrue:
etc...), so it might happen that low level literals enumeration does not
fit higher level...

Le lun. 24 juin 2019 à 10:48, Marcel Taeumel <marcel.taeumel at hpi.de> a
écrit :

> Hi, there.
>
> Please find attached a new version of this refactoring.
>
> I discovered more recent code for scanning literals (that seems to be at
> the *bytecode* level, not *object* level):
>
> BytecodeEncoder class >> #scanBlockOrNilForLiteral:
> EncoderForSistaV1 class >> #scanBlockOrNilForLiteral:
> EncoderForV3 class >> #scanBlockOrNilForLiteral:
>
> However, I could not see a way to *enumerate* literals this way. Did I
> miss something? Makes me wonder about the entire use of CompiledCode >>
> #literalsDo:. We could replace #hasLiteral: with an implementation similar
> to Behavior >> #whichSelectorsreferTo:thorough: using
> #scanBlockOrNilForLiteral:.
>
>
> Thoughts? Eliot? :-) How is the conceptional relationship between "has
> literal" and "literals do"?
>
> Best,
> Marcel
>
> Am 28.05.2019 14:49:59 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
> Hi, there.
>
> Please find attached a change set that (tries to) clean up everything
> related to enumerating or testing literals in CompiledCode, CompiledMethod,
> and CompiledBlock.
>
> I have three important questions:
>
> - The purpose of #hasLiteralThorough is not needed anymore because we
> enumerate and test always in a "thorough" way?
> - Are the enumeration boundaries in CompiledCode, CompiledMethod,
> CompiledBlock in #literalsDo: correct?
> - What is a literal as expected in #hasLiteral: etc. to answer true? Just
> symbols or also bindings (symbol-to-class) and classes themselves?
>
> Try exploring this result: "(Morph >> #fullDrawOn:) literals" or similar.
>
>
> Best,
> Marcel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190624/8d731404/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 136440 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190624/8d731404/attachment-0001.png>


More information about the Squeak-dev mailing list