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

commits at source.squeak.org commits at source.squeak.org
Thu Jan 11 08:11:03 UTC 2018


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2312.mcz

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

Name: VMMaker.oscog-eem.2312
Author: eem
Time: 11 January 2018, 12:10:35.160469 am
UUID: b20770ae-50f3-4ea8-9bc6-7bf2a4f4fb6e
Ancestors: VMMaker.oscog-dtl.2311

Fix two places where cloning forgets to set the immutability bit if the input has it set (shallowCopy should /not/ copy across the immutability bit, but become: and pin: should).

Comment a possibility for concision in the plugin security function declarations.  Opinions?

=============== Diff against VMMaker.oscog-dtl.2311 ===============

Item was changed:
  ----- Method: FilePlugin class>>declareCVarsIn: (in category 'translation') -----
  declareCVarsIn: aCCodeGenerator
  
+ 	"Hmmm, we could use (self instVarNames select: [:ivn| ivn first = $s and: [ivn second isUppercase]])"
  	self declareC:  #('sCCPfn' 'sCDFfn' 'sCDPfn' 'sCGFTfn' 'sCLPfn' 'sCOFfn' 'sCRFfn' 'sCSFTfn' 'sDFAfn' 'sHFAfn')
  		as: #'void *'
  		in: aCCodeGenerator.
  	aCCodeGenerator addHeaderFile: '"FilePlugin.h"'!

Item was changed:
  ----- Method: SocketPlugin class>>declareCVarsIn: (in category 'translation') -----
  declareCVarsIn: aCCodeGenerator
  
+ 	"Hmmm, we could use 
+ 		self declareC:  (self instVarNames select: [:ivn| ivn first = $s and: [ivn second isUppercase]])
+ 			as: #'void *'
+ 			in: aCCodeGenerator."
  	aCCodeGenerator var: 'sDSAfn'	type: 'void *'.
  	aCCodeGenerator var: 'sHSAfn'	type: 'void *'.
  	aCCodeGenerator var: 'sCCTPfn'	type: 'void *'.
  	aCCodeGenerator var: 'sCCLOPfn'	type: 'void *'.
  	aCCodeGenerator var: 'sCCSOTfn'	type: 'void *'.
  	aCCodeGenerator addHeaderFile: '"SocketPlugin.h"'!

Item was changed:
  ----- Method: SpurMemoryManager>>cloneInOldSpace:forPinning: (in category 'allocation') -----
  cloneInOldSpace: objOop forPinning: forPinning
  	<inline: false>
  	| numSlots fmt newObj hash |
  	numSlots := self numSlotsOf: objOop.
  	fmt := self formatOf: objOop.
  	
  	forPinning
  		ifTrue:
  			[newObj := self allocateSlotsForPinningInOldSpace: numSlots
  							bytes: (self objectBytesForSlots: numSlots)
  							format: fmt
  							classIndex: (self classIndexOf: objOop)]
  		ifFalse:
  			[newObj := self allocateSlotsInOldSpace: numSlots
  							bytes: (self objectBytesForSlots: numSlots)
  							format: fmt
  							classIndex: (self classIndexOf: objOop)].
  	newObj ifNil:
  		[^0].
  	(self isPointersFormat: fmt)
  		ifTrue:
  			[| hasYoung |
  			 hasYoung := false.
  			 0 to: numSlots - 1 do:
  				[:i| | oop |
  				oop := self fetchPointer: i ofObject: objOop.
  				((self isNonImmediate: oop)
  				 and: [self isForwarded: oop]) ifTrue:
  					[oop := self followForwarded: oop].
  				((self isNonImmediate: oop)
  				 and: [self isYoungObject: oop]) ifTrue:
  					[hasYoung := true].
  				self storePointerUnchecked: i
  					ofObject: newObj
  					withValue: oop].
  			hasYoung ifTrue:
  				[scavenger remember: newObj]]
  		ifFalse:
  			[0 to: numSlots - 1 do:
  				[:i|
  				self storePointerUnchecked: i
  					ofObject: newObj
  					withValue: (self fetchPointer: i ofObject: objOop)].
  			 fmt >= self firstCompiledMethodFormat ifTrue:
  				[coInterpreter maybeFixClonedCompiledMethod: newObj.
  				 ((self isYoungObject: objOop) or: [self isRemembered: objOop]) ifTrue:
  					[scavenger remember: newObj]]].
  	(hash := self rawHashBitsOf: objOop) ~= 0 ifTrue:
  		[self setHashBitsOf: newObj to: hash].
+ 	(self isObjImmutable: objOop) ifTrue:
+ 		[self setIsImmutableOf: newObj to: true].
  	^newObj!

Item was changed:
  ----- Method: SpurMemoryManager>>outOfPlaceBecome:and:copyHashFlag: (in category 'become implementation') -----
  outOfPlaceBecome: obj1 and: obj2 copyHashFlag: copyHashFlag
  	<inline: #never> "in an effort to fix a compiler bug with two-way become post r3427"
  	"Allocate two new objects, n1 & n2.  Copy the contents appropriately. Convert
  	 obj1 and obj2 into forwarding objects pointing to n2 and n1 respectively"
  	| clone1 clone2 |
  	clone1 := (self isContextNonImm: obj1)
  				ifTrue: [coInterpreter cloneContext: obj1]
  				ifFalse: [self clone: obj1].
  	clone2 := (self isContextNonImm: obj2)
  				ifTrue: [coInterpreter cloneContext: obj2]
  				ifFalse: [self clone: obj2].
+ 	(self isObjImmutable: obj1) ifTrue:
+ 		[self setIsImmutableOf: clone1 to: true].
+ 	(self isObjImmutable: obj2) ifTrue:
+ 		[self setIsImmutableOf: clone2 to: true].
  	copyHashFlag
  		ifTrue:
  			[self setHashBitsOf: clone1 to: (self rawHashBitsOf: obj1).
  			 self setHashBitsOf: clone2 to: (self rawHashBitsOf: obj2)]
  		ifFalse:
  			[self setHashBitsOf: clone1 to: (self rawHashBitsOf: obj2).
  			 self setHashBitsOf: clone2 to: (self rawHashBitsOf: obj1)].
  	self
  		forward: obj1 to: clone2;
  		forward: obj2 to: clone1.
  	((self isYoungObject: obj1) ~= (self isYoungObject: clone2)
  	 or: [(self isYoungObject: obj2) ~= (self isYoungObject: clone1)]) ifTrue:
  		[becomeEffectsFlags := becomeEffectsFlags bitOr: OldBecameNewFlag]!



More information about the Vm-dev mailing list