[Vm-dev] Eliot's BlockClosure model questions
henrik.s.johansen at veloxit.no
Fri Aug 2 11:35:52 UTC 2013
On Aug 1, 2013, at 10:17 , Eliot Miranda <eliot.miranda at gmail.com> wrote:
> On Thu, Aug 1, 2013 at 10:15 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> On Thu, Aug 1, 2013 at 1:21 AM, Clément Bera <bera.clement at gmail.com> wrote:
> Hello Eliot,
> So I implemented clean blocks with Opal in Pharo 3. I didn't know where to put the byte code of the clean block, so I put it at the end of the method.
> ^ [ 1 + 2 ]
> 17 <20> pushConstant: [...]
> 18 <7C> returnTop
> 19 <76> pushConstant: 1
> 20 <77> pushConstant: 2
> 21 <B0> send: +
> 22 <7D> blockReturn
> having in the literal Array:
> [ 1 + 2 ]
> The startpc of the block is 19.
> Its outerContext is a context with nil as receiver and the method OCOpalExamples>>#exampleCleanBlock.
> Its numArgs is 0 and it has no copiedValues.
> But it does not work with the JIT.
> Thinking about it I'm pretty sure the problem is that the JIT scans for and counts pushClosure: bytecodes to know how many blocks a method contains, but clean blocks don't need pushClosure: bytecodes. So the JIT needs to look for clean blocks, e.g. either by scanning a method's literals or by looking at the arguments of pushLiteral: bytecodes. In any case the image will allow me to develop a fix.
Made a non-Opal version that works in 2.0, located at https://dl.dropboxusercontent.com/u/6751081/BlockTest.zip together with a startup script that loads the package, then crashes the image.
Note; all three clean block version in the .zip can be #value'd from a Workspace, it's first when you try to run those made by installClean/installCleanMinimal in a loop that the image crashes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev