[Vm-dev] VM Maker: VMMaker.oscog-eem.1679.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Feb 13 21:10:38 UTC 2016

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

==================== Summary ====================

Name: VMMaker.oscog-eem.1679
Author: eem
Time: 13 February 2016, 1:08:25.162285 pm
UUID: dac7e09c-8ee4-4fee-bd93-9cdcb7acb992
Ancestors: VMMaker.oscog-eem.1678

And revert the sort order regression in the last commit to not disturb the generated source unnecessarily.

=============== Diff against VMMaker.oscog-eem.1678 ===============

Item was changed:
  ----- Method: CCodeGenerator>>emitExportsNamed:pluginName:on: (in category 'C code generator') -----
  emitExportsNamed: exportsNamePrefix pluginName: pluginName on: aStream
  	"Store all the exported primitives in the form used by the internal named prim system."
  	| nilVMClass excludeDepth |
  	(nilVMClass := vmClass isNil) ifTrue: "We need a vmClass temporarily to compute accessor depths."
  		[vmClass := StackInterpreter].
  	"Don't include the depth in the vm's named primitives if the vm is non-Spur."
  	excludeDepth := exportsNamePrefix = 'vm'
  					  and: [pluginName isEmpty
  					  and: [vmClass objectMemoryClass hasSpurMemoryManagerAPI not]].
  	aStream cr; cr; nextPutAll: 'void* '; nextPutAll: exportsNamePrefix; nextPutAll: '_exports[][3] = {'; cr.
+ 	((methods select: [:m| m export]) asSortedCollection: [:a :b| a selector caseSensitiveLessOrEqual: b selector]) do:
- 	((methods select: [:m| m export]) asSortedCollection: [:a :b| a selector < b selector]) do:
  		[:method| | compileTimeOptionPragmas primName |
  		(compileTimeOptionPragmas := method compileTimeOptionPragmas) notEmpty ifTrue:
  			[method outputConditionalDefineFor: compileTimeOptionPragmas on: aStream].
  		 primName := self cFunctionNameFor: method selector.
  		 aStream tab; nextPutAll: '{"'; nextPutAll: pluginName; nextPutAll: '", "'; nextPutAll: primName.
  		 excludeDepth ifFalse:
  			[(self accessorDepthForSelector: primName asSymbol) ifNotNil:
  				[:depth| "store the accessor depth in a hidden byte immediately after the primName"
  				self assert: depth < 128.
  					nextPutAll: '\000\';
  					nextPutAll: ((depth bitAnd: 255) printStringBase: 8 nDigits: 3)]].
  		 aStream nextPutAll: '", (void*)'; nextPutAll: primName; nextPutAll: '},'; cr.
  		 method terminateConditionalDefineFor: compileTimeOptionPragmas on: aStream].
  	aStream tab; nextPutAll: '{NULL, NULL, NULL}'; cr; nextPutAll: '};'; cr.
  	nilVMClass ifTrue:
  		[vmClass := nil]!

More information about the Vm-dev mailing list