Hi all,
I am curious to know whether the Squeak Context model provides any operation to swap the latest two elements from the stack. Something like:
To me, this appears to be the most performant approach to implement a parametrized #caseError:. Something like:
Otherwise, we would need an extra temporary variable here.
Looking forward to your answers.
Best, Christoph
Carpe Squeak!
|
Hi Christoph,
On Feb 23, 2020, at 9:01 AM, Thiede, Christoph <[hidden email]> wrote:
|
In reply to this post by Christoph Thiede
On Feb 23, 2020, at 9:01 AM, Thiede, Christoph <[hidden email]> wrote:
one could emit this sequence: dup push self pop and store temp: N (where N gets to sp - 1) send caseError:
|
Hi Eliot,
> Interesting! No, there’s no swap as yet. If SqueakV3PlusClosures has an unused bytecode I’d say go for it. (SistaV1 definitely has unused bytecodes).
Great to hear this! I would be glad to join the implementation of a new bytecode :-)
> pop and store temp: N (where N gets to sp - 1) Which bytecode are you referring to? #genStoreTemp:? This sounds indeed hacky ...
Just another question about bytecodes: Do we currently have any tools for exploring and playing around with the bytecodes? I would love to do say something like
But afaik, at the moment I have to manipulate the implementation of #emitCodeForValue:encoder: or so if I would like to test something new. Am I missing any existing tools to do so?
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Sonntag, 23. Februar 2020 18:19 Uhr An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Swap operation for stack machinery? On Feb 23, 2020, at 9:01 AM, Thiede, Christoph <[hidden email]> wrote:
one could emit this sequence:
dup
push self
pop and store temp: N (where N gets to sp - 1)
send caseError:
Carpe Squeak!
|
Free forum by Nabble | Edit this page |