VM Maker: VMMaker.oscog-eem.2483.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2483.mcz

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

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

Name: VMMaker.oscog-eem.2483
Author: eem
Time: 9 November 2018, 7:09:04.460828 pm
UUID: bb25e28f-ce39-4424-9895-b513d5acb9f9
Ancestors: VMMaker.oscog-eem.2482

Add support for a sendWheelEvents flag that persists in the image header and is settable via vmParameterAt: 48 put: ...32...

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

Item was changed:
  ----- Method: CoInterpreter>>getCogVMFlags (in category 'internal interpreter access') -----
  getCogVMFlags
  "Answer an array of flags indicating various properties of the Cog VM.
  These are the same as the image header flags shifted right two bits (excluding float order and full screen flags).
  Bit 0: specific to CoInterpreterMT
  Bit 1: if set, methods that are interpreted will have the flag bit set in their header
  Bit 2: if set, implies preempting a process does not put it to the back of its run queue
  Bit 3: specific to CoInterpreterMT
+ Bit 4: if set, implies the new finalization scheme where WeakArrays are queued
+ Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events"
- Bit 4: if set, implies the new finalization scheme where WeakArrays are queued"
  ^objectMemory integerObjectOf: (flagInterpretedMethods ifTrue: [2] ifFalse: [0])
  + (preemptionYields ifTrue: [0] ifFalse: [4])
  + (newFinalization ifTrue: [16] ifFalse: [0])
+ + (sendWheelEvents ifTrue: [32] ifFalse: [0])
+ + (imageHeaderFlags >> 2 bitClear: 2 + 4 + 16 + 32)!
- + (imageHeaderFlags >> 2 bitClear: 2 + 4 + 16)!

Item was changed:
  ----- Method: CoInterpreter>>getImageHeaderFlags (in category 'image save/restore') -----
  getImageHeaderFlags
  "Answer the flags that are contained in the 7th long of the image header."
  ^fullScreenFlag "0 or 1"
  + (VMBIGENDIAN ifTrue: [0] ifFalse: [2]) "this is the imageFloatsLittleEndian flag"
  + (flagInterpretedMethods ifTrue: [8] ifFalse: [0])
  + (preemptionYields ifTrue: [0] ifFalse: [16r10])
  + (newFinalization ifTrue: [16r40] ifFalse: [0])
+ + (sendWheelEvents ifTrue: [16r80] ifFalse: [0])
+ + (imageHeaderFlags bitClear: 16rDB) "these are any flags we do not recognize"!
- + (imageHeaderFlags bitClear: 16r5B) "these are any flags we do not recognize"!

Item was changed:
  ----- Method: CoInterpreter>>setCogVMFlags: (in category 'internal interpreter access') -----
  setCogVMFlags: flags
  "Set an array of flags indicating various properties of the Cog VM.
  Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative)
  Bit 1: if set, methods that are interpreted will have the flag bit set in their header
  Bit 2: if set, implies preempting a process does not put it to the back of its run queue
  Bit 3: if set, implies a threaded VM will not dosown the VM if owned by the GUI thread
+ Bit 4: if set, implies the new finalization scheme where WeakArrays are queued
+ Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events"
+ flags asUnsignedInteger > 63 ifTrue:
- Bit 4: if set, implies the new finalization scheme where WeakArrays are queued"
- flags asUnsignedInteger > 31 ifTrue:
  [^self primitiveFailFor: PrimErrUnsupported].
+ "processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT"
+ flagInterpretedMethods := flags anyMask: 2.
+ preemptionYields := flags noMask: 4.
+ "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT"
+ newFinalization := flags anyMask: 16.
+ sendWheelEvents := flags anyMask: 32!
- flagInterpretedMethods := (flags bitAnd: 2) ~= 0.
- preemptionYields := (flags bitAnd: 4) = 0.
- newFinalization := (flags bitAnd: 16) ~= 0!

Item was changed:
  ----- Method: CoInterpreter>>setImageHeaderFlagsFrom: (in category 'image save/restore') -----
  setImageHeaderFlagsFrom: headerFlags
  "Set the flags that are contained in the 7th long of the image header."
  imageHeaderFlags := headerFlags. "so as to preserve unrecognised flags."
  fullScreenFlag := headerFlags bitAnd: 1.
