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

commits at source.squeak.org commits at source.squeak.org
Tue Jan 14 23:42:17 UTC 2014


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

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

Name: VMMaker.oscog-eem.585
Author: eem
Time: 14 January 2014, 3:37:02.93 pm
UUID: ffc9c619-e2b4-4432-977e-aba381f975ff
Ancestors: VMMaker.oscog-eem.584

Fix become on compiled methods in Spur.  followForwardedMethods
must use isForwarded:/followForwarded: not shouldRemapObj:
because the latter will confuse methods in newSpace for forwarded
methods. Rename the interpreter followForwardedMethods' to
followForwardedMethodsInMethodZone.

In General:
Fix some comment typos.  Better comment the closed PIC prototype.

Add CogMethodZone>>printCogYoungReferrers.

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

Item was removed:
- ----- Method: CoInterpreter>>followForwardedMethods (in category 'object memory support') -----
- followForwardedMethods
- 	<doNotGenerate>
- 	cogit followForwardedMethods!

Item was added:
+ ----- Method: CoInterpreter>>followForwardedMethodsInMethodZone (in category 'object memory support') -----
+ followForwardedMethodsInMethodZone
+ 	<inline: true>
+ 	cogit followForwardedMethods!

Item was added:
+ ----- Method: CogMethodZone>>printCogYoungReferrers (in category 'printing') -----
+ printCogYoungReferrers
+ 	<api>
+ 	<returnTypeC: #void>
+ 	| pointer cogMethod |
+ 	<var: #cogMethod type: #'CogMethod *'>
+ 	pointer := youngReferrers.
+ 	[pointer < limitAddress] whileTrue:
+ 		[cogMethod := coInterpreter cCoerceSimple: (objectMemory longAt: pointer) to: #'CogMethod *'.
+ 		 cogMethod cmRefersToYoung ifFalse:
+ 			[coInterpreter print: '* '].
+ 		 coInterpreter printCogMethod: cogMethod.
+ 		 pointer := pointer + BytesPerWord]!

Item was changed:
  ----- Method: Cogit>>compileClosedPICPrototype (in category 'in-line cacheing') -----
  compileClosedPICPrototype
+ 	"Compile the abstract instructions for a full closed PIC used to initialize closedPICSize.
+ 	 The loads into SendNumArgsReg are those for optional method objects which may be
+ 	 used in MNU cases."
- 	"Compile the abstract instructions for a full closed PIC used to initialize closedPICSize"
  	| numArgs jumpNext |
  	<var: #jumpNext type: #'AbstractInstruction *'>
  	numArgs := 0.
  	self compilePICProlog: numArgs.
  	jumpNext := self compileCPICEntry.
  	self MoveCw: 16r5EAF00D R: SendNumArgsReg.
  	self JumpLong: 16r5EEDCA5E.
  	jumpNext jmpTarget: (endCPICCase0 := self Label).
  	1 to: numPICCases - 1 do:
  		[:h|
  		self CmpCw: 16rBABE1F15+h R: TempReg.
  		self MoveCw: 16rBADA550 + h R: SendNumArgsReg.
  		self JumpLongZero: 16rBEDCA5E0.
  		h = 1 ifTrue:
  			[endCPICCase1 := self Label]].
  	self MoveCw: 16rAB5CE55 R: ClassReg.
  	self JumpLong: (self cPICMissTrampolineFor: numArgs).
  	^0!

