Leon Matthes uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.threaded-LM.3354.mcz
==================== Summary ====================
Name: VMMaker.threaded-LM.3354 Author: LM Time: 19 March 2024, 2:33:25.880875 pm UUID: 469cd714-e1fa-435c-ad9d-b577ee0536d2 Ancestors: VMMaker.threaded-LM.3353
Increase Owner Log to 1Mi entries.
Some small additional adjustments
=============== Diff against VMMaker.threaded-LM.3353 ===============
Item was changed: ----- Method: CoInterpreterMT>>threadAffinityFieldValueOf: (in category 'process primitive support') ----- threadAffinityFieldValueOf: aProcess + <inline: false> "Should not be inlined, as it's useful for debugging." ^processHasThreadAffinity ifTrue: [| field | field := objectMemory fetchPointer: ThreadIdIndex ofObject: aProcess. field = objectMemory nilObject ifTrue: [0] ifFalse: [objectMemory integerValueOf: field]] ifFalse: [0]!
Item was changed: ----- Method: CogThreadManager class>>initialize (in category 'class initialization') ----- initialize "CogThreadManager initialize" CTMUninitialized := 0. CTMInitializing := 1. CTMUnavailable := 2. "off doing its own thing and not available to run the VM, e.g. calling-out." CTMAssignableOrInVM := 3. "either owning the VM or blocked on its osSemaphore available for VM work" CTMWantingOwnership := 4. "with something specific to do in the VM (e.g. return a result from a call-out, make a call-back)" CTMUnknownOwner := -1.
"Define the size of the stack of processes at time of disown/own." AWOLProcessesIncrement := 4. + OwnerLogSize := 1024 * 1024 "1M entries for logging owner switches".! - OwnerLogSize := 100 * 1024.!
Item was changed: ----- Method: FilePlugin>>primitiveFileReadPinningAndDisowning (in category 'file primitives') ----- primitiveFileReadPinningAndDisowning "This version of primitiveFileRead is for garbage collectors that support pinning and the multi-threaded VM. It actually does the own/disown dance if the bytearray is pinned." | count startIndex array file slotSize elementSize bytesRead vmHandle | <inline: true> <var: 'file' type: #'SQFile *'> <var: 'count' type: #'size_t'> <var: 'startIndex' type: #'size_t'> <var: 'slotSize' type: #'size_t'> <var: 'elementSize' type: #'size_t'> count := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 0). startIndex := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 1). array := interpreterProxy stackValue: 2. file := self fileValueOf: (interpreterProxy stackValue: 3). vmHandle := nil.
(interpreterProxy failed "buffer can be any indexable words or bytes object except CompiledMethod" or: [(interpreterProxy isWordsOrBytes: array) not]) ifTrue: [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
slotSize := interpreterProxy slotSizeOf: array. (startIndex >= 1 and: [startIndex + count - 1 <= slotSize]) ifFalse: [^interpreterProxy primitiveFailFor: PrimErrBadIndex]. - (interpreterProxy isPinned: array) ifTrue: - [vmHandle := interpreterProxy disownVM: DisownVMForThreading]. "Note: adjust startIndex for zero-origin byte indexing" elementSize := slotSize = 0 ifTrue: [1] ifFalse: [(interpreterProxy byteSizeOf: array) // slotSize]. + + (interpreterProxy isPinned: array) ifTrue: + [vmHandle := interpreterProxy disownVM: DisownVMForThreading]. bytesRead := self sqFile: file Read: count * elementSize Into: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *') At: startIndex - 1 * elementSize. vmHandle ifNotNil: [interpreterProxy ownVM: vmHandle].
interpreterProxy failed ifFalse: [interpreterProxy methodReturnInteger: bytesRead // elementSize] "answer # of elements read"!
Item was changed: ----- Method: SpurMemoryManager>>printOopsFrom:to: (in category 'debug printing') ----- printOopsFrom: startAddress to: endAddress <public> "useful for VM debugging" | oop limit firstNonEntity inEmptySpace lastNonEntity | oop := self objectBefore: startAddress. limit := endAddress asUnsignedIntegerPtr min: endOfMemory. oop := oop ifNil: [startAddress] ifNotNil: [(self objectAfter: oop) = startAddress ifTrue: [startAddress] ifFalse: [oop]]. + inEmptySpace := false. - inEmptySpace := false. [self oop: oop isLessThan: limit] whileTrue: [self printEntity: oop. [oop := self objectAfter: oop. (self long64At: oop) = 0] whileTrue: [inEmptySpace ifFalse: [inEmptySpace := true. firstNonEntity := oop]. lastNonEntity := oop]. inEmptySpace ifTrue: [inEmptySpace := false. coInterpreter print: 'skipped empty space from '; printHexnp: firstNonEntity; print:' to '; printHexnp: lastNonEntity; cr. oop := self objectStartingAt: oop]]!
vm-dev@lists.squeakfoundation.org