+ imageFloatsBigEndian := (headerFlags noMask: 2) ifTrue: [1] ifFalse: [0].
+ "processHasThreadId := headerFlags anyMask: 4. specific to CoInterpreterMT"
+ flagInterpretedMethods := headerFlags anyMask: 8.
+ preemptionYields := headerFlags noMask: 16.
+ "noThreadingOfGUIThread := headerFlags anyMask: 32. specific to CoInterpreterMT"
+ newFinalization := headerFlags anyMask: 64.
+ sendWheelEvents := headerFlags anyMask: 128!
- imageFloatsBigEndian := (headerFlags bitAnd: 2) = 0 ifTrue: [1] ifFalse: [0].
- flagInterpretedMethods := (headerFlags bitAnd: 8) ~= 0.
- preemptionYields := (headerFlags bitAnd: 16) = 0.
- newFinalization := (headerFlags bitAnd: 64) ~= 0.!

Item was changed:
  ----- Method: CoInterpreterMT>>getCogVMFlags (in category 'internal interpreter access') -----
  getCogVMFlags
  "Answer an array of flags indicating various properties of the Cog VM.
  These are the same as the image header flags shifted right two bits (excluding float order and full screen flags).
  Bit 0: implies the image's Process class has threadId as its 3rd inst var (zero relative)
  Bit 1: if set, methods that are interpreted will have the flag bit set in their header
  Bit 2: if set, implies preempting a process does not put it to the back of its run queue
  Bit 3: if set, implies the GUI will run on the first thread and event queues will not be accessed from other threads
+ Bit 4: if set, implies the new finalization scheme where WeakArrays are queued
+ Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events"
- Bit 4: if set, implies the new finalization scheme where WeakArrays are queued"
  ^objectMemory integerObjectOf: (processHasThreadId ifTrue: [1] ifFalse: [0])
  + (flagInterpretedMethods ifTrue: [2] ifFalse: [0])
  + (preemptionYields ifTrue: [0] ifFalse: [4])
  + (noThreadingOfGUIThread ifTrue: [8] ifFalse: [0])
  + (newFinalization ifTrue: [16] ifFalse: [0])
  + (imageHeaderFlags >> 2 bitClear: 1 + 2 + 4 + 8 + 16)!

Item was changed:
  ----- Method: CoInterpreterMT>>getImageHeaderFlags (in category 'image save/restore') -----
  getImageHeaderFlags
  "Answer the flags that are contained in the 7th long of the image header."
  ^fullScreenFlag "0 or 1"
  + (VMBIGENDIAN ifTrue: [0] ifFalse: [2]) "this is the imageFloatsLittleEndian flag"
  + (processHasThreadId ifTrue: [4] ifFalse: [0])
  + (flagInterpretedMethods ifTrue: [8] ifFalse: [0])
  + (preemptionYields ifTrue: [0] ifFalse: [16r10])
  + (noThreadingOfGUIThread ifTrue: [16r20] ifFalse: [0])
  + (newFinalization ifTrue: [16r40] ifFalse: [0])
+ + (sendWheelEvents ifTrue: [16r80] ifFalse: [0])
+ + (imageHeaderFlags bitClear: 16rFF) "these are any flags we do not recognize"!
- + (imageHeaderFlags bitClear: 16r7F) "these are any flags we do not recognize"!

Item was changed:
  ----- Method: CoInterpreterMT>>setCogVMFlags: (in category 'internal interpreter access') -----
  setCogVMFlags: flags
  "Set an array of flags indicating various properties of the Cog VM.
  Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative)
  Bit 1: if set, methods that are interpreted will have the flag bit set in their header
  Bit 2: if set, implies preempting a process does not put it to the back of its run queue
  Bit 3: if set, implies a threaded VM will not dosown the VM if owned by the GUI thread
+ Bit 4: if set, implies the new finalization scheme where WeakArrays are queued
+ Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events"
+ flags asUnsignedInteger > 63 ifTrue:
- Bit 4: if set, implies the new finalization scheme where WeakArrays are queued"
- flags asUnsignedInteger > 31 ifTrue:
  [^self primitiveFailFor: PrimErrUnsupported].