Item was changed:
  ----- Method: Cogit>>followForwardedMethods (in category 'garbage collection') -----
  followForwardedMethods
  	<api>
  	<option: #SpurObjectMemory>
  	<var: #cogMethod type: #'CogMethod *'>
  	| cogMethod freedPIC |
  	<var: #cogMethod type: #'CogMethod *'>
  	freedPIC := false.
  	cogMethod := self cCoerceSimple: methodZoneBase to: #'CogMethod *'.
  	[cogMethod < methodZone limitZony] whileTrue:
  		[cogMethod cmType = CMMethod ifTrue:
+ 			[(objectMemory isForwarded: cogMethod methodObject) ifTrue:
+ 				[cogMethod methodObject: (objectMemory followForwarded: cogMethod methodObject).
- 			[(objectMemory shouldRemapOop: cogMethod methodObject) ifTrue:
- 				[cogMethod methodObject: (objectMemory remapObj: cogMethod methodObject).
  				 (cogMethod cmRefersToYoung not
  				  and: [objectMemory isYoungObject: cogMethod methodObject]) ifTrue:
  					[methodZone addToYoungReferrers: cogMethod]]].
  		 cogMethod cmType = CMClosedPIC ifTrue:
+ 			[(self followMethodReferencesInClosedPIC: cogMethod) ifTrue:
- 			[(self mapObjectReferencesInClosedPIC: cogMethod) ifTrue:
  				[freedPIC := true.
  				 methodZone freeMethod: cogMethod]].
  		 cogMethod := methodZone methodAfter: cogMethod].
  	freedPIC ifTrue:
  		[self unlinkSendsToFree.
  		 processor flushICacheFrom: codeBase to: methodZone limitZony asInteger]!

Item was added:
+ ----- Method: Cogit>>followMaybeObjRefAt: (in category 'garbage collection') -----
+ followMaybeObjRefAt: mcpc
+ 	"Follow a potential object reference from a closed PIC.
+ 	 This may be a method reference or null.
+ 	 Answer if the followed literal is young."
+ 	| object subject |
+ 	object := backEnd literalBeforeFollowingAddress: mcpc.
+ 	(objectRepresentation couldBeObject: object) ifFalse:
+ 		[^false].
+ 	(objectMemory isForwarded: object) ifFalse:
+ 		[^objectMemory isYoungObject: object].
+ 	subject := objectMemory followForwarded: object.
+ 	backEnd storeLiteral: subject beforeFollowingAddress: mcpc.
+ 	codeModified := true.
+ 	^objectMemory isYoungObject: subject!

Item was added:
+ ----- Method: Cogit>>followMethodReferencesInClosedPIC: (in category 'garbage collection') -----
+ followMethodReferencesInClosedPIC: cPIC
+ 	"Remap all object references in the closed PIC.  Answer if any references are young.
+ 	Set codeModified if any modifications are made."
+ 	<var: #cPIC type: #'CogMethod *'>
+ 	| pc refersToYoung |
+ 	pc := cPIC asInteger + firstCPICCaseOffset.
+ 	refersToYoung := self followMaybeObjRefAt: pc - backEnd jumpLongByteSize.
+ 	pc := pc + cPICCaseSize.
+ 	2 to: cPIC cPICNumCases do:
+ 		[:i|
+ 		(self followMaybeObjRefAt: pc - backEnd jumpLongConditionalByteSize) ifTrue:
+ 			[refersToYoung := true].
+ 		pc := pc + cPICCaseSize].
+ 	^refersToYoung!

Item was changed:
  ----- Method: Cogit>>updateMaybeObjRefAt: (in category 'garbage collection') -----
  updateMaybeObjRefAt: mcpc
+ 	"Update a potential object reference from a closed PIC.
- 	"Update a potential object reference form a closed PIC.
  	 This may be an object reference, an inline cache tag or null.
  	 Answer if the updated literal is young."
  	| object subject |
  	object := backEnd literalBeforeFollowingAddress: mcpc.
  	(objectRepresentation couldBeObject: object) ifFalse:
  		[^false].
  	subject := objectRepresentation remapOop: object.
  	object ~= subject ifTrue:
  		[backEnd storeLiteral: subject beforeFollowingAddress: mcpc.
  		 codeModified := true].
  	^objectMemory isYoungObject: subject!

Item was changed:
  ----- Method: SpurMemoryManager>>followForwarded: (in category 'forwarding') -----
  followForwarded: objOop
  	"Follow a forwarding pointer.  Alas we cannot prevent forwarders to forwarders
  	 being created by lazy become.  Consider the following example by Igor Stasenko:
  		array := { a. b. c }.
  		- array at: 1 points to &a. array at: 2 points to &b. array at: 3 points to &c Ó
  		a becomeForward: b
  		- array at: 1 still points to &a. array at: 2 still points to &b. array at: 3 still points to &c
  		b becomeForward: c.
  		- array at: 1 still points to &a. array at: 2 still points to &b. array at: 3 still points to &c
  		- when accessing array first one has to follow a forwarding chain:
  		&a -> &b -> c"
+ 	<api>
  	| referent |
  	self assert: (self isForwarded: objOop).
  	referent := self fetchPointer: 0 ofMaybeForwardedObject: objOop.
  	[(self isOopForwarded: referent)] whileTrue:
  		[referent := self fetchPointer: 0 ofMaybeForwardedObject: referent].
  	^referent!

Item was removed:
- ----- Method: StackInterpreter>>followForwardedMethods (in category 'object memory support') -----
- followForwardedMethods
- 	"This is just a stub for the CoInterpreter"!

Item was added:
+ ----- Method: StackInterpreter>>followForwardedMethodsInMethodZone (in category 'object memory support') -----
+ followForwardedMethodsInMethodZone
+ 	"This is just a stub for the CoInterpreter"!

Item was changed:
  ----- Method: StackInterpreter>>postBecomeAction: (in category 'object memory support') -----
  postBecomeAction: theBecomeEffectsFlags
  	theBecomeEffectsFlags ~= 0 ifTrue:
  		[self followForwardingPointersInStackZone: theBecomeEffectsFlags.
  		 (theBecomeEffectsFlags anyMask: BecameCompiledMethodFlag) ifTrue:
+ 			[self followForwardedMethodsInMethodCache.
+ 			 self followForwardedMethodsInMethodZone]. "for CoInterpreter"
- 			[self followForwardedMethodsInMethodCache].
- 		 self followForwardedMethods. "for CoInterpreter"
  		 self followForwardingPointersInScheduler]!



More information about the Vm-dev mailing list