[Vm-dev] Re: adding external plugins to Squeak 4.2 on the Mac

David T. Lewis lewis at mail.msen.com
Sun Jul 17 19:25:59 UTC 2011


On Sun, Jul 17, 2011 at 11:57:54AM +0200, Craig Latta wrote:
>  
> 
> Hi John (and Esteban :) --
> 
>      Cool, that was it! I'm embarrassed I'd forgotten about that. I
> still have no idea what the release Mac VM binary has for VM_PROXY_MAJOR
> and VM_PROXY_MINOR, though, I just removed the check entirely from my
> plugin. :)
> 
>      So... clearly there should be some way for plugin authors to be
> able to check those values on a VM that someone else built? A
> command-line argument, perhaps? I didn't see one mentioned by running
> the VM with -help, but I guess I'll check the sources now, to be sure...
> at any rate it should be mentioned in the help message.

Craig,

This seems like a pretty good idea to me. Now that you mention it, I'm
surprised no one thought to do this before. Attached change set provides
primitives that answer the VM_PROXY_MAJOR and VM_PROXY_MINOR for the VM,
as well as for plugins (internal or external). If this looks good, I'll
add it to VMMaker trunk (it should work for oscog also).

Dave

-------------- next part --------------
'From Squeak3.11alpha of 11 July 2011 [latest update: #11554] on 17 July 2011 at 3:13:54 pm'!
"Change Set:		VMM-InterpreterProxyVersion-dtl
Date:			17 July 2011
Author:			David T. Lewis

As suggested by Craig Latta <http://lists.squeakfoundation.org/pipermail/vm-dev/2011-July/008838.html> there should be some way for plugin authors to be able to check the values of VM_PROXY_MAJOR and VM_PROXY_MINOR on a VM that someone else built.

Add two primitives to the VM:
  InterpreterPrimitives>>primitiveVmProxyMajorVersion
  InterpreterPrimitives>>primitiveVmProxyMinorVersion

And add two primitives to all plugins:
  InterpreterPlugin>>primitiveVmProxyMajorVersion
  InterpreterPlugin>>primitiveVmProxyMinorVersion

Interpreter proxy version of the VM is accessed by
  <primitive: #primitiveVmProxyMajorVersion>
and
  <primitive: #primitiveVmProxyMinorVersion>

Interpreter proxy version of a plugin (either internal or external) is accessed by e.g.
  <primitive: #primitiveVmProxyMajorVersion module: #MiscPrimitivePlugin>
and
  <primitive: #primitiveVmProxyMinorVersion module: #MiscPrimitivePlugin>
"!


!InterpreterPlugin methodsFor: 'other primitives' stamp: 'dtl 7/17/2011 11:38'!
primitiveVmProxyMajorVersion
	"Answer the value of VM_PROXY_MAJOR, the interpreterProxy major version number.
	The major and minor version numbers identify revision level of the interface between
	plugins and the virtual machine."

	<export: true>
	self pop: 1; pushInteger: interpreterProxy majorVersion
! !

!InterpreterPlugin methodsFor: 'other primitives' stamp: 'dtl 7/17/2011 11:38'!
primitiveVmProxyMinorVersion
	"Answer the value of VM_PROXY_MINOR, the interpreterProxy minor version number.
	The major and minor version numbers identify revision level of the interface between
	plugins and the virtual machine."

	<export: true>
	self pop: 1; pushInteger: interpreterProxy minorVersion
! !


!InterpreterPrimitives methodsFor: 'other primitives' stamp: 'dtl 7/17/2011 14:59'!
primitiveVmProxyMajorVersion
	"Answer the value of VM_PROXY_MAJOR, the interpreterProxy major version number.
	The major and minor version numbers identify revision level of the interface between
	plugins and the virtual machine. Various interpreter simulators may override to provide
	their vmProxyMajor version values, with Interpreter provided here as a default."

	<export: true>
	self pop: 1
		thenPushInteger: (self
				cCode: 'VM_PROXY_MAJOR'
				inSmalltalk: [Interpreter vmProxyMajorVersion])	! !

!InterpreterPrimitives methodsFor: 'other primitives' stamp: 'dtl 7/17/2011 14:59'!
primitiveVmProxyMinorVersion
	"Answer the value of VM_PROXY_MINOR, the interpreterProxy minor version number.
	The major and minor version numbers identify revision level of the interface between
	plugins and the virtual machine. Various interpreter simulators may override to provide
	their vmProxyMinor version values, with Interpreter provided here as a default."

	<export: true>
	self pop: 1
		thenPushInteger: (self
				cCode: 'VM_PROXY_MINOR'
				inSmalltalk: [Interpreter vmProxyMajorVersion])! !



More information about the Vm-dev mailing list