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

commits at source.squeak.org commits at source.squeak.org
Fri Dec 11 14:24:09 UTC 2015


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

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

Name: VMMaker.oscog-cb.1579
Author: cb
Time: 11 December 2015, 3:22:35.575 pm
UUID: 3e053d5a-393a-4f63-ba6e-2322be747aa9
Ancestors: VMMaker.oscog-cb.1578

Added the option so it is not included in the compilation as this method can't compile to C.

=============== Diff against VMMaker.oscog-cb.1578 ===============

Item was changed:
  ----- Method: InterpreterPrimitives>>canBeImmutable: (in category 'object access primitives') -----
  canBeImmutable: oop
+ 	"Currently cant compile to C"
+ 	<option: #IMMUTABILITY>
  	| scheduler processLists list first last link |
  	
  	self assert: (objectMemory isNonImmediate: oop).
  	
  	"For now we fail the primitive for contexts to we ensure there are no immutable contexts.
  	Later we can consider having immutable contexts and send cannotReturn callback
  	when returning to an immutable context. That would mean that setting a context 
  	to immutable would require a divorce and returns to immutable context are 
  	necessarily across stack pages"
  	(objectMemory isContext: oop) ifTrue: [ ^ false ].
  	
  	"I don't get it for semaphores so they can't be immutable"
  	(objectMemory isSemaphoreObj: oop) ifTrue: [^ false].
  	
  	"The rest of the code is relative to process management: the Processor (the active 
  	process scheduler) can't be immutable, as well as all the objects relative to Process management "
  	scheduler := self fetchPointer: ValueIndex ofObject: (self splObj: SchedulerAssociation).
  	processLists := objectMemory fetchPointer: ProcessListsIndex ofObject: scheduler.
  	((objectMemory formatOf: oop) = objectMemory nonIndexablePointerFormat)
  		ifFalse: 
  			[ (objectMemory isArrayNonImm: oop) ifFalse: [ ^ true ].
  			  ^ (oop = processLists) not ].
  	(objectMemory numSlotsOf: oop) >= 2 ifFalse: [ ^ true ].
  	"is the oop the scheduler itself ?"
  	oop = scheduler ifTrue: [ ^ false ].
  	1 to: (objectMemory numSlotsOf: processLists) do: [ :i |
  		"is the oop one of the linked lists ?"
  		(list := processLists at: i) = oop ifTrue: [^ false].
  		"is the oop one of the runnable process ?"
  		first := objectMemory fetchPointer: FirstLinkIndex ofObject: list.
  		first = objectMemory nilObject ifFalse: 
  			[ last := objectMemory fetchPointer: LastLinkIndex ofObject: list.
  			  link := first.
  			  [ link = last ] whileFalse: 
  				[ link = oop ifTrue: [ ^ false ]. 
  				  link := objectMemory fetchPointer: NextLinkIndex ofObject: link. ] ] ].
  	^ true!



More information about the Vm-dev mailing list