+ processHasThreadId := flags anyMask: 1.
+ flagInterpretedMethods := flags anyMask: 2.
+ preemptionYields := flags noMask: 4.
+ noThreadingOfGUIThread := flags anyMask: 8.
+ newFinalization := flags anyMask: 16.
+ sendWheelEvents := flags anyMask: 32!
- processHasThreadId := (flags bitAnd: 1) ~= 0.
- flagInterpretedMethods := (flags bitAnd: 2) ~= 0.
- preemptionYields := (flags bitAnd: 4) = 0.
- noThreadingOfGUIThread := (flags bitAnd: 8) ~= 0.
- newFinalization := (flags bitAnd: 16) ~= 0!

Item was changed:
  ----- Method: CoInterpreterMT>>setImageHeaderFlagsFrom: (in category 'image save/restore') -----
  setImageHeaderFlagsFrom: headerFlags
  "Set the flags that are contained in the 7th long of the image header."
  imageHeaderFlags := headerFlags. "so as to preserve unrecognised flags."
  fullScreenFlag := headerFlags bitAnd: 1.
+ imageFloatsBigEndian := (headerFlags noMask: 2) ifTrue: [1] ifFalse: [0].
+ processHasThreadId := headerFlags anyMask: 4.
+ flagInterpretedMethods := headerFlags anyMask: 8.
+ preemptionYields := headerFlags noMask: 16.
+ noThreadingOfGUIThread := headerFlags anyMask: 32.
+ newFinalization := headerFlags anyMask: 64.
+ sendWheelEvents := headerFlags anyMask: 128.
- imageFloatsBigEndian := (headerFlags bitAnd: 2) = 0 ifTrue: [1] ifFalse: [0].
- processHasThreadId := (headerFlags bitAnd: 4) ~= 0.
- flagInterpretedMethods := (headerFlags bitAnd: 8) ~= 0.
- preemptionYields := (headerFlags bitAnd: 16) = 0.
- noThreadingOfGUIThread := (headerFlags bitAnd: 32) ~= 0.
- newFinalization := (headerFlags bitAnd: 64) ~= 0.
 
  processHasThreadId ifFalse:
  [self print: 'warning, processHasThreadId flag is unset; cannot function as a threaded VM if so.'; cr]!

Item was changed:
  InterpreterPrimitives subclass: #StackInterpreter
(excessive size, no diff calculated)

Item was changed:
  ----- Method: StackInterpreter>>getCogVMFlags (in category 'internal interpreter access') -----
  getCogVMFlags
  "Answer an array of flags indicating various properties of the Cog VM.
  These are the same as the image header flags shifted right two bits (excluding float order and full screen flags).
  Bit 0: specific to CoInterpreterMT
  Bit 1: specific to CoInterpreter
  Bit 2: if set, implies preempting a process does not put it to the back of its run queue
  Bit 3: specific to CoInterpreterMT
+ Bit 4: if set, implies the new finalization scheme where WeakArrays are queued
+ Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events"
- Bit 4: if set, implies the new finalization scheme where WeakArrays are queued"
  ^objectMemory integerObjectOf: (preemptionYields ifTrue: [0] ifFalse: [4])
  + (newFinalization ifTrue: [16] ifFalse: [0])
+ + (sendWheelEvents ifTrue: [32] ifFalse: [0])
+ + (imageHeaderFlags >> 2 bitClear: 4 + 16 + 32)!
- + (imageHeaderFlags >> 2 bitClear: 4 + 16)!

Item was changed:
  ----- Method: StackInterpreter>>getImageHeaderFlags (in category 'image save/restore') -----
  getImageHeaderFlags
  "Answer the flags that are contained in the 7th long of the image header."
  ^fullScreenFlag "0 or 1"
  + (VMBIGENDIAN ifTrue: [0] ifFalse: [2]) "this is the imageFloatsLittleEndian flag"
  + (preemptionYields ifTrue: [0] ifFalse: [16r10])
  + (newFinalization ifTrue: [16r40] ifFalse: [0])
