[Vm-dev] VM Maker: VMMaker.oscog-eem.3196.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jun 21 19:03:38 UTC 2022


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

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

Name: VMMaker.oscog-eem.3196
Author: eem
Time: 21 June 2022, 12:03:22.54506 pm
UUID: 1eb8444f-5929-4dde-b183-856503e68d96
Ancestors: VMMaker.oscog-WoC.3195

Allow upscaleDisplayIfHighDPI to be set from the command line & if so not be overwritten by the value in the image header.

=============== Diff against VMMaker.oscog-WoC.3195 ===============

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])
  	+ (primitiveDoMixedArithmetic ifTrue: [0] ifFalse: [16r100])
+ 	"N.B. flag mask 16r200 is fileTimesInUTC, responded to by the FilePlugin & FileAttributesPlugin"
- 	"N.B. flag mask 16r200 is fileTimesInUTC, responded to by the FIlePlugin & FileAttributesPlugin"
  	+ (upscaleDisplayIfHighDPI ifTrue: [0] ifFalse: [16r400])
  	+ (imageHeaderFlags bitClear: 1+2+8+16r10+16r40+16r80+16r100+16r200+16r400) "these are any flags we do not recognize"!

Item was changed:
  ----- Method: CoInterpreter>>setImageHeaderFlags: (in category 'internal interpreter access') -----
  setImageHeaderFlags: flags
  	"Set an array of flags indicating various properties of the saved image, responded to on image load.
  	 These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag.
  	 Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) (meaningful to the MT VM only)
  	 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 disown the VM if owned by the GUI thread (meaningful to the MT VM only)
  	 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 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)
  	 Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times
+ 	 Bit 8: if set, implies the VM will not upscale the display on high DPI monitors; older VMs did this by default."
- 	 Bit 8: if set, implies the VM will not upscale the display on high DPI monitors; older VMs did this by default.
- 	 Bit 8: if set, implies the VM will not upscale the display on high DPI devices"
  	flags asUnsignedInteger > 511 ifTrue:
  		[^self primitiveFailFor: PrimErrUnsupported].
  	"processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT"
  	imageHeaderFlags := (flags anyMask: 1)
  							ifTrue: [imageHeaderFlags bitOr: 4]
  							ifFalse: [imageHeaderFlags bitClear: 4].
  	flagInterpretedMethods := flags anyMask: 2.
  	preemptionYields := flags noMask: 4.
  	"noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT"
  	imageHeaderFlags := (flags anyMask: 8)
  							ifTrue: [imageHeaderFlags bitOr: 32]
  							ifFalse: [imageHeaderFlags bitClear: 32].
  	newFinalization := flags anyMask: 16.
  	sendWheelEvents := flags anyMask: 32.
  	primitiveDoMixedArithmetic := flags noMask: 64.
  	imageHeaderFlags := (flags anyMask: 128)
  							ifTrue: [imageHeaderFlags bitOr: 512]
  							ifFalse: [imageHeaderFlags bitClear: 512].
  	upscaleDisplayIfHighDPI := flags noMask: 256!

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.
+ 	 This is sent at image load time."
- 	"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.
+ 	primitiveDoMixedArithmetic < 0 ifTrue: "i.e. has it not been set on the command line?"
+ 		[primitiveDoMixedArithmetic := headerFlags noMask: 256].
+ 	"N.B. flag mask 512 is responded to by the FilePlugin & FileAttributesPlugin"
+ 	upscaleDisplayIfHighDPI < 0 ifTrue: "i.e. has it not been set on the command line?"
+ 		[upscaleDisplayIfHighDPI := headerFlags noMask: 1024]!
- 	primitiveDoMixedArithmetic := headerFlags noMask: 256.
- 	"N.B. flag mask 512 is responded to by the FIlePlugin & FileAttributesPlugin"
- 	upscaleDisplayIfHighDPI := headerFlags noMask: 1024!

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])
  	"was: noThreadingOfGUIThread ifTrue: [16r20] ifFalse: [0]); a broken idea"
  	+ (newFinalization ifTrue: [16r40] ifFalse: [0])
  	+ (sendWheelEvents ifTrue: [16r80] ifFalse: [0])
  	+ (primitiveDoMixedArithmetic ifTrue: [0] ifFalse: [16r100])
