Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.412.mcz ==================== Summary ==================== Name: Cog-eem.412 Author: eem Time: 23 October 2020, 8:21:06.015949 pm UUID: 5aa6e5fb-f48c-45fc-9b43-a5ffda953561 Ancestors: Cog-eem.411 Simplifications in set/void register state. State to revive MultiProcessor. =============== Diff against Cog-eem.411 =============== Item was removed: - ----- Method: BochsIA32Alien>>setRegisterState: (in category 'accessing-abstract') ----- - setRegisterState: aRegisterStateArray - "N.B. keep in sync with voidRegisterState" - self eax: (aRegisterStateArray at: 1). - self ebx: (aRegisterStateArray at: 2). - self ecx: (aRegisterStateArray at: 3). - self edx: (aRegisterStateArray at: 4). - self esp: (aRegisterStateArray at: 5). - self ebp: (aRegisterStateArray at: 6). - self esi: (aRegisterStateArray at: 7). - self edi: (aRegisterStateArray at: 8). - self eip: (aRegisterStateArray at: 9). - self eflags: (aRegisterStateArray at: 10). - self xmm0low: (aRegisterStateArray at: 11). - self xmm1low: (aRegisterStateArray at: 12). - self xmm2low: (aRegisterStateArray at: 13). - self xmm3low: (aRegisterStateArray at: 14). - self xmm4low: (aRegisterStateArray at: 15). - self xmm5low: (aRegisterStateArray at: 16). - self xmm6low: (aRegisterStateArray at: 17). - self xmm7low: (aRegisterStateArray at: 18)! Item was removed: - ----- Method: BochsIA32Alien>>voidRegisterState (in category 'accessing-abstract') ----- - voidRegisterState - "N.B. keep in sync with setRegisterState:" - self setRegisterState: (Array new: 18 withAll: 0)! Item was added: + ----- Method: CogProcessorAlien>>setRegisterState: (in category 'accessing-abstract') ----- + setRegisterState: aRegisterStateArray + "N.B. keep in sync with registerState, voidRegisterState, registerStateSetters, registerStateGetters" + | setters | + setters := self registerStateSetters. + aRegisterStateArray withIndexDo: + [:state :index| + self perform: (setters at: index) with: state]! Item was added: + ----- Method: CogProcessorAlien>>voidRegisterState (in category 'accessing-abstract') ----- + voidRegisterState + "N.B. keep in sync with registerState, voidRegisterState, registerStateSetters, registerStateGetters" + self registerStateSetters do: + [:setter| self perform: setter with: 0]! Item was removed: - ----- Method: GdbARMAlien>>setRegisterState: (in category 'accessing-abstract') ----- - setRegisterState: aRegisterStateArray - "N.B. keep in sync with voidRegisterState" - - self r0: (aRegisterStateArray at: 1). - self r1: (aRegisterStateArray at: 2). - self r2: (aRegisterStateArray at: 3). - self r3: (aRegisterStateArray at: 4). - self r4: (aRegisterStateArray at: 5). - self r5: (aRegisterStateArray at: 6). - self r6: (aRegisterStateArray at: 7). - self r7: (aRegisterStateArray at: 8). - self r8: (aRegisterStateArray at: 9). - self r9: (aRegisterStateArray at: 10). - self r10: (aRegisterStateArray at: 11). - self fp: (aRegisterStateArray at: 12). - self r12: (aRegisterStateArray at: 13). - self sp: (aRegisterStateArray at: 14). - self lr: (aRegisterStateArray at: 15). - self pc: (aRegisterStateArray at: 16). - self eflags: (aRegisterStateArray at: 17).! Item was removed: - ----- Method: GdbARMAlien>>voidRegisterState (in category 'accessing-abstract') ----- - voidRegisterState - "N.B. keep in sync with setRegisterState:" - self setRegisterState: (Array new: 17 withAll: 0)! Item was changed: Object subclass: #MultiProcessor + instanceVariableNames: 'mutex processor guardedProcessorProtocol unguardedProcessorProtocol owner registerState coInterpreter threadIndex cogit' - instanceVariableNames: 'mutex processor guardedProcessorProtocol unguardedProcessorProtocol owner registerState coInterpreter threadIndex' classVariableNames: '' poolDictionaries: '' category: 'Cog-Processors'! Item was changed: ----- Method: MultiProcessor>>coInterpreter: (in category 'initialize-release') ----- coInterpreter: aCoInterpreter + coInterpreter := aCoInterpreter. + cogit := aCoInterpreter cogit! - coInterpreter := aCoInterpreter! Item was changed: ----- Method: MultiProcessor>>doesNotUnderstand: (in category 'message forwarding') ----- doesNotUnderstand: aMessage "Forward a message to the actual processor, managing a thread-switch if necessary. Catch ProcessorSimulationTraps and raise them outside of the critical section to avoid deadlock when reentering the VM from a trap and switching threads in the run-time." | selector result trap | selector := aMessage selector. (guardedProcessorProtocol includes: selector) ifFalse: [^(unguardedProcessorProtocol includes: selector) ifTrue: [processor perform: selector withArguments: aMessage arguments] ifFalse: [super doesNotUnderstand: aMessage]]. + (#(simulateLeafCallOf:nextpc:memory:) includes: selector) ifTrue: + [self halt: selector]. result := [mutex critical: [owner ~~ mutex owningProcess ifTrue: [owner ifNotNil: [registerState at: owner put: processor registerState]. (registerState at: (owner := mutex owningProcess) ifAbsent: nil) ifNil: [coInterpreter initializeProcessorForThreadIndex: (threadIndex := threadIndex + 1)] ifNotNil: [:newState| processor setRegisterState: newState]]. processor perform: selector withArguments: aMessage arguments]] + on: ProcessorSimulationTrap, Error, AssertionFailure + do: [:ex| + ex class == ProcessorSimulationTrap ifFalse: + [ex pass]. + trap := ex]. - on: ProcessorSimulationTrap, Error - do: [:ex| trap := ex]. ^trap ifNil: [result] ifNotNil: [trap signal]! Item was added: + ----- Method: MultiProcessor>>flushICacheFrom:to: (in category 'system primitives') ----- + flushICacheFrom: startAddress "<Integer>" to: endAddress "<Integer>" + processor flushICacheFrom: startAddress to: endAddress! Item was changed: ----- Method: MultiProcessor>>processor: (in category 'initialize-release') ----- processor: aProcessor processor := aProcessor. + "Try and compute messages such as those in the execution category, for which + we should thread-switch, and those, in accessing, for which we don't need to. + Better would be to use pragmas to label those messages we should thread-switch on." + guardedProcessorProtocol := Set new. + unguardedProcessorProtocol := Set new. + (aProcessor class withAllSuperclasses copyUpThrough: CogProcessorAlien) do: + [:class| + unguardedProcessorProtocol addAll: class selectors. + #(execution) do: + [ :category| + guardedProcessorProtocol addAll: (class organization listAtCategoryNamed: category)]]. + unguardedProcessorProtocol removeAll: guardedProcessorProtocol! - guardedProcessorProtocol := aProcessor class selectors asSet - addAll: aProcessor class superclass selectors; - yourself. - unguardedProcessorProtocol := #(#'Cog API' #opcodes #disassembly #printing) - inject: Set new - into: [ :protocol :category| - protocol - addAll: (aProcessor class organization listAtCategoryNamed: category); - addAll: (aProcessor class superclass organization listAtCategoryNamed: category); - yourself]. - guardedProcessorProtocol removeAll: unguardedProcessorProtocol! Item was added: + ----- Method: Mutex>>owningProcess (in category '*Cog-Processors-accessing') ----- + owningProcess + ^owner! |
Free forum by Nabble | Edit this page |