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

commits at source.squeak.org commits at source.squeak.org
Fri Jan 27 18:55:38 UTC 2017


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

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

Name: VMMaker.oscog-eem.2116
Author: eem
Time: 27 January 2017, 10:54:32.147069 am
UUID: aacee506-96d1-4cb6-8a9c-d27fb6b54754
Ancestors: VMMaker.oscog-eem.2115

Newspeak: Comment NSSendCache.

Make the SpurPlanningCompactor movement tracing stuff optional and in agreement with the scavenger's facilities.

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

Item was changed:
  VMStructType subclass: #NSSendCache
  	instanceVariableNames: 'classTag enclosingObject target selector numArgs depth'
  	classVariableNames: ''
  	poolDictionaries: 'CogMethodConstants VMBasicConstants'
  	category: 'VMMaker-JIT'!
+ 
+ !NSSendCache commentStamp: 'eem 1/27/2017 10:04' prior: 0!
+ A NSSendCache is an inline cache for Newspeak absent receiver sends, designed and implemented by Ryan Macnak.  These caches are used with four varieties of absent receiver sends:
+ 	absent self send
+ 	absent implciit receiver send
+ 	absent dynamic super send
+ 	absent outer send.
+ 
+ See Cogit>>#linkNSSendCache:classTag:enclosingObject:target:caller: and senders.  These caches have
+   - a guarded class id (not an oop)
+   - an absent receiver (or 0 if it is the method receiver) (an oop or 0)
+   - a target method in the code zone (not an oop)
+   - depth (not an oop) the nesting depth of the receiver fror an outer send, or < 0 if not nested
+   - numArgs (not an oop)
+   - the selector (an oop)
+ 
+ The selector, numArgs and depth are read at link time.  The class id is checked at send time and if it matches, the absentReceiver, enclosingObject numArgs and and target method are read, self being substituted for the absentReceiver if absentReceiver is 0.  numArgs is read for sends with arity > 3 (it is implicit in the trampoline for arities 0 to 3) and used to adjust the stack and insert the relevant receiver.  See genNSSendTrampolineFor:numArgs:enclosingObjectCheck:called:.
+ 
+ Note that the caches themselves are also pinned objects on the heap (a non-object punned word array whose elements are not traced) rather than in the code zone, so GC also needs to trace and update references from Cogged methods to these cache objects.  The absent receiver can be updated or cleared on GC. The selector must be updated on GC. The target method can be updated or cleared on code compaction.  The class id, absent receiver, and target method are weak references. cache->selector and method->cache are strong references..
+ 
+ Instance Variables
+ 	classTag:			<Integer>
+ 	depth:				<Integer>
+ 	enclosingObject:	<Object or 0>
+ 	numArgs:			<Integer>
+ 	selector:			<Object>
+ 	target:				<CogMethod>
+ 
+ classTag
+ 	- classTag of the method receiver for which this is valid (the classTag of self in the method in which the send occurs, not the class of the message receiver)
+ 
+ depth
+ 	- nesting depth for outer sends
+ 
+ enclosingObject
+ 	- the oop of the enclosingObject or 0 if none
+ 
+ numArgs
+ 	- send numArgs
+ 
+ selector
+ 	- the oop of the message's selector
+ 
+ target
+ 	- the target CogMethod or 0 if none
+ !

Item was changed:
  ----- Method: SpurPlanningCompactor>>forwardMobileObject:to:savedFirstFieldPtr: (in category 'private') -----
  forwardMobileObject: o to: toFinger savedFirstFieldPtr: savedFirstFieldPtr
  	"Forward a mobile object to some new location, saving its first field through savedFirstFieldPtr.
  	 Don't use forward:to:; we dont want to alter the object in any way other than by setting the forwarding pointer."
  	<inline: true>
  	lastMobileObject := o.
  	manager
  		longAt: savedFirstFieldPtr
  			put: (manager fetchPointer: 0 ofObject: o);
  		storePointerUnchecked: 0
  			ofObject: o
  				withValue: ((manager hasOverflowHeader: o)
  								ifTrue: [toFinger + manager baseHeaderSize]
  								ifFalse: [toFinger]).
+ 	self cCode: '' inSmalltalk: [relocationMap ifNotNil: [:rm| rm at: o put: savedFirstFieldPtr]]!
- 	self cCode: '' inSmalltalk: [relocationMap at: o put: savedFirstFieldPtr]!

Item was changed:
  ----- Method: SpurPlanningCompactor>>initializeCompaction (in category 'compaction') -----
  initializeCompaction
  	manager checkFreeSpace: GCModeFull.
  	self selectSavedFirstFieldsSpace.
  	self unpinRememberedSet.
  	manager
  		resetFreeListHeads;
  		totalFreeOldSpace: 0;
  		beginSlidingCompaction.
+ 	savedFirstFieldsSpace top: savedFirstFieldsSpace start - manager bytesPerOop!
- 	savedFirstFieldsSpace top: savedFirstFieldsSpace start - manager bytesPerOop.
- 	self cCode: '' inSmalltalk: [relocationMap := Dictionary new]!

Item was added:
+ ----- Method: SpurPlanningCompactor>>recordMovements (in category 'compaction') -----
+ recordMovements
+ 	relocationMap := Dictionary new!



More information about the Vm-dev mailing list