[Vm-dev] VM Maker: VMMaker.oscog-cb.2425.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 31 12:26:26 UTC 2018


ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2425.mcz

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

Name: VMMaker.oscog-cb.2425
Author: cb
Time: 31 July 2018, 2:25:52.408855 pm
UUID: 7548185f-235d-4121-82af-bed5fa5ae82b
Ancestors: VMMaker.oscog-eem.2424

New things can be forwarders with selective compactor.

In this case I've just added the code to follow by default since it's on the uncommon path.

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

Item was changed:
  ----- Method: CoInterpreterMT>>wakeHighestPriority (in category 'process primitive support') -----
  wakeHighestPriority
  	"Return the highest priority process that is ready to run.
  	 To save time looking at many empty lists before finding a
  	 runnable process the VM maintains a variable holding the
  	 highest priority runnable process.  If this variable is 0 then the
  	 VM does not know the highest priority and must search all lists.
  
  	 Override to answer nil when there is no runnable process instead of
  	 aborting.  In the threaded VM the abort test is done in transferTo:from:
  	 becaue there may be some thread waiting to own the VM.  The transfer
  	 to the thread shouldn't be done here because not all clients call this in
  	 the right context (allowing a longjmp back to the threadSchedulingLoop)."
  	| schedLists p processList proc ctxt |
  	schedLists := objectMemory fetchPointer: ProcessListsIndex ofObject: self schedulerPointer.
  	p := highestRunnableProcessPriority = 0
  			ifTrue: [objectMemory numSlotsOf: schedLists]
  			ifFalse: [highestRunnableProcessPriority].
  	[(p := p - 1) >= 0] whileTrue:
  		[processList := objectMemory fetchPointer: p ofObject: schedLists.
  	 	 [self isEmptyList: processList] whileFalse:
  			["Only answer processes with a runnable suspendedContext.
  			  Discard those that aren't; the VM would crash otherwise."
  			 proc := self removeFirstLinkOfList: processList.
  			 ctxt := objectMemory fetchPointer: SuspendedContextIndex ofObject: proc.
  			 (self isLiveContext: ctxt) ifTrue:
  				[highestRunnableProcessPriority := p + 1.
  				^proc].
+ 			  self cppIf: SPURVM ifTrue: 
+ 				["This is uncommon, so we can deal with forwarders here instead of assuming there isn't."
+ 				 (self isOopForwarded: ctxt) ifTrue:
+ 					[ctxt := self fixFollowedField: SuspendedContextIndex ofObject: proc withInitialValue: ctxt].
+ 				  (self isLiveContext: ctxt) ifTrue:
+ 					[highestRunnableProcessPriority := p + 1.
+ 					^proc].].
  			 self warning: 'evicted zombie process from run queue']].
  	^nil!

Item was changed:
  ----- Method: StackInterpreter>>wakeHighestPriority (in category 'process primitive support') -----
  wakeHighestPriority
  	"Return the highest priority process that is ready to run.
  	 To save time looking at many empty lists before finding a
  	 runnable process the VM maintains a variable holding the
  	 highest priority runnable process.  If this variable is 0 then the
  	 VM does not know the highest priority and must search all lists.
  	 Note: It is a fatal VM error if there is no runnable process."
  	| schedLists p processList proc ctxt |
  	self externalWriteBackHeadFramePointers.
  	schedLists := objectMemory fetchPointer: ProcessListsIndex ofObject: self schedulerPointer.
  	p := highestRunnableProcessPriority = 0
  			ifTrue: [objectMemory numSlotsOf: schedLists]
  			ifFalse: [highestRunnableProcessPriority].
  	[(p := p - 1) >= 0] whileTrue:
  		[processList := objectMemory fetchPointer: p ofObject: schedLists.
  	 	 [self isEmptyList: processList] whileFalse:
  			["Only answer processes with a runnable suspendedContext.
  			  Discard those that aren't; the VM would crash otherwise."
  			 proc := self removeFirstLinkOfList: processList.
  			 ctxt := objectMemory fetchPointer: SuspendedContextIndex ofObject: proc.
  			 (self isLiveContext: ctxt) ifTrue:
  				[highestRunnableProcessPriority := p + 1.
  				^proc].
+ 			  self cppIf: SPURVM ifTrue: 
+ 				["This is uncommon, so we can deal with forwarders here instead of assuming there isn't."
+ 				 (self isOopForwarded: ctxt) ifTrue:
+ 					[ctxt := self fixFollowedField: SuspendedContextIndex ofObject: proc withInitialValue: ctxt].
+ 				  (self isLiveContext: ctxt) ifTrue:
+ 					[highestRunnableProcessPriority := p + 1.
+ 					^proc].].
  			 self warning: 'evicted zombie process from run queue']].
  	self error: 'scheduler could not find a runnable process'.
  	^nil!



More information about the Vm-dev mailing list