[Vm-dev] VM Maker: VMMaker.oscog-EstebanLorenzano.1564.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Dec 7 12:25:44 UTC 2015


Esteban Lorenzano uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-EstebanLorenzano.1564.mcz

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

Name: VMMaker.oscog-EstebanLorenzano.1564
Author: EstebanLorenzano
Time: 7 December 2015, 1:22:41.655345 pm
UUID: 44b50984-d269-46c7-b4c0-841b9186e369
Ancestors: VMMaker.oscog-eem.1563

Restored a check for spur in simulator. I still need it because we are still bootstrapping  pharo-spur from a non spur image (this will change this week, hopefully, but for the moment ...)

Restored the "in memory" read restriction for FFI (unless object is pinned).

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

Item was changed:
  ----- Method: CogMIPSELCompiler>>concretizeFill32 (in category 'generate machine code - concretize') -----
  concretizeFill32
  	"fill with operand 0 according to the processor's endianness"
  	| word |
  	<var: #word type: #'unsigned long'>
  	
  	self flag: #bogus. "Gaps in the instruction stream should be filled with the stop instruction."
  	
  	word := operands at: 0.
  	self machineCodeAt: 0 put: word.
  	^machineCodeSize := 4!

Item was changed:
  ----- Method: StackInterpreterSimulator>>veryDeepCopyWith: (in category 'debug support') -----
  veryDeepCopyWith: deepCopier
  	"Override to short-circuit the copying of any VMPluginCodeGenerators referenced from mappedPluginEntries.
  	 These can in turn hold onto Monticello state, resulting in a huge ammount of unnecessary copying."
+ 	self objectMemory hasSpurMemoryManagerAPI ifTrue: 
+ 		[deepCopier references
+ 			at: mappedPluginEntries ifAbsentPut: [mappedPluginEntries].
+ 		mappedPluginEntries do:
+ 			[:tuple| | block |
+ 			block := tuple third.
+ 			deepCopier references at: block ifAbsentPut: [block]]].
- 	deepCopier references
- 		at: mappedPluginEntries ifAbsentPut: [mappedPluginEntries].
- 	mappedPluginEntries do:
- 		[:tuple| | block |
- 		block := tuple third.
- 		deepCopier references at: block ifAbsentPut: [block]].
  	^super veryDeepCopyWith: deepCopier!

Item was changed:
  ----- Method: ThreadedFFIPlugin>>ffiAddressOf:startingAt:size: (in category 'primitive support') -----
  ffiAddressOf: rcvr startingAt: byteOffset size: byteSize
  "return an int of the address of the byteSize slot (byte, short, int, whatever) at byteOffset in rcvr. Nominally intended for use with ExternalAddress objects, this code will work (for obscure historical reasons) with plain Byte or Word Arrays as well. "
  	| rcvrClass rcvrSize addr |
  	self flag: 'This needs more thought.  It is 32-bit specific.  What about 64-bit platforms?'.
  	(interpreterProxy isBytes: rcvr) ifFalse:[^interpreterProxy primitiveFail].
  	(byteOffset > 0) ifFalse:[^interpreterProxy primitiveFail].
  	rcvrClass := interpreterProxy fetchClassOf: rcvr.
  	rcvrSize := interpreterProxy byteSizeOf: rcvr.
  	rcvrClass = interpreterProxy classExternalAddress ifTrue:[
  		(rcvrSize = 4) ifFalse:[^interpreterProxy primitiveFail].
  		addr := interpreterProxy fetchPointer: 0 ofObject: rcvr.
+ 		"don't you dare to read from object memory (unless is pinned)!!"
+ 		(addr = 0 or: [(interpreterProxy isInMemory: addr) or: [(interpreterProxy isPinned: rcvr) not]])
- 		self flag: 'This needs more thought.  Instead of always allowing this couldn''t we allow it only if the address is associated with a pinned object?'.
- 		"don't you dare to read from object memory!!"
- 		(addr = 0 "or: [interpreterProxy isInMemory: addr]")
  			ifTrue:[^interpreterProxy primitiveFail].
  	] ifFalse:[
  		(byteOffset+byteSize-1 <= rcvrSize)
  			ifFalse:[^interpreterProxy primitiveFail].
  		addr := self cCoerce: (interpreterProxy firstIndexableField: rcvr) to: 'int'.
  	].
  	addr := addr + byteOffset - 1.
  	^addr!



More information about the Vm-dev mailing list