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

commits at source.squeak.org commits at source.squeak.org
Tue Jun 16 17:24:41 UTC 2015


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

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

Name: VMMaker.oscog-eem.1356
Author: eem
Time: 16 June 2015, 10:22:20.888 am
UUID: 27c54f55-7a3e-447b-b627-bbef39086d7c
Ancestors: VMMaker.oscog-eem.1355

Revise object reference scanning in PICs to allow
for out-of-line literals.  Indirect through the literals
manager to access obj refs and distinguish method
literal and class obj refs. Rename the accessors to
make clear they're for use only in closed PICs.

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

Item was removed:
- ----- Method: Cogit>>checkMaybeObjRefAt: (in category 'garbage collection') -----
- checkMaybeObjRefAt: mcpc
- 	| maybeObject |
- 	maybeObject := backEnd literalBeforeFollowingAddress: mcpc.
- 	maybeObject = 0 ifTrue:
- 		[^true].
- 	(objectRepresentation couldBeObject: maybeObject) ifFalse:
- 		[^true].
- 	^objectRepresentation checkValidObjectReference: maybeObject!

Item was added:
+ ----- Method: Cogit>>checkMaybeObjRefInClosedPIC: (in category 'garbage collection') -----
+ checkMaybeObjRefInClosedPIC: maybeObject
+ 	maybeObject = 0 ifTrue:
+ 		[^true].
+ 	(objectRepresentation couldBeObject: maybeObject) ifFalse:
+ 		[^true].
+ 	^objectRepresentation checkValidObjectReference: maybeObject!

Item was changed:
  ----- Method: Cogit>>checkValidObjectReferencesInClosedPIC: (in category 'garbage collection') -----
  checkValidObjectReferencesInClosedPIC: cPIC
  	<var: #cPIC type: #'CogMethod *'>
  	| ok pc |
  	ok := true.
  	pc := cPIC asInteger + firstCPICCaseOffset.