+ 	"N.B. flag mask 16r200 is fileTimesInUTC, responded to by the FilePlugin & FileAttributesPlugin"
- 	"N.B. flag mask 16r200 is fileTimesInUTC, responded to by the FIlePlugin & FileAttributesPlugin"
  	+ (upscaleDisplayIfHighDPI ifTrue: [0] ifFalse: [16r400])
  	+ (imageHeaderFlags bitClear: 16r7FF) "these are any flags we do not recognize"!

Item was changed:
  ----- Method: CoInterpreterMT>>setImageHeaderFlags: (in category 'internal interpreter access') -----
  setImageHeaderFlags: flags
  	"Set an array of flags indicating various properties of the saved image, responded to on image load.
  	 These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag.
  	 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: unassigned; used to mean if set, implies a threaded VM will not disown the VM if owned by the GUI thread; a broken idea
  	 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 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)
  	 Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times
+ 	 Bit 8: if set, implies the VM will not upscale the display on high DPI monitors; older VMs did this by default."
- 	 Bit 8: if set, implies the VM will not upscale the display on high DPI devices"
  	flags asUnsignedInteger > 511 ifTrue:
  		[^self primitiveFailFor: PrimErrUnsupported].
  	(flags anyMask: 8) ifTrue:
  		[^self primitiveFailFor: PrimErrInappropriate].
  	processHasThreadId := flags anyMask: 1.
  	flagInterpretedMethods := flags anyMask: 2.
  	preemptionYields := flags noMask: 4.
  	"was: noThreadingOfGUIThread := flags anyMask: 8. a broken idea"
  	newFinalization := flags anyMask: 16.
  	sendWheelEvents := flags anyMask: 32.
  	primitiveDoMixedArithmetic := flags noMask: 64.
  	imageHeaderFlags := (flags anyMask: 128)
  							ifTrue: [imageHeaderFlags bitOr: 512]
  							ifFalse: [imageHeaderFlags bitClear: 512].
  	upscaleDisplayIfHighDPI := flags noMask: 256!

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.
  	"was: noThreadingOfGUIThread := headerFlags anyMask: 32. a broken idea"
  	newFinalization := headerFlags anyMask: 64.
  	sendWheelEvents := headerFlags anyMask: 128.
+ 	primitiveDoMixedArithmetic < 0 ifTrue: "i.e. has it not been set on the command line?"
+ 		[primitiveDoMixedArithmetic := headerFlags noMask: 256].
+ 	"N.B. flag mask 512 is responded to by the FilePlugin & FileAttributesPlugin"
+ 	upscaleDisplayIfHighDPI < 0 ifTrue: "i.e. has it not been set on the command line?"
+ 		[upscaleDisplayIfHighDPI := headerFlags noMask: 1024].
- 	primitiveDoMixedArithmetic := headerFlags noMask: 256.
- 	"N.B. flag mask 512 is responded to by the FIlePlugin & FileAttributesPlugin"
- 	upscaleDisplayIfHighDPI := headerFlags noMask: 1024.
  
  	processHasThreadId ifFalse:
  		[self print: 'warning, processHasThreadId flag is unset; cannot function as a threaded VM if so.'; cr]!

Item was changed:
  ----- Method: StackInterpreter class>>declareCVarsIn: (in category 'translation') -----
  declareCVarsIn: aCCodeGenerator
  	| vmClass |
  	self class == thisContext methodClass ifFalse: [^self]. "Don't duplicate decls in subclasses"
  	vmClass := aCCodeGenerator vmClass. "Generate primitiveTable etc based on vmClass, not just StackInterpreter"
  	aCCodeGenerator
  		addHeaderFile: '<stdio.h> /* for printf */';
  		addHeaderFile: '<stdlib.h> /* for e.g. alloca */';
  		addHeaderFile: '<setjmp.h>';
  		addHeaderFile: '<wchar.h> /* for wint_t */';
  		addHeaderFile: '"vmCallback.h"';
  		addHeaderFile: '"sqMemoryFence.h"';
  		addHeaderFile: '"sqImageFileAccess.h"';
  		addHeaderFile: '"sqSetjmpShim.h"';
  		addHeaderFile: '"dispdbg.h"'.
  	LowcodeVM ifTrue:
  		[aCCodeGenerator addHeaderFile: '"sqLowcodeFFI.h"'].
  
  	vmClass declareInterpreterVersionIn: aCCodeGenerator defaultName: 'Stack'.
