CompiledMethod>>value:withArguments:

Ian Piumarta Ian.Piumarta at inria.fr
Tue Dec 28 19:40:31 UTC 1999


> Thanks. I tried some of these (they seemed to work or failed when they
> should), but
> 
>     (Point compiledMethodAt: #x) valueWithReceiver: 3 at 4 arguments: #()
> 
> crashes on my machine (Squeak 2.6, Win98), followed by fatal error when
> opening the debugger.

It's a Compiler bug.  The method Point>>x has a primitive response
that never fails ("quick push of instance field") and since the
Compiler expects the runtime to respond to this without ever trying to
execute bytecodes, it doesn't bother generating any bytecodes in the
method at all.  To fix this, in Compiler>>generate: modify the final
return in the block argument to the first send to simply record the
primitive index for the quick response:

	self generateIfQuick: [:method | primitive _ method primitive].

then re-accept Point>>x and try the example again.

[Dan: here's an example of cheating and then getting caught. ;-)]

Ian





More information about the Squeak-dev mailing list