+ + (sendWheelEvents ifTrue: [16r80] ifFalse: [0])
+ + (imageHeaderFlags bitClear: 16rD3) "these are any flags we do not recognize"!
- + (imageHeaderFlags bitClear: 16r53) "these are any flags we do not recognize"!

Item was changed:
  ----- Method: StackInterpreter>>initialize (in category 'initialization') -----
  initialize
  "Here we can initialize the variables C initializes to zero.  #initialize methods do /not/ get translated."
  super initialize.
  checkAllocFiller := false. "must precede initializeObjectMemory:"
  stackLimit := 0. "This is also the initialization flag for the stack system."
  stackPage := overflowedPage := 0.
  extraFramesToMoveOnOverflow := 0.
  bytecodeSetSelector := 0.
  highestRunnableProcessPriority := 0.
  nextPollUsecs := 0.
  nextWakeupUsecs := 0.
  tempOop := tempOop2 := theUnknownShort := 0.
  interruptPending := false.
  inIOProcessEvents := 0.
  fullScreenFlag := 0.
+ sendWheelEvents := deferDisplayUpdates := false.
- deferDisplayUpdates := false.
  displayBits := displayWidth := displayHeight := displayDepth := 0.
  pendingFinalizationSignals := statPendingFinalizationSignals := 0.
  globalSessionID := 0.
  jmpDepth := 0.
  longRunningPrimitiveStartUsecs := longRunningPrimitiveStopUsecs := 0.
  maxExtSemTabSizeSet := false.
  debugCallbackInvokes := debugCallbackPath := debugCallbackReturns := 0.
  statForceInterruptCheck := statStackOverflow := statCheckForEvents :=
  statProcessSwitch := statIOProcessEvents := statStackPageDivorce :=
  statIdleUsecs := 0!

Item was changed:
  ----- Method: StackInterpreter>>setCogVMFlags: (in category 'internal interpreter access') -----
  setCogVMFlags: flags
  "Set an array of flags indicating various properties of the Cog VM.
  Bit 2: if set, implies preempting a process does not put it to the back of its run queue
+ Bit 4: if set, implies the new finalization scheme where WeakArrays are queued
+ Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events"
+ flags asUnsignedInteger > 63 ifTrue:
- Bit 4: if set, implies the new finalization scheme where WeakArrays are queued"
- flags asUnsignedInteger > 31 ifTrue:
  [^self primitiveFailFor: PrimErrUnsupported].
+ "processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT"
+ "flagInterpretedMethods := flags anyMask: 2. specific to CoInterpreter"
+ preemptionYields := flags noMask: 4.
+ "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT"
+ newFinalization := flags anyMask: 16.
+ sendWheelEvents := flags anyMask: 32!
- preemptionYields := (flags bitAnd: 4) = 0.
- newFinalization := (flags bitAnd: 16) ~= 0!

Item was changed:
  ----- Method: StackInterpreter>>setImageHeaderFlagsFrom: (in category 'image save/restore') -----
  setImageHeaderFlagsFrom: headerFlags
  "Set the flags that are contained in the 7th long of the image header."
  imageHeaderFlags := headerFlags. "so as to preserve unrecognised flags."
  fullScreenFlag := headerFlags bitAnd: 1.
+ imageFloatsBigEndian := (headerFlags noMask: 2) ifTrue: [1] ifFalse: [0].
+ "processHasThreadId := headerFlags anyMask: 4. specific to CoInterpreterMT"
+ "flagInterpretedMethods := headerFlags anyMask: 8. specific to CoInterpreter"
+ preemptionYields := headerFlags noMask: 16.
+ "noThreadingOfGUIThread := headerFlags anyMask: 32. specific to CoInterpreterMT"
+ newFinalization := headerFlags anyMask: 64.
+ sendWheelEvents := headerFlags anyMask: 128!
- imageFloatsBigEndian := (headerFlags bitAnd: 2) = 0 ifTrue: [1] ifFalse: [0].
- preemptionYields := (headerFlags bitAnd: 16) = 0.
- newFinalization := (headerFlags bitAnd: 64) ~= 0.!