- 	#('primitiveDoMixedArithmetic' 'upscaleDisplayIfHighDPI' ) do:
- 		 [:var|
- 		aCCodeGenerator
- 			var: var
- 			declareC: 'sqInt ', var, ' = true'].
  	aCCodeGenerator
  		var: #interpreterProxy  type: #'struct VirtualMachine*'.
  	aCCodeGenerator
  		declareVar: #sendTrace type: 'volatile int';
  		declareVar: #byteCount type: #usqLong. "see dispdbg.h"
  	"These need to be pointers or unsigned."
  	self declareC: #(instructionPointer method newMethod)
  		as: #usqInt
  		in: aCCodeGenerator.
  	"These are all pointers; char * because Slang has no support for C pointer arithmetic."
  	self declareC: #(localIP localSP localFP stackPointer framePointer stackLimit breakSelector)
  		as: #'char *'
  		in: aCCodeGenerator.
  	aCCodeGenerator
  		var: #breakSelectorLength
  		declareC: 'sqInt breakSelectorLength = MinSmallInteger'.
  	self declareC: #(stackPage overflowedPage)
  		as: #'StackPage *'
  		in: aCCodeGenerator.
  	aCCodeGenerator
  		var: #transcript type: #'FILE *'.
  	aCCodeGenerator removeVariable: 'stackPages'.  "this is an implicit receiver in the translated code."
  	"This defines bytecodeSetSelector as 0 if MULTIPLEBYTECODESETS
  	 is not defined, for the benefit of the interpreter on slow machines."
  	aCCodeGenerator addConstantForBinding: (self bindingOf: #MULTIPLEBYTECODESETS).
  	MULTIPLEBYTECODESETS == false ifTrue:
  		[aCCodeGenerator
  			removeVariable: 'bytecodeSetSelector'].
  	BytecodeSetHasExtensions == false ifTrue:
  		[aCCodeGenerator
  			removeVariable: 'extA';
  			removeVariable: 'extB'].
  	aCCodeGenerator
  		var: #methodCache
  		declareC: 'sqIntptr_t methodCache[MethodCacheSize + 1 /* ', (MethodCacheSize + 1) printString, ' */]'.
  	NewspeakVM
  		ifTrue:
  			[aCCodeGenerator
  				var: #nsMethodCache
  				declareC: 'sqIntptr_t nsMethodCache[NSMethodCacheSize + 1 /* ', (NSMethodCacheSize + 1) printString, ' */]']
  		ifFalse:
  			[aCCodeGenerator
  				removeVariable: #nsMethodCache;
  				removeVariable: 'localAbsentReceiver';
  				removeVariable: 'localAbsentReceiverOrZero'].
  	AtCacheTotalSize isInteger ifTrue:
  		[aCCodeGenerator
  			var: #atCache
  			declareC: 'sqInt atCache[AtCacheTotalSize + 1 /* ', (AtCacheTotalSize + 1) printString, ' */]'].
  	aCCodeGenerator
  		var: #primitiveTable
  		declareC: 'void (*primitiveTable[MaxPrimitiveIndex + 2 /* ', (MaxPrimitiveIndex + 2) printString, ' */])(void) = ', vmClass primitiveTableString.
  	vmClass primitiveTable do:
  		[:symbolOrNot|
  		(symbolOrNot isSymbol
  		 and: [symbolOrNot ~~ #primitiveFail]) ifTrue:
  			[(aCCodeGenerator methodNamed: symbolOrNot) ifNotNil:
  				[:tMethod| tMethod returnType: #void]]].
  
  	vmClass objectMemoryClass hasSpurMemoryManagerAPI
  		ifTrue:
  			[aCCodeGenerator
  				var: #primitiveAccessorDepthTable
  				type: 'signed char'
  				sizeString: 'MaxPrimitiveIndex + 2 /* ', (MaxPrimitiveIndex + 2) printString, ' */'
  				array: (vmClass primitiveAccessorDepthTableUsing: aCCodeGenerator).
  			 aCCodeGenerator
  				removeConstant: #PrimNumberInstVarAt;
  				removeConstant: #PrimNumberPerform;
  				removeConstant: # PrimNumberPerformWithArgs;
  				removeConstant: #PrimNumberShallowCopy;
  				removeConstant: #PrimNumberSlotAt;
  				removeConstant: #PrimNumberFlushExternalPrimitives;
  				removeConstant: #PrimNumberUnloadModule]
  		ifFalse:
  			[aCCodeGenerator
  				removeVariable: #primitiveAccessorDepthTable;
  				removeConstant: #PrimNumberVMParameter].
  
  	aCCodeGenerator
  		var: #displayBits type: #'void *';
  		var: #primitiveCalloutPointer declareC: 'void *primitiveCalloutPointer = (void *)-1'.
+ 	#('primitiveDoMixedArithmetic' 'upscaleDisplayIfHighDPI' ) do:
+ 		 [:var|
+ 		aCCodeGenerator
+ 			var: var
+ 			declareC: 'sqInt ', var, ' = -1'].
  	self declareC: #(displayWidth displayHeight displayDepth) as: #int in: aCCodeGenerator.
  	aCCodeGenerator
  		var: #primitiveFunctionPointer
  			declareC: 'void (*primitiveFunctionPointer)()';
  			var: 'pcPreviousToFunction'
  				declareC: 'sqInt (* const pcPreviousToFunction)(sqInt,sqInt) = ', (aCCodeGenerator cFunctionNameFor: PCPreviousToFunction);
  		var: #externalPrimitiveTable
  			declareC: 'void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* ', (MaxExternalPrimitiveTableSize + 1) printString, ' */])(void)';
  		var: #interruptCheckChain
  			declareC: 'void (*interruptCheckChain)(void) = 0';
  		var: #showSurfaceFn
  			declareC: 'int (*showSurfaceFn)(sqIntptr_t, int, int, int, int)'.
  
  	self declareCAsUSqLong: #(nextPollUsecs nextWakeupUsecs
  								"these are high-frequency enough that they're overflowing quite quickly on modern hardware"
  								statProcessSwitch statIOProcessEvents statForceInterruptCheck
  								statCheckForEvents statStackOverflow statStackPageDivorce
  								statIdleUsecs)
  		in: aCCodeGenerator.
  	aCCodeGenerator var: #nextProfileTick type: #sqLong.
  	aCCodeGenerator var: #reenterInterpreter type: 'jmp_buf'.
  	LowcodeVM
  		ifTrue:
  			[aCCodeGenerator
  				var: #lowcodeCalloutState type: #'sqLowcodeCalloutState*'.
  			 self declareC: #(nativeSP nativeStackPointer shadowCallStackPointer)
  				as: #'char *'
  				in: aCCodeGenerator]
  		ifFalse:
  			[#(lowcodeCalloutState nativeSP nativeStackPointer shadowCallStackPointer) do:
  				[:var| aCCodeGenerator removeVariable: var]].
  	(self instVarNames select: [:ivn| ivn beginsWith: 'longRunningPrimitive']) do:
  		[:lrpmVar|
  		aCCodeGenerator
  			var: lrpmVar
  			declareC: '#if LRPCheck\', ((lrpmVar endsWith: 'Usecs') ifTrue: [#usqLong] ifFalse: [#sqInt]), ' ', lrpmVar, '\#endif']!

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])
  	+ (primitiveDoMixedArithmetic ifTrue: [0] ifFalse: [16r100])
+ 	"N.B. flag mask 16r200 is fileTimesInUTC, responded to by the FilePlugin & FileAttributesPlugin"
- 	"N.B. flag mask 16r200 is fileTimesInUTC, responded to by the FIlePlugin & FileAttributesPlugin"
  	+ (upscaleDisplayIfHighDPI ifTrue: [0] ifFalse: [16r400])
  	+ (imageHeaderFlags bitClear: 1+2+16r10+16r40+16r80+16r100+16r200+16r400) "these are any flags we do not recognize"!

Item was changed:
  ----- Method: StackInterpreter>>initialize (in category 'initialization') -----
  initialize
+ 	"Initialize the variables C initializes to zero (or explicitly in StackInterpreter class>>declareCVarsIn:).
+ 	 #initialize methods do /not/ get translated."
- 	"Here we can initialize the variables C initializes to zero.  #initialize methods do /not/ get translated."
  	super initialize.
  	newFinalization := false.
  	stackLimit := 0. "This is also the initialization flag for the stack system."
  	stackPage := overflowedPage := nil.
  	extraFramesToMoveOnOverflow := 0.
  	bytecodeSetSelector := 0.
  	highestRunnableProcessPriority := 0.
  	nextPollUsecs := 0.
  	nextWakeupUsecs := 0.
  	tempOop := tempOop2 := theUnknownShort := 0.
  	interruptPending := false.
  	inIOProcessEvents := 0.
  	fullScreenFlag := 0.
  	sendWheelEvents := deferDisplayUpdates := cannotDeferDisplayUpdates := false.
  	displayBits := displayWidth := displayHeight := displayDepth := 0.
  	pendingFinalizationSignals := statPendingFinalizationSignals := 0.
  	globalSessionID := 0.
  	longRunningPrimitiveStartUsecs := longRunningPrimitiveStopUsecs := 0.
  	maxExtSemTabSizeSet := false.
  	debugCallbackInvokes := debugCallbackPath := debugCallbackReturns := 0.
+ 	primitiveCalloutPointer := primitiveDoMixedArithmetic := upscaleDisplayIfHighDPI := -1. "initialized in declaration in declareCVarsIn:"
- 	primitiveCalloutPointer := -1. "initialized in declaration in declareCVarsIn:"
  	transcript := Transcript. "initialized to stdout in readImageFromFile:HeapSize:StartingAt:"
  	pcPreviousToFunction := PCPreviousToFunction. "initialized via StackInterpreter class>>declareCVarsIn:"
  	statForceInterruptCheck := statStackOverflow := statCheckForEvents :=
  	statProcessSwitch := statIOProcessEvents := statStackPageDivorce :=
  	statIdleUsecs := 0!

Item was changed:
  ----- Method: StackInterpreter>>setImageHeaderFlags: (in category 'internal interpreter access') -----
  setImageHeaderFlags: flags
  	"Set an array of flags indicating various properties of the saved image, responded to on image load.
  	 These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag.
  	 Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) (meaningful to the MT VM only)
  	 Bit 1: if set, methods that are interpreted will have the flag bit set in their header (meaningful to the Cog VM only)
  	 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 disown the VM if owned by the GUI thread (meaningful to the MT VM only)
  	 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 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)
  	 Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times
+ 	 Bit 8: if set, implies the VM will not upscale the display on high DPI monitors; older VMs did this by default."
- 	 Bit 8: if set, implies the VM will not upscale the display on high DPI devices"
  	flags asUnsignedInteger > 511 ifTrue:
  		[^self primitiveFailFor: PrimErrUnsupported].
  	"processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT"
  	imageHeaderFlags := (flags anyMask: 1)
  							ifTrue: [imageHeaderFlags bitOr: 4]
  							ifFalse: [imageHeaderFlags bitClear: 4].
  	"flagInterpretedMethods := flags anyMask: 2. specific to CoInterpreter"
  	imageHeaderFlags := (flags anyMask: 2)
  							ifTrue: [imageHeaderFlags bitOr: 8]
  							ifFalse: [imageHeaderFlags bitClear: 8].
  	preemptionYields := flags noMask: 4.
  	"noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT"
  	imageHeaderFlags := (flags anyMask: 8)
  							ifTrue: [imageHeaderFlags bitOr: 32]
  							ifFalse: [imageHeaderFlags bitClear: 32].
  	newFinalization := flags anyMask: 16.
  	sendWheelEvents := flags anyMask: 32.
  	primitiveDoMixedArithmetic := flags noMask: 64.
  	imageHeaderFlags := (flags anyMask: 128)
  							ifTrue: [imageHeaderFlags bitOr: 512]
  							ifFalse: [imageHeaderFlags bitClear: 512].
  	upscaleDisplayIfHighDPI := flags noMask: 256!

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.
+ 	primitiveDoMixedArithmetic < 0 ifTrue: "i.e. has it not been set on the command line?"
+ 		[primitiveDoMixedArithmetic := headerFlags noMask: 256].
+ 	"N.B. flag mask 512 is responded to by the FilePlugin & FileAttributesPlugin"
+ 	upscaleDisplayIfHighDPI < 0 ifTrue: "i.e. has it not been set on the command line?"
+ 		[upscaleDisplayIfHighDPI := headerFlags noMask: 1024]!
- 	primitiveDoMixedArithmetic := headerFlags noMask: 256.
- 	"N.B. flag mask 512 is responded to by the FIlePlugin & FileAttributesPlugin"
- 	upscaleDisplayIfHighDPI := headerFlags noMask: 1024!



More information about the Vm-dev mailing list