+ 	(self checkMaybeObjRefInClosedPIC: (literalsManager objRefInClosedPICAt: pc - backEnd jumpLongByteSize)) ifFalse:
- 	(self checkMaybeObjRefAt: pc - backEnd jumpLongByteSize) ifFalse:
  		[self print: 'object leak in CPIC '; printHex: cPIC asInteger;
  			print: ' @ '; printHex: pc - backEnd jumpLongByteSize; cr.
  		 ok := false].
  	pc := pc + cPICCaseSize.
  	2 to: cPIC cPICNumCases do:
  		[:i|
  		objectRepresentation inlineCacheTagsMayBeObjects ifTrue:
+ 			[(self checkMaybeObjRefInClosedPIC: (literalsManager classRefInClosedPICAt: pc - backEnd jumpLongConditionalByteSize)) ifFalse:
- 			[(self checkMaybeObjRefAt: pc - backEnd jumpLongConditionalByteSize - backEnd loadLiteralByteSize) ifFalse:
  				[self print: 'object leak in CPIC '; printHex: cPIC asInteger;
  					print: ' @ '; printHex: pc - backEnd jumpLongConditionalByteSize - backEnd loadLiteralByteSize; cr.
  				 ok := false]].
+ 		(self checkMaybeObjRefInClosedPIC: (literalsManager objRefInClosedPICAt: pc - backEnd jumpLongConditionalByteSize)) ifFalse:
- 		(self checkMaybeObjRefAt: pc - backEnd jumpLongConditionalByteSize) ifFalse:
  			[self print: 'object leak in CPIC '; printHex: cPIC asInteger;
  				print: ' @ '; printHex: pc - backEnd jumpLongConditionalByteSize; cr.
  			 ok := false].
  		pc := pc + cPICCaseSize].
  	^ok!

Item was removed:
- ----- 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>>followMaybeObjRefInClosedPICAt: (in category 'garbage collection') -----
+ followMaybeObjRefInClosedPICAt: 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 := literalsManager objRefInClosedPICAt: mcpc.
+ 	(objectRepresentation couldBeObject: object) ifFalse:
+ 		[^false].
+ 	(objectMemory isForwarded: object) ifFalse:
+ 		[^objectMemory isYoungObject: object].
+ 	subject := objectMemory followForwarded: object.
+ 	literalsManager storeObjRef: subject inClosedPICAt: mcpc.
+ 	codeModified := true.
+ 	^objectMemory isYoungObject: subject!

Item was changed:
  ----- 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 followMaybeObjRefInClosedPICAt: pc - backEnd jumpLongByteSize.
- 	refersToYoung := self followMaybeObjRefAt: pc - backEnd jumpLongByteSize.
  	pc := pc + cPICCaseSize.
  	2 to: cPIC cPICNumCases do:
  		[:i|
+ 		(self followMaybeObjRefInClosedPICAt: pc - backEnd jumpLongConditionalByteSize) ifTrue:
- 		(self followMaybeObjRefAt: pc - backEnd jumpLongConditionalByteSize) ifTrue:
  			[refersToYoung := true].
  		pc := pc + cPICCaseSize].
  	^refersToYoung!

Item was changed:
  ----- Method: Cogit>>mapObjectReferencesInClosedPIC: (in category 'garbage collection') -----
  mapObjectReferencesInClosedPIC: 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 updateMaybeObjRefInClosedPICAt: pc - backEnd jumpLongByteSize.
- 	refersToYoung := self updateMaybeObjRefAt: pc - backEnd jumpLongByteSize.
  	pc := pc + cPICCaseSize.
  	2 to: cPIC cPICNumCases do:
  		[:i|
  		objectRepresentation inlineCacheTagsMayBeObjects ifTrue:
+ 			[(self updateMaybeClassRefAt: pc - backEnd jumpLongConditionalByteSize) ifTrue:
- 			[(self updateMaybeObjRefAt: pc - backEnd jumpLongConditionalByteSize - backEnd loadLiteralByteSize) ifTrue:
  				[refersToYoung := true]].
+ 		(self updateMaybeObjRefInClosedPICAt: pc - backEnd jumpLongConditionalByteSize) ifTrue:
- 		(self updateMaybeObjRefAt: pc - backEnd jumpLongConditionalByteSize) ifTrue:
  			[refersToYoung := true].
  		pc := pc + cPICCaseSize].
  	^refersToYoung!

Item was added:
+ ----- Method: Cogit>>updateMaybeClassRefInClosedPICAt: (in category 'garbage collection') -----
+ updateMaybeClassRefInClosedPICAt: mcpc
+ 	"Update a potential object reference from 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 := literalsManager classRefInClosedPICAt: mcpc.
+ 	(objectRepresentation couldBeObject: object) ifFalse:
+ 		[^false].
+ 	subject := objectRepresentation remapOop: object.
+ 	object ~= subject ifTrue:
+ 		[literalsManager storeClassRef: subject inClosedPICAt: mcpc.
+ 		 codeModified := true].
+ 	^objectMemory isYoungObject: subject!

Item was removed:
- ----- Method: Cogit>>updateMaybeObjRefAt: (in category 'garbage collection') -----
- updateMaybeObjRefAt: mcpc
- 	"Update a potential object reference from 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 added:
+ ----- Method: Cogit>>updateMaybeObjRefInClosedPICAt: (in category 'garbage collection') -----
+ updateMaybeObjRefInClosedPICAt: mcpc
+ 	"Update a potential object reference from 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 := literalsManager objRefInClosedPICAt: mcpc.
+ 	(objectRepresentation couldBeObject: object) ifFalse:
+ 		[^false].
+ 	subject := objectRepresentation remapOop: object.
+ 	object ~= subject ifTrue:
+ 		[literalsManager storeObjRef: subject inClosedPICAt: mcpc.
+ 		 codeModified := true].
+ 	^objectMemory isYoungObject: subject!

Item was changed:
  VMClass subclass: #InLineLiteralsManager
+ 	instanceVariableNames: 'cogit backEnd'
- 	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'VMMaker-JIT'!
  
  !InLineLiteralsManager commentStamp: 'eem 6/7/2015 12:07' prior: 0!
  An InLineLiteralsManager is a dummy class that understands the OutOfLineLiteralsManager API but does nothing.  It is used to allow the Cogits to work with back-ends that generate either in-line or out-of-line literals.!

Item was added:
+ ----- Method: InLineLiteralsManager>>classRefInClosedPICAt: (in category 'garbage collection') -----
+ classRefInClosedPICAt: mcpc
+ 	<inline: true>
+ 	^backEnd literalBeforeFollowingAddress: mcpc - backEnd loadLiteralByteSize!

Item was changed:
  ----- Method: InLineLiteralsManager>>cogit: (in category 'initialization') -----
  cogit: aCogit
+ 	<doNotGenerate>
+ 	cogit := aCogit.
+ 	backEnd := aCogit backEnd!
- 	<doNotGenerate>!

Item was added:
+ ----- Method: InLineLiteralsManager>>objRefInClosedPICAt: (in category 'garbage collection') -----
+ objRefInClosedPICAt: mcpc
+ 	<inline: true>
+ 	^cogit backEnd literalBeforeFollowingAddress: mcpc!

Item was added:
+ ----- Method: InLineLiteralsManager>>storeClassRef:inClosedPICAt: (in category 'garbage collection') -----
+ storeClassRef: classObj inClosedPICAt: address
+ 	<var: #address type: #usqInt>
+ 	<inline: true>
+ 	backEnd storeLiteral: classObj beforeFollowingAddress: address - backEnd loadLiteralByteSize!

Item was added:
+ ----- Method: InLineLiteralsManager>>storeObjRef:inClosedPICAt: (in category 'garbage collection') -----
+ storeObjRef: literal inClosedPICAt: address
+ 	<var: #address type: #usqInt>
+ 	<inline: true>
+ 	backEnd storeLiteral: literal beforeFollowingAddress: address!

Item was added:
+ ----- Method: OutOfLineLiteralsManager>>classRefInClosedPICAt: (in category 'garbage collection') -----
+ classRefInClosedPICAt: mcpc
+ 	^objectMemory longAt: mcpc - objectMemory bytesPerOop!

Item was added:
+ ----- Method: OutOfLineLiteralsManager>>objRefInClosedPICAt: (in category 'garbage collection') -----
+ objRefInClosedPICAt: mcpc
+ 	^objectMemory longAt: mcpc!

Item was added:
+ ----- Method: OutOfLineLiteralsManager>>storeClassRef:inClosedPICAt: (in category 'garbage collection') -----
+ storeClassRef: classObj inClosedPICAt: address
+ 	<var: #address type: #usqInt>
+ 	<inline: true>
+ 	objectMemory longAt: address - objectMemory bytesPerOop put: classObj!

Item was added:
+ ----- Method: OutOfLineLiteralsManager>>storeObjRef:inClosedPICAt: (in category 'garbage collection') -----
+ storeObjRef: literal inClosedPICAt: address
+ 	<var: #address type: #usqInt>
+ 	<inline: true>
+ 	objectMemory longAt: address put: literal!



More information about the Vm-dev mailing list