Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3368.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3368 Author: eem Time: 19 April 2024, 11:41:04.395712 am UUID: 9f9dc531-0e56-45f7-8c71-b567cfe447f0 Ancestors: VMMaker.oscog-eem.3367
Fix a silly bug in primitiveShowDisplayRect, which checked for argument marcshalling failure *after* using the parameters!!
MT VM: Apply ioEventThreadAffinity guard in primitiveForceDisplayUpdate & primitiveShowDisplayRect.
Slang: allow breakpointing of creation of TMethods by adding a class var to CCodeGenerator (cuz the plumbing in VMMaker isn't conducive to getting at its code generator).
=============== Diff against VMMaker.oscog-eem.3367 ===============
Item was changed: Object subclass: #CCodeGenerator instanceVariableNames: 'vmClass structClasses translationDict asArgumentTranslationDict inlineList constants variables variableDeclarations scopeStack methods macros apiMethods apiVariables kernelReturnTypes currentMethod headerFiles globalVariableUsage useSymbolicConstants generateDeadCode requiredSelectors previousCommentMarksInlining previousCommenter logger suppressAsmLabels asmLabelCounts pools selectorTranslations staticallyResolvedPolymorphicReceivers optionsDictionary breakSrcInlineSelectors breakDestInlineSelectors breakOnInline vmMaker accessorDepthCache beganInlining' + classVariableNames: 'BreakSrcSelectors NoRegParmsInAssertVMs' - classVariableNames: 'NoRegParmsInAssertVMs' poolDictionaries: 'VMBasicConstants' category: 'VMMaker-Translation to C'!
!CCodeGenerator commentStamp: 'tpr 5/2/2003 14:30' prior: 0! This class oversees the translation of a subset of Smalltalk to C, allowing the comforts of Smalltalk during development and the efficiency and portability of C for the resulting interpreter. See VMMaker for more useful info!
Item was changed: ----- Method: CCodeGenerator>>compileToTMethodSelector:in: (in category 'utilities') ----- compileToTMethodSelector: selector in: aClass "Compile a method to a TMethod" (breakSrcInlineSelectors notNil and: [(breakSrcInlineSelectors includes: selector) and: [breakOnInline ~~ true]]) ifTrue: + [self halt: 'Compiling ', aClass name, '>>', selector]. - [self halt].
^(aClass >> selector) asTranslationMethodOfClass: self translationMethodClass
"was: | implementingClass | implementingClass := aClass. ^(Compiler new parse: ([aClass sourceCodeAt: selector] on: KeyNotFound do: [:ex| ""Quick hack for simulating Pharo images..."" (PharoVM and: [aClass == String class and: [selector == #findSubstringViaPrimitive:in:startingAt:matchTable:]]) ifFalse: [ex pass]. (implementingClass := ByteString) sourceCodeAt: #findSubstring:in:startingAt:matchTable:]) in: implementingClass notifying: nil) asTranslationMethodOfClass: self translationMethodClass"!
Item was changed: ----- Method: CCodeGenerator>>initialize (in category 'initialize-release') ----- initialize translationDict := Dictionary new. inlineList := Array new. constants := Dictionary new: 100. variables := Set new: 100. variableDeclarations := Dictionary new: 100. methods := Dictionary new: 500. kernelReturnTypes := self computeKernelReturnTypes. macros := Dictionary new. self initializeCTranslationDictionary. headerFiles := OrderedCollection new. globalVariableUsage := Dictionary new. useSymbolicConstants := true. generateDeadCode := true. scopeStack := OrderedCollection new. self getLogger. pools := IdentitySet new. selectorTranslations := IdentityDictionary new. accessorDepthCache := IdentityDictionary new. beganInlining := false. suppressAsmLabels := false. previousCommentMarksInlining := false. previousCommenter := nil. breakSrcInlineSelectors := IdentitySet new. + breakDestInlineSelectors := IdentitySet new. + BreakSrcSelectors ifNotNil: [:them| breakSrcInlineSelectors addAll: them]! - breakDestInlineSelectors := IdentitySet new!
Item was changed: ----- Method: CoInterpreterMT>>ioEventThreadAffinity (in category 'threading support') ----- ioEventThreadAffinity "Default" + <doNotGenerate> ^-1!
Item was added: + ----- Method: CoInterpreterMT>>primitiveForceDisplayUpdate (in category 'I/O primitives') ----- + primitiveForceDisplayUpdate + "On some platforms, this primitive forces enqueued display updates to be processed immediately. On others, it does nothing. + Override so that if the platform requires GUI activity to be restricted to a given thread, we ony force update if on the right thread." + + (self ioEventThreadAffinity > 0 + and: [self ioEventThreadAffinity ~= cogThreadManager getVMOwner]) ifFalse: + [self ioForceDisplayUpdate]!
Item was added: + ----- Method: CoInterpreterMT>>primitiveShowDisplayRect (in category 'I/O primitives') ----- + primitiveShowDisplayRect + "Force the given rectangular section of the Display to be copied to the screen. + On some platforms, this primitive forces enqueued display updates to be processed immediately. On others, it does nothing. + Override so that if the platform requires GUI activity to be restricted to a given thread, we ony force update if on the right thread." + | bottom top right left | + bottom := self stackIntegerValue: 0. + top := self stackIntegerValue: 1. + right := self stackIntegerValue: 2. + left := self stackIntegerValue: 3. + self successful ifTrue: + [self updateDisplayLeft: left Top: top Right: right Bottom: bottom. + (self ioEventThreadAffinity > 0 + and: [self ioEventThreadAffinity ~= cogThreadManager getVMOwner]) ifFalse: + [self ioForceDisplayUpdate]. + self methodReturnReceiver]!
Item was changed: ----- Method: InterpreterPrimitives>>primitiveShowDisplayRect (in category 'I/O primitives') ----- primitiveShowDisplayRect "Force the given rectangular section of the Display to be copied to the screen." | bottom top right left | bottom := self stackIntegerValue: 0. top := self stackIntegerValue: 1. right := self stackIntegerValue: 2. left := self stackIntegerValue: 3. - self updateDisplayLeft: left Top: top Right: right Bottom: bottom. self successful ifTrue: + [self updateDisplayLeft: left Top: top Right: right Bottom: bottom. + self ioForceDisplayUpdate. + self methodReturnReceiver]! - [self ioForceDisplayUpdate. - self pop: 4]!
vm-dev@lists.squeakfoundation.org