[Vm-dev] Re: [squeak-dev] Numbered primitives in images

David T. Lewis lewis at mail.msen.com
Sat Jan 16 14:55:02 UTC 2010

On Sat, Jan 16, 2010 at 08:16:06AM +0530, K. K. Subramaniam wrote:
> On Friday 15 January 2010 10:46:45 pm Bert Freudenberg wrote:
> > On 15.01.2010, at 16:58, K. K. Subramaniam wrote:
> > > Scratch 1.4 (Linux) of 30-Nov-2009 on 3.11-3 VM.
> > > Break into Scratch and do "Socket initializeNetwork".
> > 
> > So it does not occur in normal operation?
> Only if you define "normal" as "offline" ;-). Any operation which uses networking 
> (url block) goes through this method and it will fail when run under the 
> 3.11.3 VM built from unix-3.11.3-vmm or svn trunk.
> BTW, Scratch image is just an example which has numbered primitives.
> The 3.10-4 VM has primitiveObsoleteIndexedPrimitive in slot 207 in 
> platforms/unix/src/vm/interp.c while the 3.11.3 tar.gz and the trunk contain 
> primitiveFail. The change crept in r1935 through vmm-dtl-126.
> Is this intentional or an oversight?

Sorry I was not able to reply earlier. The change was intentional,
but the effect on Scratch was not.

Some of the obsolete primitives had to be dropped when we added the
block closure support. This happened in February 2009 (VMMaker-eem.114
in the SqS/VMMaker). Specifically, we changed from this, which redirects
the numbered primitives:

		"Networking Primitives (200-225) - NO LONGER INDEXED"
		(200 225 primitiveObsoleteIndexedPrimitive)

to this, which reallocates the numbers for closure support and for
future COG integration:

		"new closure primitives (were Networking primitives)"
		(200 primitiveClosureCopyWithCopiedValues)
		(201 primitiveClosureValue) "value"
		(202 primitiveClosureValue) "value:"
		(203 primitiveClosureValue) "value:value:"
		(204 primitiveClosureValue) "value:value:value:"
		(205 primitiveClosureValue) "value:value:value:value:"
		(206 primitiveClosureValueWithArgs) "valueWithArguments:"

		(207 209 primitiveFail) "reserved for Cog primitives"

The obsolete primitive redirection had been in place for at least five
years, so backward compatibility had been preserved for some time.

Question for Subbu: Is this an important issue may affect a large number
of Scratch users? In other words, are there kids trying to run Scratch,
and their Scratch image stops working properly after Squeak gets updated
to use a new VM?

And a thought for the vm-dev list: I don't know if there might be a
technical solution to this, but it might be possible to use a strategy
in which the some of the old primitive lookups are preserved (at least
for the range 207 through 225) if and only if the image format is
pre-closures. Follow ups to this on vm-only.


More information about the Vm-dev mailing list