From commits at source.squeak.org Wed Dec 2 03:54:50 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 2 Dec 2020 03:54:50 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2905.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2905.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2905 Author: eem Time: 1 December 2020, 7:54:43.160518 pm UUID: b2778a08-d45d-4f84-8467-21a8eccf46dc Ancestors: VMMaker.oscog-eem.2904 Cogit: extend the assert in cogMethodContaining: to handle interruption at backward branches. Rename ceCheckForInterrupts to ceCheckForInterrupt to match Cogit's ceCheckForInterruptTrampoline inst var. SoundPlugin/SmartSyntaxPlugin Slang:Fix a compile-time warning due to a bad cast of firstIndexableField: for WordsOrBytes parameters. Nuke usobsoleted generators (ccgLoad:expr:asCharPtrFrom: superceded by ccgLoad:expr:asCharPtrFrom:andThen:, etc). Avoid the unnecessary cast of the void * return type of firstIndexableField to parameters. Simulaiton: Add SignedCArray and coercion between it and CArray. =============== Diff against VMMaker.oscog-eem.2904 =============== Item was added: + ----- Method: BalloonArray>>beSigned (in category 'converting') ----- + beSigned! Item was added: + ----- Method: BalloonArray>>beUnsigned (in category 'converting') ----- + beUnsigned + self shouldNotImplement! Item was added: + ----- Method: CArray>>beSigned (in category 'converting') ----- + beSigned + SignedCArray adoptInstance: self! Item was added: + ----- Method: CArray>>beUnsigned (in category 'converting') ----- + beUnsigned! Item was changed: ----- Method: CArray>>coerceTo:sim: (in category 'converting') ----- coerceTo: cTypeString sim: interpreterSimulator ^cTypeString caseOf: { ['int'] -> [self ptrAddress]. ['float *'] -> [self asSingleFloatAccessor]. ['double *'] -> [self asDoubleFloatAccessor]. + ['sqInt *'] -> [self shallowCopy unitSize: interpreter bytesPerOop; beSigned]. + ['unsigned int *'] -> [self shallowCopy unitSize: 4; beUnsigned]. + ['int *'] -> [self shallowCopy unitSize: 4; beSigned]. + ['unsigned short *'] -> [self shallowCopy unitSize: 2; beUnsigned]. + ['short *'] -> [self shallowCopy unitSize: 2; beSigned]. + ['unsigned char *'] -> [self shallowCopy unitSize: 1; beUnsigned]. + ['char *'] -> [self shallowCopy unitSize: 1; beSigned]. "C is ambivalent on the issue; sigh..." - ['sqInt *'] -> [self shallowCopy unitSize: interpreter bytesPerOop; yourself]. - ['unsigned int *'] -> [self shallowCopy unitSize: 4; yourself]. - ['int *'] -> [self shallowCopy unitSize: 4; yourself]. - ['char *'] -> [self shallowCopy unitSize: 1; yourself]. - ['unsigned char *'] -> [self shallowCopy unitSize: 1; yourself]. ['unsigned'] -> [self ptrAddress]. ['sqInt'] -> [self ptrAddress]. ['usqInt'] -> [self ptrAddress]. ['sqIntptr_t'] -> [self shallowCopy unitSize: interpreter bytesPerOop; yourself] }! Item was added: + ----- Method: CFloatArray>>beSigned (in category 'converting') ----- + beSigned! Item was added: + ----- Method: CFloatArray>>beUnsigned (in category 'converting') ----- + beUnsigned + self shouldNotImplement! Item was added: + ----- Method: CoInterpreter>>ceCheckForInterrupt (in category 'trampolines') ----- + ceCheckForInterrupt + + | switched | + self cCode: [] inSmalltalk: + [self maybeCheckStackDepth: 0 sp: stackPointer pc: instructionPointer]. + switched := self checkForEventsMayContextSwitch: true. + self returnToExecutive: false postContextSwitch: switched! Item was removed: - ----- Method: CoInterpreter>>ceCheckForInterrupts (in category 'trampolines') ----- - ceCheckForInterrupts - - | switched | - self cCode: [] inSmalltalk: - [self maybeCheckStackDepth: 0 sp: stackPointer pc: instructionPointer]. - switched := self checkForEventsMayContextSwitch: true. - self returnToExecutive: false postContextSwitch: switched! Item was changed: ----- Method: CogMethodZone>>cogMethodContaining: (in category 'jit - api') ----- cogMethodContaining: mcpc "Answer the method containing mcpc for the purposes of code zone compaction, where mcpc is actually the value of instructionPointer at the time of a compaction." | cogMethod prevMethod | mcpc > limitAddress ifTrue: [^nil]. mcpc < baseAddress ifTrue: [cogit assertMcpcIsPrimReturn: mcpc. ^nil]. self assert: mcpc < self limitZony. cogMethod := coInterpreter cCoerceSimple: baseAddress to: #'CogMethod *'. [cogMethod asUnsignedInteger < mcpc] whileTrue: [prevMethod := cogMethod. cogMethod := self methodAfter: cogMethod]. "Since mcpc is actually instructionPointer we expect that it is either at the stack check (normal code zone reclamation invoked through checkForEventsMayContextSwitch:) or is in a primitive, immediately following the call of the C primitive routine." self assert: (prevMethod notNil and: [mcpc = (prevMethod asUnsignedInteger + prevMethod stackCheckOffset) + or: [(cogit backEnd isCallPrecedingReturnPC: mcpc) + and: [(coInterpreter + primitiveIndexOfMethod: prevMethod methodObject + header: prevMethod methodHeader) > 0 + or: [(cogit backEnd callTargetFromReturnAddress: mcpc) = cogit ceCheckForInterruptTrampoline]]]]). - or: [(coInterpreter - primitiveIndexOfMethod: prevMethod methodObject - header: prevMethod methodHeader) > 0 - and: [cogit backEnd isCallPrecedingReturnPC: mcpc]]]). ^prevMethod! Item was added: + ----- Method: Cogit>>ceCheckForInterruptTrampoline (in category 'accessing') ----- + ceCheckForInterruptTrampoline + + ^ceCheckForInterruptTrampoline! Item was changed: ----- Method: Cogit>>genCheckForInterruptsTrampoline (in category 'initialization') ----- genCheckForInterruptsTrampoline self zeroOpcodeIndex. "if we have a link register we will assume that it does not get automatically pushed onto the stack and thus there is no need to pop it before saving to instructionPointerAddress" backEnd hasLinkRegister ifTrue: [self MoveR: LinkReg Aw: coInterpreter instructionPointerAddress] ifFalse: [self PopR: TempReg. "instruction pointer" self MoveR: TempReg Aw: coInterpreter instructionPointerAddress]. + ^self genTrampolineFor: #ceCheckForInterrupt + called: 'ceCheckForInterruptTrampoline' - ^self genTrampolineFor: #ceCheckForInterrupts - called: 'ceCheckForInterruptsTrampoline' numArgs: 0 arg: nil arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: false resultReg: NoReg appendOpcodes: true! Item was added: + CArray subclass: #SignedCArray + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-InterpreterSimulation'! Item was added: + ----- Method: SignedCArray>>at: (in category 'accessing') ----- + at: offset + | value | + value := super at: offset. + (value bitShift: unitSize * -8 + 1) = 0 ifTrue: + [^value]. + ^value - (1 bitShift: unitSize * 8)! Item was added: + ----- Method: SignedCArray>>at:put: (in category 'accessing') ----- + at: offset put: value + super + at: offset + put: (value >= 0 + ifTrue: [value] + ifFalse: [value bitAnd: (1 bitShift: unitSize * 8) - 1]). + ^value! Item was added: + ----- Method: SignedCArray>>beSigned (in category 'converting') ----- + beSigned! Item was added: + ----- Method: SignedCArray>>beUnsigned (in category 'converting') ----- + beUnsigned + CArray adoptInstance: self! Item was removed: - ----- Method: SmartSyntaxPluginAssignmentCodeGenerator>>ccgLoad:expr:asCharPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asCharPtrFrom: stackIndex - ^self assign: aString coerceTo: #'char *' from: stackIndex! Item was removed: - ----- Method: SmartSyntaxPluginAssignmentCodeGenerator>>ccgLoad:expr:asIntPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asIntPtrFrom: stackIndex - ^self assign: aString coerceTo: #'int *' from: stackIndex! Item was removed: - ----- Method: SmartSyntaxPluginAssignmentCodeGenerator>>ccgLoad:expr:asOopPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asOopPtrFrom: stackIndex - ^self assign: aString coerceTo: 'sqInt *' from: stackIndex! Item was added: + ----- Method: SmartSyntaxPluginAssignmentCodeGenerator>>ccgLoad:expr:asShortPtrFrom:andThen: (in category 'coercing') ----- + ccgLoad: aBlock expr: aString asShortPtrFrom: stackIndex andThen: valBlock + ^self assign: aString coerceTo: #'short *' from: stackIndex! Item was removed: - ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asCharPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asCharPtrFrom: anInteger - "Answer codestring for character pointer to first indexable field of object (without validating side-effect), as described in comment to ccgLoad:expr:asRawOopFrom:" - - ^aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''char *'''])! Item was changed: ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asCharPtrFrom:andThen: (in category 'coercing') ----- ccgLoad: aBlock expr: aString asCharPtrFrom: anInteger andThen: valBlock "Answer codestring for character pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! - ^(valBlock value: anInteger), '.', - (aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''char *'''])) - ! Item was removed: - ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asIntPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asIntPtrFrom: anInteger - "Answer codestring for integer pointer to first indexable field of object (without validating side-effect), as described in comment to ccgLoad:expr:asRawOopFrom:" - - ^aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''int *'''])! Item was changed: ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asIntPtrFrom:andThen: (in category 'coercing') ----- ccgLoad: aBlock expr: aString asIntPtrFrom: anInteger andThen: valBlock "Answer codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! - ^(valBlock value: anInteger), '.', - (aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''int *''']))! Item was removed: - ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asOopPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asOopPtrFrom: anInteger - "Answer codestring for integer pointer to first indexable field of object (without validating side-effect), as described in comment to ccgLoad:expr:asRawOopFrom:" - - ^aBlock value: (String streamContents: - [:aStream | - aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - print: anInteger; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''sqInt *'''])! Item was changed: ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asOopPtrFrom:andThen: (in category 'coercing') ----- ccgLoad: aBlock expr: aString asOopPtrFrom: anInteger andThen: valBlock "Answer codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! - ^(valBlock value: anInteger), '.', - (aBlock value: (String streamContents: - [:aStream | - aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - print: anInteger; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''sqInt *''']))! Item was added: + ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asPtrFrom:andThen: (in category 'coercing') ----- + ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock + "Answer codestring for void pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + + ^(valBlock value: anInteger), + '.', + (aBlock value: 'interpreterProxy firstIndexableField:(interpreterProxy stackValue:', anInteger asString, '))')! Item was added: + ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asShortPtrFrom:andThen: (in category 'coercing') ----- + ccgLoad: aBlock expr: aString asShortPtrFrom: anInteger andThen: valBlock + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! Item was changed: ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asUnsignedLong64PtrFrom:andThen: (in category 'coercing') ----- ccgLoad: aBlock expr: aString asUnsignedLong64PtrFrom: anInteger andThen: valBlock "Answer a codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! - ^(valBlock value: anInteger), '.', - (aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''unsigned long long *''']))! Item was changed: ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asUnsignedPtrFrom:andThen: (in category 'coercing') ----- ccgLoad: aBlock expr: aString asUnsignedPtrFrom: anInteger andThen: valBlock "Answer a codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! - ^(valBlock value: anInteger), '.', - (aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''unsigned *''']))! Item was changed: ----- Method: SmartSyntaxPluginCodeGenerator>>ccgLoad:expr:asUnsignedShortPtrFrom:andThen: (in category 'coercing') ----- ccgLoad: aBlock expr: aString asUnsignedShortPtrFrom: anInteger andThen: valBlock "Answer a codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:" + ^self ccgLoad: aBlock expr: aString asPtrFrom: anInteger andThen: valBlock! - ^(valBlock value: anInteger), '.', - (aBlock value: (String streamContents: [:aStream | aStream - nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:'; - crtab: 4; - nextPutAll: '(interpreterProxy stackValue:'; - nextPutAll: anInteger asString; - nextPutAll: '))'; - crtab: 3; - nextPutAll: 'to: ''unsigned short *''']))! Item was added: + ----- Method: SmartSyntaxPluginSimulator>>ccgLoad:expr:asShortPtrFrom:andThen: (in category 'simulation') ----- + ccgLoad: codeGen expr: exprBlock asShortPtrFrom: stackIndex andThen: validateBlock + ^[:oop| + validateBlock value: oop. + interpreterProxy cCoerce: (interpreterProxy firstIndexableField: oop) asInteger to: #'short *']! Item was removed: - ----- Method: SmartSyntaxPluginValidationCodeGenerator>>ccgLoad:expr:asCharPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asCharPtrFrom: stackIndex - ^self loadAs: #isWordsOrBytes: from: stackIndex! Item was removed: - ----- Method: SmartSyntaxPluginValidationCodeGenerator>>ccgLoad:expr:asIntPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asIntPtrFrom: stackIndex - ^self loadAs: #isWordsOrBytes: from: stackIndex! Item was removed: - ----- Method: SmartSyntaxPluginValidationCodeGenerator>>ccgLoad:expr:asOopPtrFrom: (in category 'coercing') ----- - ccgLoad: aBlock expr: aString asOopPtrFrom: stackIndex - ^self loadAs: #isNonImmediate: from: stackIndex! Item was added: + ----- Method: SmartSyntaxPluginValidationCodeGenerator>>ccgLoad:expr:asShortPtrFrom:andThen: (in category 'coercing') ----- + ccgLoad: aBlock expr: aString asShortPtrFrom: stackIndex andThen: validationString + ^validationString, (self stackAccessorFor: stackIndex)! Item was changed: ----- Method: WordsOrShorts class>>ccg:prolog:expr:index: (in category 'plugin generation') ----- ccg: cg prolog: aBlock expr: aString index: anInteger ^cg ccgLoad: aBlock expr: aString + asShortPtrFrom: anInteger - asCharPtrFrom: anInteger andThen: (cg ccgValBlock: 'isWordsOrShorts')! From noreply at github.com Wed Dec 2 04:10:54 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 01 Dec 2020 20:10:54 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 043649: CogVm source as per VMMaker.oscog-eem.2905 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 0436497af4df9ff833582533e27301d12a67e4d7 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/0436497af4df9ff833582533e27301d12a67e4d7 Author: Eliot Miranda Date: 2020-12-01 (Tue, 01 Dec 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspur64src/vm/cointerp.c M nsspur64src/vm/cointerp.h M nsspur64src/vm/gcc3x-cointerp.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M nsspursrc/vm/cointerp.c M nsspursrc/vm/cointerp.h M nsspursrc/vm/gcc3x-cointerp.c M platforms/iOS/plugins/SoundPlugin/sqSqueakSoundCoreAudio.m M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spur64src/vm/cointerp.c M spur64src/vm/cointerp.h M spur64src/vm/gcc3x-cointerp.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursista64src/vm/cointerp.c M spursista64src/vm/cointerp.h M spursista64src/vm/gcc3x-cointerp.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursistasrc/vm/cointerp.c M spursistasrc/vm/cointerp.h M spursistasrc/vm/gcc3x-cointerp.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M spursrc/vm/cointerp.c M spursrc/vm/cointerp.h M spursrc/vm/gcc3x-cointerp.c M src/plugins/SoundPlugin/SoundPlugin.c M src/vm/cogit.h M src/vm/cogitARMv5.c M src/vm/cogitIA32.c M src/vm/cogitMIPSEL.c M src/vm/cointerp.c M src/vm/cointerp.h M src/vm/gcc3x-cointerp.c Log Message: ----------- CogVm source as per VMMaker.oscog-eem.2905 Cogit: extend the assert in cogMethodContaining: to handle interruption at backward branches. Rename ceCheckForInterrupts to ceCheckForInterrupt to match Cogit's ceCheckForInterruptTrampoline inst var. SoundPlugin/SmartSyntaxPlugin Slang:Fix a compile-time warning due to a bad cast of firstIndexableField: for WordsOrBytes parameters. From no-reply at appveyor.com Wed Dec 2 06:02:33 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 02 Dec 2020 06:02:33 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2323 Message-ID: <20201202060233.1.2BE0C3BAC7682F3F@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Wed Dec 2 17:07:04 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 02 Dec 2020 09:07:04 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f9281e: Xcode 12 will not build 32-bit Mac VMs. [ci skip] Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f9281e7e5b48d3b817a0bad4beeff823cc59bb3c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f9281e7e5b48d3b817a0bad4beeff823cc59bb3c Author: Eliot Miranda Date: 2020-12-02 (Wed, 02 Dec 2020) Changed paths: M build.macos32x86/common/Makefile.flags Log Message: ----------- Xcode 12 will not build 32-bit Mac VMs. [ci skip] From eliot.miranda at gmail.com Wed Dec 2 17:20:46 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Wed, 2 Dec 2020 09:20:46 -0800 Subject: [Vm-dev] Xcode 11 32-bit builds Message-ID: Hi All, I know that Xcode 12 will not build all of the 32-bit Mac VM; the SoundPlugin fails to compile. I've updated the Makefiles to emit a warning. I have Xcode 10 & Xcode 12, but I haven't tested Xcode 11. Can anyone tell me if Xcode 11 does build the 32-bit VMs successfully or not? And if not, what's the first failure. _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Sat Dec 5 01:36:53 2020 From: noreply at github.com (Eliot Miranda) Date: Fri, 04 Dec 2020 17:36:53 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] c7b43b: 64-bit Macos builds: Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: c7b43b347b96989c68c470771c0197b5bc88e450 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c7b43b347b96989c68c470771c0197b5bc88e450 Author: Eliot Miranda Date: 2020-12-04 (Fri, 04 Dec 2020) Changed paths: M build.macos64ARMv8/common/Makefile.app M build.macos64ARMv8/common/entitlements.plist M build.macos64x64/common/Makefile.app A build.macos64x64/common/entitlements.plist Log Message: ----------- 64-bit Macos builds: Add the com.apple.security.cs.allow-unsigned-executable-memory entitlement, and add the --timestamp & --options=runtime options to codesign to produce a properyl signed, notarized timestamp & "hardened" runtime VM, needed for 10.14 and 11.x deployment. From no-reply at appveyor.com Sat Dec 5 03:27:42 2020 From: no-reply at appveyor.com (AppVeyor) Date: Sat, 05 Dec 2020 03:27:42 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2324 Message-ID: <20201205032742.1.FCE0C3B488A694E6@appveyor.com> An HTML attachment was scrubbed... URL: From stes at telenet.be Sun Dec 6 10:28:33 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 6 Dec 2020 11:28:33 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header Message-ID: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Because I'm having some annoying compiler warnings when compiling the subversion classical VM squeak 4.19.2, I'm checking the FloatMathPlugin. First of all the problem is the following, about 70 errors like this: "./platforms/Cross/plugins/FloatMathPlugin/fdlibm/fdlibm.h", line 19: warning: m acro redefined: __LITTLE_ENDIAN The Makefile for building the FloatMathPlugin sets ./i86/FloatMathPlugin/CMakeFiles/FloatMathPlugin.dir/flags.make:C_DEFINES = -DNO _ISNAN=1 -DSQUEAK_BUILTIN_PLUGIN=1 -D__LITTLE_ENDIAN=1 The flag -D__LITTLE_ENDIAN=1 comes from cmake 's config.cmake: In platforms/unix/plugins/FloatMathPlugin/config.cmake you can see > PLUGIN_DEFINITIONS (-D__LITTLE_ENDIAN=1) Now at the same time the fdlibm.h header file redefines the __LITTLE_ENDIAN: #if defined(i386) || defined(i486) || \ defined(intel) || defined(x86) || defined(i86pc) || \ defined(__alpha) || defined(__osf__) #define __LITTLE_ENDIAN #endif So this causes lots of harmless but annoying, "./platforms/Cross/plugins/FloatMathPlugin/fdlibm/fdlibm.h", line 19: warning: m acro redefined: __LITTLE_ENDIAN I'd like to get rid of those warnings by fixing the fdlibm.h. If I compare platforms/Cross/plugins/FloatMathPlugin/fdlibm/fdlibm.h in the subversion sources (for Squeak 4.19.2), and in the opensmalltalk git sources (for Squeak Cog 5.0 ), then I notice major differences. In both cases the head of the fdlibm.h file is the same: /* @(#)fdlibm.h 1.5 04/04/22 */ /* * ==================================================== * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. * * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ However if I "diff" the fdlibm.h from OpenSmalltalk and the one that is in Subversion, they seem very different. For example the OpenSmalltalk fdlibh.h has #ifdef __cplusplus while that is not present in the subversion 4.19.2 sources for the fdlibm.h. As an experiment I copied the one from OpenSmalltalk to the VM 4.19.2: bash-4.4$ cp $HOME/src/opensmalltalk/platforms/Cross/third-party/fdlibm/fdlibm.h $HOME/src/squeak4vm/platforms/Cross/plugins/FloatMathPlugin/fdlibm/fdlibm.h If you run then svn diff you gets lots of differences between the fdlibm.h from OpenSmalltalk, and the one that is in subversion. However the OpenSmalltalk fdlibm.h is NOT compiling in the classical VM 4.19.2. I can fix the compiler warnings by the following small patch: bash-4.4$ svn diff fdlibm.h Index: fdlibm.h =================================================================== - --- fdlibm.h (revision 3790) +++ fdlibm.h (working copy) @@ -16,8 +16,10 @@ #if defined(i386) || defined(i486) || \ defined(intel) || defined(x86) || defined(i86pc) || \ defined(__alpha) || defined(__osf__) +#ifndef __LITTLE_ENDIAN #define __LITTLE_ENDIAN #endif +#endif With the above patch I get a clean build for the FloatMathPlugin. It results in a clean build for both 64bit and 32bit. Which is important as the CMAKE comment indicates the cmake flag is set, precisely for the 64bit case (the 64bit case was not dealt with by the SunOS 2004 header file). So what happened I think is that the cmake settings was done for 64bit, and it started to cause a lot of redefined macro warnings in the 32bit case. Would it please be possible to commit the above small patch to the subversion sources ? This would suppress the compiler warnings. Thanks ! David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfzLGjAAoJEAwpOKXMq1MaYu8H/0qGt9eBZdgBADEg8tptKnSb 5mCSxSMybnSG1rRolnp9UG+8jRd8f0gwjlUuv2UvylV6bZekbGXicNFvTG/nxF6L htP65CVftVbdwwmt+wPa9juSBhsAFy7qcYF7YZeUJ4jLq7z8fFLI3Zid1Wco3Vb9 cyPUcKMTZ+xgPQ/b9DpHlScPX0NoZQranKQe3Xa5vnczewyxcigBRQ/wtevg8gl1 ormfE218TzCjvdRPjfxCvkybtmsbzLhMdlq7Ymih71xD+4VvrFZd4rNn8YAQddPe ScJxyw4nUXO8lLnG2DZeW15xSpGtyAujL4SlY6XLvu2E88WQI6PRYLrSimemXjU= =0zl1 -----END PGP SIGNATURE----- From notifications at github.com Tue Dec 8 07:34:09 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 07 Dec 2020 23:34:09 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: Fixed right? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/535#issuecomment-740440042 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Tue Dec 8 07:34:10 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 07 Dec 2020 23:34:10 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: Closed #535. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/535#event-4083324741 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Tue Dec 8 07:36:20 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 07 Dec 2020 23:36:20 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) Message-ID: Hi, The warning/error pthread_setschedparam failed: Not owner is also happening on Solaris, and obviously it also prints some text, which does not really make sense on Solaris. I have documented on the following Wiki how to get rid of this warning/error on Solaris: https://sourceforge.net/p/solaris-squeak/wiki/Home/ I don't know how to fix the issue specifically on your Ubuntu distribution, but possibly it makes sense to - when the error happens - to print a simple: "error: pthread_setschedparam failed: Not owner or "error: heartbeat thread unable to run at higher priority" Such a simple short message would be sufficient, and then the user can try to do some research and find fixes for the specific platform, where the error happens. I can imagine that on various Unix flavors the instructions for: /etc/security/limits.d/squeak.conf do not apply. Also note that in my limited experience on Solaris, I can either fix the warning (by having threads run at different priorities) or ignore the warning, as it does not seem to make much difference ... But it's not nice that an extensive error message is printed, certainly not when it does not apply to that specific Unix distribution. Regards, David Stes -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 8 07:36:43 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 7 Dec 2020 23:36:43 -0800 Subject: [Vm-dev] setting rtprio on ubuntu 18 x64 box appears to fail In-Reply-To: <456350113.87849630.1595441532460.JavaMail.zimbra@telenet.be> References: <1660314514.68187081.1595011578217.JavaMail.zimbra@telenet.be> <1090452593.73885861.1595159750729.JavaMail.zimbra@telenet.be> <456350113.87849630.1595441532460.JavaMail.zimbra@telenet.be> Message-ID: Hi David, I created an issue for this: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540 On Wed, Jul 22, 2020 at 11:12 AM stes at PANDORA.BE wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > Hi, > > The warning/error > > pthread_setschedparam failed: Not owner > > is also happening on Solaris, and obviously it also prints some text, > which does not really make sense on Solaris. > > I have documented on the following Wiki how to get rid of this > warning/error > on Solaris: > > https://sourceforge.net/p/solaris-squeak/wiki/Home/ > > I don't know how to fix the issue specifically on your Ubuntu distribution, > but possibly it makes sense to - when the error happens - to print a > simple: > > "error: pthread_setschedparam failed: Not owner > > or > > "error: heartbeat thread unable to run at higher priority" > > Such a simple short message would be sufficient, and then the user can > try to do some research and find fixes for the specific platform, > where the error happens. > > I can imagine that on various Unix flavors the instructions for: > > /etc/security/limits.d/squeak.conf > > do not apply. > > Also note that in my limited experience on Solaris, I can either fix > the warning (by having threads run at different priorities) or ignore > the warning, as it does not seem to make much difference ... > > But it's not nice that an extensive error message is printed, > certainly not when it does not apply to that specific Unix distribution. > > Regards, > David Stes > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJfGIB/AAoJEAwpOKXMq1MaRngIAKRpp650F5wxVLLl5RI03rxY > Cbog93dnnXYhEtsKr1U1+FLTfwXcvMVDEI6nTi0dUuRfUg+698yPblisUJtQzgc4 > 3k54aqbz36oslkJA1y+kBU9V6nv/LfvVwpz9R0fnvuGTZndZYYHMfbCcU9yfDZ6x > psHJ2EQRWfT+tjXC1nVHARb2IIWfR2NtG/YoaZcuohNE342B2CHx3OisTck5tlKA > Fnx1pl/G7Z4OHleSmqKUT1KkMGfMHz4VIW0t3/D2CCMOuYqXQxxOejD2mqtqhzMP > 8uUqNo1TLAmTjZwY4NVt7sa2Ny2PUXhxkASOL0c3YlvB3Dp6DAYNPptFmWC48Is= > =5Vgy > -----END PGP SIGNATURE----- > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Tue Dec 8 08:10:36 2020 From: notifications at github.com (dcstes) Date: Tue, 08 Dec 2020 00:10:36 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: Hi everyone, It's good that there is an open issue for this issue. Also note that there are 2 different things here : (1) the issue itself which is that pthread_setschedparam failed: Not owner and (2) how to solve this For the message, it would be sufficient to just report (1) what happens. Now the action that one should take to resolve this, depends on the operating system, and also to some extent I think there may be different approaches. For example, I have recently discovered that an additional necessary privilege must be given at the Solaris zone level : example# zonecfg -z myzone zonecfg:myzone> set limitpriv="default,proc_priocntl" zonecfg:myzone2> exit To be able to add "privs=proc_priocntl" in a zone. One possible approach to address the issue itself is by creating a profile: # profiles -p Squeak profiles:Squeak> set desc="Allow Squeak VM to Set Priority" profiles:Squeak> add cmd=/usr/bin/squeak profiles:Squeak:squeak> set privs=proc_priocntl profiles:Squeak:squeak> end profiles:Squeak> commit profiles:Squeak> info name=Squeak desc=Allow Squeak VM to Set Priority cmd=/usr/bin/squeak profiles:Squeak> exit However bottom line is there is a difference between the issue itself, and the many different ways to address the issue on the various platforms and distributions of operating systems. Regards, David Stes -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-740457493 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Tue Dec 8 17:00:06 2020 From: notifications at github.com (Eliot Miranda) Date: Tue, 08 Dec 2020 09:00:06 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: Hi David, would it be practicable to create a page on the wiki here in this repository that lists the solutions fir the various platforms and then have the error message in the vm reference that wiki page? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-740762673 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Tue Dec 8 17:01:41 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Tue, 8 Dec 2020 18:01:41 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> Message-ID: <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 In attach the patch for fdlibm.h ... Hopefully the attachement is posted, not sure whether the list accepts this. For "subversion" sources at http://squeakvm.org/svn/squeak. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfz7E6AAoJEAwpOKXMq1MaT5wH/3C7UnH6HaxSAE3a5AkQ4Q65 Enble1+u8YuHkJOyBGHVOgWNYQ4E09EM1XckpOGFhNpYy8IlRvtV+ReivIHXLpkC SfSUkKbQx9CzIu/sc3JQKKZ8r4y1P13S6hOv16B5h8giPZC6TpYL18681g7hRsq7 TrXlrDj65BYEWXnTyIEL/znrTFpt5kOwMg4H0iZ7sWi0KLDRc7xumA/O1XXPmWV/ kd8oYX7pH8wpUqjMKlncrAyJUg2gQqJAvGzN/HYpRnK2xRmEfxtWCN0gQ5wnQD5a Dq5pqgqB0gIwWKS+4J0cHq+s6vNlCh8IlvI1OMMAPJVXvhqYEDpXvrwKq/OCxdc= =ckvr -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: fdlibm.h.patch Type: text/x-patch Size: 530 bytes Desc: not available URL: From notifications at github.com Tue Dec 8 17:25:40 2020 From: notifications at github.com (dcstes) Date: Tue, 08 Dec 2020 09:25:40 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Currently if I go to http://wiki.squeak.org/squeak/search and I type in the "Search" field : pthread_setschedparam There is "No Match". The recent changes to the Wiki http://wiki.squeak.org/squeak/recent seem to be related mostly to programming in Squeak. But there are also wiki pages on building the VM software, so a document on the wiki about the "pthread_setschedparam failed: Not owner ... See https://github.com/OpenSmalltalk/opensmalltalk-vm/releases/tag/r3732#linux" issue could be a good idea on wiki.squeak.org. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfz7akAAoJEAwpOKXMq1MaSZcIALmMv1/jOYadGS+2ghb7ePyS r0w3GH/7bPfQvWdn41b95pP9otYoXhQWbIPYy7gwbWoYu+MfeU7CeuUHra7H986u OWcA0ffN2a6yBoenl6ovvz/FoojZm5ZfbN848OYN9nRgdW84Uq2KVmvd2t5itHrv L2SjJLma2am84eC8wBRG0G4bjjGtaM5erx/JkQWz+1J+WPdC/X//NpMu+emf+z27 K3EseCeV6Lj1Gu5Ks8GK60MnLzR6gsvuHJfnrHMEvZtjQQ9JA70S+bDFx2bLpjbt Yoq8CmOTe74EtC/gEjVyrZ/KGuJRMMA5JsUmFq47CsqKIytBoHvqrnFfiy+1xdQ= =yvka -----END PGP SIGNATURE----- -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-740780532 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Thu Dec 10 12:25:11 2020 From: notifications at github.com (dcstes) Date: Thu, 10 Dec 2020 04:25:11 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Another thing to consider is whether calling pthread_setschedparam() should be the default ... My impression is that if I just ignore the warning "pthread_setschedparam failed: Not owner" the programs still run fine. So perhaps the default could be changed NOT to issue a pthread_setschedparam() and make it optional. Maybe some option like '-best-performance' could enable this. Currently the message seems to indicate it is for "best operation". So the message implies that the default could be not to issue the pthread_setschedparam() and then have the user it enable via a switch. In any case, the message is very specific and it combines both error and solution, while the solution is "cookbookish" it tells you how what to do, but there are many variations possible and many operating systems, what could be the right "cookbook recipe" on one system may not apply to another ... MESSAGE: pthread_setschedparam failed: Not owner This VM uses a separate heartbeat thread to update its internal clock and handle events. For best operation, this thread should run at a higher priority, however the VM was unable to change the priority. The effect is that heavily loaded systems may experience some latency issues. If this occurs, please create the appropriate configuration file in /etc/security/limits.d/ as shown below: cat < From notifications at github.com Thu Dec 10 19:54:27 2020 From: notifications at github.com (dcstes) Date: Thu, 10 Dec 2020 11:54:27 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 By the way, there seems to be an alternative to running the Squeak VM in a profile which raises the privilege temporarily. It also seems possible to permanently raise the privilege, for example, in a zone by the /etc/security/policy.conf file. # grep proc_priocntl /etc/security/policy.conf PRIV_DEFAULT=basic,proc_priocntl By raising the PRIV_DEFAULT to also allow process/light weight processes (threads) to set their own priority (which is not by default allowed), it is possible to get rid of the pthread_setschedparam() warning. Now permanently allowing this for all threads is best limited, in a zone (a jail) inside the operating system, by setting the limit of the zone to: # zonecfg -z newt info | grep limitpriv limitpriv: default,proc_priocntl David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf0nyPAAoJEAwpOKXMq1MaJoAIAJQwLdN/oTJTPvg4QwNdemJl dOgB5GGlu4q8dHTb0G2lubcIXHSuQbtOOAIMsY7H3nxvYbjX91jJbeLnOp71RpGu xq5tL8MWuTVP8ocEs+UOFkyMb+emDK9ox0OGynI/HwyWsJmpXaU8/X10NbJiPqGa UCZ0q1CE3MEjcvGTcABIjUZ3TQdQ2Hc0XTbfNF+aZBKW9k76u7Q5/ULmvhajO0gd SAak4I8OfoecaJenqWRK+2oi+R2Ih98DzKGtoVQnaCwmkZJGv0eBQ14+YiuKA8c7 mod4xkR7zyMu6YhaoZ3jmZNmUQ6/LZ2rITSXIHvHs3Rlq7KXKrAyaDPRnw52/Rs= =Ihdi -----END PGP SIGNATURE----- -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-742758712 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Fri Dec 11 14:45:57 2020 From: notifications at github.com (dcstes) Date: Fri, 11 Dec 2020 06:45:57 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] SunOS change: document /etc/security/policy.conf (#541) Message-ID: This is a documentation update on /etc/security/policy.conf on Solaris and how to modify it to run the Squeak VM in a Sollaris "zone". David Stes You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/541 -- Commit Summary -- * SunOS change: document /etc/security/policy.conf -- File Changes -- M build.sunos64x64/HowToBuild (40) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/541.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/541.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/541 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Fri Dec 11 15:47:32 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Fri, 11 Dec 2020 16:47:32 +0100 Subject: [Vm-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Message-ID: Hi all, I'm not sure this is already known, but CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly crashes the VM on macOS. I tried it with an older VM from last year and the latest bleeding edge (202012050134). Best, Fabio From no-reply at appveyor.com Fri Dec 11 16:49:46 2020 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 11 Dec 2020 16:49:46 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2325 Message-ID: <20201211164946.1.3F96C1C5BEDBFCCB@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Fri Dec 11 22:45:47 2020 From: noreply at github.com (Eliot Miranda) Date: Fri, 11 Dec 2020 14:45:47 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 753104: Fix careless inclusion of unistd.h in sqFilePlugin... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 753104ddb490f7f5ada7e2861a93ea0adc747de4 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/753104ddb490f7f5ada7e2861a93ea0adc747de4 Author: Eliot Miranda Date: 2020-12-11 (Fri, 11 Dec 2020) Changed paths: M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c Log Message: ----------- Fix careless inclusion of unistd.h in sqFilePluginBasicPrims.c which breaks on MSVC. [ci skip] From eliot.miranda at gmail.com Fri Dec 11 23:08:05 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 11 Dec 2020 15:08:05 -0800 Subject: [Vm-dev] [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Fabio, On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus wrote: > Hi all, > > I'm not sure this is already known, but > CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly > crashes the VM on macOS. I tried it with an older VM from last year > and the latest bleeding edge (202012050134). > I just tried it on macOS in a bleeding edge VM and see a failing test (Error: subscript out of bounds: 38 from testValuePaneModify) but no crash. When you run under a debugger what stack trace do you see? _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Fri Dec 11 23:09:20 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 11 Dec 2020 15:09:20 -0800 Subject: [Vm-dev] [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Fabio, On Fri, Dec 11, 2020 at 3:08 PM Eliot Miranda wrote: > Hi Fabio, > > On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus > wrote: > >> Hi all, >> >> I'm not sure this is already known, but >> CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly >> crashes the VM on macOS. I tried it with an older VM from last year >> and the latest bleeding edge (202012050134). >> > > I just tried it on macOS in a bleeding edge VM and see a failing test > (Error: subscript out of bounds: 38 from testValuePaneModify) but no crash. > When you run under a debugger what stack trace do you see? > Ah, I'm using the SistaV1 bytecode set. Are you using ClosuresV3? > > _,,,^..^,,,_ > best, Eliot > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Fri Dec 11 23:11:53 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 11 Dec 2020 15:11:53 -0800 Subject: [Vm-dev] [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Fabio, On Fri, Dec 11, 2020 at 3:09 PM Eliot Miranda wrote: > Hi Fabio, > > On Fri, Dec 11, 2020 at 3:08 PM Eliot Miranda > wrote: > >> Hi Fabio, >> >> On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus >> wrote: >> >>> Hi all, >>> >>> I'm not sure this is already known, but >>> CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly >>> crashes the VM on macOS. I tried it with an older VM from last year >>> and the latest bleeding edge (202012050134). >>> >> >> I just tried it on macOS in a bleeding edge VM and see a failing test >> (Error: subscript out of bounds: 38 from testValuePaneModify) but no >> crash. When you run under a debugger what stack trace do you see? >> > > Ah, I'm using the SistaV1 bytecode set. Are you using ClosuresV3? > And the test should be rewritten to do e.g. self object initialPC + N so it works with both 64-bit and 32-bit images. _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Dec 12 13:24:30 2020 From: notifications at github.com (Fabio Niephaus) Date: Sat, 12 Dec 2020 05:24:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM (#542) Message-ID: Following up on [my recent crash report](http://forum.world.st/CompiledCodeInspectorTest-gt-gt-testValuePaneModifyLiteral-crashes-the-VM-td5125258.html):
The Squeak trunk version number and version of the VM can be found in this crash log. ``` $ ~/bin/Squeak64-202012050134.app/Contents/MacOS/Squeak ~/dev/graal/trufflesqueak/images/Squeak6.0alpha-20078-64bit.image 2020-12-12 10:46:27.727 Squeak[22077:774954] Warning: Expected min height of view: () to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation. Illegal instruction Sat Dec 12 10:46:34 2020 VM: 202012050134 https://github.com/OpenSmalltalk/opensmalltalk-vm.git Date: Fri Dec 4 17:34:29 2020 CommitHash: c7b43b3 Plugins: 202012050134 https://github.com/OpenSmalltalk/opensmalltalk-vm.git C stack backtrace & registers: rax 0x00000001062657a8 rbx 0x0000000106266090 rcx 0x0000000106265760 rdx 0x000000010fd10248 rdi 0x0000000111816900 rsi 0x000000010626f980 rbp 0x00007ffee9a9aae8 rsp 0x00007ffee9a9aab0 r8 0x000000010624a778 r9 0x0000000000000179 r10 0x0000000106266100 r11 0x00007ffee9a9aae8 r12 0x00007ffee9a9aae8 r13 0x0000000112307908 r14 0x0000000000000000 r15 0x00007ffee9a9aab8 rip 0x000000010fa518ae 0 ??? 0x000000010fa518ae 0x0 + 4557445294 1 Squeak 0x00000001061cf9e1 reportStackState + 818 2 Squeak 0x00000001061cfd35 sigsegv + 195 3 libsystem_platform.dylib 0x00007fff2036fd7d _sigtramp + 29 Smalltalk stack dump: 0x7ffee9a9aae8 I CompiledCodeInspectorTest>evaluateObject 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9ab30 I CompiledCodeInspectorTest>testValuePaneModifyLiteral 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9ab70 I CompiledCodeInspectorTest(TestCase)>performTest 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9aba0 M [] in CompiledCodeInspectorTest>runCase 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9abd8 M FullBlockClosure(BlockClosure)>on:do: 0x10fd0d1f8: a(n) FullBlockClosure 0x7ffee9a9ac28 M [] in CompiledCodeInspectorTest>timeout:after: 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9ac68 M FullBlockClosure(BlockClosure)>ensure: 0x10fd0db48: a(n) FullBlockClosure 0x7ffee9a9acc8 I CompiledCodeInspectorTest(TestCase)>timeout:after: 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9ad08 M [] in CompiledCodeInspectorTest>runCase 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9ad48 M FullBlockClosure(BlockClosure)>ensure: 0x10fce48c0: a(n) FullBlockClosure 0x7ffee9a9ad90 I CompiledCodeInspectorTest(TestCase)>runCase 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a9add8 I [] in TestResult>runCase: 0x10fce4180: a(n) TestResult 0x7ffee9a9ae20 I Time class>microsecondsToRun: 0x1106d1078: a(n) Time class 0x7ffee9a9ae68 I Time class>millisecondsToRun: 0x1106d1078: a(n) Time class 0x7ffee9a986e0 I FullBlockClosure(BlockClosure)>timeToRun 0x10fce4668: a(n) FullBlockClosure 0x7ffee9a98728 I FullBlockClosure(BlockClosure)>timeToRunWithoutGC 0x10fce4668: a(n) FullBlockClosure 0x7ffee9a98768 M [] in TestResult>runCase: 0x10fce4180: a(n) TestResult 0x7ffee9a987a0 M FullBlockClosure(BlockClosure)>on:do: 0x10fce4418: a(n) FullBlockClosure 0x7ffee9a987f0 M [] in FullBlockClosure>on:do:on:do: 0x10fce4418: a(n) FullBlockClosure 0x7ffee9a98828 M FullBlockClosure(BlockClosure)>on:do: 0x10fce4578: a(n) FullBlockClosure 0x7ffee9a98878 I FullBlockClosure(BlockClosure)>on:do:on:do: 0x10fce4418: a(n) FullBlockClosure 0x7ffee9a988e0 I TestResult>runCase: 0x10fce4180: a(n) TestResult 0x7ffee9a98928 I CompiledCodeInspectorTest(TestCase)>run: 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a98978 I CompiledCodeInspectorTest(TestCase)>run 0x10fce4160: a(n) CompiledCodeInspectorTest 0x7ffee9a989c8 I MessageTrace(CodeHolder)>testRunSuite: 0x10fc576d8: a(n) MessageTrace 0x7ffee9a98a18 I MessageTrace(CodeHolder)>testRunTest 0x10fc576d8: a(n) MessageTrace 0x7ffee9a98a58 I MessageTrace(StringHolder)>perform:orSendTo: 0x10fc576d8: a(n) MessageTrace 0x7ffee9a98aa0 M [] in MenuItemMorph>invokeWithEvent: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98ae0 M FullBlockClosure(BlockClosure)>ensure: 0x10fce3948: a(n) FullBlockClosure 0x7ffee9a98b30 I CursorWithMask(Cursor)>showWhile: 0x110c81260: a(n) CursorWithMask 0x7ffee9a98b80 I MenuItemMorph>invokeWithEvent: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98bc8 I MenuItemMorph>mouseUp: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98c00 M MenuItemMorph>handleMouseUp: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98c38 M MouseButtonEvent>sentTo: 0x10fc53cd0: a(n) MouseButtonEvent 0x7ffee9a98c78 M MenuItemMorph(Morph)>handleEvent: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98cc0 M MorphicEventDispatcher>dispatchEvent:withHandler:withMorph: 0x10fc53d28: a(n) MorphicEventDispatcher 0x7ffee9a98d08 M MorphicEventDispatcher>dispatchDefault:with: 0x10fc53d28: a(n) MorphicEventDispatcher 0x7ffee9a98d48 M MorphicEventDispatcher>dispatchEvent:with: 0x10fc53d28: a(n) MorphicEventDispatcher 0x7ffee9a98d90 M MenuItemMorph(Morph)>processEvent:using: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98dd0 M MenuItemMorph(Morph)>processEvent: 0x10fc53c40: a(n) MenuItemMorph 0x7ffee9a98e20 M [] in MorphicEventDispatcher>dispatchEvent:toSubmorphsOf: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a98e68 M Array(SequenceableCollection)>do: 0x10fc53d40: a(n) Array 0x7ffee9a96780 M MenuMorph(Morph)>submorphsDo: 0x10fc52750: a(n) MenuMorph 0x7ffee9a967c0 M MorphicEventDispatcher>dispatchEvent:toSubmorphsOf: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a96810 M MorphicEventDispatcher>dispatchEvent:withHandler:withMorph: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a96858 M MorphicEventDispatcher>dispatchDefault:with: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a96898 M MorphicEventDispatcher>dispatchEvent:with: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a968e0 M MenuMorph(Morph)>processEvent:using: 0x10fc52750: a(n) MenuMorph 0x7ffee9a96930 M MorphicEventDispatcher>doProcessingForFocusEvent:with: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a96978 M MorphicEventDispatcher>dispatchFocusEventFully:with: 0x10fc528c8: a(n) MorphicEventDispatcher 0x7ffee9a969b8 M MenuMorph>processFocusEvent:using: 0x10fc52750: a(n) MenuMorph 0x7ffee9a969f8 M MenuMorph(Morph)>processFocusEvent: 0x10fc52750: a(n) MenuMorph 0x7ffee9a96a48 M [] in HandMorph>sendFocusEvent:to:clear: 0x1115bbea8: a(n) HandMorph 0x7ffee9a96a90 M [] in ActiveEventVariable class>value:during: 0x11109d8b0: a(n) ActiveEventVariable class 0x7ffee9a96ad0 M FullBlockClosure(BlockClosure)>ensure: 0x10fc52a40: a(n) FullBlockClosure 0x7ffee9a96b20 M ActiveEventVariable class(DynamicVariable class)>value:during: 0x11109d8b0: a(n) ActiveEventVariable class 0x7ffee9a96b70 M [] in ActiveEventVariable class>value:during: 0x11109d8b0: a(n) ActiveEventVariable class 0x7ffee9a96bb0 M FullBlockClosure(BlockClosure)>ensure: 0x10fc52b88: a(n) FullBlockClosure 0x7ffee9a96bf0 M ActiveEventVariable class>value:during: 0x11109d8b0: a(n) ActiveEventVariable class 0x7ffee9a96c30 M MouseButtonEvent(MorphicEvent)>becomeActiveDuring: 0x10fbb4718: a(n) MouseButtonEvent 0x7ffee9a96c80 M [] in HandMorph>sendFocusEvent:to:clear: 0x1115bbea8: a(n) HandMorph 0x7ffee9a96cc8 M [] in ActiveHandVariable class>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a96d08 M FullBlockClosure(BlockClosure)>ensure: 0x10fc52da8: a(n) FullBlockClosure 0x7ffee9a96d58 M ActiveHandVariable class(DynamicVariable class)>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a96da8 M [] in ActiveHandVariable class>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a96de8 M FullBlockClosure(BlockClosure)>ensure: 0x10fc52ef0: a(n) FullBlockClosure 0x7ffee9a96e28 M ActiveHandVariable class>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a96e68 M HandMorph>becomeActiveDuring: 0x1115bbea8: a(n) HandMorph 0x7ffee9a97748 M [] in HandMorph>sendFocusEvent:to:clear: 0x1115bbea8: a(n) HandMorph 0x7ffee9a97790 M [] in ActiveWorldVariable class>value:during: 0x11109d9b8: a(n) ActiveWorldVariable class 0x7ffee9a977d0 M FullBlockClosure(BlockClosure)>ensure: 0x10fc531c8: a(n) FullBlockClosure 0x7ffee9a97820 M ActiveWorldVariable class(DynamicVariable class)>value:during: 0x11109d9b8: a(n) ActiveWorldVariable class 0x7ffee9a97870 M [] in ActiveWorldVariable class>value:during: 0x11109d9b8: a(n) ActiveWorldVariable class 0x7ffee9a978b0 M FullBlockClosure(BlockClosure)>ensure: 0x10fc53310: a(n) FullBlockClosure 0x7ffee9a978f0 M ActiveWorldVariable class>value:during: 0x11109d9b8: a(n) ActiveWorldVariable class 0x7ffee9a97930 M PasteUpMorph>becomeActiveDuring: 0x1107331e8: a(n) PasteUpMorph 0x7ffee9a97978 M HandMorph>sendFocusEvent:to:clear: 0x1115bbea8: a(n) HandMorph 0x7ffee9a979d0 M HandMorph>sendEvent:focus:clear: 0x1115bbea8: a(n) HandMorph 0x7ffee9a97a18 M HandMorph>sendMouseEvent: 0x1115bbea8: a(n) HandMorph 0x7ffee9a97a58 M HandMorph>handleEvent: 0x1115bbea8: a(n) HandMorph 0x7ffee9a97aa8 M HandMorph>processEvents 0x1115bbea8: a(n) HandMorph 0x7ffee9a97ae8 M [] in WorldState>doOneCycleNowFor: 0x1115bbae0: a(n) WorldState 0x7ffee9a97b30 M [] in ActiveHandVariable class>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a97b70 M FullBlockClosure(BlockClosure)>ensure: 0x10fc53628: a(n) FullBlockClosure 0x7ffee9a97bc0 M ActiveHandVariable class(DynamicVariable class)>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a97c10 M [] in ActiveHandVariable class>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a97c50 M FullBlockClosure(BlockClosure)>ensure: 0x10fc53770: a(n) FullBlockClosure 0x7ffee9a97c90 M ActiveHandVariable class>value:during: 0x11109d950: a(n) ActiveHandVariable class 0x7ffee9a97cd0 M HandMorph>becomeActiveDuring: 0x1115bbea8: a(n) HandMorph 0x7ffee9a97d10 M [] in WorldState>doOneCycleNowFor: 0x1115bbae0: a(n) WorldState 0x7ffee9a97d58 M Array(SequenceableCollection)>do: 0x110362490: a(n) Array 0x7ffee9a97d90 M WorldState>handsDo: 0x1115bbae0: a(n) WorldState 0x7ffee9a97dd0 M WorldState>doOneCycleNowFor: 0x1115bbae0: a(n) WorldState 0x7ffee9a97e08 M WorldState>doOneCycleFor: 0x1115bbae0: a(n) WorldState 0x7ffee9a97e40 M PasteUpMorph>doOneCycle 0x1107331e8: a(n) PasteUpMorph 0x7ffee9a97e70 M [] in MorphicProject>spawnNewProcess 0x110a9cda0: a(n) MorphicProject 0x112ce7368 s [] in FullBlockClosure(BlockClosure)>newProcess Most recent primitives at:put: value: basicNew: basicNew new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: basicNew: new: **CompactCode** at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: at: key new: at: at: at: at:put: at: at: scanForEmptySlotFor: scanForEmptySlotFor: scanForEmptySlotFor: at:put: at: at: at: at: at:put: at: at:put: at: scanForEmptySlotFor: = at:put: at: at: at: at: at:put: at: at: at:put: at: at:put: at: at: at: identityHash at:put: at: at: at: identityHash at:put: at: at:put: at: at:put: at: at: at:put: at: at: at:put: at: at: at:put: at: at: at: at: at: at: at: at: at: key key identityHash copyWithDependent: basicNew: basicAt:put: new: yourself yourself new: basicNew: new: basicNew: new: value signal suspend getSystemAttribute: getSystemAttribute: basicNew basicNew basicNew: stackp: numCopiedValues numCopiedValues resume value wait signal utcMicrosecondClock at: at: value:value: at:put: primSignal:atUTCMicroseconds: wait signal wait basicNew value perform: at: value: at: value: at: value: at: value: at: value: at: value: value: value: at: value: value: at: value: at: value: at: value: at: value: value utcMicrosecondClock value value: **StackOverflow** basicNew value: size at: asciiValue at: asciiValue at: asciiValue at: asciiValue at: asciiValue at: asciiValue format utcMicrosecondClock basicSize **PrimitiveFailure** basicNew: numCopiedValues value stack page bytes 4096 available headroom 1480 minimum unused headroom 0 (Illegal instruction) [1] 22077 abort ~/bin/Squeak64-202012050134.app/Contents/MacOS/Squeak ```
For the record, I'm on macOS Big Sur (11.0.1) and the 64bit image uses Sista and FullBlockClosures. Please let me know if you need more info, @eliotmiranda. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/542 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Sat Dec 12 13:26:17 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Sat, 12 Dec 2020 14:26:17 +0100 Subject: [Vm-dev] [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: Hi Eliot, Interesting that you can't reproduce this. I've opened https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/542 with additional information. Fabio On Sat, Dec 12, 2020 at 12:12 AM Eliot Miranda wrote: > > Hi Fabio, > > On Fri, Dec 11, 2020 at 3:09 PM Eliot Miranda wrote: >> >> Hi Fabio, >> >> On Fri, Dec 11, 2020 at 3:08 PM Eliot Miranda wrote: >>> >>> Hi Fabio, >>> >>> On Fri, Dec 11, 2020 at 7:47 AM Fabio Niephaus wrote: >>>> >>>> Hi all, >>>> >>>> I'm not sure this is already known, but >>>> CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly >>>> crashes the VM on macOS. I tried it with an older VM from last year >>>> and the latest bleeding edge (202012050134). >>> >>> >>> I just tried it on macOS in a bleeding edge VM and see a failing test (Error: subscript out of bounds: 38 from testValuePaneModify) but no crash. When you run under a debugger what stack trace do you see? >> >> >> Ah, I'm using the SistaV1 bytecode set. Are you using ClosuresV3? > > > And the test should be rewritten to do e.g. self object initialPC + N so it works with both 64-bit and 32-bit images. > > _,,,^..^,,,_ > best, Eliot > From tim at rowledge.org Sun Dec 13 02:07:29 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 12 Dec 2020 18:07:29 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? Message-ID: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> Is anybody else doing anything with MP3 files? It looks like we haven't included any image-side support for them for several releases now (I've look back to 4.5) but it is/was working just fine for the work I did on Pi Scratch. That was, admittedly, quite a while ago. In the current system I can load much of Scratch without too many issues - sounds are really messed up in various places, some morph building is broken etc - but today I'm trying to see why mp3 sounds don't. It seems that the code for the src/plugins/Mpeg3Plugin.c is broken. The autogenerated checks for the types of the arguments is insisting that be indexable pointers, when is is in fact a variable word array. That at least explains why the prim fails, which is at least a step forward. Current code on opensmalltalk git - /* int mpeg3_read_audio(mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream) */ /* Mpeg3Plugin>>#primitiveMPEG3ReadAudio:shortArray:channel:samples:stream: */ EXPORT(sqInt) primitiveMPEG3ReadAudio(void) { sqInt aChannelNumber; sqInt aNumber; sqInt *anArray; short *arrayBase; sqInt aSampleNumber; mpeg3_t *file; sqInt fileHandle; sqInt result; result = 0; if (!(((isPointers(stackValue(3))) && (isIndexable(stackValue(3)))) && ((isIntegerObject((aChannelNumber = stackValue(2)))) && ((isIntegerObject((aSampleNumber = stackValue(1)))) && (isIntegerObject((aNumber = stackValue(0)))))))) { primitiveFailFor(PrimErrBadArgument); return null; } The two interesting things I have remaining energy to point out today - The Slang does explicitly and wrongly declare it as self primitive: 'primitiveMPEG3ReadAudio' parameters: #(Oop Array SmallInteger SmallInteger SmallInteger). .. which clearly doesn't help. It has, however, been that way since 2006. And the old C file from Back Then has result = 0; fileHandle = stackValue(4); success(isIndexable(stackValue(3))); anArray = ((sqInt *) (firstIndexableField(stackValue(3)))); aChannelNumber = stackIntegerValue(2); aSampleNumber = stackIntegerValue(1); aNumber = stackIntegerValue(0); if (failed()) { return null; } .. and so it makes kinda sense why it worked Back Then. Thus I am inclined (and not just because I'm falling asleep) to think that some change in how the prologue stuff is generated might have started to note the Array declaration and become more zealous. More when awake. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: STOP: No Op From tim at rowledge.org Sun Dec 13 06:02:19 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 12 Dec 2020 22:02:19 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> Message-ID: <70425292-75A7-4F8A-B7CC-8D0F800039EA@rowledge.org> OK, I woke up with a start and an idea. Changing to 'WordArray' and recompiling... made mp3 files play. I wonder if there are any other places needing changing. Tomorrow... > On 2020-12-12, at 6:07 PM, tim Rowledge wrote: > > > Is anybody else doing anything with MP3 files? It looks like we haven't included any image-side support for them for several releases now (I've look back to 4.5) but it is/was working just fine for the work I did on Pi Scratch. That was, admittedly, quite a while ago. > > In the current system I can load much of Scratch without too many issues - sounds are really messed up in various places, some morph building is broken etc - but today I'm trying to see why mp3 sounds don't. > > It seems that the code for the src/plugins/Mpeg3Plugin.c is broken. The autogenerated checks for the types of the arguments is insisting that be indexable pointers, when is is in fact a variable word array. That at least explains why the prim fails, which is at least a step forward. > > Current code on opensmalltalk git - > > /* int mpeg3_read_audio(mpeg3_t *file, > float *output_f, > short *output_i, > int channel, > long samples, > int stream) */ > > /* Mpeg3Plugin>>#primitiveMPEG3ReadAudio:shortArray:channel:samples:stream: */ > EXPORT(sqInt) > primitiveMPEG3ReadAudio(void) > { > sqInt aChannelNumber; > sqInt aNumber; > sqInt *anArray; > short *arrayBase; > sqInt aSampleNumber; > mpeg3_t *file; > sqInt fileHandle; > sqInt result; > > result = 0; > if (!(((isPointers(stackValue(3))) > && (isIndexable(stackValue(3)))) > && ((isIntegerObject((aChannelNumber = stackValue(2)))) > && ((isIntegerObject((aSampleNumber = stackValue(1)))) > && (isIntegerObject((aNumber = stackValue(0)))))))) { > primitiveFailFor(PrimErrBadArgument); > return null; > } > > The two interesting things I have remaining energy to point out today - > The Slang does explicitly and wrongly declare it as > > self primitive: 'primitiveMPEG3ReadAudio' parameters: #(Oop Array SmallInteger SmallInteger SmallInteger). > > .. which clearly doesn't help. It has, however, been that way since 2006. > > And the old C file from Back Then has > > result = 0; > fileHandle = stackValue(4); > success(isIndexable(stackValue(3))); > anArray = ((sqInt *) (firstIndexableField(stackValue(3)))); > aChannelNumber = stackIntegerValue(2); > aSampleNumber = stackIntegerValue(1); > aNumber = stackIntegerValue(0); > if (failed()) { > return null; > } > .. and so it makes kinda sense why it worked Back Then. > > Thus I am inclined (and not just because I'm falling asleep) to think that some change in how the prologue stuff is generated might have started to note the Array declaration and become more zealous. > > More when awake. > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: STOP: No Op > > > tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: POI: Power Off Intermittently From noreply at github.com Sun Dec 13 09:33:54 2020 From: noreply at github.com (dcstes) Date: Sun, 13 Dec 2020 01:33:54 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] e1ca7b: SunOS change: document /etc/security/policy.conf Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: e1ca7b258cb7a467280804266c029f75f5172dfd https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e1ca7b258cb7a467280804266c029f75f5172dfd Author: stes Date: 2020-12-11 (Fri, 11 Dec 2020) Changed paths: M build.sunos64x64/HowToBuild Log Message: ----------- SunOS change: document /etc/security/policy.conf Commit: db5f88f7c819c97fcf5ce42fa20a790434581542 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/db5f88f7c819c97fcf5ce42fa20a790434581542 Author: dcstes <71445905+dcstes at users.noreply.github.com> Date: 2020-12-13 (Sun, 13 Dec 2020) Changed paths: M build.sunos64x64/HowToBuild Log Message: ----------- Merge pull request #541 from dcstes/policyconf SunOS change: document /etc/security/policy.conf Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/753104ddb490...db5f88f7c819 From notifications at github.com Sun Dec 13 09:33:55 2020 From: notifications at github.com (dcstes) Date: Sun, 13 Dec 2020 01:33:55 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] SunOS change: document /etc/security/policy.conf (#541) In-Reply-To: References: Message-ID: Merged #541 into Cog. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/541#event-4105834835 -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Sun Dec 13 11:25:51 2020 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 13 Dec 2020 11:25:51 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2326 Message-ID: <20201213112551.1.D36333F8B8BC719F@appveyor.com> An HTML attachment was scrubbed... URL: From stes at telenet.be Sun Dec 13 15:50:46 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 13 Dec 2020 16:50:46 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> Message-ID: <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 If there is someone with access to http://squeakvm.org/svn/squeak (subversion), can they please have a look at the issue ? It seems simple to fix. Thanks, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf1jgGAAoJEAwpOKXMq1MaXNIIAJoyCpMjAS9HzY8HC8wlG/Wk VP2sqoQlEoS0x2eDT9PSKnFjOzGQaFEdgd8BfUKso18/ZbGNTUAA6TGJKrLjtEi+ LCKdPxUdkHd6sQg3tlbJDI4K9lyIeY3AB4pj7ygJ/+6OhHuowX2u/iTyXQL+kLe4 N1UQFWD8DKeHQkIVLBOIq0VOf8o3ffAr5mbYe1oWHHwbj5bKGT7s6S+XkXAEh1tG Yx+uIhzOJcz1BOfNPF74uMZjF5wbC1S/N1lRPt7yxtOpwAxGG1Z2BCrKW9LwWkFK 8vqX4SXS0UwNzmkpNsgwqdJ1ZyB0uBjEs22KcPCNTSnDVnoKK/6zRjU7RWpyvoY= =PG3Q -----END PGP SIGNATURE----- From lewis at mail.msen.com Sun Dec 13 16:53:37 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 13 Dec 2020 11:53:37 -0500 Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> Message-ID: <20201213165337.GA89573@shell.msen.com> Hi David, On Sun, Dec 13, 2020 at 04:50:46PM +0100, stes at PANDORA.BE wrote: > > > If there is someone with access to http://squeakvm.org/svn/squeak (subversion), > can they please have a look at the issue ? > > It seems simple to fix. > > Thanks, > David Stes > I tried applying the patch, and it compiles and runs on my Linux box. However if I am reading this right, the patch forces __LITTLE_ENDIAN to be defined for all platforms, so that would break big endian systems. Granted, there are no big endian platforms in common use these days, but it still doesn't seem like the right way to deal with it. Am I right in understanding that the original code causes compiler warnings on Solaris, but that it compiles and works correctly despite the warnings? If so, I would honestly suggest just ignoring the warnings. Otherwise if it is a functional problem, maybe there is a way that we can make the build system ensure a correct setting for __LITTLE_ENDIAN. I have not looked at this, but I suspect there will be a way that we could make it work. Dave From stes at telenet.be Sun Dec 13 17:56:18 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 13 Dec 2020 18:56:18 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> Message-ID: <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 The #ifndef __LITTLE_ENDIAN only checks whether __LITTLE_ENDIAN is NOT defined (ifndef=ifnotdefined). Note that this is inside a code block that is #if defined(i386). Basically they #define __LITTLE_ENDIAN in the common case of i386. However this causes tons of warnings because at the cmake level, __LITTLE_ENDIAN is already defined (on the C compiler command line). So this patch is not breaking the big endian case (I may try SPARC someday), and also it does not break the x64 case. Note that the cmake config file indicates a change was made to fix the x64, which I think then had this unfortunate effect on the i386 case. So if possible please apply the patch. It fixes lots of warnings for me that looked quite suspicious to me ... David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf1lWSAAoJEAwpOKXMq1Mae1gIAJu3x/immP3Jx7L6kqJRoopR OQJQ3fltw9b37i7p1FSoZd3kdOZxe6oihREDZb6Ay8DegI0HFrGlyIib3HTKBCGU DCPCSlw/5hFHhvhdzsjk++dqkq3XHPU9mSYPl9Wz6e4a3ceNBLxmoVCauHPZHiPu PLLe5EDFgsMKIQtL62EU3ySXfGw60UgEHQpr/Q7l4SgNfHA3dTJjq7yoSdHBO/dr xN9pqQQA500QeYdf8XPFrHQbonOn4iclDKEs+aDKFkumYRcKg57vLp3KiN2OwCIU aMft14o4ISh0iK9uGe3oebdnTVNSkFb0fwQKYzEW1oOFCoYRm+ZCsNQF5UP2X5o= =VNaO -----END PGP SIGNATURE----- From stes at telenet.be Sun Dec 13 18:03:47 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 13 Dec 2020 19:03:47 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> Message-ID: <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 In the cmake.config platforms/unix/plugins/FloatMathPlugin/config.cmake it says: # fdlibm.h does not recognize x86_64, so set endianness here for all platforms. TEST_BIG_ENDIAN (IS_BIG_ENDIAN) IF (NOT IS_BIG_ENDIAN) PLUGIN_DEFINITIONS (-D__LITTLE_ENDIAN=1) ENDIF () So basically the cmake is testing IS_BIG_ENDIAN and if not so, then it defines __LITTLE_ENDIAN. That's fine but the problem is that the old code in the fdlibm.h header is #define __LITTLE_ENDIAN which (1) is a duplicate def and (2) defines to a different value (because it does not define it =1). So assuming you want to keep the definition at the cmake level (for x64), then in the header file it should be conditional #ifndef __LITTLE_ENDIAN (if not already defined on the command line) David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf1ldjAAoJEAwpOKXMq1MaQEIH/0CafOdErjdTHcJmwxSz/ZR6 NrmYXFzB2uZZpGiGETVVZl73fmC0TlQ4tBxd5jVacZxoeCV+LpU4D61PP3cGVJMj elpjhy8UWvOinzqKhBjN8Xl7AdaJzugJLp0s8Ovb9St2Y41HIRjQZCCO47FdRB1T zY87dehH68lPIZ9/HCc0YB5+HZvuIV0uMJMmI3YdmwsBnuMfcaMmnkhKfk65Lt0j h9Ehp2q+NHfxHbJu0Xxab8TEfZlWVFH9aVJsOQ/GFe6Wdo+J+sq51AshLyYIbB3t F1Tis4l0Zrghxm+oDIJ+EmvhZcrPE29Fo0eHXFJ4Tsq0wUqR9Kj/dl3hVFNGlok= =40Mx -----END PGP SIGNATURE----- From stes at telenet.be Sun Dec 13 18:13:29 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 13 Dec 2020 19:13:29 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> Message-ID: <881470040.40438696.1607883209982.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 By the way, regarding the "big endian" case, such as the SPARC processor, I may ask around maybe I can find a helpful soul who compiles it on SPARC. Could be interesting, and it may work ... it has worked in the past, so why not still today ... In any case my patch was not intended for the big endian case, but it also does not break the big endian case. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf1llmAAoJEAwpOKXMq1MaNK8H/0QWfNe5r9rx9anMU4DPH4y1 My5dAA9ttJBrOHsEzpPIXOgHdLgzARV2v9gSxh89Irp3ACjF0KCfBYZ6keGYq/cG TeHq75Y1dr3GVZkJ1F2lmvzswSvSBueDXQhfmZq891/dtFmBu0ziO6e/WPxmR4e5 YtA+elYH98jk+8JJbciJFt32UqlQZb+OPnUf/QnuUPaqAPDdK9u9RwdeWKpInc4H sfZTcdRKgq5FLKai+JNZKd4X1Jhy+Xc05y0ttujErlbvrjKznCo/KJlxA+WUaEV2 U93doL5hiKt1yMeFkDMzfliCOAGoDbQCsPW9fMmaaJD0FGX3gRegiXkoOuqO2GQ= =mkSh -----END PGP SIGNATURE----- From lewis at mail.msen.com Sun Dec 13 18:26:49 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 13 Dec 2020 13:26:49 -0500 Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> Message-ID: <20201213182649.GA6335@shell.msen.com> On Sun, Dec 13, 2020 at 07:03:47PM +0100, stes at PANDORA.BE wrote: > > > In the cmake.config > > platforms/unix/plugins/FloatMathPlugin/config.cmake > > it says: > > > # fdlibm.h does not recognize x86_64, so set endianness here for all platforms. > > TEST_BIG_ENDIAN (IS_BIG_ENDIAN) > IF (NOT IS_BIG_ENDIAN) > PLUGIN_DEFINITIONS (-D__LITTLE_ENDIAN=1) > ENDIF () > > So basically the cmake is testing IS_BIG_ENDIAN and if not so, > then it defines __LITTLE_ENDIAN. > > That's fine but the problem is that the old code in the fdlibm.h header > is #define __LITTLE_ENDIAN which (1) is a duplicate def and (2) defines > to a different value (because it does not define it =1). > > So assuming you want to keep the definition at the cmake level (for x64), > then in the header file it should be conditional > > #ifndef __LITTLE_ENDIAN (if not already defined on the command line) > > > David Stes > Oh, that is good, the config.cmake is already handling it. I like your idea of using #ifndef __LITTLE_ENDIAN to prevent redefinition in fdlibm.h. It is a minimal change to the original Sun code and it will have no adverse effect on other platforms. I tried this on my Linux box. It compiles without warnings, and all of the FloatMathPluginTests tests are green (these are in the VMMaker package, not Squeak trunk). It's a trivial change but I'm attaching a copy of the file I used for reference. If you can confirm that this does what is needed on Solaris, I'll push the update to SVN for you. Thanks! Dave -------------- next part -------------- A non-text attachment was scrubbed... Name: fdlibm.h Type: text/x-chdr Size: 6283 bytes Desc: not available URL: From stes at telenet.be Sun Dec 13 19:09:27 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 13 Dec 2020 20:09:27 +0100 (CET) Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <881470040.40438696.1607883209982.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> <881470040.40438696.1607883209982.JavaMail.zimbra@telenet.be> Message-ID: <1763098011.40551299.1607886567526.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I had to run the file through tr -d '\015' < fdlibm.h to delete CR (carriage-return). Possibly there are combinations of CR and NL in the file. It may also be because of my download of the file. But besides that - after deleting CR - I had a svn diff, and it is close to what I submitted. I now get bash-4.4$ svn diff Index: fdlibm.h =================================================================== - --- fdlibm.h (revision 3790) +++ fdlibm.h (working copy) @@ -13,11 +13,13 @@ /* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly but these catch some common cases. */ +#ifndef __LITTLE_ENDIAN #if defined(i386) || defined(i486) || \ defined(intel) || defined(x86) || defined(i86pc) || \ defined(__alpha) || defined(__osf__) #define __LITTLE_ENDIAN #endif +#endif #ifdef __LITTLE_ENDIAN That is OK by me. This compiles OK now with the SunPRO C compiler. I checked both 32bit and 64bit because the Makefile first descends in build and then in build64. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf1mWgAAoJEAwpOKXMq1MaWtwIAI+a9/PqKASc/zfGE+FoTHvw 4QUmFwB47ssJJG9HGLwbC7XAKQvwGYekGq8jf4POfBCyI7dZpG4ISZwWGb3XTwt3 RcN4xR3QI+/raRS0qGD4ZQaNkBnUFVqpDtq+ruKEboOFPpJpZknqXMFfsM/asPKk oxKtsxPczbL3W9OoeSgsw4LGHkTZoPzunGpgqv2Re/574OJdse4iy4ln4MO2CcVG wWBcC2JRtZLqe/yfF+jZQ9kg7OmjBwpC/c3GPCZbeIZipRFXtz5ekvovYNlq0ywB UC2SEIGt4TyY7tI/JCJ/xsKPkEtUZ/WVA7lXsBkwHRNPzrXNY/xTfmr77yGqhjw= =Q7tY -----END PGP SIGNATURE----- From lewis at mail.msen.com Sun Dec 13 19:46:32 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 13 Dec 2020 14:46:32 -0500 Subject: [Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header In-Reply-To: <1763098011.40551299.1607886567526.JavaMail.zimbra@telenet.be> References: <1006358798.14971516.1607250513743.JavaMail.zimbra@telenet.be> <1100470362.22673173.1607446901572.JavaMail.zimbra@telenet.be> <1115518071.40069732.1607874646974.JavaMail.zimbra@telenet.be> <1133410613.40398363.1607882178381.JavaMail.zimbra@telenet.be> <75247224.40417436.1607882627515.JavaMail.zimbra@telenet.be> <881470040.40438696.1607883209982.JavaMail.zimbra@telenet.be> <1763098011.40551299.1607886567526.JavaMail.zimbra@telenet.be> Message-ID: <20201213194632.GA18701@shell.msen.com> On Sun, Dec 13, 2020 at 08:09:27PM +0100, stes at PANDORA.BE wrote: > > > I had to run the file through tr -d '\015' < fdlibm.h > to delete CR (carriage-return). > > Possibly there are combinations of CR and NL in the file. > > It may also be because of my download of the file. > Yes it was probably just an artifact of the download. > But besides that - after deleting CR - I had a svn diff, > and it is close to what I submitted. > > I now get > > bash-4.4$ svn diff > Index: fdlibm.h > =================================================================== > - --- fdlibm.h (revision 3790) > +++ fdlibm.h (working copy) > @@ -13,11 +13,13 @@ > /* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly > but these catch some common cases. */ > > +#ifndef __LITTLE_ENDIAN > #if defined(i386) || defined(i486) || \ > defined(intel) || defined(x86) || defined(i86pc) || \ > defined(__alpha) || defined(__osf__) > #define __LITTLE_ENDIAN > #endif > +#endif > > #ifdef __LITTLE_ENDIAN > > > That is OK by me. This compiles OK now with the SunPRO C compiler. > > I checked both 32bit and 64bit because the Makefile first descends in > build and then in build64. > > David Stes > I just committed your fix to SVN, revision 3791. Thanks, Dave From tim at rowledge.org Sun Dec 13 22:57:05 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 13 Dec 2020 14:57:05 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: <70425292-75A7-4F8A-B7CC-8D0F800039EA@rowledge.org> References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> <70425292-75A7-4F8A-B7CC-8D0F800039EA@rowledge.org> Message-ID: <153F961E-4C45-4A6F-AACB-97EDC2502CD7@rowledge.org> Hmph. So I see that the mpeg3plugin actually got slang-updated a couple of weeks back and actually fixed this issue, but the plugin C code hasn't been regenerated in 3+ months. Sure, *I* can generate the stuff, I can probably remember how to use it anyway, but it could cause confusion for anyone less steeped in the lore. And please don't anyone suggest I try to make this git stuff do anything. > On 2020-12-12, at 10:02 PM, tim Rowledge wrote: > > > OK, I woke up with a start and an idea. Changing to 'WordArray' and recompiling... made mp3 files play. > > I wonder if there are any other places needing changing. Tomorrow... > >> On 2020-12-12, at 6:07 PM, tim Rowledge wrote: >> >> >> Is anybody else doing anything with MP3 files? It looks like we haven't included any image-side support for them for several releases now (I've look back to 4.5) but it is/was working just fine for the work I did on Pi Scratch. That was, admittedly, quite a while ago. >> >> In the current system I can load much of Scratch without too many issues - sounds are really messed up in various places, some morph building is broken etc - but today I'm trying to see why mp3 sounds don't. >> >> It seems that the code for the src/plugins/Mpeg3Plugin.c is broken. The autogenerated checks for the types of the arguments is insisting that be indexable pointers, when is is in fact a variable word array. That at least explains why the prim fails, which is at least a step forward. >> >> Current code on opensmalltalk git - >> >> /* int mpeg3_read_audio(mpeg3_t *file, >> float *output_f, >> short *output_i, >> int channel, >> long samples, >> int stream) */ >> >> /* Mpeg3Plugin>>#primitiveMPEG3ReadAudio:shortArray:channel:samples:stream: */ >> EXPORT(sqInt) >> primitiveMPEG3ReadAudio(void) >> { >> sqInt aChannelNumber; >> sqInt aNumber; >> sqInt *anArray; >> short *arrayBase; >> sqInt aSampleNumber; >> mpeg3_t *file; >> sqInt fileHandle; >> sqInt result; >> >> result = 0; >> if (!(((isPointers(stackValue(3))) >> && (isIndexable(stackValue(3)))) >> && ((isIntegerObject((aChannelNumber = stackValue(2)))) >> && ((isIntegerObject((aSampleNumber = stackValue(1)))) >> && (isIntegerObject((aNumber = stackValue(0)))))))) { >> primitiveFailFor(PrimErrBadArgument); >> return null; >> } >> >> The two interesting things I have remaining energy to point out today - >> The Slang does explicitly and wrongly declare it as >> >> self primitive: 'primitiveMPEG3ReadAudio' parameters: #(Oop Array SmallInteger SmallInteger SmallInteger). >> >> .. which clearly doesn't help. It has, however, been that way since 2006. >> >> And the old C file from Back Then has >> >> result = 0; >> fileHandle = stackValue(4); >> success(isIndexable(stackValue(3))); >> anArray = ((sqInt *) (firstIndexableField(stackValue(3)))); >> aChannelNumber = stackIntegerValue(2); >> aSampleNumber = stackIntegerValue(1); >> aNumber = stackIntegerValue(0); >> if (failed()) { >> return null; >> } >> .. and so it makes kinda sense why it worked Back Then. >> >> Thus I am inclined (and not just because I'm falling asleep) to think that some change in how the prologue stuff is generated might have started to note the Array declaration and become more zealous. >> >> More when awake. >> >> tim >> -- >> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim >> Strange OpCodes: STOP: No Op >> >> >> > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: POI: Power Off Intermittently > > > tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim State-of-the-art: What we could do with enough money. From tim at rowledge.org Sun Dec 13 23:32:09 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 13 Dec 2020 15:32:09 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: <153F961E-4C45-4A6F-AACB-97EDC2502CD7@rowledge.org> References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> <70425292-75A7-4F8A-B7CC-8D0F800039EA@rowledge.org> <153F961E-4C45-4A6F-AACB-97EDC2502CD7@rowledge.org> Message-ID: > On 2020-12-13, at 2:57 PM, tim Rowledge wrote: > > Hmph. So I see that the mpeg3plugin actually got slang-updated a couple of weeks back and actually fixed this issue, but the plugin C code hasn't been regenerated in 3+ months. Wait, what? It's not there now. Sigh. Evidently I'm seeing into different futures or something. This is not good; last time that happened everyone stopped being dinosaurian. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Don't compare floating point numbers solely for equality. From noreply at github.com Mon Dec 14 00:50:10 2020 From: noreply at github.com (Eliot Miranda) Date: Sun, 13 Dec 2020 16:50:10 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] c93cd6: Mac Big Sur builds. Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: c93cd672fca8f814c32ae00eb0626dd8e0018d0a https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c93cd672fca8f814c32ae00eb0626dd8e0018d0a Author: Eliot Miranda Date: 2020-12-13 (Sun, 13 Dec 2020) Changed paths: M build.macos64x64/common/Makefile.app Log Message: ----------- Mac Big Sur builds. codesign does not sign bundles within the app. So explicitly sign App.app/Contents/Resources/*.bundle. Any unsigned bundles will fail to load on Big Sur. [ci skip] From tim at rowledge.org Mon Dec 14 05:03:01 2020 From: tim at rowledge.org (tim Rowledge) Date: Sun, 13 Dec 2020 21:03:01 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> Message-ID: <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> > On 2020-11-22, at 8:50 PM, Levente Uzonyi wrote: > > On Sat, 21 Nov 2020, Eliot Miranda wrote: > >> Hi Yoshiki, >> >> Levente replaced the select code with epoll code on Linux a fey weeks >> ago. Maybe there’s a regression. > > That is indeed the culprit. epoll_wait expects the timeout in milliseconds but the value is in microseconds. Unfortunately, fixing that brings back the old increased cpu usage. Do we have a decent solution for this issue? It *utterly* ruins NuScratch on a Pi and I'm trying to make a new release. Won't someone please think of the children? tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: ETO: Emulate Toaster Oven From commits at source.squeak.org Mon Dec 14 05:10:20 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 14 Dec 2020 05:10:20 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-tpr.2906.mcz Message-ID: tim Rowledge uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-tpr.2906.mcz ==================== Summary ==================== Name: VMMaker.oscog-tpr.2906 Author: tpr Time: 13 December 2020, 9:07:40.834798 pm UUID: df432f2d-0ae6-4d4e-9f9b-db364976a138 Ancestors: VMMaker.oscog-eem.2905 Mpeg3Plugin sample read routines expect word arrays,not pointer arrays. Became an issue recently due to Slang changes? =============== Diff against VMMaker.oscog-eem.2905 =============== Item was changed: ----- Method: Mpeg3Plugin>>primitiveMPEG3ReReadAudio:shortArray:channel:samples:stream: (in category 'primitives') ----- primitiveMPEG3ReReadAudio: fileHandle shortArray: anArray channel: aChannelNumber samples: aSampleNumber stream: aNumber | file result arrayBase | "int mpeg3_reread_audio(mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream)" self primitive: 'primitiveMPEG3ReReadAudio' + parameters: #(Oop WordArray SmallInteger SmallInteger SmallInteger). - parameters: #(Oop Array SmallInteger SmallInteger SmallInteger). file := self mpeg3tValueOf: fileHandle. file = nil ifTrue: [^0]. aNumber < 0 ifTrue: [interpreterProxy success: false. ^nil]. aNumber >= (self cCode: 'result = mpeg3_total_astreams(file)') ifTrue: [ interpreterProxy success: false. ^0 ]. arrayBase := self cCoerce: anArray to: 'short *'. interpreterProxy failed ifTrue: [^nil]. self cCode: 'result = mpeg3_reread_audio(file,(float *) NULL,arrayBase,aChannelNumber,aSampleNumber,aNumber)'. ^result asSmallIntegerObj ! Item was changed: ----- Method: Mpeg3Plugin>>primitiveMPEG3ReadAudio:shortArray:channel:samples:stream: (in category 'primitives') ----- primitiveMPEG3ReadAudio: fileHandle shortArray: anArray channel: aChannelNumber samples: aSampleNumber stream: aNumber | file result arrayBase | "int mpeg3_read_audio(mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream)" self primitive: 'primitiveMPEG3ReadAudio' + parameters: #(Oop WordArray SmallInteger SmallInteger SmallInteger). - parameters: #(Oop Array SmallInteger SmallInteger SmallInteger). file := self mpeg3tValueOf: fileHandle. file = nil ifTrue: [^0]. aNumber < 0 ifTrue: [interpreterProxy success: false. ^nil]. aNumber >= (self cCode: 'result = mpeg3_total_astreams(file)') ifTrue: [ interpreterProxy success: false. ^0 ]. arrayBase := self cCoerce: anArray to: 'short *'. interpreterProxy failed ifTrue: [^nil]. self cCode: 'result = mpeg3_read_audio(file,(float *) NULL,arrayBase,aChannelNumber,aSampleNumber,aNumber)'. ^result asSmallIntegerObj ! From noreply at github.com Mon Dec 14 05:32:17 2020 From: noreply at github.com (smalltalking) Date: Sun, 13 Dec 2020 21:32:17 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 3db388: Fix two issues with the epoll code Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 3db3888c2a76bd91ef66d70521d85f80e9d18f1d https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3db3888c2a76bd91ef66d70521d85f80e9d18f1d Author: Levente Uzonyi Date: 2020-12-14 (Mon, 14 Dec 2020) Changed paths: M platforms/unix/vm/aio.c Log Message: ----------- Fix two issues with the epoll code - epoll_wait expects the timeout value in milliseconds instead of microseconds - set the EPOLLET flag for all events as a cheaper alternative of removing the event handlers each time they are triggered From leves at caesar.elte.hu Mon Dec 14 05:34:55 2020 From: leves at caesar.elte.hu (Levente Uzonyi) Date: Mon, 14 Dec 2020 06:34:55 +0100 (CET) Subject: [Vm-dev] Another NuScratch issue In-Reply-To: <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> Message-ID: On Sun, 13 Dec 2020, tim Rowledge wrote: > > > >> On 2020-11-22, at 8:50 PM, Levente Uzonyi wrote: >> >> On Sat, 21 Nov 2020, Eliot Miranda wrote: >> >>> Hi Yoshiki, >>> >>> Levente replaced the select code with epoll code on Linux a fey weeks >>> ago. Maybe there’s a regression. >> >> That is indeed the culprit. epoll_wait expects the timeout in milliseconds but the value is in microseconds. Unfortunately, fixing that brings back the old increased cpu usage. > > Do we have a decent solution for this issue? It *utterly* ruins NuScratch on a Pi and I'm trying to make a new release. Won't someone please think of the children? Just pushed a fix[1]. Let me know if that works. Levente [1] https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3db3888c2a76bd91ef66d70521d85f80e9d18f1d > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: ETO: Emulate Toaster Oven From no-reply at appveyor.com Mon Dec 14 07:23:33 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 14 Dec 2020 07:23:33 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2327 Message-ID: <20201214072333.1.379D3685A25D6760@appveyor.com> An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Mon Dec 14 17:31:44 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Mon, 14 Dec 2020 09:31:44 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> Message-ID: Thanks. I had a workaround but was not for real. Levente's patch works for me. On Sun, Dec 13, 2020 at 9:35 PM Levente Uzonyi wrote: > On Sun, 13 Dec 2020, tim Rowledge wrote: > > > > > > > > >> On 2020-11-22, at 8:50 PM, Levente Uzonyi wrote: > >> > >> On Sat, 21 Nov 2020, Eliot Miranda wrote: > >> > >>> Hi Yoshiki, > >>> > >>> Levente replaced the select code with epoll code on Linux a fey weeks > >>> ago. Maybe there’s a regression. > >> > >> That is indeed the culprit. epoll_wait expects the timeout in > milliseconds but the value is in microseconds. Unfortunately, fixing that > brings back the old increased cpu usage. > > > > Do we have a decent solution for this issue? It *utterly* ruins > NuScratch on a Pi and I'm trying to make a new release. Won't someone > please think of the children? > > Just pushed a fix[1]. Let me know if that works. > > > Levente > > [1] > https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3db3888c2a76bd91ef66d70521d85f80e9d18f1d > > > > tim > > -- > > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > > Strange OpCodes: ETO: Emulate Toaster Oven -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Mon Dec 14 18:01:31 2020 From: tim at rowledge.org (tim Rowledge) Date: Mon, 14 Dec 2020 10:01:31 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> Message-ID: <94DC8077-F3A3-4C6B-9FEB-5E405649C7AB@rowledge.org> > On 2020-12-14, at 9:31 AM, Yoshiki Ohshima wrote: > > Thanks. > > I had a workaround but was not for real. Levente's patch works for me. It's a big improvement but there is still something making for odd hesitations in Asteroid Blaster; which is obviously one of the most important benchmarks imaginable. Probably not a VM thing though tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Earth is 98% full...please delete anyone you can. From noreply at github.com Tue Dec 15 03:27:11 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 14 Dec 2020 19:27:11 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 73ed9e: CogVM source as per VMMaker.oscog-tpr.2906 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 73ed9e41c227f41c9e96631d4ee55feb91f69f35 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/73ed9e41c227f41c9e96631d4ee55feb91f69f35 Author: Eliot Miranda Date: 2020-12-14 (Mon, 14 Dec 2020) Changed paths: M src/plugins/Mpeg3Plugin/Mpeg3Plugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-tpr.2906 Mpeg3Plugin sample read routines must expect word arrays, not pointer arrays. Became an issue recently due to Slang changes? From no-reply at appveyor.com Tue Dec 15 05:17:59 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 15 Dec 2020 05:17:59 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2328 Message-ID: <20201215051759.1.2526957A514AA103@appveyor.com> An HTML attachment was scrubbed... URL: From craig at blackpagedigital.com Tue Dec 15 18:03:18 2020 From: craig at blackpagedigital.com (Craig Latta) Date: Tue, 15 Dec 2020 10:03:18 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: <153F961E-4C45-4A6F-AACB-97EDC2502CD7@rowledge.org> References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> <70425292-75A7-4F8A-B7CC-8D0F800039EA@rowledge.org> <153F961E-4C45-4A6F-AACB-97EDC2502CD7@rowledge.org> Message-ID: Tim writes: > Sure, *I* can generate the stuff, I can probably remember how to use > it anyway, but it could cause confusion for anyone less steeped in the > lore. And please don't anyone suggest I try to make this git stuff do > anything. Ooh, that's an interesting idea... I can tell this is your big moment to learn all about GitHub Actions... ;) -C -- Craig Latta :: research computer scientist Black Page Digital :: Berkeley, California 663137D7940BF5C0AFC 1349FB2ADA32C4D5314CE From eliot.miranda at gmail.com Wed Dec 16 03:42:04 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 15 Dec 2020 19:42:04 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> Message-ID: Hi Tim, On Sat, Dec 12, 2020 at 6:07 PM tim Rowledge wrote: > > Is anybody else doing anything with MP3 files? It looks like we haven't > included any image-side support for them for several releases now (I've > look back to 4.5) but it is/was working just fine for the work I did on Pi > Scratch. That was, admittedly, quite a while ago. > > In the current system I can load much of Scratch without too many issues - > sounds are really messed up in various places, some morph building is > broken etc - but today I'm trying to see why mp3 sounds don't. > > It seems that the code for the src/plugins/Mpeg3Plugin.c is broken. The > autogenerated checks for the types of the arguments is insisting that be > indexable pointers, when is is in fact a variable word array. That at least > explains why the prim fails, which is at least a step forward. > > Current code on opensmalltalk git - > > /* int mpeg3_read_audio(mpeg3_t *file, > float *output_f, > short *output_i, > int channel, > long samples, > int stream) */ > > /* > Mpeg3Plugin>>#primitiveMPEG3ReadAudio:shortArray:channel:samples:stream: */ > EXPORT(sqInt) > primitiveMPEG3ReadAudio(void) > { > sqInt aChannelNumber; > sqInt aNumber; > sqInt *anArray; > short *arrayBase; > sqInt aSampleNumber; > mpeg3_t *file; > sqInt fileHandle; > sqInt result; > > result = 0; > if (!(((isPointers(stackValue(3))) > && (isIndexable(stackValue(3)))) > && ((isIntegerObject((aChannelNumber = stackValue(2)))) > && ((isIntegerObject((aSampleNumber = stackValue(1)))) > && (isIntegerObject((aNumber = stackValue(0)))))))) { > primitiveFailFor(PrimErrBadArgument); > return null; > } > > The two interesting things I have remaining energy to point out today - > The Slang does explicitly and wrongly declare it as > > self primitive: 'primitiveMPEG3ReadAudio' parameters: #(Oop Array > SmallInteger SmallInteger SmallInteger). > > .. which clearly doesn't help. It has, however, been that way since 2006. > > And the old C file from Back Then has > > result = 0; > fileHandle = stackValue(4); > success(isIndexable(stackValue(3))); > anArray = ((sqInt *) (firstIndexableField(stackValue(3)))); > aChannelNumber = stackIntegerValue(2); > aSampleNumber = stackIntegerValue(1); > aNumber = stackIntegerValue(0); > if (failed()) { > return null; > } > .. and so it makes kinda sense why it worked Back Then. > Ah, thank you. That explains things. I had to change the checking to be more aggressive so that Spur's lazy forwarding would work. I had to arrange that such code would fail for forwarders. So I had to change the generated Slang so that it tested for a particular kind of array, rather than not testing at all and hence potentially passing a pointer to a forwarder. > Thus I am inclined (and not just because I'm falling asleep) to think that > some change in how the prologue stuff is generated might have started to > note the Array declaration and become more zealous. > Exactly. Spur requires the extra zealousness. > More when awake. > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: STOP: No Op > > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Dec 16 03:56:50 2020 From: tim at rowledge.org (tim Rowledge) Date: Tue, 15 Dec 2020 19:56:50 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> Message-ID: <11332A05-90CA-428E-99A1-ABDF776D98CD@rowledge.org> > On 2020-12-15, at 7:42 PM, Eliot Miranda wrote: > [snip] > > Ah, thank you. That explains things. I had to change the checking to be more aggressive so that Spur's lazy forwarding would work. I had to arrange that such code would fail for forwarders. So I had to change the generated Slang so that it tested for a particular kind of array, rather than not testing at all and hence potentially passing a pointer to a forwarder. OK, I see. Well, I put WordArray in (and the re-read prim too) and it now works ok on a Pi and hopefully somebody else will test the latest code on other platforms soon. I think the github thing did an autogenerate ok after looking at the C file. Always interesting working out what is happening when it isn't some code that changed but rather a dog that didn't bark in the night... Now I wish I could work out why I get so much nasty crackle-graunch sound when any sound mixing is done. I'll leave that to another thread in squeak-dev though since I suspect it is not very VM specific. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Oxymorons: Sweet sorrow From eliot.miranda at gmail.com Wed Dec 16 05:22:04 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 15 Dec 2020 21:22:04 -0800 Subject: [Vm-dev] MPEG3Plugin code appears broken when generated? In-Reply-To: <11332A05-90CA-428E-99A1-ABDF776D98CD@rowledge.org> References: <50A7AA9D-4D4A-43F1-86A0-BBD7BD491AF6@rowledge.org> <11332A05-90CA-428E-99A1-ABDF776D98CD@rowledge.org> Message-ID: On Tue, Dec 15, 2020 at 7:56 PM tim Rowledge wrote: > > > > > On 2020-12-15, at 7:42 PM, Eliot Miranda > wrote: > > [snip] > > > > Ah, thank you. That explains things. I had to change the checking to > be more aggressive so that Spur's lazy forwarding would work. I had to > arrange that such code would fail for forwarders. So I had to change the > generated Slang so that it tested for a particular kind of array, rather > than not testing at all and hence potentially passing a pointer to a > forwarder. > > OK, I see. Well, I put WordArray in (and the re-read prim too) and it now > works ok on a Pi and hopefully somebody else will test the latest code on > other platforms soon. I think the github thing did an autogenerate ok after > looking at the C file. Always interesting working out what is happening > when it isn't some code that changed but rather a dog that didn't bark in > the night... I did it. I loaded your package, regenerated the plugin using the VMMakerTool, and committed and pushed. Now I wish I could work out why I get so much nasty crackle-graunch sound > when any sound mixing is done. I'll leave that to another thread in > squeak-dev though since I suspect it is not very VM specific. > _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Wed Dec 16 09:32:04 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Wed, 16 Dec 2020 10:32:04 +0100 Subject: [Vm-dev] MoreVMs 2021 : Workshop on Modern Language Runtimes, Ecosystems, and VMs Message-ID: ============================================================================ Call for Extended Abstracts and Talks: MoreVMs’21 5th International Workshop on Modern Language Runtimes, Ecosystems, and VMs Co-located with ‹Programming›’21 March 22nd to 26th, 2021, Online, United Kingdom https://2021.programming-conference.org/home/MoreVMs-2021 ============================================================================ Following four previous successful editions, the MoreVMs’21 workshop aims to bring together industrial and academic programmers to discuss the design, implementation, and usage of modern languages and runtimes. This includes aspects such as reuse of language runtimes, modular implementation, language design, and compilation strategies. By bringing together both researchers and practitioners, the workshop aims to enable a diverse discussion on how languages and runtimes are currently being utilized, and where they need to improve further. In addition to conventional workshop-style submissions, MoreVMs also accepts (and encourages) submissions that present early-stage work and emerging ideas. Relevant topics include, but are definitely not limited to, the following: - Extensible VM design (compiler- or interpreter-based VMs) - Reusable components (e.g. interpreters, garbage collectors, ...) - Static and dynamic compilation techniques - Techniques for targeting high-level languages such as JavaScript - Interoperability between languages - Tooling support (e.g. debugging, profiling, etc.) - Programming language development environments - Case studies of existing language implementation approaches - Language implementation challenges and trade-offs - Surveys and usage reports to understand usage in the wild - Ideas for more predictable performance - Ideas for how VMs could take advantage of new hardware features - Ideas for how we should build languages in the future Workshop Format and Submissions ------------------------------- We welcome presentation proposals in the form of extended abstracts (2 to 4 pages long) and talk proposals (title and 400 words abstract) discussing new techniques, insights, experiences, works-in-progress, as well as future visions, from either an academic or industrial perspective. The extended abstracts and talk proposals, and if the speakers wish, their slides, will be published on the workshop's website. Alternatively, extended abstracts can be published as part of the companion of ‹Programming›’21 in the ACM DL. Publication in the ACM DL is conditional on the acceptance by the program committee. Please note that MoreVMs’21 is organized as an academic workshop, and as such, speakers will be required to register for the workshop. Author Instructions ------------------- Submissions should use the ACM `acmart` format: https://www.acm.org/publications/proceedings-template If you are using LaTeX, submissions should use the 'acmart' document class with the 'sigconf' option, and with a font size of 9 point. Please use the Libertine/Biolinum font family. Please include page numbers in your submission using the LaTeX command `\settopmatter{printfolios=true}`. All submissions should be in PDF format. Please also ensure that your submission is legible when printed on a black and white printer. In particular, please check that colors remain distinct and font sizes are legible. Submission Site: https://easychair.org/conferences/?conf=morevms21 Important Dates --------------- Extended abstract and talk submissions: 2021-01-13 Author notification: 2021-02-15 Camera Ready: 2021-02-26 Workshop: TBA (between 2021-03-22 and 2021-03-26) All deadlines are Anywhere on Earth (AoE), i.e. GMT/UTC-12:00 hour. Program Committee ----------------- Maya Armyanova, Google, Germany Maxime Chevalier-Boisvert, Université de Montréal, Canada Lukas Diekmann, King's College London, United Kingdom Charlie Gracie, Microsoft, Canada Daco Harkes, Google, Denmark Christian Humer, Oracle Labs, Switzerland Sophie Kaleba, University of Kent, United Kingdom Mikel Luján, University of Manchester, United Kingdom Ana Milanova, Rensselaer Polytechnic Institute, United States Tobias Pape, Hasso Plattner Institute, University of Potsdam, Germany Tomoharu Ugawa, University of Tokyo, Japan Organizers ---------- Fabio Niephaus, Hasso Plattner Institute, University of Potsdam, Germany David Leopoldseder, Oracle Labs, Austria From smalltalk at stefan-marr.de Wed Dec 16 10:16:15 2020 From: smalltalk at stefan-marr.de (Stefan Marr) Date: Wed, 16 Dec 2020 10:16:15 +0000 Subject: [Vm-dev] Postdoc Position and PhD Studentship for Programming Language Implementation Research at the University of Kent Message-ID: We are seeking to appoint a qualified and highly motivated researcher to work as a Research Associate (Postdoc) as well as a PhD student. You will work on a project titled “CaMELot: Catching and Mitigating Event-Loop Concurrency Issues”, which is funded by an EPSRC UK grant and is led by Dr Stefan Marr. Job description / Additional Information / Please apply at: Postdoc Closing Date: 17 January 2021 https://jobs.kent.ac.uk/Vacancy.aspx?ref=CEMS-005-20 PhD studentship Closing Date: 13 January 2021 https://www.jobs.ac.uk/job/CCY406/phd-studentship-catching-and-mitigating-event-loop-concurrency-issues Modern server applications utilize concurrency in many ways. Actors and event loops are popular as programming paradigms since they avoid low-level concurrency issues. Unfortunately, even when using actors or event loops, server applications still show other types of concurrency bugs. Though, they can be mitigated with run-time detection techniques. In the CaMELot project, we want to make detection and mitigation fast enough to be usable in production systems. This way, even though software may contain bugs, we can reduce their impact on correct execution. Building on a system for deterministic replay of actor applications, you would investigate how one can use lightweight race detection to facilitate debugging of the underlying concurrency issues. Afterall, if we can detect the issues, we should help developers to fix them! One of the challenges here is to derive actionable insights from the detected races. A tool processing the race detection results may guide developers to fix the underlying issues, possibly replaying the problematic execution for the developers. For more details, please email me (s.marr at kent.ac.uk) or see the links above. When joining the project, you’ll also be an active member of the Programming Languages and Systems (PLAS) research group. PLAS spans the breadth and depth of practical and theoretical aspects of programming languages and system building related to languages. Our work goes across paradigms (imperative, object-oriented, functional, logic) and is complemented by our systems research in concurrency, relaxed memory, verified compilation, verification, language prototypes, garbage collection, and tools. All our work is linked by a shared vision of the power and impact of programming languages on the rest of Computer Science. The PLAS group at Kent has a long history of contributions to the field and continues to be a hotbed of programming language research in the South East of England: https://www.cs.kent.ac.uk/research/groups/plas/index.html The School of Computing [1] is a welcoming, supportive, and diverse environment whose commitment to gender equality has been recognised with a Bronze Athena SWAN [2] award. We are keen to enhance the balanced, inclusive and diverse nature of the community within our School and would particularly encourage female candidates to apply for these posts. The University of Kent campus overlooks the city centre of Canterbury, and with 125 nationalities represented, it has a very cosmopolitan feel. Canterbury is a small city that retains parts of its medieval walls (with Roman foundations). Famous for its heritage (Canterbury Cathedral; Chaucer’s Tales; etc), Canterbury is a vibrant community and UNESCO World Heritage site whose culture and leisure facilities are enhanced by hosting three universities. The city and surrounding region combines an attractive and affordable environment, excellent schools, and fast transport links to London and mainland Europe. Links: [1] https://cs.kent.ac.uk/ [2] http://www.ecu.ac.uk/equality-charters/athena-swan/ -- Stefan Marr School of Computing, University of Kent https://stefan-marr.de/research/ From commits at source.squeak.org Wed Dec 16 18:36:21 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 16 Dec 2020 18:36:21 -0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2886.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2886.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2886 Author: eem Time: 15 November 2020, 11:27:11.64449 pm UUID: 78490b88-d959-40aa-9436-2b640bb0ecc6 Ancestors: VMMaker.oscog-eem.2885 Oops. Forgot to revert a method necessary to make the previous commit compile. =============== Diff against VMMaker.oscog-eem.2885 =============== From vanessa at codefrau.net Wed Dec 16 21:01:33 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Wed, 16 Dec 2020 13:01:33 -0800 Subject: [Vm-dev] Method header 64 vs 32 bits Message-ID: Hi Eliot / Clément / everyone, how do I properly convert a 64 bit method header word to 32 bits? E.g. if in 64 bits I have 0x8000000000000049 my guess it would be 0x80000049 in 32 bits, but which bits should I actually drop? Thanks! Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Thu Dec 17 10:31:34 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Thu, 17 Dec 2020 02:31:34 -0800 Subject: [Vm-dev] Method header 64 vs 32 bits In-Reply-To: References: Message-ID: <65CCB60F-07FB-4F98-9E2C-08FD3BE881B6@gmail.com> Hi Vanessa, A method header fits in a 31 bit SmallInteger on 32-bits and is exactly the same value on 64-bits. So the values of a method header are in the range ((2 raisedTo: 30) negated to: (2 raisedTo: 30)). Therefore, at the Smalltalk level no change is required; one uses the same integer value. But at the machine level - to go from 32 to 64 bits one preserves the bottom 30 bits above the tag bit, shifting left two bits to make room for the three bit immediate tag, and moves the sign bit from bit 31 (0 relative) to bit 63, and sets the bottom three bits to 1. - to go from 64 to 32 bits one shifts the bottom 30 bits above the tag right two bits, shifts the sign bit right 32 bits and sets the bottom tag bit to 1. I chose not to take advantage of the bits 31 to 60 in 64 bits. It would make converting back and forth a night mare. So in 64 bits exactly the same limitations on numLiterals, numTemps and numArgs apply. If and when 32 bit support becomes obsolete (please no...) we can revisit but right now wasting 30 bits, when we have a max literals limit of 32k, and a way of expanding beyond the Max arg/temp count of 16/32 using tuples and the indirect temp vector bytecodes, seems like the right choice to me. Thoughts? _,,,^..^,,,_ (phone) > On Dec 16, 2020, at 1:02 PM, Vanessa Freudenberg wrote: > >  > Hi Eliot / Clément / everyone, > > how do I properly convert a 64 bit method header word to 32 bits? > > E.g. if in 64 bits I have 0x8000000000000049 my guess it would be 0x80000049 in 32 bits, but which bits should I actually drop? > > Thanks! > Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From vanessa at codefrau.net Fri Dec 18 02:30:20 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Thu, 17 Dec 2020 18:30:20 -0800 Subject: [Vm-dev] Method header 64 vs 32 bits In-Reply-To: <65CCB60F-07FB-4F98-9E2C-08FD3BE881B6@gmail.com> References: <65CCB60F-07FB-4F98-9E2C-08FD3BE881B6@gmail.com> Message-ID: Thanks, Eliot. I think I did guess exactly what you described. My example was just wrong, because SqueakJS does not use a tag bit for immediates, but the oop's type (SmallIntegers are plain JS numbers). What I do now to convert 64-to-32 is basically: var header = bits[0] >> 3; var numLits = header & 0x7FFF; method.pointers = decodePointers(bits, 1+numLits); // wrong header method.pointers[0] = (bits[1] & 0x80000000) | header; // fixed header ... where bits is a 32-bit unsigned int array of the image, positioned after the object header of the method (and assumed to be 64 bit little endian). Cheers! Vanessa On Thu, Dec 17, 2020 at 2:31 AM Eliot Miranda wrote: > > Hi Vanessa, > > A method header fits in a 31 bit SmallInteger on 32-bits and is exactly > the same value on 64-bits. So the values of a method header are in the > range ((2 raisedTo: 30) negated to: (2 raisedTo: 30)). Therefore, at the > Smalltalk level no change is required; one uses the same integer value. > > But at the machine level > - to go from 32 to 64 bits one preserves the bottom 30 bits above the tag > bit, shifting left two bits to make room for the three bit immediate tag, > and moves the sign bit from bit 31 (0 relative) to bit 63, and sets the > bottom three bits to 1. > - to go from 64 to 32 bits one shifts the bottom 30 bits above the tag > right two bits, shifts the sign bit right 32 bits and sets the bottom tag > bit to 1. > > I chose not to take advantage of the bits 31 to 60 in 64 bits. It would > make converting back and forth a night mare. So in 64 bits exactly the same > limitations on numLiterals, numTemps and numArgs apply. If and when 32 bit > support becomes obsolete (please no...) we can revisit but right now > wasting 30 bits, when we have a max literals limit of 32k, and a way of > expanding beyond the Max arg/temp count of 16/32 using tuples and the > indirect temp vector bytecodes, seems like the right choice to me. > Thoughts? > > _,,,^..^,,,_ (phone) > > On Dec 16, 2020, at 1:02 PM, Vanessa Freudenberg > wrote: > >  > Hi Eliot / Clément / everyone, > > how do I properly convert a 64 bit method header word to 32 bits? > > E.g. if in 64 bits I have 0x8000000000000049 my guess it would be > 0x80000049 in 32 bits, but which bits should I actually drop? > > Thanks! > Vanessa > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Fri Dec 18 06:37:16 2020 From: noreply at github.com (Eliot Miranda) Date: Thu, 17 Dec 2020 22:37:16 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 912e76: MacOS: Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 912e763a1c49692ccb53faddfa0c42737c258879 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/912e763a1c49692ccb53faddfa0c42737c258879 Author: Eliot Miranda Date: 2020-12-17 (Thu, 17 Dec 2020) Changed paths: M build.macos64x64/common/Makefile.flags M build.macos64x64/common/Makefile.vm M build.macos64x64/common/entitlements.plist M platforms/iOS/plugins/CameraPlugin/AVFoundationVideoGrabber.m M platforms/iOS/plugins/SoundPlugin/sqSqueakSoundCoreAudio.m M platforms/iOS/vm/OSX/Squeak-Info.plist Log Message: ----------- MacOS: Add entitlements for camera and microphone access for Big Sur. Add the code to request permission from the user. This is only compilable on 10.14 SDKs and subsequent, so the code is guarded and not included if compiled with an earlier SDK. Hence add AVFoundation to the base VM's frameworks; the auth code is defined here-in. Make sure TARGET_MIN_VERSION is passed to plugin makes. Correct a slip in the microphone entitlement usage string in the plist. [ci skip] From noreply at github.com Fri Dec 18 06:50:25 2020 From: noreply at github.com (Eliot Miranda) Date: Thu, 17 Dec 2020 22:50:25 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 5431a1: MacOS: Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 5431a13d1ef2b3f37b0527405d9e771693d02ff1 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/5431a13d1ef2b3f37b0527405d9e771693d02ff1 Author: Eliot Miranda Date: 2020-12-17 (Thu, 17 Dec 2020) Changed paths: M build.macos64ARMv8/common/Makefile.flags M build.macos64ARMv8/common/Makefile.vm M build.macos64ARMv8/common/entitlements.plist M build.macos64x64/common/Makefile.flags M build.macos64x64/common/Makefile.vm Log Message: ----------- MacOS: Copy changes to the ARMv8 build, and clean-up to reduce extraneous diffs. [ci skip] From vanessa at codefrau.net Fri Dec 18 07:10:06 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Thu, 17 Dec 2020 23:10:06 -0800 Subject: [Vm-dev] Smalltalk Zoo: 48 Years of Smalltalk History at CHM Message-ID: > > In commemoration of the 40th anniversary of the release of Smalltalk-80, > the Computer History Museum is proud to announce a collaboration with Dan > Ingalls to preserve and host the “Smalltalk Zoo.” Dan has been working on this for a good while now. I helped with the SqueakJS part. Today the Computer History Museum announced it: https://computerhistory.org/blog/introducing-the-smalltalk-zoo-48-years-of-smalltalk-history-at-chm/ Not everything is working perfectly yet. If you want to help out, I can put you in touch with Dan. Cheers! Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Fri Dec 18 18:25:39 2020 From: noreply at github.com (Eliot Miranda) Date: Fri, 18 Dec 2020 10:25:39 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 8464dc: Eliminate a deprecation and a non-effect warning o... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 8464dc37c65f16016991ccb58219d2ac7c6d9f1f https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8464dc37c65f16016991ccb58219d2ac7c6d9f1f Author: Eliot Miranda Date: 2020-12-18 (Fri, 18 Dec 2020) Changed paths: M platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m M platforms/iOS/vm/OSX/sqMacUnixExternalPrims.m M platforms/iOS/vm/SqueakPureObjc_Prefix.pch R platforms/minheadless/common/sqExternalPrimitives.c.orig Log Message: ----------- Eliminate a deprecation and a non-effect warning on MacOS. Eliminate an unnecessary copy and do some cleanup in NacOS sqMacUnixExternalPrims.m. Nuke obsolete headless file. [ci skip] From Yoshiki.Ohshima at acm.org Fri Dec 18 18:44:20 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Fri, 18 Dec 2020 10:44:20 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: <94DC8077-F3A3-4C6B-9FEB-5E405649C7AB@rowledge.org> References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> <94DC8077-F3A3-4C6B-9FEB-5E405649C7AB@rowledge.org> Message-ID: Where can I try the Asteroid Blaster? My workaround was just divide the wait time by 1000 and I'm curious to see if that has different effects on a different example. On Mon, Dec 14, 2020 at 10:01 AM tim Rowledge wrote: > > > > > On 2020-12-14, at 9:31 AM, Yoshiki Ohshima > wrote: > > > > Thanks. > > > > I had a workaround but was not for real. Levente's patch works for me. > > It's a big improvement but there is still something making for odd > hesitations in Asteroid Blaster; which is obviously one of the most > important benchmarks imaginable. Probably not a VM thing though > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Earth is 98% full...please delete anyone you can. > > > -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Fri Dec 18 20:17:19 2020 From: noreply at github.com (Eliot Miranda) Date: Fri, 18 Dec 2020 12:17:19 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a6522a: MacOS: Make request for access to the camera & mic... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a6522a9e0f86a6832e0354a7e528a423f7f7e505 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a6522a9e0f86a6832e0354a7e528a423f7f7e505 Author: Eliot Miranda Date: 2020-12-18 (Fri, 18 Dec 2020) Changed paths: M platforms/iOS/plugins/CameraPlugin/AVFoundationVideoGrabber.m M platforms/iOS/plugins/SoundPlugin/sqSqueakSoundCoreAudio.m Log Message: ----------- MacOS: Make request for access to the camera & microphone in Camera and Sound plugins block until the user responds. [ci skip] From notifications at github.com Sat Dec 19 10:39:41 2020 From: notifications at github.com (dcstes) Date: Sat, 19 Dec 2020 02:39:41 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 When running the Web Framework 'Aida 6.8' on the Cog VM 5.0, I do notice that there seems to be interest in solving the "heartbeat thread" warning. If I just ignore the warning about the heartbeat thread priority, small Squeak examples and the Squeak system itself seems to run fine. However the Aida web framework seems to depend on 'scheduling' issues, and Aida apparently works better if I modify the /etc/security/policy.conf Or maybe it just appears to work better. # grep proc_priocntl /etc/security/policy.conf PRIV_DEFAULT=basic,proc_priocntl In any case modifying the /etc/security/policy.conf gets rid of the warning. The warning itself is however phrased in such a way that there's no indication, that you have to modify the /etc/security/policy.conf of course. My guess is that there's a great many choices and different options, on how to allow a process to set its priority, on various systems. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf3dgMAAoJEAwpOKXMq1Ma9z4IAIDnoXvKZBa/TSNGfxa+DbEr RL5LxPM6aViQWzOiqlBuTeMWDUsieOe8J9ucEkxnEue5zWYNPs9+tfQXY8OqeU5+ hrdAOAG0amQoJVPjMqbO8ZQoQ0p3Vlsx143DJmotUiKQ81EiADcbVGN7SM9Pq3Yd dLl9IaY74eZoaGCkvNQI8tXIyLir5ZdX/3OKGqR4gibD6mKbYweBT0jWusl3eVAs xfrYLZeWAW7/3cpFW3E2DTpy/bv8cwmoO6/vr5ARP581Guj2LQv3nI3B1MZHWen2 SjrDDlih6Z+A5U5ATXT2JFxbZVLyrJ9wpw2sMGHGRUQia6C7jIbH+btBpzDfeP4= =NdSf -----END PGP SIGNATURE----- -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-748455764 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Mon Dec 21 02:16:30 2020 From: noreply at github.com (Eliot Miranda) Date: Sun, 20 Dec 2020 18:16:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 683f31: On Mac allow the interested VM builder to specify ... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 683f3191c7a016bf4ee04667ac7c5619fea92ca7 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/683f3191c7a016bf4ee04667ac7c5619fea92ca7 Author: Eliot Miranda Date: 2020-12-20 (Sun, 20 Dec 2020) Changed paths: M platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m Log Message: ----------- On Mac allow the interested VM builder to specify that crash.dmp appears in a specific directory relative to the preferences directory. Implement register printing in crash.dmp for ARMv8. [ci skip] From commits at source.squeak.org Mon Dec 21 02:24:04 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 21 Dec 2020 02:24:04 0000 Subject: [Vm-dev] VM Maker: VMMaker-dtl.420.mcz Message-ID: David T. Lewis uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-dtl.420.mcz ==================== Summary ==================== Name: VMMaker-dtl.420 Author: dtl Time: 20 December 2020, 9:10:42.452 pm UUID: 25d351dc-3d71-45a5-adfe-95aa9f63e5bf Ancestors: VMMaker-dtl.419 VMMaker 4.19.3 Let primitiveResumeFromSnapshot handle a changed image format for the resumed snapshot object. Install and update an appropriate primitive table dynamically on entry to the interpreter loop. Reset the image format number in the interpreter when resuming a snapshot object. These changes enable e.g. a Squeak 4.6 image to resume into a Squeak 3.6 snapshot and vice versa. =============== Diff against VMMaker-dtl.419 =============== Item was changed: Interpreter subclass: #ContextInterpreter + instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext localReturnContext localReturnValue messageSelector currentBytecode primitiveIndex primitiveFunctionPointer methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptPending savedWindowSize deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks newNativeMethod methodClass receiverClass interpreterVersion imageFormatVersionNumber interpreterProxy showSurfaceFn interruptCheckCounter interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable primitiveTableDefaults globalSessionID jmpBuf jmpDepth jmpMax suspendedCallbacks suspendedMethods imageFormatInitialVersion allowAccessBeyondSP' - instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext localReturnContext localReturnValue messageSelector currentBytecode primitiveIndex primitiveFunctionPointer methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptPending savedWindowSize deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks newNativeMethod methodClass receiverClass interpreterVersion imageFormatVersionNumber interpreterProxy showSurfaceFn interruptCheckCounter interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable globalSessionID jmpBuf jmpDepth jmpMax suspendedCallbacks suspendedMethods imageFormatInitialVersion allowAccessBeyondSP' classVariableNames: 'BlockArgumentCountIndex BytecodeTable CacheProbeMax CallerIndex CompilerHooksSize DirBadPath DirEntryFound DirNoMoreEntries DoBalanceChecks HomeIndex InitialIPIndex MaxJumpBuf MessageDictionaryIndex MethodCacheNative TempFrameStart' poolDictionaries: 'VMMethodCacheConstants VMSqueakV3BytecodeConstants' category: 'VMMaker-Interpreter'! !ContextInterpreter commentStamp: '' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. It has been modernized with 32-bit pointers, better management of Contexts, and attention to variable use that allows the CCodeGenerator (qv) to keep, eg, the instruction pointer and stack pointer in registers as well as keeping most simple variables in a global array that seems to improve performance for most platforms. In addition to SmallInteger arithmetic and Floats, it supports logic on 32-bit PositiveLargeIntegers, thus allowing it to simulate itself much more effectively than would otherwise be the case. NOTE: Here follows a list of things to be borne in mind when working on this code, or when making changes for the future. 1. There are a number of things that should be done the next time we plan to release a copletely incompatible image format. These include unifying the instanceSize field of the class format word -- see instantiateClass:indexableSize:, and unifying the bits of the method primitive index (if we decide we need more than 512, after all) -- see primitiveIndexOf:. Also, contexts should be given a special format code (see next item). 2. There are several fast checks for contexts (see isContextHeader: and isMethodContextHeader:) which will fail if the compact class indices of BlockContext or MethodContext change. This is necessary because the oops may change during a compaction when the oops are being adjusted. It's important to be aware of this when writing a new image using the systemTracer. A better solution would be to reserve one of the format codes for Contexts only. 3. We have made normal files tolerant to size and positions up to 32 bits. This has not been done for async files, since they are still experimental. The code in size, at: and at:put: should work with sizes and indices up to 31 bits, although I have not tested it (di 12/98); it might or might not work with 32-bit sizes. 4. Note that 0 is used in a couple of places as an impossible oop. This should be changed to a constant that really is impossible (or perhaps there is code somewhere that guarantees it --if so it should be put in this comment). The places include the method cache and the at cache. ! Item was changed: ----- Method: ContextInterpreter class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator aCCodeGenerator addHeaderFile: ''. aCCodeGenerator var: #interpreterProxy type: #'struct VirtualMachine*'. "declare primitiveTable as an array of pointers to a function returning void, taking no arguments" aCCodeGenerator var: #primitiveFunctionPointer declareC: 'void (*primitiveFunctionPointer)(void)'. aCCodeGenerator var: #methodCache declareC: 'long methodCache[' , (MethodCacheSize + 1) printString , ']'. aCCodeGenerator var: #atCache declareC: 'sqInt atCache[' , (AtCacheTotalSize + 1) printString , ']'. aCCodeGenerator var: #statGCTime type: #sqLong. aCCodeGenerator var: #statFullGCMSecs type: #sqLong. aCCodeGenerator var: #statIGCDeltaTime type: #sqLong. aCCodeGenerator var: #statIncrGCMSecs type: #sqLong. aCCodeGenerator var: #localIP type: #'char*'. aCCodeGenerator var: #localSP type: #'char*'. aCCodeGenerator var: #showSurfaceFn type: #'void*'. aCCodeGenerator var: #compilerHooks declareC: 'sqInt (*compilerHooks[' , (CompilerHooksSize + 1) printString , '])()'. aCCodeGenerator var: #interpreterVersion declareC: 'const char *interpreterVersion = "' , SmalltalkImage current datedVersion , ' [' , SmalltalkImage current lastUpdateString , ']"'. self declareCAsOop: {#instructionPointer. #method. #newMethod. #activeContext. #theHomeContext. #stackPointer} in: aCCodeGenerator. aCCodeGenerator var: #jmpBuf declareC: 'jmp_buf jmpBuf[' , (MaxJumpBuf + 1) printString , ']'. aCCodeGenerator var: #suspendedCallbacks declareC: 'sqInt suspendedCallbacks[' , (MaxJumpBuf + 1) printString , ']'. aCCodeGenerator var: #suspendedMethods declareC: 'sqInt suspendedMethods[' , (MaxJumpBuf + 1) printString , ']'. "Reinitialized at interpreter entry by #initializeImageFormatVersion" aCCodeGenerator var: #imageFormatVersionNumber declareC: 'sqInt imageFormatVersionNumber = 0'. "Declared here to prevent inclusion in foo struct by CCodeGeneratorGlobalStructure" aCCodeGenerator var: #imageFormatInitialVersion declareC: 'sqInt imageFormatInitialVersion = 0'. + aCCodeGenerator var: #primitiveTable declareC: 'void (*primitiveTable[', MaxPrimitiveIndex asString, '])(void)'. + aCCodeGenerator var: #primitiveTableDefaults declareC: 'void (*primitiveTableDefaults[' , (MaxPrimitiveIndex + 2) printString , '] )(void)= ' , self primitiveTableString. - aCCodeGenerator var: #primitiveTable declareC: 'void (*primitiveTable[' , (MaxPrimitiveIndex + 2) printString , '] )(void)= ' , self primitiveTableString. aCCodeGenerator var: #externalPrimitiveTable declareC: 'void (*externalPrimitiveTable[' , (MaxExternalPrimitiveTableSize + 1) printString , '])(void)'. ! Item was added: + ----- Method: ContextInterpreter>>installPrimitiveTable (in category 'primitive table') ----- + installPrimitiveTable + + 0 to: MaxPrimitiveIndex do: [ :i | + primitiveTable at: i put: (primitiveTableDefaults at: i) ]. + self updatePrimitiveTable. + ! Item was changed: ----- Method: ContextInterpreter>>interpret (in category 'interpreter shell') ----- interpret "This is the main interpreter loop. It normally loops forever, fetching and executing bytecodes. When running in the context of a browser plugin VM, however, it must return control to the browser periodically. This should done only when the state of the currently running Squeak thread is safely stored in the object heap. Since this is the case at the moment that a check for interrupts is performed, that is when we return to the browser if it is time to do so. Interrupt checks happen quite frequently." "should not be inlined into any senders" self initializeImageFormatVersion. + self installPrimitiveTable. - self updatePrimitiveTable.. allowAccessBeyondSP := self useOldPrimitives. "some old images must disable stack bounds check" self browserPluginInitialiseIfNeeded. "record entry time when running as a browser plug-in" self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self dispatchOn: currentBytecode in: BytecodeTable]. localIP := localIP - 1. "undo the pre-increment of IP before returning" self externalizeIPandSP. ! Item was changed: ----- Method: ContextInterpreter>>primitiveResumeFromSnapshot (in category 'snapshot utility primitives') ----- primitiveResumeFromSnapshot "Discard the current object memory and resume interpreter execution in the provided snapshot." | expectedArraySize snapshotValues size newMemoryBytesOrBitmap bigEndian snapshotImageFormat snapshotStartOfMemory snapshotSpecialObjectsOop snapshotLastHash screenSizePoint headerSize imageBytes imageHeaderFlags snapshotExtraVMMemory swapBytes snapshotFullScreen defaultHeapSize desiredHeapSize | expectedArraySize := 11. "ImageSnapshot new asValues size => 11" argumentCount == 1 ifFalse: [ ^self primitiveFailFor: PrimErrBadNumArgs]. snapshotValues := self stackObjectValue: 0. self assertClassOf: snapshotValues is: (objectMemory splObj: ClassArray). self successful ifFalse: [ ^self primitiveFailFor: PrimErrBadArgument]. size := objectMemory numSlotsOf: snapshotValues. size < expectedArraySize ifTrue: [ ^self primitiveFailFor: PrimErrBadArgument]. newMemoryBytesOrBitmap := objectMemory fetchPointer: 0 ofObject: snapshotValues. bigEndian := (objectMemory fetchPointer: 1 ofObject: snapshotValues) = objectMemory trueObject. snapshotImageFormat := objectMemory integerValueOf: (objectMemory fetchPointer: 2 ofObject: snapshotValues).. (self readableFormat: snapshotImageFormat) ifFalse: [ ^self primitiveFailFor: PrimErrInappropriate ]. headerSize := objectMemory integerValueOf: (objectMemory fetchPointer: 3 ofObject: snapshotValues).. imageBytes := self positive32BitValueOf: (objectMemory fetchPointer: 4 ofObject: snapshotValues).. "good for up to 2GB image" snapshotStartOfMemory := objectMemory integerValueOf: (objectMemory fetchPointer: 5 ofObject: snapshotValues).. snapshotSpecialObjectsOop := objectMemory integerValueOf: (objectMemory fetchPointer: 6 ofObject: snapshotValues).. snapshotLastHash := objectMemory integerValueOf: (objectMemory fetchPointer: 7 ofObject: snapshotValues).. screenSizePoint := objectMemory fetchPointer: 8 ofObject: snapshotValues.. self assertClassOf: screenSizePoint is: (objectMemory splObj: ClassPoint). self successful ifFalse: [ ^self primitiveFailFor: PrimErrBadArgument]. imageHeaderFlags := objectMemory integerValueOf: (objectMemory fetchPointer: 9 ofObject: snapshotValues).. snapshotExtraVMMemory := objectMemory integerValueOf: (objectMemory fetchPointer: 10 ofObject: snapshotValues).. + imageFormatVersionNumber := 0. + imageFormatInitialVersion := snapshotImageFormat. swapBytes := bigEndian ~= self isBigEnder. snapshotFullScreen := false. "FIXME" "From sqUnixMain.c #define DefaultHeapSize 20 megabytes BEYOND actual image size" defaultHeapSize := 20 * 1000 * 1000. desiredHeapSize := defaultHeapSize + imageBytes. self snapshotResume: newMemoryBytesOrBitmap heapSize: desiredHeapSize swapBytes: swapBytes oldBaseAddr: snapshotStartOfMemory specialObjectsOop: snapshotSpecialObjectsOop lastHash: snapshotLastHash savedWindowSize: screenSizePoint fullScreenFlag: snapshotFullScreen extraVMMemory: snapshotExtraVMMemory. self pop: 1 thenPush: newMemoryBytesOrBitmap. ! Item was added: + ----- Method: ContextInterpreter>>updatePrimitiveTable (in category 'primitive table') ----- + updatePrimitiveTable + "Make any run time updates to the primitive table that may be required for supporting + the current running image. May be called by an interpreter that determines at run time + that it needs to provide support for an older image. + + References: The SqueakJS dispatch table, which is known to run the full range of Squeak + images, is used as a reference, along with comparison to the Squeak VM table as of + January 2005 from VMMaker-tpr.22, which was the last version prior to converting + images to support full closures (dtl Dec 2016)" + + + self useOldPrimitives ifTrue: [ + self installPrimitive: #primitiveNext at: 65. + self installPrimitive: #primitiveNextPut at: 66. + self installPrimitive: #primitiveAtEnd at: 67. + + self installPrimitive: #primitiveBlockCopy at: 80. + self installPrimitive: #primitiveValue at: 81. + self installPrimitive: #primitiveValueWithArgs at: 82. + + self installPrimitive: 'primitiveCopyBits' from: 'BitBltPlugin' at: 96. + + self installPrimitive: #primitiveValueUninterruptably at: 123. + + self installPrimitive: 'primitiveReadJoystick' from: 'JoystickTabletPlugin' at: 146. + + self installPrimitive: 'primitiveWarpBits' from: 'BitBltPlugin' at: 147. + + self installPrimitive: 'primitiveFileAtEnd' from: 'FilePlugin' at: 150. + self installPrimitive: 'primitiveFileClose' from: 'FilePlugin' at: 151. + self installPrimitive: 'primitiveFileGetPosition' from: 'FilePlugin' at: 152. + self installPrimitive: 'primitiveFileOpen' from: 'FilePlugin' at: 153. + self installPrimitive: 'primitiveFileRead' from: 'FilePlugin' at: 154. + self installPrimitive: 'primitiveFileSetPosition' from: 'FilePlugin' at: 155. + self installPrimitive: 'primitiveFileDelete' from: 'FilePlugin' at: 156. + self installPrimitive: 'primitiveFileSize' from: 'FilePlugin' at: 157. + self installPrimitive: 'primitiveFileWrite' from: 'FilePlugin' at: 158. + self installPrimitive: 'primitiveFileRename' from: 'FilePlugin' at: 159. + self installPrimitive: 'primitiveDirectoryCreate' from: 'FilePlugin' at: 160. + self installPrimitive: 'primitiveDirectoryDelimitor' from: 'FilePlugin'at: 161. + self installPrimitive: 'primitiveDirectoryLookup' from: 'FilePlugin' at: 162. + self installPrimitive: 'primitiveDirectoryDelete' from: 'FilePlugin' at: 163. + self installPrimitive: 'primitiveDirectorySetMacTypeAndCreator' from: 'FilePlugin' at: 169. + + self installPrimitive: 'primitiveSoundStart' from: 'SoundPlugin' at: 170. + self installPrimitive: 'primitiveSoundStartWithSemaphore' from: 'SoundPlugin' at: 171. + self installPrimitive: 'primitiveSoundStop' from: 'SoundPlugin' at: 172. + self installPrimitive: 'primitiveSoundAvailableSpace' from: 'SoundPlugin' at: 173. + self installPrimitive: 'primitiveSoundPlaySamples' from: 'SoundPlugin' at: 174. + self installPrimitive: 'primitiveSoundPlaySilence' from: 'SoundPlugin' at: 175. + self installPrimitive: 'primWaveTableSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 176. + self installPrimitive: 'primFMSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 177. + self installPrimitive: 'primPluckedSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 178. + self installPrimitive: 'primSampledSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 179. + self installPrimitive: 'primitiveMixFMSound' from: 'SoundGenerationPlugin' at: 180. + self installPrimitive: 'primitiveMixPluckedSound' from: 'SoundGenerationPlugin' at: 181. + self installPrimitive: 'oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol' from: 'SoundGenerationPlugin' at: 182. + self installPrimitive: 'primitiveApplyReverb' from: 'SoundGenerationPlugin' at: 183. + self installPrimitive: 'primitiveMixLoopedSampledSound' from: 'SoundGenerationPlugin' at: 184. + self installPrimitive: 'primitiveMixSampledSound' from: 'SoundGenerationPlugin' at: 185. + + self installPrimitive: 'primitiveSoundInsertSamples' from: 'SoundPlugin' at: 189. + + self installPrimitive: 'primitiveSoundStopRecording' from: 'SoundPlugin' at: 191. + self installPrimitive: 'primitiveSoundGetRecordingSampleRate' from: 'SoundPlugin' at: 192. + self installPrimitive: 'primitiveSoundRecordSamples' from: 'SoundPlugin' at: 193. + self installPrimitive: 'primitiveSoundSetRecordLevel' from: 'SoundPlugin' at: 194. + + self installPrimitive: 'primitiveInitializeNetwork' from: 'SocketPlugin' at: 200. + self installPrimitive: 'primitiveResolverStartNameLookup' from: 'SocketPlugin' at: 201. + self installPrimitive: 'primitiveResolverNameLookupResult' from: 'SocketPlugin' at: 202. + self installPrimitive: 'primitiveResolverStartAddressLookup' from: 'SocketPlugin' at: 203. + self installPrimitive: 'primitiveResolverAddressLookupResult' from: 'SocketPlugin' at: 204. + self installPrimitive: 'primitiveResolverAbortLookup' from: 'SocketPlugin' at: 205. + self installPrimitive: 'primitiveResolverLocalAddress' from: 'SocketPlugin' at: 206. + self installPrimitive: 'primitiveResolverStatus' from: 'SocketPlugin' at: 207. + self installPrimitive: 'primitiveResolverError' from: 'SocketPlugin' at: 208. + self installPrimitive: 'primitiveSocketCreate' from: 'SocketPlugin' at: 209. + self installPrimitive: 'primitiveSocketDestroy' from: 'SocketPlugin' at: 210. + self installPrimitive: 'primitiveSocketConnectionStatus' from: 'SocketPlugin' at: 211. + self installPrimitive: 'primitiveSocketError' from: 'SocketPlugin' at: 212. + self installPrimitive: 'primitiveSocketLocalAddress' from: 'SocketPlugin' at: 213. + self installPrimitive: 'primitiveSocketLocalPort' from: 'SocketPlugin' at: 214. + self installPrimitive: 'primitiveSocketRemoteAddress' from: 'SocketPlugin' at: 215. + self installPrimitive: 'primitiveSocketRemotePort' from: 'SocketPlugin' at: 216. + self installPrimitive: 'primitiveSocketConnectToPort' from: 'SocketPlugin' at: 217. + self installPrimitive: 'primitiveSocketListenOnPort' from: 'SocketPlugin' at: 218. + self installPrimitive: 'primitiveSocketCloseConnection' from: 'SocketPlugin' at: 219. + self installPrimitive: 'primitiveSocketAbortConnection' from: 'SocketPlugin' at: 220. + self installPrimitive: 'primitiveSocketReceiveDataBufCount' from: 'SocketPlugin' at: 221. + self installPrimitive: 'primitiveSocketReceiveDataAvailable' from: 'SocketPlugin' at: 222. + self installPrimitive: 'primitiveSocketSendDataBufCount' from: 'SocketPlugin' at: 223. + self installPrimitive: 'primitiveSocketSendDone' from: 'SocketPlugin' at: 224. + + self installPrimitive: 'primitiveDecompressFromByteArray' from: 'MiscPrimitivePlugin' at: 234. + self installPrimitive: 'primitiveCompareString' from: 'MiscPrimitivePlugin' at: 235. + self installPrimitive: 'primitiveConvert8BitSigned' from: 'MiscPrimitivePlugin' at: 236. + self installPrimitive: 'primitiveCompressToByteArray' from: 'MiscPrimitivePlugin' at: 237. + + self installPrimitive: 'primitiveSerialPortOpen' from: 'SerialPlugin' at: 238. + self installPrimitive: 'primitiveSerialPortClose' from: 'SerialPlugin' at: 239. + self installPrimitive: 'primitiveSerialPortWrite' from: 'SerialPlugin' at: 240. + self installPrimitive: 'primitiveSerialPortRead' from: 'SerialPlugin' at: 241. + + self installPrimitive: 'primitiveTranslateStringWithTable' from: 'MiscPrimitivePlugin' at: 243. + self installPrimitive: 'primitiveFindFirstInString' from: 'MiscPrimitivePlugin' at: 244. + self installPrimitive: 'primitiveIndexOfAsciiInString' from: 'MiscPrimitivePlugin' at: 245. + self installPrimitive: 'primitiveFindSubstring' from: 'MiscPrimitivePlugin' at: 246. + ] + ! Item was removed: - ----- Method: InterpreterPrimitives>>updatePrimitiveTable (in category 'primitive table') ----- - updatePrimitiveTable - "Make any run time updates to the primitive table that may be required for supporting - the current running image. May be called by an interpreter that determines at run time - that it needs to provide support for an older image. - - References: The SqueakJS dispatch table, which is known to run the full range of Squeak - images, is used as a reference, along with comparison to the Squeak VM table as of - January 2005 from VMMaker-tpr.22, which was the last version prior to converting - images to support full closures (dtl Dec 2016)" - - | primitiveTableUpdated | - - - primitiveTableUpdated == true ifFalse: [ - primitiveTableUpdated := true. - self useOldPrimitives ifTrue: [ - self installPrimitive: #primitiveNext at: 65. - self installPrimitive: #primitiveNextPut at: 66. - self installPrimitive: #primitiveAtEnd at: 67. - - self installPrimitive: #primitiveBlockCopy at: 80. - self installPrimitive: #primitiveValue at: 81. - self installPrimitive: #primitiveValueWithArgs at: 82. - - self installPrimitive: 'primitiveCopyBits' from: 'BitBltPlugin' at: 96. - - self installPrimitive: #primitiveValueUninterruptably at: 123. - - self installPrimitive: 'primitiveReadJoystick' from: 'JoystickTabletPlugin' at: 146. - - self installPrimitive: 'primitiveWarpBits' from: 'BitBltPlugin' at: 147. - - self installPrimitive: 'primitiveFileAtEnd' from: 'FilePlugin' at: 150. - self installPrimitive: 'primitiveFileClose' from: 'FilePlugin' at: 151. - self installPrimitive: 'primitiveFileGetPosition' from: 'FilePlugin' at: 152. - self installPrimitive: 'primitiveFileOpen' from: 'FilePlugin' at: 153. - self installPrimitive: 'primitiveFileRead' from: 'FilePlugin' at: 154. - self installPrimitive: 'primitiveFileSetPosition' from: 'FilePlugin' at: 155. - self installPrimitive: 'primitiveFileDelete' from: 'FilePlugin' at: 156. - self installPrimitive: 'primitiveFileSize' from: 'FilePlugin' at: 157. - self installPrimitive: 'primitiveFileWrite' from: 'FilePlugin' at: 158. - self installPrimitive: 'primitiveFileRename' from: 'FilePlugin' at: 159. - self installPrimitive: 'primitiveDirectoryCreate' from: 'FilePlugin' at: 160. - self installPrimitive: 'primitiveDirectoryDelimitor' from: 'FilePlugin'at: 161. - self installPrimitive: 'primitiveDirectoryLookup' from: 'FilePlugin' at: 162. - self installPrimitive: 'primitiveDirectoryDelete' from: 'FilePlugin' at: 163. - self installPrimitive: 'primitiveDirectorySetMacTypeAndCreator' from: 'FilePlugin' at: 169. - - self installPrimitive: 'primitiveSoundStart' from: 'SoundPlugin' at: 170. - self installPrimitive: 'primitiveSoundStartWithSemaphore' from: 'SoundPlugin' at: 171. - self installPrimitive: 'primitiveSoundStop' from: 'SoundPlugin' at: 172. - self installPrimitive: 'primitiveSoundAvailableSpace' from: 'SoundPlugin' at: 173. - self installPrimitive: 'primitiveSoundPlaySamples' from: 'SoundPlugin' at: 174. - self installPrimitive: 'primitiveSoundPlaySilence' from: 'SoundPlugin' at: 175. - self installPrimitive: 'primWaveTableSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 176. - self installPrimitive: 'primFMSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 177. - self installPrimitive: 'primPluckedSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 178. - self installPrimitive: 'primSampledSoundmixSampleCountintostartingAtpan' from: 'SoundGenerationPlugin' at: 179. - self installPrimitive: 'primitiveMixFMSound' from: 'SoundGenerationPlugin' at: 180. - self installPrimitive: 'primitiveMixPluckedSound' from: 'SoundGenerationPlugin' at: 181. - self installPrimitive: 'oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol' from: 'SoundGenerationPlugin' at: 182. - self installPrimitive: 'primitiveApplyReverb' from: 'SoundGenerationPlugin' at: 183. - self installPrimitive: 'primitiveMixLoopedSampledSound' from: 'SoundGenerationPlugin' at: 184. - self installPrimitive: 'primitiveMixSampledSound' from: 'SoundGenerationPlugin' at: 185. - - self installPrimitive: 'primitiveSoundInsertSamples' from: 'SoundPlugin' at: 189. - - self installPrimitive: 'primitiveSoundStopRecording' from: 'SoundPlugin' at: 191. - self installPrimitive: 'primitiveSoundGetRecordingSampleRate' from: 'SoundPlugin' at: 192. - self installPrimitive: 'primitiveSoundRecordSamples' from: 'SoundPlugin' at: 193. - self installPrimitive: 'primitiveSoundSetRecordLevel' from: 'SoundPlugin' at: 194. - - self installPrimitive: 'primitiveInitializeNetwork' from: 'SocketPlugin' at: 200. - self installPrimitive: 'primitiveResolverStartNameLookup' from: 'SocketPlugin' at: 201. - self installPrimitive: 'primitiveResolverNameLookupResult' from: 'SocketPlugin' at: 202. - self installPrimitive: 'primitiveResolverStartAddressLookup' from: 'SocketPlugin' at: 203. - self installPrimitive: 'primitiveResolverAddressLookupResult' from: 'SocketPlugin' at: 204. - self installPrimitive: 'primitiveResolverAbortLookup' from: 'SocketPlugin' at: 205. - self installPrimitive: 'primitiveResolverLocalAddress' from: 'SocketPlugin' at: 206. - self installPrimitive: 'primitiveResolverStatus' from: 'SocketPlugin' at: 207. - self installPrimitive: 'primitiveResolverError' from: 'SocketPlugin' at: 208. - self installPrimitive: 'primitiveSocketCreate' from: 'SocketPlugin' at: 209. - self installPrimitive: 'primitiveSocketDestroy' from: 'SocketPlugin' at: 210. - self installPrimitive: 'primitiveSocketConnectionStatus' from: 'SocketPlugin' at: 211. - self installPrimitive: 'primitiveSocketError' from: 'SocketPlugin' at: 212. - self installPrimitive: 'primitiveSocketLocalAddress' from: 'SocketPlugin' at: 213. - self installPrimitive: 'primitiveSocketLocalPort' from: 'SocketPlugin' at: 214. - self installPrimitive: 'primitiveSocketRemoteAddress' from: 'SocketPlugin' at: 215. - self installPrimitive: 'primitiveSocketRemotePort' from: 'SocketPlugin' at: 216. - self installPrimitive: 'primitiveSocketConnectToPort' from: 'SocketPlugin' at: 217. - self installPrimitive: 'primitiveSocketListenOnPort' from: 'SocketPlugin' at: 218. - self installPrimitive: 'primitiveSocketCloseConnection' from: 'SocketPlugin' at: 219. - self installPrimitive: 'primitiveSocketAbortConnection' from: 'SocketPlugin' at: 220. - self installPrimitive: 'primitiveSocketReceiveDataBufCount' from: 'SocketPlugin' at: 221. - self installPrimitive: 'primitiveSocketReceiveDataAvailable' from: 'SocketPlugin' at: 222. - self installPrimitive: 'primitiveSocketSendDataBufCount' from: 'SocketPlugin' at: 223. - self installPrimitive: 'primitiveSocketSendDone' from: 'SocketPlugin' at: 224. - - self installPrimitive: 'primitiveDecompressFromByteArray' from: 'MiscPrimitivePlugin' at: 234. - self installPrimitive: 'primitiveCompareString' from: 'MiscPrimitivePlugin' at: 235. - self installPrimitive: 'primitiveConvert8BitSigned' from: 'MiscPrimitivePlugin' at: 236. - self installPrimitive: 'primitiveCompressToByteArray' from: 'MiscPrimitivePlugin' at: 237. - - self installPrimitive: 'primitiveSerialPortOpen' from: 'SerialPlugin' at: 238. - self installPrimitive: 'primitiveSerialPortClose' from: 'SerialPlugin' at: 239. - self installPrimitive: 'primitiveSerialPortWrite' from: 'SerialPlugin' at: 240. - self installPrimitive: 'primitiveSerialPortRead' from: 'SerialPlugin' at: 241. - - self installPrimitive: 'primitiveTranslateStringWithTable' from: 'MiscPrimitivePlugin' at: 243. - self installPrimitive: 'primitiveFindFirstInString' from: 'MiscPrimitivePlugin' at: 244. - self installPrimitive: 'primitiveIndexOfAsciiInString' from: 'MiscPrimitivePlugin' at: 245. - self installPrimitive: 'primitiveFindSubstring' from: 'MiscPrimitivePlugin' at: 246. - ] - ] - ! Item was changed: ----- Method: VMMaker class>>versionString (in category 'version testing') ----- versionString "VMMaker versionString" + ^'4.19.3'! - ^'4.19.2'! From commits at source.squeak.org Mon Dec 21 14:38:00 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 21 Dec 2020 14:38:00 0000 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.47.mcz Message-ID: David T. Lewis uploaded a new version of ImageFormat to project VM Maker: http://source.squeak.org/VMMaker/ImageFormat-dtl.47.mcz ==================== Summary ==================== Name: ImageFormat-dtl.47 Author: dtl Time: 21 December 2020, 9:37:58.44 am UUID: 34f44ce2-fc83-48b9-9a79-42b4ce1a441b Ancestors: ImageFormat-dtl.46 Minor changes to allow package to load in old Squeak images =============== Diff against ImageFormat-dtl.46 =============== Item was changed: ----- Method: ImageFileHeader>>hash (in category 'comparing') ----- hash + ^imageBytes hash bitXor: lastHash! - ^imageBytes hash xor: lastHash! Item was changed: ----- Method: ImageFormat class>>generateCkFormatProgram:on: (in category 'ckformat') ----- generateCkFormatProgram: programName on: stream "Generate source code for an image format version reader. The program is intended for testing image file format from a unix shell script such that the shell script can decide what VM to run based on image requirements." | fileID formatNumber | fileID := (Smalltalk classNamed: #CCodeGenerator) + ifNil: [ self name, ' ', DateAndTime now asString ] + ifNotNilDo: [ :ccg | ccg monticelloDescriptionFor: self ]. - ifNotNil: [ :ccg | ccg monticelloDescriptionFor: self ] - ifNil: [ self name, ' ', DateAndTime now asString ]. stream nextPutAll: '/* ', programName, ': Print the image format number on standard output */'; cr; nextPutAll: '/* for use in a shell script to test image format requirements. */'; cr; nextPutAll: '/* A non-zero return status code indicates failure. */'; cr; cr; nextPutAll: '/* Usage: ', programName, ' imageFileName */'; cr; cr; nextPutAll: '/* --- DO NOT EDIT THIS FILE --- */'; cr; nextPutAll: '/* --- Automatically generated from class ', fileID, '--- */'; cr; nextPutAll: '/* --- Source code is in package ImageFormat in the VMMaker repository --- */'; cr; nextPutAll: '/* --- DO NOT EDIT THIS FILE --- */'; cr; cr; nextPutAll: '#include '; cr; nextPutAll: '#include '; cr; nextPutAll: '#include '; cr; cr; nextPutAll: 'int main(int argc, char **argv) {'; cr; tab; nextPutAll: 'FILE *f;'; cr; tab; nextPutAll: 'unsigned char buf[8];'; cr; tab; nextPutAll: 'int formatNumber;'; cr; tab; nextPutAll: 'unsigned char c;'; cr; tab; nextPutAll: 'int match;'; cr; tab; nextPutAll: 'if (argc !!= 2) {'; cr; tab; tab; nextPutAll: 'printf("usage: ', programName, ' imageFileName\n");'; cr; tab; tab; nextPutAll: 'printf("answer the image format number for an image file or 0 if not known\n");'; cr; tab; tab; nextPutAll: 'printf("known image formats:\n");'; cr. KnownVersionNumbers do: [ :e | | s | s := String streamContents: [ :strm | strm nextPutAll: e asString, ': '. (self fromInteger: e) printDescriptionOn: strm withVersionNumber: false ]. stream tab; tab; nextPutAll: 'printf("', s, '\n");'; cr ]. stream tab; tab; nextPutAll: 'exit(1);'; cr; tab; nextPutAll: '}'; cr; tab; nextPutAll: 'f = fopen(argv[1], "r");'; cr; tab; nextPutAll: 'if (f == NULL) {'; cr; tab; tab; nextPutAll: 'perror(argv[1]);'; cr; tab; tab; nextPutAll: 'exit(2);'; cr; tab; nextPutAll: '}'; cr. { 0. 512 } do: [:offset | stream tab; nextPutAll: 'if(fseek(f, '; nextPutAll: offset asString; nextPutAll: 'L, SEEK_SET) !!= 0) {';cr; tab; tab; nextPutAll: 'fprintf(stderr, "cannot go to pos %d in %s\n", '; nextPutAll: offset asString; nextPutAll: ', argv[1]);'; cr; tab; tab; nextPutAll: 'exit(3);'; cr; tab; nextPutAll: '}'; cr; tab; nextPutAll: 'if (fread(buf, 1, 8, f) < 8) {'; cr; tab; tab; nextPutAll: 'fprintf(stderr, "cannot read %s\n", argv[1]);'; cr; tab; tab; nextPutAll: 'exit(3);'; cr; tab; nextPutAll: '}'; cr. self versionNumberByteArrays withIndexDo: [ :v :tag | | b | formatNumber := (self fromBytes: v) asInteger. b := 'b_', formatNumber asString, '_', tag asString. stream tab; nextPutAll: '{'; cr; tab; nextPutAll: 'unsigned char ', b, '[', v size asString, ']= { '. v inject: true into: [:first : elem | first ifFalse: [stream nextPutAll: ', ']. stream nextPutAll: elem asString. false]. stream nextPutAll: '};'; cr; tab; nextPutAll: 'if (memcmp(buf, ', b, ', ', v size asString, ') == 0) {'; cr; tab; tab; nextPutAll: 'printf("%d\n", ', formatNumber, ');'; cr; tab; tab; nextPutAll: 'exit(0);'; cr; tab; nextPutAll: '}'; cr; tab; nextPutAll: '}'; cr]]. stream tab; nextPutAll: 'printf("0\n"); /* print an invalid format number */';cr; tab; nextPutAll: 'exit (-1); /* not found, exit with error code */'; cr; nextPutAll: '}'; cr ! From notifications at github.com Mon Dec 21 18:40:52 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 21 Dec 2020 10:40:52 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: Hi David, you say "Another thing to consider is whether calling pthread_setschedparam() should be the default ... My impression is that if I just ignore the warning "pthread_setschedparam failed: Not owner" the programs still run fine. So perhaps the default could be changed NOT to issue a pthread_setschedparam() and make it optional." This is not the right solution, but it's a little non-obvious. What the setschedparam call does is raise the priority of the heartbeat thread relative to the main Smalltalk thread. Leaving it out means that the heartbeat thread runs at the same priority as the main Smalltalk thread. The effect of this is that if the main Smalltalk thread runs continuously, for example is in some compute-intensive loop, then the heartbeat thread will be prevented from running, and hence events such as Delay expiry will not be checked for, and the main thread will never be interrupted. Try something like the following with a heartbeat thread running at the same priority as the main thread running on a single core machine and you'll manifest the issue: ```| p | p := [| i | i := 0. [(i := i + 1) odd ifTrue: [i := i - 1]] repeat] newProcess. p forkAt: Processor activePriority - 1. (Delay forSeconds: 1) wait. p terminate``` without the heartbeat thread running at a higher priority process p consumes all the processor and the heartbeat thread never gets to run, consequently the Delay forSeconds: 1) wait does not complete and p continues running. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-749130827 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Dec 21 23:30:22 2020 From: notifications at github.com (smalltalking) Date: Mon, 21 Dec 2020 15:30:22 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: > The effect of this is that if the main Smalltalk thread runs continuously, for example is in some compute-intensive loop, then the heartbeat thread will be prevented from running, and hence events such as Delay expiry will not be checked for, and the main thread will never be interrupted. I doubt any modern OS does cooperative scheduling at any priority level. Without the increased priority, the heartbeat will still be scheduled but it may not interrupt the main thread at the intended time. Also, today's machines are almost all multi-core, so even if you keep a core busy with the main thread, another core may schedule the heartbeat process. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-749252942 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Tue Dec 22 00:14:31 2020 From: tim at rowledge.org (tim Rowledge) Date: Mon, 21 Dec 2020 16:14:31 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: <2E579BCD-04CC-4D86-B3C8-8E23676486DA@rowledge.org> > On 2020-12-21, at 3:30 PM, smalltalking wrote: > > > The effect of this is that if the main Smalltalk thread runs continuously, for example is in some compute-intensive loop, then the heartbeat thread will be prevented from running, and hence events such as Delay expiry will not be checked for, and the main thread will never be interrupted. > > I doubt any modern OS does cooperative scheduling at any priority level. Without the increased priority, the heartbeat will still be scheduled but it may not interrupt the main thread at the intended time. > Also, today's machines are almost all multi-core, so even if you keep a core busy with the main thread, another core may schedule the heartbeat process. Well, yeah, that's really the point - you can't rely upon it. On some machines, with some versions of some OS it may work perfectly. On another day it might not. The bit that has been bothering me recently with this is that a simple test program to try the priority raise seems to work but the nominally-the-same code in the actual VM tells me the raise failed. I'm not a fan of inconsistency. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim There can never be a computer language in which you cannot write a bad program. From vanessa at codefrau.net Tue Dec 22 05:32:03 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Mon, 21 Dec 2020 21:32:03 -0800 Subject: [Vm-dev] [ANN] SqueakJS 1.0 Message-ID: Hi All, yesterday I released version 1.0 of SqueakJS, exactly 7 years after my first public announcement on December 20, 2013. https://squeak.js.org/ Arguably I should have done this back in 2016 when it could run Spur images. What got it over the last hump was Fabio's interpreter for Sista bytecodes and Erik's refactoring for Node.js. SqueakJS is now the most compatible Squeak VM: it can run pre-release images from 1996 as well as the latest Squeak 6.0 trunk image. For production, you should still use non-Sista images, because no JIT has been implemented yet. A big Thank You to all the contributors over the years, and to Dan Ingalls for the inspiration, and funding the initial development. There are still many things to work on: - a simple JIT for Sista bytecode to bring its speed at least up to par with its pre-Sista speed - a "real" JIT with context mapping (keeping temps in JS vars rather than on the stack) and send optimizations (mapping sends to JS function invocations) - 64 bit support for pre-Spur images - big-endian support for 64 bit images Help is very welcome at https://github.com/codefrau/SqueakJS Happy Holidays to Everyone! Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 22 08:41:05 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 22 Dec 2020 00:41:05 -0800 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: _,,,^..^,,,_ (phone) > On Dec 21, 2020, at 9:32 PM, Vanessa Freudenberg wrote: > >  > Hi All, > > yesterday I released version 1.0 of SqueakJS, exactly 7 years after my first public announcement on December 20, 2013. > > https://squeak.js.org/ > > Arguably I should have done this back in 2016 when it could run Spur images. What got it over the last hump was Fabio's interpreter for Sista bytecodes and Erik's refactoring for Node.js. > > SqueakJS is now the most compatible Squeak VM: it can run pre-release images from 1996 as well as the latest Squeak 6.0 trunk image. Congrats, Vanessa; cool work. Please see my reply to your System-codefrau.1205.mcz commit. > For production, you should still use non-Sista images, because no JIT has been implemented yet. > > A big Thank You to all the contributors over the years, and to Dan Ingalls for the inspiration, and funding the initial development. > > There are still many things to work on: > > - a simple JIT for Sista bytecode to bring its speed at least up to par with its pre-Sista speed > - a "real" JIT with context mapping (keeping temps in JS vars rather than on the stack) and send optimizations (mapping sends to JS function invocations) > - 64 bit support for pre-Spur images > - big-endian support for 64 bit images > > Help is very welcome at https://github.com/codefrau/SqueakJS We have an effort crisis with the execution machinery. You are asking did help. I am asking for help. We have at least four different Squeak vm efforts. Little mutual support. Little community involvement. Nothing new, but I do find this a serious problem. Thank you for tolerating my gloom in this holiday season. > Happy Holidays to Everyone! > Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 22 09:08:28 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 22 Dec 2020 01:08:28 -0800 Subject: [Vm-dev] [squeak-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: References: Message-ID: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Hi Vanessa, Hi Fabio, Hi David, Hi All, > On Dec 20, 2020, at 10:24 PM, commits at source.squeak.org wrote: > > Vanessa Freudenberg uploaded a new version of System to project The Trunk: > http://source.squeak.org/trunk/System-codefrau.1205.mcz > > ==================== Summary ==================== > > Name: System-codefrau.1205 > Author: codefrau > Time: 20 December 2020, 10:23:10.790782 pm > UUID: f94486f3-3743-4300-a495-c2a89089e122 > Ancestors: System-dtl.1204 > > Update platformName for SqueakJS 1.0 > > =============== Diff against System-dtl.1204 =============== > > Item was changed: > ----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') ----- > isLowerPerformance > "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure" > ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example" > + or: [self platformName = 'JS'] "SqueakJS"! > - or: [self platformName = 'Web'] "SqueakJS"! this is interesting. The method is do crude, but potentially we have a much more rational basis upon which to derive its result. I would expect the effective performance to be the product of processor speed (mips), core execution engine architecture and object representation. Mips varies hugely across the range from eg Raspberry Pi 2,3,4 to various Intel (i5,I7,i9 etc) and Apple Silicon. The range here is about one order of magnitude. Execution architecture varies from pure context interpreter (the BTTF VM), Stack Interpreter, Squeak JS interpreter, Squeak JS generation one JIT, Squeak JS subsequent generation JITs (temps in JS vars, sends mapped to JS calls), Cog JIT, Sista JIT. Very crudely Spur = 2 x v3 (actually about 1.7 and varies according to workflow). Of the execution architectures Sista JIT is for practical purposes not yet implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak JS JITs I think that the send mapping isn’t implemented (am I right?). But is the temp var mapping implemented? If so what difference does it make? Context to Stack is about 1.5. Stack to Cog is about 6. So the notion is that if we can come up with crude numbers that rank the execution architectures and a measure of mips we can compute a meaningful numeric estimate of likely Smalltalk execution speed and answer isLowerPerformance if this number falls below a specific threshold. What we have now based on platformName is simply wrong. eg a Raspberry Pi 4 is way faster than a Pi 3. One thing I did for visual works is estimate processor mips by timing the first invocation of the allInstances primitive and dividing by the number of objects. Basically the heuristic is that mips is roughly (inversely) proportional to how much time per object the first allInstances invocation spends. There is (almost) always an allInstances invocation at startup in VisualWorks (to clear font handles IIRC), and there may be in a Squeak image. Alternatives are measuring how long it takes to load and/or swizzle the image on load divided by the heap size. Basically we have the opportunity to introspection at startup cheaply measuring the time some costly primitive takes to run and this result can be cached, accessed via a primitive or vmParameter and perhaps updated as execution proceeds. Does this sound like overkill? If not, what should we choose as our mips measurer? We want something that all VMs have to do somewhat similarly fairly early on system startup and we can correlate with stopwatches and macro benchmarks like the time taken for the Compiler package to recompile itself, etc. Eliot _,,,^..^,,,_ (phone) From notifications at github.com Tue Dec 22 09:50:56 2020 From: notifications at github.com (dcstes) Date: Tue, 22 Dec 2020 01:50:56 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Well I can understand that Eliot has good reasons to raise the priority of the heartbeat thread. Also I have noticed now that I'm running a nice package "AIDA" (web framework on top of Swazoo) that the WebScheduler is sensitive to scheduling of course. My feeling about it is that still the error message is "too specific". Perhaps the "configure" script could define something like HAVE_LINUX_PAM_LIMITS because I believe the directory /etc/security/limits.d on Linux is related to a pam_limits package. The platforms/vm/unix/sqUnixHeartbeat.c could then print the message only #ifdef HAVE_LINUX_PAM_LIMITS Some Linux distros may not even have that directory /etc/security/limits.d. Regarding Solaris, or other Unix systems that are not Linux, they can have their own system of privileges to allow/disallow a thread or a process to set or raise priority. See https://en.wikipedia.org/wiki/Pluggable_authentication_module So although Solaris uses PAM, I could then not define HAVE_LINUX_PAM_LIMITS, and then at the least the error message would be more suitable. Although the action to remediate the issue would be different, the heartbeat thread could still run at a different priority than the main thread. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf4cFXAAoJEAwpOKXMq1MaH70H+wZMv7KCxiMNKlAINfMgKmfA h/6+uxpqvyA6qncIaB9Ewmj1IIesO18kSomTBHDQFYFNdV0DnippzVpkQ1Q4mvrK U1iSIj8a0qRjNYlkrOFdkDa0hSg2OhV4vHjqp48mGCCV0BovFKr3AoaNkUyiLhM+ qAIX6BsmNNgWeBoWf9hTWyot1uk6XXAhlT2UUyn4wImnHcrsKlJc+9EFK112ZlNQ siZen1aPEZYZD7k2t8/raRVVYDekHbugIFeVcbj+lsAp5GqM1pqJeRnW0t9IipRm Sxg2Rq4GvI+VknpVq3pY5fROHdSiu/0yj4EhEJrI42N11hwk4+Y0pdoD8K6TNF0= =7kpF -----END PGP SIGNATURE----- -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-749453726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Tue Dec 22 17:51:56 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 22 Dec 2020 12:51:56 -0500 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: <20201222175156.GA58144@shell.msen.com> Vanessa, On Mon, Dec 21, 2020 at 09:32:03PM -0800, Vanessa Freudenberg wrote: > > Hi All, > > yesterday I released version 1.0 of SqueakJS, exactly 7 years after my > first public announcement on December 20, 2013. > > https://squeak.js.org/ > What a nice surprise for the holidays. Thank you!!! > Arguably I should have done this back in 2016 when it could run Spur > images. What got it over the last hump was Fabio's interpreter for Sista > bytecodes and Erik's refactoring for Node.js. > > SqueakJS is now the most compatible Squeak VM: it can run pre-release > images from 1996 as well as the latest Squeak 6.0 trunk image. > > For production, you should still use non-Sista images, because no JIT has > been implemented yet. > Shortcuts for switching back and forth in a trunk image: CompiledCode useSista: true CompiledCode useSista: false Dave > A big Thank You to all the contributors over the years, and to Dan Ingalls > for the inspiration, and funding the initial development. > > There are still many things to work on: > > - a simple JIT for Sista bytecode to bring its speed at least up to par > with its pre-Sista speed > - a "real" JIT with context mapping (keeping temps in JS vars rather than > on the stack) and send optimizations (mapping sends to JS function > invocations) > - 64 bit support for pre-Spur images > - big-endian support for 64 bit images > > Help is very welcome at https://github.com/codefrau/SqueakJS > > Happy Holidays to Everyone! > Vanessa From lewis at mail.msen.com Tue Dec 22 18:47:41 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 22 Dec 2020 13:47:41 -0500 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: <20201222184741.GA65093@shell.msen.com> On Tue, Dec 22, 2020 at 12:41:05AM -0800, Eliot Miranda wrote: > > > > Help is very welcome at https://github.com/codefrau/SqueakJS > > We have an effort crisis with the execution machinery. You are asking > did help. I am asking for help. We have at least four different Squeak > vm efforts. Little mutual support. Little community involvement. Nothing > new, but I do find this a serious problem. I would prefer to think that the glass is half full. Maybe we don't have enough people, but I believe that the various efforts are complimentary. It is quite remarkable to see the results as various projects push the limits of extreme performance and extreme portability. The only thing that makes me sad about this is that we do not have a way to pursue the Sista/Scorch opportunities. I understand this topic just barely enough to recognize that it is innovative and important. I don't have any competence in the area at all, but I really do hope that more can be done to move these ideas forward. > > Thank you for tolerating my gloom in this holiday season. > Gloom is something of a holiday tradtion ;-) Dave From craig at blackpagedigital.com Tue Dec 22 19:50:11 2020 From: craig at blackpagedigital.com (Craig Latta) Date: Tue, 22 Dec 2020 11:50:11 -0800 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: <0aeeccf0-13d8-7f17-ce56-d51c0b5929b0@blackpagedigital.com> Hi Eliot-- > We have at least four different Squeak vm efforts. I think JS is a significant platform which, for now, doesn't fit the concept of platform, execution artifact, and how that artifact is built that we use with the other platforms. (I'm keen to make things converge a bit with WebAssembly.) It's a worthy additional front, even though the other fronts are understaffed. And JS is significant for both the reach it gives our applications, and the large audience of developers we can interest in JS/Smalltalk hybrids. > We have an effort crisis with the execution machinery. You are asking > for help. I am asking for help... Little mutual support. What additional mutual support do you think there could be? > Little community involvement. I can't let that pass without noting that I'm involved and enthusiastic. :) > Nothing new, but I do find this a serious problem. Thank you for > tolerating my gloom in this holiday season. It's okay, let's turn that gloom into a plan! -C -- Craig Latta :: research computer scientist Black Page Digital :: Berkeley, California 663137D7940BF5C0AFC 1349FB2ADA32C4D5314CE From vanessa at codefrau.net Tue Dec 22 21:44:10 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Tue, 22 Dec 2020 13:44:10 -0800 Subject: [Vm-dev] [squeak-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: On Tue, Dec 22, 2020 at 1:08 AM Eliot Miranda wrote: > > Of the execution architectures Sista JIT is for practical purposes not yet > implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak JS > JITs I think that the send mapping isn’t implemented (am I right?). But is > the temp var mapping implemented? If so what difference does it make? > Context to Stack is about 1.5. Stack to Cog is about 6. > None of that has been implemented in SqueakJS. The current JIT only gets rid of the generic bytecode decoding, plus it inlines small-int arithmetic. However, that still gives an 8x increase in bytecode speed, which causes the send speed as measured by tinyBenchmarks to go up by 3.5x too. It also *feels* significantly faster with the JIT enabled. See the comment on top of https://github.com/codefrau/SqueakJS/blob/main/jit.js > > Does this sound like overkill? If not, what should we choose as our mips > measurer? We want something that all VMs have to do somewhat similarly > fairly early on system startup and we can correlate with stopwatches and > macro benchmarks like the time taken for the Compiler package to recompile > itself, etc. > I like measuring all-over performance, and not adding any extra work. Like, DateAndTime is pretty early in the startup list. It could remember the time its startup was invoked. Another class that comes later could set a LowPerformance flag if it took longer than x ms since DateAndTime was initialized. I just tried that with ProcessorScheduler (see attachment). On Safari and a 5.3 image I get ImageStartMS = 133 ms, on Chrome 250 ms. On a fast VM I get 5 ms. So maybe if that takes longer than say 50 ms it could be considered low performance? Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: startup-codefrau.1.cs Type: text/x-csharp Size: 3055 bytes Desc: not available URL: From eliot.miranda at gmail.com Tue Dec 22 21:57:33 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 22 Dec 2020 13:57:33 -0800 Subject: [Vm-dev] [squeak-dev] The Trunk: System-codefrau.1205.mcz In-Reply-To: References: <26679313-2E4A-4BDA-9993-CCC738C6A01D@gmail.com> Message-ID: On Tue, Dec 22, 2020 at 1:44 PM Vanessa Freudenberg wrote: > On Tue, Dec 22, 2020 at 1:08 AM Eliot Miranda > wrote: > >> >> Of the execution architectures Sista JIT is for practical purposes not >> yet implemented, a prototype, but may offer 2x to 4x of Cog. Of the Squeak >> JS JITs I think that the send mapping isn’t implemented (am I right?). But >> is the temp var mapping implemented? If so what difference does it make? >> Context to Stack is about 1.5. Stack to Cog is about 6. >> > > None of that has been implemented in SqueakJS. The current JIT only gets > rid of the generic bytecode decoding, plus it inlines small-int arithmetic. > > However, that still gives an 8x increase in bytecode speed, which causes > the send speed as measured by tinyBenchmarks to go up by 3.5x too. It also > *feels* significantly faster with the JIT enabled. > > See the comment on top of > https://github.com/codefrau/SqueakJS/blob/main/jit.js > >> >> Does this sound like overkill? If not, what should we choose as our mips >> measurer? We want something that all VMs have to do somewhat similarly >> fairly early on system startup and we can correlate with stopwatches and >> macro benchmarks like the time taken for the Compiler package to recompile >> itself, etc. >> > > I like measuring all-over performance, and not adding any extra work. > > Like, DateAndTime is pretty early in the startup list. It could remember > the time its startup was invoked. Another class that comes later could set > a LowPerformance flag if it took longer than x ms since DateAndTime was > initialized. > > I just tried that with ProcessorScheduler (see attachment). On Safari and > a 5.3 image I get ImageStartMS = 133 ms, on Chrome 250 ms. On a fast VM I > get 5 ms. So maybe if that takes longer than say 50 ms it could be > considered low performance? > Works for me. I would record and provide an accessor for ImageStartUsecs (a class variable in SmalltalkImage, using microseconds :-) ). Then one can either use isLowerPerformance or the actual time for a more "nuanced" view. _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From vanessa at codefrau.net Wed Dec 23 00:24:34 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Tue, 22 Dec 2020 16:24:34 -0800 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: On Tue, Dec 22, 2020 at 12:41 AM Eliot Miranda wrote: > > We have an effort crisis with the execution machinery. You are asking did > help. I am asking for help. We have at least four different Squeak vm > efforts. Little mutual support. Little community involvement. Nothing > new, but I do find this a serious problem. Thank you for tolerating my > gloom in this holiday season. > It's not a zero-sum game, and there's no one-size-fits-all. People are passionate about different things, especially if they do it in their spare time. The people helping me with the JavaScript stuff are not the same people interested in working on the main VM. And sometimes there is mutual support, like when Fabio implemented Sista bytecodes and FullClosures for SqueakJS right after he had done it in Java for TruffleSqueak. So, cheers to a diverse community! ❤️🧡💛💚💙💜🤎🖤 Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 23 00:32:54 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 23 Dec 2020 00:32:54 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2907.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2907.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2907 Author: eem Time: 22 December 2020, 4:32:46.670664 pm UUID: 5bf10ff3-9f29-4f07-b93a-91354783cb32 Ancestors: VMMaker.oscog-tpr.2906 Simulation: Fix regression in SocketPluginSimulator due to changes to CArray>>coerceTo:sim: in VMMaker.oscog-eem.2905; 'char *' is assumed to be unsigned. Add a missing Socket primitive simulation (hit when running the SocketTests under simulation). Add a useful error message to CLiteralArray>>at:put: =============== Diff against VMMaker.oscog-tpr.2906 =============== Item was changed: ----- Method: CArray>>coerceTo:sim: (in category 'converting') ----- coerceTo: cTypeString sim: interpreterSimulator ^cTypeString caseOf: { ['int'] -> [self ptrAddress]. ['float *'] -> [self asSingleFloatAccessor]. ['double *'] -> [self asDoubleFloatAccessor]. ['sqInt *'] -> [self shallowCopy unitSize: interpreter bytesPerOop; beSigned]. ['unsigned int *'] -> [self shallowCopy unitSize: 4; beUnsigned]. ['int *'] -> [self shallowCopy unitSize: 4; beSigned]. ['unsigned short *'] -> [self shallowCopy unitSize: 2; beUnsigned]. ['short *'] -> [self shallowCopy unitSize: 2; beSigned]. ['unsigned char *'] -> [self shallowCopy unitSize: 1; beUnsigned]. + ['char *'] -> [self shallowCopy unitSize: 1; beUnsigned]. "C is ambivalent on the issue; sigh... SocketPlugin assumes unsigned" - ['char *'] -> [self shallowCopy unitSize: 1; beSigned]. "C is ambivalent on the issue; sigh..." ['unsigned'] -> [self ptrAddress]. ['sqInt'] -> [self ptrAddress]. ['usqInt'] -> [self ptrAddress]. ['sqIntptr_t'] -> [self shallowCopy unitSize: interpreter bytesPerOop; yourself] }! Item was changed: ----- Method: CLiteralArray>>at:put: (in category 'accessing') ----- at: offset put: val + self error: 'Literals are immutable; proceed to attempt to assign anyway...'. ^object at: offset + 1 put: val! Item was added: + ----- Method: SocketPluginSimulator>>sqSocket:ListenOnPort:BacklogSize: (in category 'simulation') ----- + sqSocket: socketHandle ListenOnPort: portNumber BacklogSize: backlog + ^[Socket basicNew + primSocket: ((self hostSocketHandleFromSimSocketHandle: socketHandle) ifNil: [^self]) + listenOn: portNumber + backlogSize: backlog] + on: SocketPrimitiveFailed + do: [:ex| + interpreterProxy primitiveFail. + 0]! From craig at blackpagedigital.com Wed Dec 23 00:53:40 2020 From: craig at blackpagedigital.com (Craig Latta) Date: Tue, 22 Dec 2020 16:53:40 -0800 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: (tangent) > The people helping me with the JavaScript stuff are not the same > people interested in working on the main VM. Must raise my hand again here... I'm an exception. I want to be able to demo my apps on all platforms, and teach the audience how to maintain the whole thing. Also, my apps use features that require me to dig into the VM on all platforms (e.g., remote messaging and instrumented garbage collection). -C -- Craig Latta :: research computer scientist Black Page Digital :: Berkeley, California 663137D7940BF5C0AFC 1349FB2ADA32C4D5314CE From commits at source.squeak.org Wed Dec 23 02:11:34 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 23 Dec 2020 02:11:34 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2908.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2908.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2908 Author: eem Time: 22 December 2020, 6:11:26.000244 pm UUID: fddf1a4f-c585-45ab-8a74-442230cd3dbd Ancestors: VMMaker.oscog-eem.2907 StackInterpreter: Provide a selective event printing facility for primGetNextEvent:. Add vm parameter 12 (also potentially settable via a command line argument) to provide a mask of event types to print. Slang: Upgrade the f:printf: transformation to allow specifying stderr as the stream. Upgrade literal array declararions to allow more than one (mangle the target variable name). =============== Diff against VMMaker.oscog-eem.2907 =============== Item was changed: ----- Method: Array>>coerceTo:sim: (in category '*VMMaker-interpreter simulator') ----- coerceTo: cTypeString sim: interpreterSimulator + ^CLiteralArray on: self! - - ^ self! Item was changed: VMClass subclass: #InterpreterPrimitives + instanceVariableNames: 'objectMemory messageSelector argumentCount newMethod primFailCode osErrorCode exceptionPC inFFIFlags profileMethod profileProcess profileSemaphore nextProfileTick preemptionYields newFinalization sHEAFn ffiExceptionResponse eventTraceMask' - instanceVariableNames: 'objectMemory messageSelector argumentCount newMethod primFailCode osErrorCode exceptionPC inFFIFlags profileMethod profileProcess profileSemaphore nextProfileTick preemptionYields newFinalization sHEAFn ffiExceptionResponse' classVariableNames: 'CrossedX EndOfRun MillisecondClockMask' poolDictionaries: 'VMBasicConstants VMBytecodeConstants VMMethodCacheConstants VMObjectIndices VMSqueakClassIndices VMStackFrameOffsets' category: 'VMMaker-Interpreter'! !InterpreterPrimitives commentStamp: 'eem 8/24/2018 11:05' prior: 0! InterpreterPrimitives implements most of the VM's core primitives. It is the root of the interpreter hierarchy so as to share the core primitives amongst the varioius interpreters. Instance Variables argumentCount ffiExceptionResponse inFFIFlags messageSelector newMethod nextProfileTick objectMemory (simulation only) preemptionYields primFailCode osErrorCode profileMethod profileProcess profileSemaphore secHasEnvironmentAccess argumentCount - the number of arguments of the current message ffiExceptionResponse - controls system response to exceptions during FFI calls. See primitiveFailForFFIException:at: inFFIFlags - flags recording currently only whether the system is in an FFI call messageSelector - the oop of the selector of the current message newMethod - the oop of the result of looking up the current message nextProfileTick - the millisecond clock value of the next profile tick (if profiling is in effect) objectMemory - the memory manager and garbage collector that manages the heap preemptionYields - a boolean controlling the process primitives. If true (old, incorrect, blue-book semantics) a preempted process is sent to the back of its run-queue. If false, a process preempted by a higher-priority process is put back at the head of its run queue, hence preserving cooperative scheduling within priorities. primFailCode - primitive success/failure flag, 0 for success, otherwise the reason code for failure osErrorCode - a 64-bit value settable by external primitives conveying arbitrary error codes from the operating system and/or system libraries profileMethod - the oop of the method at the time nextProfileTick was reached profileProcess - the oop of the activeProcess at the time nextProfileTick was reached profileSemaphore - the oop of the semaphore to signal when nextProfileTick is reached secHasEnvironmentAccess - the function to call to check if access to the envronment should be granted to primitiveGetenv ! Item was changed: ----- Method: InterpreterPrimitives>>initialize (in category 'initialization') ----- initialize "Here we can initialize the variables C initializes to zero. #initialize methods do /not/ get translated." + argumentCount := primFailCode := nextProfileTick := osErrorCode := exceptionPC := inFFIFlags := ffiExceptionResponse := eventTraceMask := 0. - argumentCount := primFailCode := nextProfileTick := osErrorCode := exceptionPC := inFFIFlags := ffiExceptionResponse := 0. newFinalization := false! Item was changed: ----- Method: InterpreterPrimitives>>primitiveGetNextEvent (in category 'I/O primitives') ----- primitiveGetNextEvent "Primitive. Return the next input event from the VM event queue." | evtBuf arg value eventTypeIs | self cCode: [] inSmalltalk: [evtBuf := objectMemory newInputEventAccessorOfSize: 8]. arg := self stackTop. ((objectMemory isArray: arg) and:[(objectMemory slotSizeOf: arg) = 8]) ifFalse: [^self primitiveFailFor: PrimErrBadArgument]. self ioGetNextEvent: (self cCoerce: evtBuf to: 'sqInputEvent*'). self successful ifFalse: [^nil]. + (eventTraceMask ~= 0 + and: [eventTraceMask anyMask: (1 bitShift: (evtBuf at: 0))]) ifTrue: + [self traceInputEvent: evtBuf]. + "Event type" eventTypeIs := evtBuf at: 0. self storeInteger: 0 ofObject: arg withValue: (evtBuf at: 0). self successful ifFalse: [^nil]. eventTypeIs = 6 ifTrue: "Event is Complex, assume evtBuf is populated correctly and return" [1 to: 7 do: [:i | value := evtBuf at: i. self storePointer: i ofObject: arg withValue: value]] ifFalse: ["Event time stamp" self storeInteger: 1 ofObject: arg withValue: ((evtBuf at: 1) bitAnd: MillisecondClockMask). self successful ifFalse: [^nil]. "Event arguments" 2 to: 7 do:[:i| value := evtBuf at: i. (objectMemory isIntegerValue: value) ifTrue:[self storeInteger: i ofObject: arg withValue: value] ifFalse: [value := self positiveMachineIntegerFor: value. objectMemory storePointer: i ofObject: arg withValue: value]]]. self successful ifTrue: [self pop: 1]! Item was added: + ----- Method: InterpreterPrimitives>>traceInputEvent: (in category 'I/O primitive support') ----- + traceInputEvent: evtBuf + + | eventTypeNames | + eventTypeNames := self + cCoerce: #('None' 'Mouse' 'Keyboard' 'DragDropFiles' 'Menu' 'Window' 'Complex' 'MouseWheel' 'Plugin') + to: #'char **'. + 'Event%s/%d @ %u\t\t%d/%x %d/%x\n\t%d/%x %d/%x\t %d/%x %p\n' + f: #stderr + printf: { ((evtBuf at: 0) between: 0 and: 8) + ifTrue: [eventTypeNames at: (evtBuf at: 0)] + ifFalse: ['?']. + evtBuf at: 0. + evtBuf at: 1. "timestamp" + evtBuf at: 2. evtBuf at: 2. evtBuf at: 3. evtBuf at: 3. + evtBuf at: 4. evtBuf at: 4. evtBuf at: 5. evtBuf at: 5. + evtBuf at: 6. evtBuf at: 6. + evtBuf at: 7 } "windowIndex"! Item was changed: ----- Method: StackInterpreter class>>mustBeGlobal: (in category 'translation') ----- mustBeGlobal: var "Answer if a variable must be global and exported. Used for inst vars that are accessed from VM support code, and for variables that are initialized to some value (e.g. primitiveDoMixedArithmetic)." ^(super mustBeGlobal: var) or: [(self objectMemoryClass mustBeGlobal: var) or: [(#('interpreterProxy' 'interpreterVersion' 'inIOProcessEvents' 'sendWheelEvents' + 'deferDisplayUpdates' 'eventTraceMask' 'extraVMMemory' - 'deferDisplayUpdates' 'extraVMMemory' 'showSurfaceFn' 'displayBits' 'displayWidth' 'displayHeight' 'displayDepth' 'desiredNumStackPages' 'desiredEdenBytes' 'primitiveDoMixedArithmetic' 'breakLookupClassTag' 'breakSelector' 'breakSelectorLength' 'sendTrace' 'checkAllocFiller' 'checkedPluginName' "'reenterInterpreter'" 'suppressHeartbeatFlag' 'ffiExceptionResponse' 'debugCallbackInvokes' 'debugCallbackPath' 'debugCallbackReturns') includes: var) or: [ "This allows slow machines to define bytecodeSetSelector as 0 to avoid the interpretation overhead." MULTIPLEBYTECODESETS not and: [var = 'bytecodeSetSelector']]]]! Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveAllVMParameters: (in category 'system control primitives') ----- (excessive size, no diff calculated) Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveGetVMParameter: (in category 'system control primitives') ----- primitiveGetVMParameter: arg "See primitiveVMParameter method comment. N.B. written as a returning case to avoid branch limits in the V3 bytecode set." arg caseOf: { [1] -> [^self positiveMachineIntegerFor: objectMemory oldSpaceSize]. [2] -> [^objectMemory integerObjectOf: objectMemory newSpaceSize]. [3] -> [^self positiveMachineIntegerFor: objectMemory totalMemorySize]. [6] -> [^objectMemory integerObjectOf: objectMemory tenuringThreshold]. [7] -> [^objectMemory integerObjectOf: objectMemory statFullGCs]. [8] -> [^objectMemory integerObjectOf: objectMemory statFullGCUsecs + 500 // 1000]. [9] -> [^objectMemory integerObjectOf: (objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory statScavenges] ifFalse: [objectMemory statIncrGCs])]. [10] -> [^objectMemory integerObjectOf: (objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory statScavengeGCUsecs] ifFalse: [objectMemory statIncrGCUsecs]) + 500 // 1000]. [11] -> [^objectMemory integerObjectOf: objectMemory statTenures]. + [12] -> [^objectMemory integerObjectOf: eventTraceMask]. - [12] -> [^ConstZero]. "Was JITTER VM info" [13] -> [^self getVMTickerStartUSecs]. [14] -> [^self getVMTickerCount]. [15] -> [^self getVMTickeeCallCount]. [16] -> [^self positive64BitIntegerFor: statIdleUsecs]. [17] -> [^(SistaVM and: [self isCog]) ifTrue: [objectMemory floatObjectOf: self getCogCodeZoneThreshold] ifFalse: [ConstZero]]. [18] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory integerObjectOf: objectMemory statCompactionUsecs + 500 // 1000] ifFalse: [ConstZero]]. [19] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory integerObjectOf: objectMemory scavengeThresholdAsExtent] ifFalse: [ConstZero]]. [20] -> [^objectMemory positive64BitIntegerFor: self ioUTCStartMicroseconds]. [21] -> [^objectMemory integerObjectOf: objectMemory rootTableCount]. [22] -> [^objectMemory integerObjectOf: objectMemory statRootTableOverflows]. [23] -> [^objectMemory integerObjectOf: extraVMMemory]. [24] -> [^objectMemory integerObjectOf: objectMemory shrinkThreshold]. [25] -> [^objectMemory integerObjectOf: objectMemory growHeadroom]. [26] -> [^objectMemory integerObjectOf: self ioHeartbeatMilliseconds]. [27] -> [^objectMemory integerObjectOf: objectMemory statMarkCount]. [28] -> [^objectMemory integerObjectOf: objectMemory statSweepCount]. [29] -> [^objectMemory integerObjectOf: objectMemory statMkFwdCount]. [30] -> [^objectMemory integerObjectOf: objectMemory statCompMoveCount]. [31] -> [^objectMemory integerObjectOf: objectMemory statGrowMemory]. [32] -> [^objectMemory integerObjectOf: objectMemory statShrinkMemory]. [33] -> [^objectMemory integerObjectOf: objectMemory statRootTableCount]. [34] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:"was statAllocationCount" [objectMemory positive64BitIntegerFor: objectMemory currentAllocatedBytes]]. [35] -> [^objectMemory integerObjectOf: objectMemory statSurvivorCount]. [36] -> [^objectMemory integerObjectOf: (self microsecondsToMilliseconds: objectMemory statGCEndUsecs)]. [37] -> [^objectMemory integerObjectOf: objectMemory statSpecialMarkCount]. [38] -> [^objectMemory integerObjectOf: objectMemory statIGCDeltaUsecs + 500 // 1000]. [39] -> [^objectMemory integerObjectOf: statPendingFinalizationSignals]. [40] -> [^objectMemory integerObjectOf: objectMemory wordSize]. [41] -> [^objectMemory integerObjectOf: self imageFormatVersion]. [42] -> [^objectMemory integerObjectOf: numStackPages]. [43] -> [^objectMemory integerObjectOf: desiredNumStackPages]. [44] -> [^objectMemory integerObjectOf: objectMemory edenBytes]. [45] -> [^objectMemory integerObjectOf: desiredEdenBytes]. [46] -> [^self getCogCodeSize]. [47] -> [^self getDesiredCogCodeSize]. [48] -> [^self getImageHeaderFlagsParameter]. [49] -> [^objectMemory integerObjectOf: self ioGetMaxExtSemTableSize]. [52] -> [^objectMemory integerObjectOf: objectMemory rootTableCapacity]. [53] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory integerObjectOf: objectMemory numSegments]]. [54] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory integerObjectOf: objectMemory freeSize]]. [55] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory floatObjectOf: objectMemory getHeapGrowthToSizeGCRatio]]. [56] -> [^self positive64BitIntegerFor: statProcessSwitch]. [57] -> [^self positive64BitIntegerFor: statIOProcessEvents]. [58] -> [^self positive64BitIntegerFor: statForceInterruptCheck]. [59] -> [^self positive64BitIntegerFor: statCheckForEvents]. [60] -> [^self positive64BitIntegerFor: statStackOverflow]. [61] -> [^self positive64BitIntegerFor: statStackPageDivorce]. [62] -> [^self getCodeCompactionCount]. [63] -> [^self getCodeCompactionMSecs]. [64] -> [^self getCogMethodCount]. [65] -> [^self getCogVMFeatureFlags]. [66] -> [^objectMemory integerObjectOf: self stackPageByteSize]. [67] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [self positiveMachineIntegerFor: objectMemory maxOldSpaceSize]]. [68] -> [^objectMemory floatObjectOf: stackPages statAverageLivePagesWhenMapping]. [69] -> [^objectMemory integerObjectOf: stackPages statMaxPageCountWhenMapping]. [70] -> [^objectMemory integerObjectOf: self vmProxyMajorVersion]. [71] -> [^objectMemory integerObjectOf: self vmProxyMinorVersion]. [72] -> [^objectMemory integerObjectOf: objectMemory statMarkUsecs + 500 // 1000]. [73] -> [^objectMemory integerObjectOf: objectMemory statSweepUsecs + 500 // 1000]. [74] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory integerObjectOf: objectMemory statMaxAllocSegmentTime + 500 // 1000]]. [75] -> [^objectMemory booleanObjectOf: self primitiveDoMixedArithmetic] } otherwise: [^nil]! Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveSetVMParameter:arg: (in category 'system control primitives') ----- primitiveSetVMParameter: index arg: argOop "See primitiveVMParameter method comment" | arg result | "argOop read & checks; in most cases this is an integer parameter. Handle the exceptions." index caseOf: { [17] -> [((objectMemory isFloatInstance: argOop) or: [objectMemory isIntegerObject: argOop]) ifFalse: [primFailCode := PrimErrBadArgument]]. [55] -> [((objectMemory isFloatInstance: argOop) or: [objectMemory isIntegerObject: argOop]) ifFalse: [primFailCode := PrimErrBadArgument]]. [68] -> [((objectMemory isFloatInstance: argOop) or: [objectMemory isIntegerObject: argOop]) ifFalse: [primFailCode := PrimErrBadArgument]]. [67] -> [arg := self positiveMachineIntegerValueOf: argOop]. [75] -> [arg := objectMemory booleanValueOf: argOop] } otherwise: [arg := objectMemory integerValueOf: argOop]. self failed ifTrue: [^self primitiveFailFor: PrimErrBadArgument]. "assume failure, then set success for handled indices" self primitiveFailFor: PrimErrBadArgument. index caseOf: { [5] -> [objectMemory hasSpurMemoryManagerAPI ifFalse: ["Was: result := allocationsBetweenGCs. allocationsBetweenGCs := arg." "Ignore for now, because old images won't start up otherwise. See 45 for eden size setting." result := objectMemory nilObject. self initPrimCall]]. [6] -> [result := objectMemory integerObjectOf: objectMemory tenuringThreshold. primFailCode := objectMemory tenuringThreshold: arg]. + [12] -> [result := objectMemory integerObjectOf: eventTraceMask. + eventTraceMask := arg. + self initPrimCall]. [11] -> [arg >= 0 ifTrue: [result := objectMemory integerObjectOf: objectMemory statTenures. objectMemory statTenures: arg. self initPrimCall]]. [17] -> [(SistaVM and: [self isCog]) ifTrue: [result := objectMemory floatObjectOf: self getCogCodeZoneThreshold. primFailCode := self setCogCodeZoneThreshold: (self noInlineLoadFloatOrIntFrom: argOop)]]. [23] -> [result := objectMemory integerObjectOf: extraVMMemory. extraVMMemory := arg. self initPrimCall]. [24] -> [arg > 0 ifTrue: [result := objectMemory integerObjectOf: objectMemory shrinkThreshold. objectMemory shrinkThreshold: arg. self initPrimCall]]. [25] -> [arg > 0 ifTrue: [result := objectMemory integerObjectOf: objectMemory growHeadroom. objectMemory growHeadroom: arg. self initPrimCall]]. [26] -> [arg >= 0 ifTrue: "0 turns off the heartbeat" [result := objectMemory integerObjectOf: self ioHeartbeatMilliseconds. self ioSetHeartbeatMilliseconds: arg. self initPrimCall]]. [34] -> [(objectMemory hasSpurMemoryManagerAPI "was statAllocationCount; now statAllocatedBytes" and: [arg >= 0]) ifTrue: [result := objectMemory positive64BitIntegerFor: objectMemory currentAllocatedBytes. objectMemory setCurrentAllocatedBytesTo: arg. self initPrimCall]]. [43] -> [(arg between: 0 and: 65535) ifTrue: [result := objectMemory integerObjectOf: desiredNumStackPages. desiredNumStackPages := arg. self initPrimCall]]. [45] -> [arg >= 0 ifTrue: [result := objectMemory integerObjectOf: desiredEdenBytes. desiredEdenBytes := arg. self initPrimCall]]. [47] -> [(self isCog and: [arg between: 0 and: self maxCogCodeSize]) ifTrue: [result := objectMemory integerObjectOf: self getDesiredCogCodeSize. self setDesiredCogCodeSize: arg. self initPrimCall]]. [48] -> [arg >= 0 ifTrue: [| oldPrimitiveDoMixedArithmetic | oldPrimitiveDoMixedArithmetic := primitiveDoMixedArithmetic. result := self getImageHeaderFlagsParameter. self initPrimCall. "i.e. setImageHeaderFlags: can fail" self setImageHeaderFlags: arg. (primFailCode = 0 and: [oldPrimitiveDoMixedArithmetic ~= primitiveDoMixedArithmetic]) ifTrue: [self flushMethodCache. self flushMethodsWithMachineCodePrimitivesAndContinueAnswering: result "NOT REACHED (in CoInterpreter)"]]]. [49] -> [(arg between: 0 and: 65535) ifTrue: [result := objectMemory integerObjectOf: self ioGetMaxExtSemTableSize. self initPrimCall. "i.e. ioSetMaxExtSemTableSize: is allowed to fail" self setMaxExtSemSizeTo: arg]]. [55] -> [objectMemory hasSpurMemoryManagerAPI ifTrue: [result := objectMemory floatObjectOf: objectMemory getHeapGrowthToSizeGCRatio. primFailCode := objectMemory setHeapGrowthToSizeGCRatio: (self noInlineLoadFloatOrIntFrom: argOop)]]. [67] -> [(arg >= 0 and: [objectMemory hasSpurMemoryManagerAPI]) ifTrue: [result := self positiveMachineIntegerFor: objectMemory maxOldSpaceSize. primFailCode := objectMemory setMaxOldSpaceSize: arg]]. [68] -> [result := objectMemory floatObjectOf: stackPages statAverageLivePagesWhenMapping. self initPrimCall. "i.e. statAverageLivePagesWhenMapping: is allowed to fail" stackPages statAverageLivePagesWhenMapping: (self noInlineLoadFloatOrIntFrom: argOop)]. [69] -> [arg >= 0 ifTrue: [result := objectMemory integerObjectOf: stackPages statMaxPageCountWhenMapping. stackPages statMaxPageCountWhenMapping: arg. self initPrimCall]]. [74] -> [(arg >= 0 and: [objectMemory hasSpurMemoryManagerAPI]) ifTrue: [result := objectMemory integerObjectOf: objectMemory statMaxAllocSegmentTime + 500 // 1000. stackPages statMaxAllocSegmentTime: arg. "usually 0" self initPrimCall]]. [75] -> [| mustFlush | result := objectMemory booleanObjectOf: self primitiveDoMixedArithmetic. self initPrimCall. mustFlush := primitiveDoMixedArithmetic ~= arg. primitiveDoMixedArithmetic := arg. mustFlush ifTrue: [self flushMethodCache. self flushMethodsWithMachineCodePrimitivesAndContinueAnswering: result "NOT REACHED (in CoInterpreter)"]] } otherwise: []. self successful ifTrue: [self methodReturnValue: result] "return old value" ifFalse: [self primitiveFailFor: PrimErrInappropriate] "attempting to write a read-only or non-existent parameter"! Item was changed: ----- Method: TAssignmentNode>>emitLiteralArrayDeclarationOn:level:generator: (in category 'C code generation') ----- emitLiteralArrayDeclarationOn: aStream level: level generator: aCCodeGen + | type literalName | - | type | type := expression args last value. self assert: type last = $*. + literalName := variable name, 'Initializer'. aStream crtab: level; nextPutAll: '{ static '; nextPutAll: (aCCodeGen + arrayInitializerCalled: literalName - arrayInitializerCalled: 'aLiteralArray' for: expression args first value sizeString: nil type: type allButLast) withBlanksTrimmed; nextPut: $;; crtab: level + 1; nextPutAll: variable name; + nextPutAll: ' = '; + nextPutAll: literalName; + nextPut: $; ; - nextPutAll: ' = aLiteralArray;'; crtab: level; nextPut: $}; cr! Item was changed: ----- Method: TMethod>>prepareMethodIn: (in category 'transformations') ----- prepareMethodIn: aCodeGen "Record sends of builtin operators, map sends of the special selector dispatchOn:in: with case statement nodes, and map sends of caseOf:[otherwise:] to switch statements. Declare limit variables for to:[by:]do: loops with limits that potentially have side-effects. As a hack also update the types of variables introduced to implement cascades correctly. This has to be done at the same time as this is done, so why not piggy back here?" extraVariableNumber ifNotNil: [declarations keysAndValuesDo: [:varName :decl| decl isBlock ifTrue: [self assert: ((varName beginsWith: 'cascade') and: [varName last isDigit]). locals add: varName. self declarationAt: varName put: (decl value: self value: aCodeGen), ' ', varName]]]. aCodeGen pushScope: declarations while:"N.B. nodesWithParentsDo: is bottom-up, hence replacement is destructive and conserved." [parseTree nodesWithParentsDo: [:node :parent| node isSend ifTrue: [aCodeGen ifStaticallyResolvedPolymorphicReceiverThenUpdateSelectorIn: node. (aCodeGen isBuiltinSelector: node selector) ifTrue: [node isBuiltinOperator: true. "If a to:by:do:'s limit has side-effects, declare the limit variable, otherwise delete it from the args" node selector = #to:by:do: ifTrue: [self ensureToByDoLoopLimitIsSafeAndEfficient: node in: aCodeGen]] ifFalse: [(CaseStatements includes: node selector) ifTrue: [parent replaceNodesIn: (Dictionary newFromPairs: { node. self buildCaseStmt: node in: aCodeGen})]. (#(caseOf: #caseOf:otherwise:) includes: node selector) ifTrue: [parent replaceNodesIn: (Dictionary newFromPairs: { node. self buildSwitchStmt: node parent: parent })]. (#(printf: f:printf:) includes: node selector) ifTrue: + [self transformPrintf: node]]]]]! - [| map | - map := Dictionary new. - node nodesDo: - [:subNode| - (subNode isConstant and: [subNode value isString and: [subNode value includes: $%]]) ifTrue: - [map at: subNode put: subNode asPrintfFormatStringNode]. - node replaceNodesIn: map]]]]]]! Item was added: + ----- Method: TMethod>>transformPrintf: (in category 'transformations') ----- + transformPrintf: sendNode + "Handle forms of f:printf: & printf:. f:printf: is either + logFile f: formatLiteral printf: args + or + formatLiteral f: streamName printf: args + printf is + formatLiteral printf: args" + | map | + (sendNode receiver isConstant + and: [sendNode receiver value isString]) ifTrue: + [| format | + format := sendNode receiver asPrintfFormatStringNode. + sendNode selector first == $f ifTrue: "fprintf et al..." + [sendNode receiver: (TVariableNode new setName: 'self'). + sendNode arguments: {sendNode args first. format}, sendNode args allButFirst. + ^sendNode]. + sendNode receiver: format. + ^sendNode]. + map := Dictionary new. + sendNode nodesDo: + [:subNode| + (subNode isConstant and: [subNode value isString and: [subNode value includes: $%]]) ifTrue: + [map at: subNode put: subNode asPrintfFormatStringNode]]. + sendNode replaceNodesIn: map. + ^sendNode! From noreply at github.com Wed Dec 23 02:28:51 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 22 Dec 2020 18:28:51 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] ae0346: CogVM source as per VMMaker.oscog-eem.2908 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: ae03460c08772de94d1e55f9c81e74c726435920 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ae03460c08772de94d1e55f9c81e74c726435920 Author: Eliot Miranda Date: 2020-12-22 (Tue, 22 Dec 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cointerp.c M nsspur64src/vm/cointerp.h M nsspur64src/vm/gcc3x-cointerp.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cointerp.c M nsspursrc/vm/cointerp.h M nsspursrc/vm/gcc3x-cointerp.c M nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.c M spur64src/vm/cogit.h M spur64src/vm/cointerp.c M spur64src/vm/cointerp.h M spur64src/vm/cointerpmt.c M spur64src/vm/cointerpmt.h M spur64src/vm/gcc3x-cointerp.c M spur64src/vm/gcc3x-cointerpmt.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cointerp.c M spurlowcode64src/vm/cointerp.h M spurlowcode64src/vm/gcc3x-cointerp.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spurlowcodesrc/vm/cointerp.c M spurlowcodesrc/vm/cointerp.h M spurlowcodesrc/vm/gcc3x-cointerp.c M spurlowcodestack64src/vm/gcc3x-interp.c M spurlowcodestack64src/vm/interp.c M spurlowcodestacksrc/vm/gcc3x-interp.c M spurlowcodestacksrc/vm/interp.c M spursista64src/vm/cogit.h M spursista64src/vm/cointerp.c M spursista64src/vm/cointerp.h M spursista64src/vm/gcc3x-cointerp.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cointerp.c M spursistasrc/vm/cointerp.h M spursistasrc/vm/gcc3x-cointerp.c M spursrc/vm/cogit.h M spursrc/vm/cointerp.c M spursrc/vm/cointerp.h M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerp.c M spursrc/vm/gcc3x-cointerpmt.c M spurstack64src/vm/gcc3x-interp.c M spurstack64src/vm/interp.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/validImage.c M src/vm/cogit.h M src/vm/cointerp.c M src/vm/cointerp.h M src/vm/gcc3x-cointerp.c M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2908 StackInterpreter: Provide a selective event printing facility for primGetNextEvent:. Add vm parameter 12 (also potentially settable via a command line argument) to provide a mask of event types to print. Slang: Upgrade the f:printf: transformation to allow specifying stderr as the stream. Upgrade literal array declararions to allow more than one (mangle the target variable name). From vanessa at codefrau.net Wed Dec 23 03:36:30 2020 From: vanessa at codefrau.net (Vanessa Freudenberg) Date: Tue, 22 Dec 2020 19:36:30 -0800 Subject: [Vm-dev] [ANN] SqueakJS 1.0 In-Reply-To: References: Message-ID: On Tue, Dec 22, 2020 at 4:53 PM Craig Latta wrote: > > (tangent) > > > The people helping me with the JavaScript stuff are not the same > > people interested in working on the main VM. > > Must raise my hand again here... I'm an exception. I want to be > able to demo my apps on all platforms, and teach the audience how to > maintain the whole thing. Also, my apps use features that require me to > dig into the VM on all platforms (e.g., remote messaging and > instrumented garbage collection). > Which is awesome! As I wrote, "sometimes there is mutual support" :) Vanessa -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Dec 23 04:20:31 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 23 Dec 2020 04:20:31 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2329 Message-ID: <20201223042031.1.348E554932A18DA6@appveyor.com> An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Wed Dec 23 07:36:03 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Wed, 23 Dec 2020 08:36:03 +0100 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2907.mcz In-Reply-To: References: Message-ID: Hi Eliot, IMO no C code should assume that char is signed nor unsigned... If socket plugin assumes unsigned, shouldn't it better use unsigned char* explicitelitely? Le mer. 23 déc. 2020 à 01:33, a écrit : > > Eliot Miranda uploaded a new version of VMMaker to project VM Maker: > http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2907.mcz > > ==================== Summary ==================== > > Name: VMMaker.oscog-eem.2907 > Author: eem > Time: 22 December 2020, 4:32:46.670664 pm > UUID: 5bf10ff3-9f29-4f07-b93a-91354783cb32 > Ancestors: VMMaker.oscog-tpr.2906 > > Simulation: > Fix regression in SocketPluginSimulator due to changes to > CArray>>coerceTo:sim: in VMMaker.oscog-eem.2905; 'char *' is assumed to be > unsigned. > Add a missing Socket primitive simulation (hit when running the > SocketTests under simulation). > Add a useful error message to CLiteralArray>>at:put: > > =============== Diff against VMMaker.oscog-tpr.2906 =============== > > Item was changed: > ----- Method: CArray>>coerceTo:sim: (in category 'converting') ----- > coerceTo: cTypeString sim: interpreterSimulator > > ^cTypeString caseOf: { > ['int'] -> [self ptrAddress]. > ['float *'] -> [self > asSingleFloatAccessor]. > ['double *'] -> [self > asDoubleFloatAccessor]. > ['sqInt *'] -> [self shallowCopy > unitSize: interpreter bytesPerOop; beSigned]. > ['unsigned int *'] -> [self shallowCopy unitSize: 4; > beUnsigned]. > ['int *'] -> [self > shallowCopy unitSize: 4; beSigned]. > ['unsigned short *'] -> [self shallowCopy unitSize: 2; > beUnsigned]. > ['short *'] -> [self shallowCopy > unitSize: 2; beSigned]. > ['unsigned char *'] -> [self shallowCopy unitSize: 1; > beUnsigned]. > + ['char *'] -> [self shallowCopy > unitSize: 1; beUnsigned]. "C is ambivalent on the issue; sigh... > SocketPlugin assumes unsigned" > - ['char *'] -> [self shallowCopy > unitSize: 1; beSigned]. "C is ambivalent on the issue; sigh..." > ['unsigned'] -> [self ptrAddress]. > ['sqInt'] -> [self > ptrAddress]. > ['usqInt'] -> [self ptrAddress]. > ['sqIntptr_t'] -> [self shallowCopy unitSize: > interpreter bytesPerOop; yourself] }! > > Item was changed: > ----- Method: CLiteralArray>>at:put: (in category 'accessing') ----- > at: offset put: val > + self error: 'Literals are immutable; proceed to attempt to assign > anyway...'. > ^object at: offset + 1 put: val! > > Item was added: > + ----- Method: SocketPluginSimulator>>sqSocket:ListenOnPort:BacklogSize: > (in category 'simulation') ----- > + sqSocket: socketHandle ListenOnPort: portNumber BacklogSize: backlog > + ^[Socket basicNew > + primSocket: ((self > hostSocketHandleFromSimSocketHandle: socketHandle) ifNil: [^self]) > + listenOn: portNumber > + backlogSize: backlog] > + on: SocketPrimitiveFailed > + do: [:ex| > + interpreterProxy primitiveFail. > + 0]! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Dec 23 20:55:01 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 23 Dec 2020 20:55:01 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2909.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2909.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2909 Author: nice Time: 23 December 2020, 9:54:51.201058 pm UUID: 6869c4f1-9d80-40c3-8409-7c05e087edf5 Ancestors: VMMaker.oscog-eem.2908 WIP: implement new BitBlt ops (rules) for alpha compositing "42" alphaScale:with: "43" alphaUnscale:with: "44" alphaBlendUnscaled:with: This is a proposal implementation for https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505 The generated C code compiles, but it's otherwise mostly yet unused and untested code. I commit it before I loose it. There's probably more to do for letting accelerated code work (PI). =============== Diff against VMMaker.oscog-eem.2908 =============== Item was changed: SmartSyntaxInterpreterPlugin subclass: #BitBltSimulation instanceVariableNames: 'destForm sourceForm halftoneForm combinationRule destX destY width height sourceX sourceY clipX clipY clipWidth clipHeight sourceWidth sourceHeight sourceDepth sourcePitch sourceBits sourcePPW sourceMSB destWidth destHeight destDepth destPitch destBits destPPW destMSB bitCount skew mask1 mask2 preload nWords destMask hDir vDir sourceIndex sourceDelta destIndex destDelta sx sy dx dy bbW bbH halftoneHeight noSource noHalftone halftoneBase sourceAlpha srcBitShift dstBitShift bitBltOop affectedL affectedR affectedT affectedB opTable maskTable ditherMatrix4x4 ditherThresholds16 ditherValues16 hasSurfaceLock warpSrcShift warpSrcMask warpAlignShift warpAlignMask warpBitShiftTable querySurfaceFn lockSurfaceFn unlockSurfaceFn isWarping cmFlags cmMask cmShiftTable cmMaskTable cmLookupTable cmBitsPerColor dither8Lookup componentAlphaModeColor componentAlphaModeAlpha ungammaLookupTable gammaLookupTable numGCsOnInvocation bitBltIsReceiver endOfDestination endOfSource' classVariableNames: 'AllOnes AlphaIndex BBClipHeightIndex BBClipWidthIndex BBClipXIndex BBClipYIndex BBColorMapIndex BBDestFormIndex BBDestXIndex BBDestYIndex BBHalftoneFormIndex BBHeightIndex BBLastIndex BBRuleIndex BBSourceFormIndex BBSourceXIndex BBSourceYIndex BBWarpBase BBWidthIndex BBXTableIndex BEBitBltIndex BinaryPoint BlueIndex ColorMapFixedPart ColorMapIndexedPart ColorMapNewStyle ColorMapPresent CrossedX EndOfRun FixedPt1 FormBitsIndex FormDepthIndex FormHeightIndex FormWidthIndex GreenIndex OpTable OpTableSize RedIndex' poolDictionaries: '' category: 'VMMaker-Interpreter'! + !BitBltSimulation commentStamp: 'nice 10/31/2020 23:39' prior: 0! - !BitBltSimulation commentStamp: 'tpr 3/25/2013 16:50' prior: 0! This class implements BitBlt, much as specified in the Blue Book spec. Performance has been enhanced through the use of pointer variables such as sourceIndex and destIndex, and by separating several special cases of the inner loop. Operation has been extended to color, with support for 1, 2, 4, 8, 16, and 32-bit pixel sizes. Conversion between different pixel sizes is facilitated by accepting an optional color map. In addition to the original 16 combination rules, this BitBlt supports 16 fail (for old paint mode) 17 fail (for old mask mode) 18 sourceWord + destinationWord 19 sourceWord - destinationWord 20 rgbAdd: sourceWord with: destinationWord 21 rgbSub: sourceWord with: destinationWord 22 OLDrgbDiff: sourceWord with: destinationWord 23 OLDtallyIntoMap: destinationWord -- old vers doesn't clip to bit boundary 24 alphaBlend: sourceWord with: destinationWord 25 pixPaint: sourceWord with: destinationWord 26 pixMask: sourceWord with: destinationWord 27 rgbMax: sourceWord with: destinationWord 28 rgbMin: sourceWord with: destinationWord 29 rgbMin: sourceWord bitInvert32 with: destinationWord 30 alphaBlendConst: sourceWord with: destinationWord -- alpha passed as an arg 31 alphaPaintConst: sourceWord with: destinationWord -- alpha passed as an arg 32 rgbDiff: sourceWord with: destinationWord 33 tallyIntoMap: destinationWord 34 alphaBlendScaled: sourceWord with: destinationWord 35 alphaBlendScaled: sourceWord with: "unused here - only used by FXBlt" 36 alphaBlendScaled: sourceWord with: "unused here - only used by FXBlt" 37 rgbMul: sourceWord with: destinationWord 38 pixSwap: sourceWord with: destinationWord 39 pixClear: sourceWord with: destinationWord 40 fixAlpha: sourceWord with: destinationWord 41 rgbComponentAlpha: sourceWord with: destinationWord + 42 alphaScale: ignoredSourceWord with: destinationWord + 43 alphaUnscale: ignoredSourceWord with: destinationWord + 44 alphaBlendUnscaled: sourceWord with: destinationWord This implementation has also been fitted with an experimental "warp drive" that allows abritrary scaling and rotation (and even limited affine deformations) with all BitBlt storage modes supported. To add a new rule to BitBlt... 1. add the new rule method or methods in the category 'combination rules' of BBSim 2. describe it in the class comment of BBSim and in the class comment for BitBlt 3. add refs to initializeRuleTable in proper positions 4. add refs to initBBOpTable, following the pattern ! Item was changed: ----- Method: BitBltSimulation class>>initializeRuleTable (in category 'initialization') ----- initializeRuleTable "BitBltSimulation initializeRuleTable" "**WARNING** You MUST change initBBOpTable if you change this" OpTable := #( "0" clearWord:with: "1" bitAnd:with: "2" bitAndInvert:with: "3" sourceWord:with: "4" bitInvertAnd:with: "5" destinationWord:with: "6" bitXor:with: "7" bitOr:with: "8" bitInvertAndInvert:with: "9" bitInvertXor:with: "10" bitInvertDestination:with: "11" bitOrInvert:with: "12" bitInvertSource:with: "13" bitInvertOr:with: "14" bitInvertOrInvert:with: "15" destinationWord:with: "16" destinationWord:with: "unused - was old paint" "17" destinationWord:with: "unused - was old mask" "18" addWord:with: "19" subWord:with: "20" rgbAdd:with: "21" rgbSub:with: "22" OLDrgbDiff:with: "23" OLDtallyIntoMap:with: "24" alphaBlend:with: "25" pixPaint:with: "26" pixMask:with: "27" rgbMax:with: "28" rgbMin:with: "29" rgbMinInvert:with: "30" alphaBlendConst:with: "31" alphaPaintConst:with: "32" rgbDiff:with: "33" tallyIntoMap:with: "34" alphaBlendScaled:with: "35" alphaBlendScaled:with: "unused here - only used by FXBlt" "36" alphaBlendScaled:with: "unused here - only used by FXBlt" "37" rgbMul:with: "38" pixSwap:with: "39" pixClear:with: "40" fixAlpha:with: "41" rgbComponentAlpha:with: + "42" alphaScale:with: + "43" alphaUnscale:with: + "44" alphaBlendUnscaled:with: ). OpTableSize := OpTable size + 1. "0-origin indexing" ! Item was added: + ----- Method: BitBltSimulation>>alphaBlendUnscaled:with: (in category 'combination rules') ----- + alphaBlendUnscaled: sourceWord with: destinationWord + "Blend sourceWord with destinationWord using the alpha value from both sourceWord and destinationWord. + Alpha is encoded as 0 meaning 0.0, and 255 meaning 1.0. + The alpha channel and color produced are + + srcAlpha + (destAlpha*(1-srcAlpha)) + (srcAlpha*srcColor + (destAlpha*(1-srcAlpha)*dstColor)) / (srcAlpha + (destAlpha*(1-srcAlpha))) + + In contrast to alphaBlend:with: the method does not assume that destination form is opaque. + In contrast to alphaBlendScaled:with: the method does not assume that colors have been pre-scaled (muliplied) by alpha channel." + | alpha blendA result blendRB blendG | + + + + + + + + + + alpha := sourceWord >> 24. "High 8 bits of source pixel, assuming ARGB encoding" + alpha = 0 ifTrue: [ ^ destinationWord ]. + alpha = 255 ifTrue: [ ^ sourceWord ]. + + blendA := 16rFF * alpha + (16rFF - alpha * (destinationWord >> 24)) + 16rFF. "blend alpha channels" + blendA := blendA + (blendA - 1 >> 8 bitAnd: 16rFF) >> 8 bitAnd: 16rFF. "divide by 255" + + blendRB := ((sourceWord bitAnd: 16rFF00FF) * alpha) + + ((destinationWord bitAnd: 16rFF00FF) * (blendA-alpha)) + / blendA. "blend red and blue" + + blendG := ((sourceWord bitAnd: 16r00FF00) * alpha) + + ((destinationWord bitAnd: 16r00FF00) * (blendA-alpha)) + / blendA. "blend green" + result := (blendRB bitOr: blendG) bitOr: blendA << 24. + ^ result + ! Item was added: + ----- Method: BitBltSimulation>>alphaScale:with: (in category 'combination rules') ----- + alphaScale: sourceWord with: destinationWord + "Scale (premultiply) the destination with its alpha channel. + Note that sourceWord is ignored." + | alpha rb g | + "Do NOT inline this into optimized loops" + + + + + + + alpha := destinationWord >> 24. "High 8 bits is opacity (ARGB format)" + rb := ((destinationWord bitAnd: 16rFF00FF) * alpha >> 8 bitAnd: 16rFF00FF). "scale red and blue components" + g := ((destinationWord bitAnd: 16r00FF00) * alpha >> 8 bitAnd: 16r00FF00). "scale green component" + ^(g bitOr: rb) bitOr: (destinationWord bitAnd: 16rFF000000) "recompose"! Item was added: + ----- Method: BitBltSimulation>>alphaUnscale:with: (in category 'combination rules') ----- + alphaUnscale: sourceWord with: destinationWord + "Unscale (divide) the destination with its alpha channel. + Note that sourceWord is ignored." + | alpha rb g rgb carry | + "Do NOT inline this into optimized loops" + + + + + + + + + alpha := destinationWord >> 24. "High 8 bits is opacity (ARGB format)" + alpha = 0 ifTrue: [^0]. + rb := (destinationWord bitAnd: 16rFF00FF) << 8 / alpha. "unscale red and blue components" + g := (destinationWord bitAnd: 16r00FF00) / alpha. "unscale green component" + carry := ((rb >> 8 bitAnd: 16rAA00AA) >> 1 bitOr: (rb >> 8 bitAnd: 16r550055) << 1) + bitOr: ((g bitAnd: 16r00AA00) >> 1 bitOr: (g bitAnd: 16r005500) << 1). + carry := (carry bitAnd: 16rCCCCCC) >> 2 bitOr: (carry bitAnd: 16r333333) << 2. + carry := (carry bitAnd: 16rF0F0F0) >> 4 bitOr: (carry bitAnd: 16r0F0F0F) << 4. + rgb := (rb bitAnd: 16rFF00FF) bitOr: (g << 8 bitAnd: 16r00FF00). + rgb := rgb bitOr: carry. "saturate RGB components if division overflows" + ^rgb bitOr: (destinationWord bitAnd: 16rFF000000) "restore alpha"! Item was changed: ----- Method: BitBltSimulation>>initBBOpTable (in category 'initialize-release') ----- initBBOpTable self cCode: 'opTable[0+1] = (void *)clearWordwith'. self cCode: 'opTable[1+1] = (void *)bitAndwith'. self cCode: 'opTable[2+1] = (void *)bitAndInvertwith'. self cCode: 'opTable[3+1] = (void *)sourceWordwith'. self cCode: 'opTable[4+1] = (void *)bitInvertAndwith'. self cCode: 'opTable[5+1] = (void *)destinationWordwith'. self cCode: 'opTable[6+1] = (void *)bitXorwith'. self cCode: 'opTable[7+1] = (void *)bitOrwith'. self cCode: 'opTable[8+1] = (void *)bitInvertAndInvertwith'. self cCode: 'opTable[9+1] = (void *)bitInvertXorwith'. self cCode: 'opTable[10+1] = (void *)bitInvertDestinationwith'. self cCode: 'opTable[11+1] = (void *)bitOrInvertwith'. self cCode: 'opTable[12+1] = (void *)bitInvertSourcewith'. self cCode: 'opTable[13+1] = (void *)bitInvertOrwith'. self cCode: 'opTable[14+1] = (void *)bitInvertOrInvertwith'. self cCode: 'opTable[15+1] = (void *)destinationWordwith'. self cCode: 'opTable[16+1] = (void *)destinationWordwith'. self cCode: 'opTable[17+1] = (void *)destinationWordwith'. self cCode: 'opTable[18+1] = (void *)addWordwith'. self cCode: 'opTable[19+1] = (void *)subWordwith'. self cCode: 'opTable[20+1] = (void *)rgbAddwith'. self cCode: 'opTable[21+1] = (void *)rgbSubwith'. self cCode: 'opTable[22+1] = (void *)OLDrgbDiffwith'. self cCode: 'opTable[23+1] = (void *)OLDtallyIntoMapwith'. self cCode: 'opTable[24+1] = (void *)alphaBlendwith'. self cCode: 'opTable[25+1] = (void *)pixPaintwith'. self cCode: 'opTable[26+1] = (void *)pixMaskwith'. self cCode: 'opTable[27+1] = (void *)rgbMaxwith'. self cCode: 'opTable[28+1] = (void *)rgbMinwith'. self cCode: 'opTable[29+1] = (void *)rgbMinInvertwith'. self cCode: 'opTable[30+1] = (void *)alphaBlendConstwith'. self cCode: 'opTable[31+1] = (void *)alphaPaintConstwith'. self cCode: 'opTable[32+1] = (void *)rgbDiffwith'. self cCode: 'opTable[33+1] = (void *)tallyIntoMapwith'. self cCode: 'opTable[34+1] = (void *)alphaBlendScaledwith'. self cCode: 'opTable[35+1] = (void *)alphaBlendScaledwith'. self cCode: 'opTable[36+1] = (void *)alphaBlendScaledwith'. self cCode: 'opTable[37+1] = (void *)rgbMulwith'. self cCode: 'opTable[38+1] = (void *)pixSwapwith'. self cCode: 'opTable[39+1] = (void *)pixClearwith'. self cCode: 'opTable[40+1] = (void *)fixAlphawith'. + self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'. + self cCode: 'opTable[42+1] = (void *)alphaScalewith'. + self cCode: 'opTable[43+1] = (void *)alphaUnscalewith'. + self cCode: 'opTable[44+1] = (void *)alphaBlendUnscaledwith'.! - self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'.! From notifications at github.com Wed Dec 23 20:56:56 2020 From: notifications at github.com (Nicolas Cellier) Date: Wed, 23 Dec 2020 12:56:56 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Proposal for new BitBlt rules (#505) In-Reply-To: References: Message-ID: WIP http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2909.diff -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505#issuecomment-750471145 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Dec 23 21:39:18 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 23 Dec 2020 13:39:18 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Proposal for new BitBlt rules (#505) In-Reply-To: References: Message-ID: <191B5D0F-41BC-4FAD-9F13-DB20BDDB04B1@rowledge.org> > On 2020-12-23, at 12:56 PM, Nicolas Cellier wrote: > > > WIP http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2909.diff Without having actually looked into this I just want ot wave a flag to remind us all to be sure it integrates ok with the ARM special purpose bitlbt routines. Also, we *might* just possibly be getting the gift of some Ben Avison time to make the 64bit ARM equivalents. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: MBR: Move Bits Randomly From notifications at github.com Thu Dec 24 12:41:25 2020 From: notifications at github.com (Ben Coman) Date: Thu, 24 Dec 2020 04:41:25 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] More manual cmake settings management (#543) Message-ID: The previous WIP PR was copying the template file to "CMakeSettings.jsonx" (notice the x on the end). When changed to copy over actual user "CMakeSettings.json", Visual Studio was automatically re-parsing "CMakeSettings.json" and the info messages didn't get shown long enough to understand what was happening. So I believe copying the template over the user build settings will need to be a manual operation per this PR. You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/543 -- Commit Summary -- * Use download_project to get libffi at configure time. * We cannot validate the class of a ByteString only, we need to check ByteSymbol and maybe there are others users of this. * Split FFI feature into FEATURE_FFI and FEATURE_THREADED_FFI * Fixing socket plugin options for OSX * Added Linux cmake helper * Merge branch 'feat/obs-packaging' of github.com:pharo-project/opensmalltalk-vm into feat/obs-packaging * Fixed types for Unix * The exception handle should be the last called, * Fix link to uuid on OSX * Merge remote-tracking branch 'origin/headless' into feat/obs-packaging * Fixes to restore cmake builds * Simplify windows build and make it the same as cygwin * Adding configuration to detect in which thread to show the exceptions * Adding filter for showing exceptions in windows. Many libraries handles the errors locally, and out handler is global * Merge pull request #122 from tesonep/improving-windows-error-reporting * Merge branch 'headless' into aarch64 * - Moving memory access primitives * Adding needed macros * Compiling the old FFI plugin in windows clang * Simplify dependency download for windows * Fix getCrashDumpFilenameInto buffer size * Fixing the macro name * Moving the ManualSurface to the SurfacePlugin * Implementing more FFI primitives in the VM * Fixing OS_TYPE to recognize windows on 32 bits images * Fix File Plugin to make it work on 32bit systems * Adding type information to variable that is expected to be used in comparison * Fixing the type of the argument before using it. * Add Freetype support for windows * Adding a cast in the call to SQABS functions * Fixing flag declaration * [improvement] add test on type inference * [fix] integer wasn't big enough for a test, fix longPrintOop: type conflict * [improvement] add a activable error for type conflicts * Improving the generation MoveRMwr * [improvement] better name for instance variable * Removing unused methods in the implementation * [improvement] add accessor to set stopOnError * [fix] simple type fixing for the stackVM * [fix] fixing last StackInterpreter types conflict. This one might be dangerous. * Cross-platform vmmaker bootstrap done for Windows * Fixing missing case for MoveMbrR * Pass on Libgit installation and sockets plugin for windows * Fixing instruction length and calculus of literal usage. * Make linux search for libraries in the system instead of compiling them * Make the new cmake configuration work for osx * Adding tests and a new instruction * Fix superclass * Fix typing of fetchLong32: fieldIndex ofFloatObject: oop correctly * Moving stuff around to clean dependencies * Removing reverse dependency * Fixing Baseline * Cleanups * Organizing Slang in tags * More dependency cleanups, starting separating type inference * Adding tests for the memory access JIT primitives and fixing the missing instructions * Returning a value to comply with the translation to C * The machine implementatio of primitiveAt should not SignExtend the numbers. * Merge branch 'feat/libffi-windows' into Windows-vmmaker-bootstrap * Fixing encoding of instruction CmpCqR and adding tests. * Remove PThreaded plugin * Merge 3152f2f6734f5b3d01e2cbd04bd8ef0ba2f21852 * Put back cairo download * Merge CCode Generator * Fix obsolete reference * Making the build pass * Uncommenting Cogit generation * Restore sq.h * Recover inheritance rules of cogit and memory... * Do not check for bindingOf: in classes * Correct the control flow * Remove halt * Fix options * Restore preamble * Merge pull request #124 from bencoman/Windows-vmmaker-bootstrap * VMMaker for OSX * Rely on Slang Type inference * Fix primitive compilation * Fix externalPrimitiveTable for simulation * Merge 8353b0f4b952c59c7a8d0ad4dfbd27fcb736d6f9 * Fix conflicting instance variable * Fixing last merge details * Moving CArray + friends to Slang * Fix broken global reference * Add Linux vmmaker build support * Merge branch 'headless' into feat/libffi-windows * Fix assertion warnings * Do not download cairo on linux * Make download scripts depend on the platform and not on the CMake installation * Fix not->NOT syntax error * make SDL2 to be able to prefer downloads * Make PHARO_DEPENDENCIES_PREFER_DOWNLOAD_BINARIES true by default in the CI * Make use of the correct SLD2 binary for the platform * Fixing copy paths of downloaded libraries * Make use of -DPHARO_DEPENDENCIES_PREFER_DOWNLOAD_BINARIES=TRUE in non-windows too * linking libffi when not found too * Make system libffi controllable * Same download pattern for Git2 * Same download pattern for Git2 * Fix syntax error * Same build pattern for freetype * Try to fix DownloadProject PATH * use different version of pixman * Libgit other libraries * fix non windows names * Fix libgit1 url for unix * Fix libgit1 url for unix * Make OSX come before Unix * Pass on libffi for Cygwin * Disable PIC only on CYGWIN * Fix includes libffi * making libffi imports global * Merge pull request #126 from pharo-project/enh/split-slang2 * Merge branch 'headless' into fix/assertion-warning * Merge pull request #128 from pharo-project/fix/assertion-warning * Fixing upload archive names and keep them backward compatible * Merge remote-tracking branch 'origin/headless' into feat/libffi-windows * Surface plugin depends on FFI * Push up jitMehtod * First test on block * Start StackBuilderRefactor * [fix] fix theo's code * Remove start of refactoring * Merge ffb424cb9abcef0cb60aa951498eb0bfddb143f3 * Start new test with class not installed in class table * [improvement] get bytecode address for an index + a method, more readeable. * Merge 2f7099ea3ad8040f137acf15acdf85a650f6cbe6 * [improvement] add automatically set of IP, should be tested * [fix] fix accessor depth calculation in the simulation * [improvement] one more (failing) test about block closure :) * [fix] fixed a message send to the right message, probably a failled merge * Use shell cp to copy files * [improvement] we shouldn't need to set the instruction pointer by hand anymore. * Remove fall back case when an the receiver was not a context * Remove a weird check to know if the result was a Float Nan * Removing unused primitiveScanCharacters * [improvement] use a method rather than inlining it in generation * [improvement] remove most Ccode: strings in interpreter primitives * Merge branch 'headless' into gc-tests * Merging all tests. * packaging inside the right directory * Remove test for pre Spur creation path * Add test for copy variable, PC and numArgs for Closure * [fix] woups, typo * Removing the dummy implmentation of the security plugin * Avoid negative logic when possible. * try to get git short hash * Merge pull request #137 from bencoman/Change-to-DOWNLOAD_DEPENDENCIES * Use architecture qualified platform names * Merge branch 'feat/libffi-windows' of github.com:pharo-project/opensmalltalk-vm into feat/libffi-windows * Merge pull request #127 from pharo-project/feat/libffi-windows * Merge pull request #135 from pharo-project/removeCCodeStrings * Merge pull request #133 from tesonep/removing-unused-scanner-primitive * Merge pull request #130 from pharo-project/setInstructionPointerAutomatically * Merge pull request #136 from tesonep/removing-security-plugin * Merge branch 'headless' into BlockTest * Adding TestLibrary and fixing some problems * Fixing the DEBUG for building from the command line * WIP proposed template management of CMakeSettings.json * Marking functions as export * Fix typos in Freetype building * Fix dependencies on git2 building * sqManualSurface does not really depend on FFI * Remove old FFI from the build as it does not work on ARM64 * Remove old libFFI configuration * Correctly set the target compilation processor as the target CPU * Testing in the CI * Testing in the CI * Merge pull request #129 from pharo-project/BlockTest * Merge pull request #132 from pharo-project/FloatNan * remove syntaxed error test. We'll get it back from the current development branch * Merge pull request #143 from hogoww/headless * Fix freetype dependency resolution. Set it only if found * Combine GNUISATION feature with JIT flavoured vm construction. * Properly initialize maxStackFramesToPrint to 0 * Properly initialize mutex * Cleaner flushICacheFromTo transpilation putting processor as implicit => this helps avoiding macro in MSVCs * Take sigjmp support and JIT api into separate header files. * Include pharovm in the includes to build * Cleanups in flushCache => remove the processor variable and hide it inside a not generated method that is replaced by a C implementation * Merge branch 'enh/stack-windows-arm64' of https://github.com/guillep/opensmalltalk-vm into enh/stack-windows-arm64 * Making Cairo to not find the one in the OS * In Windows the epoch is from 1601, convert it to Pharo's 1901 * Put longjmp support in a single place * Added StackWalk for ARM64 * Properly define permission flags on Windows * Use _WIN32 preprocessor macro instead of WIN64 * Better comment for windows UTC time conversion * Merge remote-tracking branch 'origin/headless' into enh/stack-windows-arm64 * Merge pull request #140 from pharo-project/adding-TestLibrary * Merge remote-tracking branch 'origin/headless' into enh/stack-windows-arm64 * [improvement] temps & arguments are now set automatically from method oop, and throw errors when there's a missmatch (see tests) * Making it work on OBS * Adding variable to modify the pharo script * Merge branch 'headless' into obs-final-shandaun * Removing unused dependency * Testing FFI on Win32 * Fixing the build in unix * Merge branch 'headless' into gc-tests * Generating 32 and 64 bits source code at the same time. * Adding author guard * Fixing the CMake variables * Fixing IA32ABI plugin * Fixing the upload of files * Fixing stockReplacement * Fix stash and unstash * Having compatibility with Debian 9 * Merge branch 'headless' into obs-final-shandaun * Merge branch 'obs-final-shandaun' of https://github.com/tesonep/opensmalltalk-vm into obs-final-shandaun * Fixing the semantic difference between add_definitions and add_compiler_definitions * Fixing the macros to work with older versions of CMake * Removing unused option * Changing to CoInterpreter flavour * The BIN Path is different depending where we are * Do not need to specify output directory * WIN64 => _Win32 * Make FFI Test Library compile under clang-cl * clang cl does not need to redefine sigjmp * Cut addLibraryWithRPATH with addIndependentLibraryWithRPATH * Remove target directory from add_third_party_dependency calls * Do not compile sigjmp alternative versions if clang. * Add stack description for x86 * Fixing ASN1_STRING_get0_data not available in older versions * Getting the full path of the VM executable on windows requires using GetModuleFileName to get the unicode version of it * Merge pull request #146 from tesonep/obs-final-shandaun * Using mirror repositories for libffi and SDL2 * [cleanup] use #baseHeader insteand of #longAt: variants * Merge pull request #121 from pharo-project/gc-tests * Making tests green * First Lowcode removal * Cleanups of lowcode Class var usages * More Cleanups * More lowcode related cleanups * More cleanups * Merge remote-tracking branch 'origin/headless' into enh/stack-windows-arm64 * Merge remote-tracking branch 'origin/headless' into enh/stack-windows-arm64 * Pass on install paths * Make libffi available in the bundle * Avoid treating AIO event twice * Merge pull request #149 from guillep/cleanup/lowcode * Fix conditionals * Merge pull request #147 from guillep/enh/stack-windows-arm64 * Merge pull request #150 from guillep/fix/aio * Fix message * Merge pull request #151 from gstraube/patch-1 * Merge pull request #148 from hogoww/gc-tests * Merge pull request #145 from hogoww/methodOopSetsLocalVar * Merge branch 'headless' into Introduce-CMakeSettings-json-template * Merge pull request #142 from bencoman/Introduce-CMakeSettings-json-template * More manual CMakeSettings management. -- File Changes -- D .appveyor.yml (141) D .clang_complete (9) D .git_filters/RevDateURL.clean (6) D .git_filters/RevDateURL.smudge (40) M .gitattributes (75) D .gitconfig (6) A .github/workflows/continuous-integration-workflow.yaml (121) M .gitignore (632) A .project (3) D .travis.yml (163) M CMakeLists.txt (865) A CMakeSettings.json.template (149) A Jenkinsfile (269) A PharoConsole.exe.manifest (31) A PharoConsole.rc (28) A PharoDLL.rc (26) M README.md (366) D build.linux32ARMv6/HowToBuild (263) D build.linux32ARMv6/asasm (0) D build.linux32ARMv6/editnewspeakinstall.sh (37) D build.linux32ARMv6/editpharoinstall.sh (22) D build.linux32ARMv6/makeall (10) D build.linux32ARMv6/makeallclean (10) D build.linux32ARMv6/makeallmakefiles (12) D build.linux32ARMv6/makeproduct (10) D build.linux32ARMv6/makeproductclean (10) D build.linux32ARMv6/newspeak.cog.spur/build.assert/mvm (31) D build.linux32ARMv6/newspeak.cog.spur/build.debug/mvm (31) D build.linux32ARMv6/newspeak.cog.spur/build/mvm (31) D build.linux32ARMv6/newspeak.cog.spur/makeallclean (15) D build.linux32ARMv6/newspeak.cog.spur/makealldirty (15) D build.linux32ARMv6/newspeak.cog.spur/plugins.ext (3) D build.linux32ARMv6/newspeak.cog.spur/plugins.int (28) D build.linux32ARMv6/newspeak.stack.spur/build.assert/mvm (31) D build.linux32ARMv6/newspeak.stack.spur/build.debug/mvm (31) D build.linux32ARMv6/newspeak.stack.spur/build/mvm (31) D build.linux32ARMv6/newspeak.stack.spur/makeallclean (15) D build.linux32ARMv6/newspeak.stack.spur/makealldirty (15) D build.linux32ARMv6/newspeak.stack.spur/plugins.ext (3) D build.linux32ARMv6/newspeak.stack.spur/plugins.int (28) D build.linux32ARMv6/pharo.cog.spur/build.assert/mvm (35) D build.linux32ARMv6/pharo.cog.spur/build.debug/mvm (35) D build.linux32ARMv6/pharo.cog.spur/build/mvm (58) D build.linux32ARMv6/pharo.cog.spur/makeallclean (15) D build.linux32ARMv6/pharo.cog.spur/makealldirty (15) D build.linux32ARMv6/pharo.cog.spur/plugins.ext (17) D build.linux32ARMv6/pharo.cog.spur/plugins.ext.all (12) D build.linux32ARMv6/pharo.cog.spur/plugins.int (36) D build.linux32ARMv6/pharo.cog.spur/prepare-rpi.sh (65) D build.linux32ARMv6/squeak.cog.spur/build.assert/mvm (30) D build.linux32ARMv6/squeak.cog.spur/build.debug/mvm (30) D build.linux32ARMv6/squeak.cog.spur/build/mvm (30) D build.linux32ARMv6/squeak.cog.spur/makeallclean (15) D build.linux32ARMv6/squeak.cog.spur/makealldirty (15) D build.linux32ARMv6/squeak.cog.spur/plugins.ext (17) D build.linux32ARMv6/squeak.cog.spur/plugins.int (41) D build.linux32ARMv6/squeak.stack.spur/build.assert/mvm (30) D build.linux32ARMv6/squeak.stack.spur/build.debug/mvm (30) D build.linux32ARMv6/squeak.stack.spur/build/mvm (30) D build.linux32ARMv6/squeak.stack.spur/makeallclean (15) D build.linux32ARMv6/squeak.stack.spur/makealldirty (15) D build.linux32ARMv6/squeak.stack.spur/plugins.ext (12) D build.linux32ARMv6/squeak.stack.spur/plugins.int (39) D build.linux32ARMv6/squeak.stack.v3/build.assert/mvm (29) D build.linux32ARMv6/squeak.stack.v3/build.debug/mvm (29) D build.linux32ARMv6/squeak.stack.v3/build/mvm (29) D build.linux32ARMv6/squeak.stack.v3/makeallclean (15) D build.linux32ARMv6/squeak.stack.v3/makealldirty (15) D build.linux32ARMv6/squeak.stack.v3/plugins.ext (12) D build.linux32ARMv6/squeak.stack.v3/plugins.int (39) D build.linux32ARMv6/third-party/Makefile.lib.extra (29) D build.linux32ARMv6/third-party/Makefile.libgit2 (56) D build.linux32ARMv6/third-party/Makefile.libsdl2 (46) D build.linux32ARMv6/third-party/Makefile.libssh2 (46) D build.linux32ARMv6/third-party/mvm (13) D build.linux32ARMv7/HowToBuild (259) D build.linux32ARMv7/editnewspeakinstall.sh (37) D build.linux32ARMv7/makeall (10) D build.linux32ARMv7/makeallclean (10) D build.linux32ARMv7/makeproduct (10) D build.linux32ARMv7/makeproductclean (10) D build.linux32ARMv7/newspeak.cog.spur/build.assert/mvm (30) D build.linux32ARMv7/newspeak.cog.spur/build.debug/mvm (30) D build.linux32ARMv7/newspeak.cog.spur/build/mvm (30) D build.linux32ARMv7/newspeak.stack.spur/build.assert/mvm (30) D build.linux32ARMv7/newspeak.stack.spur/build.debug/mvm (30) D build.linux32ARMv7/newspeak.stack.spur/build/mvm (30) D build.linux32x86/HowToBuild (307) D build.linux32x86/bochsx64/conf.COG (54) D build.linux32x86/bochsx64/conf.COG.dbg (53) D build.linux32x86/bochsx64/exploration/Makefile (32) D build.linux32x86/bochsx64/makeem (3) D build.linux32x86/bochsx86/conf.COG (56) D build.linux32x86/bochsx86/makeem (3) D build.linux32x86/editnewspeakinstall.sh (37) D build.linux32x86/editpharoinstall.sh (22) D build.linux32x86/gdbarm32/conf.COG (19) D build.linux32x86/gdbarm32/makeem (4) D build.linux32x86/makeall (10) D build.linux32x86/makeallclean (10) D build.linux32x86/makeallmakefiles (12) D build.linux32x86/makeproduct (10) D build.linux32x86/makeproductclean (10) D build.linux32x86/newspeak.cog.spur/build.assert.itimerheartbeat/mvm (39) D build.linux32x86/newspeak.cog.spur/build.assert/mvm (41) D build.linux32x86/newspeak.cog.spur/build.debug.itimerheartbeat/mvm (39) D build.linux32x86/newspeak.cog.spur/build.debug/mvm (41) D build.linux32x86/newspeak.cog.spur/build.itimerheartbeat/mvm (43) D build.linux32x86/newspeak.cog.spur/build/mvm (45) D build.linux32x86/newspeak.cog.spur/makeallclean (15) D build.linux32x86/newspeak.cog.spur/makealldirty (15) D build.linux32x86/newspeak.cog.spur/plugins.ext (3) D build.linux32x86/newspeak.cog.spur/plugins.int (28) D build.linux32x86/newspeak.sista.spur/NotYetImplemented (0) D build.linux32x86/newspeak.sista.spur/makeallclean (15) D build.linux32x86/newspeak.sista.spur/makealldirty (15) D build.linux32x86/newspeak.sista.spur/plugins.ext (3) D build.linux32x86/newspeak.sista.spur/plugins.int (28) D build.linux32x86/newspeak.stack.spur/build.assert/mvm (41) D build.linux32x86/newspeak.stack.spur/build.debug/mvm (41) D build.linux32x86/newspeak.stack.spur/build/mvm (45) D build.linux32x86/newspeak.stack.spur/makeallclean (15) D build.linux32x86/newspeak.stack.spur/makealldirty (15) D build.linux32x86/newspeak.stack.spur/plugins.ext (3) D build.linux32x86/newspeak.stack.spur/plugins.int (28) D build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/mvm (39) D build.linux32x86/nsnac.cog.spur/build.assert/mvm (41) D build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/mvm (39) D build.linux32x86/nsnac.cog.spur/build.debug/mvm (41) D build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/mvm (43) D build.linux32x86/nsnac.cog.spur/build/mvm (45) D build.linux32x86/nsnac.cog.spur/makeallclean (15) D build.linux32x86/nsnac.cog.spur/makealldirty (15) D build.linux32x86/nsnac.cog.spur/plugins.ext (3) D build.linux32x86/nsnac.cog.spur/plugins.int (28) D build.linux32x86/pharo.cog.spur.lowcode/build.assert.itimerheartbeat/mvm (36) D build.linux32x86/pharo.cog.spur.lowcode/build.assert/mvm (39) D build.linux32x86/pharo.cog.spur.lowcode/build.debug.itimerheartbeat/mvm (36) D build.linux32x86/pharo.cog.spur.lowcode/build.debug/mvm (39) D build.linux32x86/pharo.cog.spur.lowcode/build.itimerheartbeat/mvm (57) D build.linux32x86/pharo.cog.spur.lowcode/build/mvm (59) D build.linux32x86/pharo.cog.spur.lowcode/makeallclean (15) D build.linux32x86/pharo.cog.spur.lowcode/makealldirty (15) D build.linux32x86/pharo.cog.spur.lowcode/plugins.ext (13) D build.linux32x86/pharo.cog.spur.lowcode/plugins.int (36) D build.linux32x86/pharo.cog.spur.minheadless/build.assert.itimerheartbeat/mvm (38) D build.linux32x86/pharo.cog.spur.minheadless/build.assert/mvm (51) D build.linux32x86/pharo.cog.spur.minheadless/build.debug.itimerheartbeat/mvm (38) D build.linux32x86/pharo.cog.spur.minheadless/build.itimerheartbeat/mvm (61) D build.linux32x86/pharo.cog.spur.minheadless/build/mvm (54) D build.linux32x86/pharo.cog.spur.minheadless/makeallclean (15) D build.linux32x86/pharo.cog.spur.minheadless/makealldirty (15) D build.linux32x86/pharo.cog.spur/build.assert.itimerheartbeat/mvm (37) D build.linux32x86/pharo.cog.spur/build.assert/mvm (40) D build.linux32x86/pharo.cog.spur/build.debug.itimerheartbeat/mvm (37) D build.linux32x86/pharo.cog.spur/build.debug/mvm (40) D build.linux32x86/pharo.cog.spur/build.itimerheartbeat/mvm (60) D build.linux32x86/pharo.cog.spur/build/mvm (62) D build.linux32x86/pharo.cog.spur/makeallclean (15) D build.linux32x86/pharo.cog.spur/makealldirty (15) D build.linux32x86/pharo.cog.spur/plugins.ext (17) D build.linux32x86/pharo.cog.spur/plugins.int (36) D build.linux32x86/pharo.sista.spur/build.assert.itimerheartbeat/mvm (46) D build.linux32x86/pharo.sista.spur/build.assert/mvm (46) D build.linux32x86/pharo.sista.spur/build.debug.itimerheartbeat/mvm (49) D build.linux32x86/pharo.sista.spur/build.debug/mvm (49) D build.linux32x86/pharo.sista.spur/build.itimerheartbeat/mvm (54) D build.linux32x86/pharo.sista.spur/build/mvm (55) D build.linux32x86/pharo.sista.spur/makeallclean (15) D build.linux32x86/pharo.sista.spur/makealldirty (15) D build.linux32x86/pharo.sista.spur/plugins.ext (15) D build.linux32x86/pharo.sista.spur/plugins.int (36) D build.linux32x86/pharo.stack.spur.lowcode/build.assert.itimerheartbeat/mvm (36) D build.linux32x86/pharo.stack.spur.lowcode/build.assert/mvm (39) D build.linux32x86/pharo.stack.spur.lowcode/build.debug.itimerheartbeat/mvm (36) D build.linux32x86/pharo.stack.spur.lowcode/build.debug/mvm (39) D build.linux32x86/pharo.stack.spur.lowcode/build.itimerheartbeat/mvm (57) D build.linux32x86/pharo.stack.spur.lowcode/build/mvm (59) D build.linux32x86/pharo.stack.spur.lowcode/makeallclean (15) D build.linux32x86/pharo.stack.spur.lowcode/makealldirty (15) D build.linux32x86/pharo.stack.spur.lowcode/plugins.ext (13) D build.linux32x86/pharo.stack.spur.lowcode/plugins.int (36) D build.linux32x86/squeak.cog.spur.immutability/build.assert/mvm (36) D build.linux32x86/squeak.cog.spur.immutability/build.debug/mvm (36) D build.linux32x86/squeak.cog.spur.immutability/build/mvm (40) D build.linux32x86/squeak.cog.spur.immutability/makeallclean (15) D build.linux32x86/squeak.cog.spur.immutability/makealldirty (15) D build.linux32x86/squeak.cog.spur.immutability/plugins.ext (16) D build.linux32x86/squeak.cog.spur.immutability/plugins.int (38) D build.linux32x86/squeak.cog.spur/build.assert.itimerheartbeat/mvm (36) D build.linux32x86/squeak.cog.spur/build.assert/mvm (36) D build.linux32x86/squeak.cog.spur/build.debug.itimerheartbeat/mvm (36) D build.linux32x86/squeak.cog.spur/build.debug/mvm (37) D build.linux32x86/squeak.cog.spur/build.itimerheartbeat/mvm (40) D build.linux32x86/squeak.cog.spur/build/mvm (40) D build.linux32x86/squeak.cog.spur/makeallclean (15) D build.linux32x86/squeak.cog.spur/makealldirty (15) D build.linux32x86/squeak.cog.spur/makethbdirty (15) D build.linux32x86/squeak.cog.spur/plugins.ext (16) D build.linux32x86/squeak.cog.spur/plugins.int (38) D build.linux32x86/squeak.cog.v3/build.assert.itimerheartbeat/mvm (34) D build.linux32x86/squeak.cog.v3/build.assert/mvm (34) D build.linux32x86/squeak.cog.v3/build.debug.itimerheartbeat/mvm (34) D build.linux32x86/squeak.cog.v3/build.debug/mvm (34) D build.linux32x86/squeak.cog.v3/build.itimerheartbeat/mvm (38) D build.linux32x86/squeak.cog.v3/build.multithreaded.assert/mvm (35) D build.linux32x86/squeak.cog.v3/build.multithreaded.debug/mvm (35) D build.linux32x86/squeak.cog.v3/build.multithreaded/mvm (39) D build.linux32x86/squeak.cog.v3/build/mvm (38) D build.linux32x86/squeak.cog.v3/makeallclean (15) D build.linux32x86/squeak.cog.v3/makealldirty (15) D build.linux32x86/squeak.cog.v3/plugins.ext (14) D build.linux32x86/squeak.cog.v3/plugins.int (38) D build.linux32x86/squeak.sista.spur/build.assert.itimerheartbeat/mvm (36) D build.linux32x86/squeak.sista.spur/build.assert/mvm (36) D build.linux32x86/squeak.sista.spur/build.debug.itimerheartbeat/mvm (36) D build.linux32x86/squeak.sista.spur/build.debug/mvm (36) D build.linux32x86/squeak.sista.spur/build.itimerheartbeat/mvm (40) D build.linux32x86/squeak.sista.spur/build/mvm (40) D build.linux32x86/squeak.sista.spur/makeallclean (15) D build.linux32x86/squeak.sista.spur/makealldirty (15) D build.linux32x86/squeak.sista.spur/plugins.ext (14) D build.linux32x86/squeak.sista.spur/plugins.int (38) D build.linux32x86/squeak.stack.spur/build.assert/mvm (37) D build.linux32x86/squeak.stack.spur/build.debug/mvm (37) D build.linux32x86/squeak.stack.spur/build/mvm (40) D build.linux32x86/squeak.stack.spur/makeallclean (15) D build.linux32x86/squeak.stack.spur/makealldirty (15) D build.linux32x86/squeak.stack.spur/plugins.ext (13) D build.linux32x86/squeak.stack.spur/plugins.int (38) D build.linux32x86/squeak.stack.v3/build.assert/mvm (36) D build.linux32x86/squeak.stack.v3/build.debug/mvm (36) D build.linux32x86/squeak.stack.v3/build/mvm (40) D build.linux32x86/squeak.stack.v3/makeallclean (15) D build.linux32x86/squeak.stack.v3/makealldirty (15) D build.linux32x86/squeak.stack.v3/plugins.ext (13) D build.linux32x86/squeak.stack.v3/plugins.int (38) D build.linux32x86/third-party/Makefile.lib.extra (27) D build.linux32x86/third-party/Makefile.libgit2 (65) D build.linux32x86/third-party/Makefile.libsdl2 (46) D build.linux32x86/third-party/Makefile.libssh2 (51) D build.linux32x86/third-party/Makefile.openssl (48) D build.linux32x86/third-party/Makefile.pkgconfig (38) D build.linux32x86/third-party/alsa-lib-1.0.17a/.gitignore (56) D build.linux32x86/third-party/alsa-lib-1.0.17a/COPYING (504) D build.linux32x86/third-party/alsa-lib-1.0.17a/ChangeLog (69) D build.linux32x86/third-party/alsa-lib-1.0.17a/INSTALL (122) D build.linux32x86/third-party/alsa-lib-1.0.17a/MEMORY-LEAK (13) D build.linux32x86/third-party/alsa-lib-1.0.17a/Makefile.am (34) D build.linux32x86/third-party/alsa-lib-1.0.17a/Makefile.in (724) D build.linux32x86/third-party/alsa-lib-1.0.17a/NOTES (56) D build.linux32x86/third-party/alsa-lib-1.0.17a/TODO (4) D build.linux32x86/third-party/alsa-lib-1.0.17a/acinclude.m4 (24) D build.linux32x86/third-party/alsa-lib-1.0.17a/aclocal.m4 (7262) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/Makefile.am (8) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/Makefile.in (528) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/alsalisp.c (110) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/hctl.lisp (91) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/hello.lisp (26) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/itest.lisp (1) D build.linux32x86/third-party/alsa-lib-1.0.17a/alsalisp/test.lisp (382) D build.linux32x86/third-party/alsa-lib-1.0.17a/aserver/COPYING (340) D build.linux32x86/third-party/alsa-lib-1.0.17a/aserver/Makefile.am (12) D build.linux32x86/third-party/alsa-lib-1.0.17a/aserver/Makefile.in (557) D build.linux32x86/third-party/alsa-lib-1.0.17a/aserver/aserver.c (1104) D build.linux32x86/third-party/alsa-lib-1.0.17a/autom4te.cache/output.0 (22836) D build.linux32x86/third-party/alsa-lib-1.0.17a/autom4te.cache/output.1 (22824) D build.linux32x86/third-party/alsa-lib-1.0.17a/autom4te.cache/requests (354) D build.linux32x86/third-party/alsa-lib-1.0.17a/autom4te.cache/traces.0 (9496) D build.linux32x86/third-party/alsa-lib-1.0.17a/autom4te.cache/traces.1 (693) D build.linux32x86/third-party/alsa-lib-1.0.17a/compile (142) D build.linux32x86/third-party/alsa-lib-1.0.17a/config.guess (1411) D build.linux32x86/third-party/alsa-lib-1.0.17a/config.sub (1500) D build.linux32x86/third-party/alsa-lib-1.0.17a/configure (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/configure.in (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/cvscompile (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/depcomp (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/Makefile.am (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/Makefile.in (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/README.1st (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/asoundrc.txt (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/doxygen.cfg.in (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/index.doxygen (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/pictures/Makefile.am (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/pictures/Makefile.in (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/pictures/wave1.gif (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/doc/pictures/wave2.gif (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/gitcompile (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/Makefile.am (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/Makefile.in (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/alisp.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/alsa (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/alsa-symbols.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/aserver.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/asoundef.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/asoundlib-head.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/asoundlib-tail.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/conf.h (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/config.h.in (0) D build.linux32x86/third-party/alsa-lib-1.0.17a/include/control.h (0) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/543.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/543.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/543 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Thu Dec 24 12:43:50 2020 From: notifications at github.com (Ben Coman) Date: Thu, 24 Dec 2020 04:43:50 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] More manual cmake settings management (#543) In-Reply-To: References: Message-ID: Closed #543. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/543#event-4147368537 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Thu Dec 24 12:43:50 2020 From: notifications at github.com (Ben Coman) Date: Thu, 24 Dec 2020 04:43:50 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] More manual cmake settings management (#543) In-Reply-To: References: Message-ID: whoops -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/543#issuecomment-750872455 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Thu Dec 24 14:24:42 2020 From: notifications at github.com (dcstes) Date: Thu, 24 Dec 2020 06:24:42 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540) In-Reply-To: References: Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On some Linux systems without PAM, it might be a possibility to use "prlimit" to set rtprio: https://serverfault.com/questions/889635/seting-rtprio-limit-in-system-without-pam For example with prlimit --rtprio=99 --pid= and then start squeak from that shell. If the Linux system has no /etc/security directory that's a possibility. Basically I think there are probably a great many different ways to achieve the goal of suppressing the "pthread_setsched" message. The current error message prints (1) a problem and (2) a Linux PAM specific cookbookish recipe to solve it. However the error message could be limited to just (1) print the problem, that's all ... The user has then to figure out for themselves how to solve it. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJf5KQ2AAoJEAwpOKXMq1MaA8oIAImkmyhtZepUSpbMYGalt2mj SdXKzaFkB3ja31q/coN4LQSajPqL0giUQfXodMG4oD2LzELQfUSZp/MIZxbmR6oF Ja/WZC64TjlgdKBHakDkDEJlHbUVn1ZXTCluyIHYafqZhbeXivlw4mkrrgRYgpHh FVBlliM6qrlH3eFU6X2mtjVzHI1TTNahPyw9skgeNRjThW3S1bnasGYPPTVJIoC0 ja/Ml/YNG08sAmEDVKzYC7G3VIqPCfFEHsGOOhJmXEYyJcUF7FoAfzSKSLZSKs4y iD6N/SME98BBUzzxtBF8wNg4jayqdGmxsCBnfqAAPQRNyDi4TL7O9oDWKaiDel8= =OJYO -----END PGP SIGNATURE----- -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/540#issuecomment-750896848 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Dec 25 03:13:08 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 25 Dec 2020 03:13:08 0000 Subject: [Vm-dev] VM Maker Inbox: VMMaker.oscog-dtl.2910.mcz Message-ID: A new version of VMMaker was added to project VM Maker Inbox: http://source.squeak.org/VMMakerInbox/VMMaker.oscog-dtl.2910.mcz ==================== Summary ==================== Name: VMMaker.oscog-dtl.2910 Author: dtl Time: 24 December 2020, 10:10:19.306764 pm UUID: eecad252-d9d1-4e76-ae46-d7e9ef61ac29 Ancestors: VMMaker.oscog-nice.2909 Let the image inform the interpreter that alternate bytecodes either are or are not in use, and remember the setting when writing or reading the image format number in a shapshot file header. Also support testing the current value of multipleBytecodeSetsActive, and listing the encoder names of supported bytecode sets. Add helper methods for string creation borrowed from OSPP. Adds two primitives: primitiveMultipleBytecodeSetsActive "Given one boolean parameter, set multipleBytecodeSetsActive to inform the VM that alternate bytecode sets such as SistaV1 are now in use and that the image format number should be updated accordingly. With zero parameters, answer the current value of multipleBytecodeSetsActive." primitiveBytecodeSetsAvailable "Answer the encoder names for the supported bytecode sets." =============== Diff against VMMaker.oscog-nice.2909 =============== Item was changed: VMClass subclass: #InterpreterPrimitives + instanceVariableNames: 'objectMemory messageSelector argumentCount newMethod primFailCode osErrorCode exceptionPC inFFIFlags profileMethod profileProcess profileSemaphore nextProfileTick preemptionYields newFinalization sHEAFn ffiExceptionResponse eventTraceMask multipleBytecodeSetsActive' - instanceVariableNames: 'objectMemory messageSelector argumentCount newMethod primFailCode osErrorCode exceptionPC inFFIFlags profileMethod profileProcess profileSemaphore nextProfileTick preemptionYields newFinalization sHEAFn ffiExceptionResponse eventTraceMask' classVariableNames: 'CrossedX EndOfRun MillisecondClockMask' poolDictionaries: 'VMBasicConstants VMBytecodeConstants VMMethodCacheConstants VMObjectIndices VMSqueakClassIndices VMStackFrameOffsets' category: 'VMMaker-Interpreter'! !InterpreterPrimitives commentStamp: 'eem 8/24/2018 11:05' prior: 0! InterpreterPrimitives implements most of the VM's core primitives. It is the root of the interpreter hierarchy so as to share the core primitives amongst the varioius interpreters. Instance Variables argumentCount ffiExceptionResponse inFFIFlags messageSelector newMethod nextProfileTick objectMemory (simulation only) preemptionYields primFailCode osErrorCode profileMethod profileProcess profileSemaphore secHasEnvironmentAccess argumentCount - the number of arguments of the current message ffiExceptionResponse - controls system response to exceptions during FFI calls. See primitiveFailForFFIException:at: inFFIFlags - flags recording currently only whether the system is in an FFI call messageSelector - the oop of the selector of the current message newMethod - the oop of the result of looking up the current message nextProfileTick - the millisecond clock value of the next profile tick (if profiling is in effect) objectMemory - the memory manager and garbage collector that manages the heap preemptionYields - a boolean controlling the process primitives. If true (old, incorrect, blue-book semantics) a preempted process is sent to the back of its run-queue. If false, a process preempted by a higher-priority process is put back at the head of its run queue, hence preserving cooperative scheduling within priorities. primFailCode - primitive success/failure flag, 0 for success, otherwise the reason code for failure osErrorCode - a 64-bit value settable by external primitives conveying arbitrary error codes from the operating system and/or system libraries profileMethod - the oop of the method at the time nextProfileTick was reached profileProcess - the oop of the activeProcess at the time nextProfileTick was reached profileSemaphore - the oop of the semaphore to signal when nextProfileTick is reached secHasEnvironmentAccess - the function to call to check if access to the envronment should be granted to primitiveGetenv ! Item was added: + ----- Method: InterpreterPrimitives>>cString:asCollection: (in category 'primitive support') ----- + cString: aCString asCollection: classIdentifier + "Answer a new collection, usually of type ByteArray or ByteString copied from + a null-terminated C string." + + | len newString | + + len := self strlen: aCString. + newString := self + instantiateClass: classIdentifier + indexableSize: len. + self strncpy: (self arrayValueOf: newString) + _: aCString + _: len. "(char *)strncpy()" + ^ newString + ! Item was added: + ----- Method: InterpreterPrimitives>>primitiveBytecodeSetsAvailable (in category 'other primitives') ----- + primitiveBytecodeSetsAvailable + "Answer the encoder names for the supported bytecode sets." + + | encoderNames | + argumentCount >0 ifTrue: + [^self primitiveFailFor: PrimErrBadNumArgs]. + encoderNames := self instantiateClass: self classArray indexableSize: 3. + self storePointer: 0 ofObject: encoderNames withValue: (self stringFromCString: 'EncoderForV3'). + self storePointer: 1 ofObject: encoderNames withValue: (self stringFromCString: 'EncoderForV3PlusClosures'). + self storePointer: 2 ofObject: encoderNames withValue: (self stringFromCString: 'EncoderForSistaV1'). + self pop: 1 thenPush: encoderNames. + ! Item was added: + ----- Method: InterpreterPrimitives>>primitiveMultipleBytecodeSetsActive (in category 'other primitives') ----- + primitiveMultipleBytecodeSetsActive + "Given one boolean parameter, set multipleBytecodeSetsActive to inform + the VM that alternate bytecode sets such as SistaV1 are now in use and + that the image format number should be updated accordingly. With zero + parameters, answer the current value of multipleBytecodeSetsActive." + + + argumentCount >1 ifTrue: + [^self primitiveFailFor: PrimErrBadNumArgs]. + argumentCount = 1 + ifTrue: [self stackTop = objectMemory trueObject + ifTrue: [self cppIf: MULTIPLEBYTECODESETS + ifTrue: [multipleBytecodeSetsActive := true] + ifFalse: [^self primitiveFailFor: PrimErrUnsupported]] + ifFalse: [self stackTop = objectMemory falseObject + ifTrue: [multipleBytecodeSetsActive := false] + ifFalse:[^self primitiveFailFor: PrimErrBadArgument]]]. + multipleBytecodeSetsActive + ifTrue: [self pop: argumentCount + 1 thenPush: objectMemory trueObject] + ifFalse: [self pop: argumentCount + 1 thenPush: objectMemory falseObject]. + ! Item was added: + ----- Method: InterpreterPrimitives>>stringFromCString: (in category 'primitive support') ----- + stringFromCString: aCString + "Answer a new ByteString copied from a null-terminated C string." + + + ^ self cString: aCString asCollection: self classString + ! Item was changed: InterpreterPrimitives subclass: #StackInterpreter (excessive size, no diff calculated) Item was changed: ----- Method: StackInterpreter class>>initializeMiscConstants (in category 'initialization') ----- initializeMiscConstants super initializeMiscConstants. STACKVM := true. "These flags function to identify a GC operation, or to specify what operations the leak checker should be run for." GCModeFull := 1. "stop-the-world global GC" GCModeNewSpace := 2. "Spur's scavenge, or V3's incremental" GCModeIncremental := 4. "incremental global gc (Dijkstra tri-colour marking); as yet unimplemented" GCModeBecome := 8. "v3 post-become sweeping/Spur forwarding" GCModeImageSegment := 16. "just a flag for leak checking image segments" GCModeFreeSpace := 32. "just a flag for leak checking free space; Spur only" GCCheckPrimCall := 64. "just a flag for leak checking external primitive calls" StackPageTraceInvalid := -1. StackPageUnreached := 0. StackPageReachedButUntraced := 1. StackPageTraced := 2. DumpStackOnLowSpace := 0. MillisecondClockMask := 16r1FFFFFFF. "Note: The external primitive table should actually be dynamically sized but for the sake of inferior platforms (e.g., Mac :-) who cannot allocate memory in any reasonable way, we keep it static (and cross our fingers...)" MaxExternalPrimitiveTableSize := 4096. "entries" MaxJumpBuf := 32. "max. callback depth" FailImbalancedPrimitives := InitializationOptions at: #FailImbalancedPrimitives ifAbsentPut: [true]. EnforceAccessControl := InitializationOptions at: #EnforceAccessControl ifAbsent: [true]. ReturnToInterpreter := 1. "setjmp/longjmp code." "Because of a hack with callbacks in the non-threaded VM they must not conflct with the VM's tag bits." DisownVMForFFICall := 16. + DisownVMForThreading := 32. + + "The multiple bytecodes active bit in the image format number" + MultipleBytecodeSetsBitmask := 512. + - DisownVMForThreading := 32 ! Item was changed: ----- Method: StackInterpreter>>readableFormat: (in category 'image save/restore') ----- readableFormat: imageVersion "Anwer true if images of the given format are readable by this interpreter. Allows a virtual machine to accept selected older image formats." + | imageVersionWithoutSistaBit | + imageVersionWithoutSistaBit := imageVersion bitAnd: ( -1 - MultipleBytecodeSetsBitmask). "Ignore multiple bytecode support identifier" + [imageVersionWithoutSistaBit = self imageFormatVersion "Float words in platform-order" - ^imageVersion = self imageFormatVersion "Float words in platform-order" or: [objectMemory hasSpurMemoryManagerAPI not "No compatibility version for Spur as yet" + and: [imageVersionWithoutSistaBit = self imageFormatCompatibilityVersion]]] "Float words in BigEndian order" + ifTrue: [multipleBytecodeSetsActive := imageVersion bitAnd: MultipleBytecodeSetsBitmask. "Remember the Sista bit" + ^ true]. + ^ false + ! - and: [imageVersion = self imageFormatCompatibilityVersion]] "Float words in BigEndian order"! Item was changed: ----- Method: StackInterpreter>>writeImageFileIO (in category 'image save/restore') ----- writeImageFileIO "Write the image header and heap contents to imageFile for snapshot. c.f. writeImageFileIOSimulation. The game below is to maintain 64-bit alignment for all putLong:toFile: occurrences." | imageName headerStart headerSize f imageBytes bytesWritten sCWIfn okToWrite | self cCode: [] inSmalltalk: [imageName := 'sooth compiler'. ^self writeImageFileIOSimulation]. "If the security plugin can be loaded, use it to check for write permission. If not, assume it's ok" sCWIfn := self ioLoadFunction: 'secCanWriteImage' From: 'SecurityPlugin'. sCWIfn ~= 0 ifTrue: [okToWrite := self cCode: '((sqInt (*)(void))sCWIfn)()'. okToWrite ifFalse:[^self primitiveFail]]. "local constants" headerStart := 0. headerSize := objectMemory wordSize = 4 ifTrue: [64] ifFalse: [128]. "header size in bytes; do not change!!" f := self sqImageFile: imageName Open: 'wb'. f = nil ifTrue: "could not open the image file for writing" [^self primitiveFail]. imageBytes := objectMemory imageSizeToWrite. headerStart := self sqImage: f File: imageName StartLocation: headerSize + imageBytes. self cCode: '/* Note: on Unix systems one could put an exec command here, padded to 512 bytes */'. "position file to start of header" self sqImageFile: f Seek: headerStart. + multipleBytecodeSetsActive + ifTrue: [self putWord32: (self imageFormatVersion bitOr: MultipleBytecodeSetsBitmask) toFile: f] + ifFalse: [self putWord32: self imageFormatVersion toFile: f]. - - self putWord32: self imageFormatVersion toFile: f. self putWord32: headerSize toFile: f. self putLong: imageBytes toFile: f. self putLong: objectMemory baseAddressOfImage toFile: f. self putLong: objectMemory specialObjectsOop toFile: f. self putLong: objectMemory newObjectHash toFile: f. self putLong: self getSnapshotScreenSize toFile: f. self putLong: self getImageHeaderFlags toFile: f. self putWord32: extraVMMemory toFile: f. self putShort: desiredNumStackPages toFile: f. self putShort: self unknownShortOrCodeSizeInKs toFile: f. self putWord32: desiredEdenBytes toFile: f. self putShort: (maxExtSemTabSizeSet ifTrue: [self ioGetMaxExtSemTableSize] ifFalse: [0]) toFile: f. self putShort: the2ndUnknownShort toFile: f. objectMemory hasSpurMemoryManagerAPI ifTrue: [self putLong: objectMemory firstSegmentBytes toFile: f. self putLong: objectMemory bytesLeftInOldSpace toFile: f. 2 timesRepeat: [self putLong: 0 toFile: f] "Pad the rest of the header."] ifFalse: [4 timesRepeat: [self putLong: 0 toFile: f]]. "Pad the rest of the header." objectMemory wordSize = 8 ifTrue: [3 timesRepeat: [self putLong: 0 toFile: f]]. "Pad the rest of the header." self assert: headerStart + headerSize = (self sqImageFilePosition: f). "position file after the header" self sqImageFile: f Seek: headerStart + headerSize. self successful ifFalse: "file write or seek failure" [self sqImageFileClose: f. ^nil]. "write the image data" objectMemory hasSpurMemoryManagerAPI ifTrue: [bytesWritten := objectMemory writeImageSegmentsToFile: f] ifFalse: [bytesWritten := self sq: (self pointerForOop: objectMemory baseAddressOfImage) Image: (self sizeof: #char) File: imageBytes Write: f]. self success: bytesWritten = imageBytes. self sqImageFileClose: f! From lewis at mail.msen.com Fri Dec 25 03:28:51 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Thu, 24 Dec 2020 22:28:51 -0500 Subject: [Vm-dev] VM Maker Inbox: VMMaker.oscog-dtl.2910.mcz Message-ID: <20201225032851.GA33070@shell.msen.com> This replaces VMMaker.oscog-dtl.2711 from the VMMaker inbox (9 February 2020), which I will move to treated. I merged the original submission, made a few changes, and added one new primitive based on earlier suggestions on vm-dev. This provides primitive support to allow the image to inform the VM that it can change the image format number from 68021 to 68533 after the image has been recompiled with SistaV1. It also provides a primitive for querying the VM for supported bytecode sets, such that this will work: Smalltalk supportedEncoders ==> {EncoderForV3 . EncoderForV3PlusClosures . EncoderForSistaV1} I am attaching a change set that illustrates the use of the two primitives. Dave -------------- next part -------------- 'From Squeak6.0alpha of 22 December 2020 [latest update: #20129] on 24 December 2020 at 9:48:09 pm'! "Change Set: DemonstrateMultipleByteCodePrimitives-dtl Date: 24 December 2020 Author: David T. Lewis Demonstrate primitiveMultipleBytecodeSetsActive and primitiveBytecodeSetsAvailable Show how the multiple bytecode support primitives might be used. Note that CompiledCode>>multipleBytecodeSetsActive: is already implemented in trunk. Smalltalk multipleBytecodeSetsActive ==> true Smalltalk supportedEncoders ==> {EncoderForV3 . EncoderForV3PlusClosures . EncoderForSistaV1} "! !SmalltalkImage methodsFor: 'vm bytecodes' stamp: 'dtl 12/24/2020 21:36'! availableByteCodeSets "Answer the encoder names for the bytecode sets supported by the VM." ! ! !SmalltalkImage methodsFor: 'vm bytecodes' stamp: 'dtl 12/24/2020 21:00'! multipleBytecodeSetsActive "Answer true if multiple bytecode support is active in the VM" ! ! !SmalltalkImage methodsFor: 'vm bytecodes' stamp: 'dtl 12/24/2020 21:09'! multipleBytecodeSetsActive: aBoolean "Inform the VM when multiple bytecode sets, typically the Sista bytecodes in addition to the traditional V3 bytecode set, are now in use is this image. The VM may use this information to update the image format number when saving the image to the file system." "This method is already implemented in trunk in class CompiledCode" ! ! !SmalltalkImage methodsFor: 'vm bytecodes' stamp: 'dtl 12/24/2020 20:58'! supportedEncoders "Answer the list of encoders that the VM can support" "Smalltalk supportedEncoders" ^ self availableByteCodeSets collect: [:e | Smalltalk classNamed: e] thenSelect: [ :e | e notNil ]! ! From commits at source.squeak.org Sat Dec 26 23:00:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 26 Dec 2020 23:00:15 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2910.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2910.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2910 Author: nice Time: 27 December 2020, 12:00:06.343561 am UUID: 32c46c83-0656-460a-8305-29ae2a93bffa Ancestors: VMMaker.oscog-nice.2909 Raise cog v3 VM compatibility to 1.17 Use a few forward compatibility messages to do so... This is not ideal for double byte and double word arrays which are not supported. Neither for word and float32 arrays that lack appropriate specialObject index... The goal is to have the squeak.cog.v3 to at least compile the new file and socket plugin versions... =============== Diff against VMMaker.oscog-nice.2909 =============== Item was changed: ----- Method: NewObjectMemory class>>vmProxyMinorVersion (in category 'api chacterization') ----- vmProxyMinorVersion "Define the VM_PROXY_MAJOR version for this VM as used to define the api in platforms/Cross/vm/sqVirtualMachine.[ch] and in interp.h." + ^17! - ^15 "isBooleanObject: & isPositiveMachineIntegerObject:"! Item was added: + ----- Method: ObjectMemory>>bytesPerElement: (in category 'forward compatibility') ----- + bytesPerElement: oop + "forward compatibility with Spur" + (self isImmediate: oop) ifTrue: + [^0]. + (self isWords: oop) ifTrue: + [^4]. + (self isBytes: oop) ifTrue: + [^1]. + ^self wordSize! Item was added: + ----- Method: ObjectMemory>>classDoubleByteArray (in category 'forward compatibility') ----- + classDoubleByteArray + "forward compatibility with Spur" + ^nil! Item was added: + ----- Method: ObjectMemory>>classDoubleWordArray (in category 'forward compatibility') ----- + classDoubleWordArray + "forward compatibility with Spur" + ^nil! Item was added: + ----- Method: ObjectMemory>>classFloat32Array (in category 'forward compatibility') ----- + classFloat32Array + "forward compatibility with Spur" + ^nil! Item was added: + ----- Method: ObjectMemory>>classFloat64Array (in category 'forward compatibility') ----- + classFloat64Array + "forward compatibility with Spur" + ^nil! Item was added: + ----- Method: ObjectMemory>>classWordArray (in category 'forward compatibility') ----- + classWordArray + "forward compatibility with Spur" + ^nil! Item was added: + ----- Method: ObjectMemory>>isLong64s: (in category 'forward compatibility') ----- + isLong64s: oop + "forward compatibility with Spur" + ^false! Item was added: + ----- Method: ObjectMemory>>isShorts: (in category 'forward compatibility') ----- + isShorts: oop + "forward compatibility with Spur" + ^false! Item was added: + ----- Method: ObjectMemory>>isWordsOrShorts: (in category 'forward compatibility') ----- + isWordsOrShorts: oop + "forward compatibility with Spur" + ^(self isShorts: oop) or: [self isWords: oop]! From noreply at github.com Sun Dec 27 09:34:42 2020 From: noreply at github.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 01:34:42 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d55941: Generate cog & stack v3 src code as of VMMaker.osc... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d559416c204475d431eb0cabce7aad1418d8e38b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d559416c204475d431eb0cabce7aad1418d8e38b Author: Nicolas Cellier Date: 2020-12-27 (Sun, 27 Dec 2020) Changed paths: M src/vm/cointerp.c M src/vm/cointerp.h M src/vm/gcc3x-cointerp.c M src/vm/interp.h M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c M stacksrc/vm/interp.h Log Message: ----------- Generate cog & stack v3 src code as of VMMaker.oscog-nice.2910 Raise cog v3 VM compatibility to 1.17 Use a few forward compatibility messages to do so... This is not ideal for double byte and double word arrays which are not supported. Neither for word and float32 arrays that lack appropriate specialObject index... The goal is to have the squeak.cog.v3 to at least compile the new file and socket plugin versions... From noreply at github.com Sun Dec 27 11:25:14 2020 From: noreply at github.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 03:25:14 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 509468: Salvage the stack builds Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 5094685a21c0c283228b5246855084e4e91c3e8f https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/5094685a21c0c283228b5246855084e4e91c3e8f Author: Nicolas Cellier Date: 2020-12-27 (Sun, 27 Dec 2020) Changed paths: M platforms/Mac OS/vm/sqPlatformSpecific.h M platforms/iOS/vm/OSX/sqPlatformSpecific.h M platforms/iOS/vm/iPhone/sqPlatformSpecific.h M platforms/minheadless/unix/sqPlatformSpecific-Unix.h M platforms/minheadless/windows/sqPlatformSpecific-Win32.h M platforms/unix/vm/sqPlatformSpecific.h M platforms/win32/vm/sqPlatformSpecific.h Log Message: ----------- Salvage the stack builds For some reasons (?) the VM_LABEL macro is now barking like this: >../../spurstack64src/vm/gcc3x-interp.c:9419:5: error: invalid symbol redefinition > VM_LABEL(extPushPseudoVariable); > ^ >In file included from ../../spurstack64src/vm/gcc3x-interp.c:29: >In file included from ../../platforms/iOS/vm/Common/sqGnu.h:46: >In file included from ../../platforms/Cross/vm/sq.h:252: >../../platforms/iOS/vm/OSX/sqPlatformSpecific.h:174:52: note: expanded from macro 'VM_LABEL' ># define VM_LABEL(foo) asm("\n.globl _L" #foo "\n_L" #foo ":") > ^ >:3:1: note: instantiated into assembly here >_LextPushPseudoVariable: >^ Since this does not happen in cog builds, avoid brainstorming and just use the same workaround. From no-reply at appveyor.com Sun Dec 27 12:32:08 2020 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 27 Dec 2020 12:32:08 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2330 Message-ID: <20201227123208.1.CE0CD1DDB3752A52@appveyor.com> An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Sun Dec 27 13:51:44 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 14:51:44 +0100 Subject: [Vm-dev] Small discrepancy in fileTimesInUTC between simulation & VM Message-ID: Hi all, Eliot, Simulation says: ^(Smalltalk vmParameterAt: 48) anyMask: 128 VM says: ^imageHeaderFlags anyMask: 512 Is the difference intentional? -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sun Dec 27 14:28:16 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 14:28:16 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2911.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2911.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2911 Author: nice Time: 27 December 2020, 3:28:06.697857 pm UUID: 5c1ef787-4a6b-4b99-9298-d4823eca470e Ancestors: VMMaker.oscog-nice.2910 Simplify the rule for generating hex literal constants when more intellegible than decimal. This is useful for having a chance to decipher generated code for bit tricks. =============== Diff against VMMaker.oscog-nice.2910 =============== Item was changed: ----- Method: CCodeGenerator>>cLiteralFor: (in category 'C code generator') ----- cLiteralFor: anObject "Return a string representing the C literal value for the given object." anObject isNumber ifTrue: [anObject isInteger ifTrue: [| hex | + hex := (anObject > 255 and: [(anObject hex asSet size * 3) <= (anObject printString asSet size * 2)]). - hex := (anObject > 0 - and: [(anObject >> anObject lowBit + 1) isPowerOfTwo - and: [(anObject highBit = anObject lowBit and: [anObject > 65536]) - or: [anObject highBit - anObject lowBit >= 4]]]). ^self cLiteralForInteger: anObject hex: hex]. anObject isFloat ifTrue: [^anObject printString]] ifFalse: [anObject isSymbol ifTrue: [^self cFunctionNameFor: anObject]. anObject isString ifTrue: [^'"', (anObject copyReplaceAll: (String with: Character cr) with: '\n') , '"']. anObject == nil ifTrue: [^ 'null' ]. anObject == true ifTrue: [^ '1' ]. anObject == false ifTrue: [^ '0' ]. anObject isCharacter ifTrue: [^anObject == $' ifTrue: ['''\'''''] "i.e. '\''" ifFalse: [anObject asString printString]]]. self error: 'Warning: A Smalltalk literal could not be translated into a C constant: ', anObject printString. ^'"XXX UNTRANSLATABLE CONSTANT XXX"'! From commits at source.squeak.org Sun Dec 27 15:21:52 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 27 Dec 2020 15:21:52 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2912.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2912.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2912 Author: nice Time: 27 December 2020, 4:21:39.377922 pm UUID: 607e7bf3-9cd1-4a6b-ac0c-7261a969519b Ancestors: VMMaker.oscog-nice.2910 Complexify the rule for generating hex literal constants when more intellegible than decimal. This is useful for having a chance to decipher generated code for bit tricks. This replaces VMMaker.oscog-nice.2911 that screwed things up (hex generates the radix 16r). VMMaker.oscog-nice.2911 should be thrown away. =============== Diff against VMMaker.oscog-nice.2910 =============== Item was changed: ----- Method: CCodeGenerator>>cLiteralFor: (in category 'C code generator') ----- cLiteralFor: anObject "Return a string representing the C literal value for the given object." + anObject isNumber ifTrue: [anObject isInteger ifTrue: + [| hex dec useHexa | + hex := anObject printStringBase: 16. + dec := anObject printStringBase: 10. + useHexa := (anObject > 255 + and: [(hex asSet size * 3) <= (dec asSet size * 2) + or: [((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * 3)]]) + or: [anObject > 0 - [| hex | - hex := (anObject > 0 and: [(anObject >> anObject lowBit + 1) isPowerOfTwo and: [(anObject highBit = anObject lowBit and: [anObject > 65536]) + or: [anObject highBit - anObject lowBit >= 4]]]]. + ^self cLiteralForInteger: anObject hex: useHexa]. - or: [anObject highBit - anObject lowBit >= 4]]]). - ^self cLiteralForInteger: anObject hex: hex]. anObject isFloat ifTrue: [^anObject printString]] ifFalse: [anObject isSymbol ifTrue: [^self cFunctionNameFor: anObject]. anObject isString ifTrue: [^'"', (anObject copyReplaceAll: (String with: Character cr) with: '\n') , '"']. anObject == nil ifTrue: [^ 'null' ]. anObject == true ifTrue: [^ '1' ]. anObject == false ifTrue: [^ '0' ]. anObject isCharacter ifTrue: [^anObject == $' ifTrue: ['''\'''''] "i.e. '\''" ifFalse: [anObject asString printString]]]. self error: 'Warning: A Smalltalk literal could not be translated into a C constant: ', anObject printString. ^'"XXX UNTRANSLATABLE CONSTANT XXX"'! From noreply at github.com Sun Dec 27 15:30:30 2020 From: noreply at github.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 07:30:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 9376af: Generate BitBltPlugin wih new alpha blending combi... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 9376afb25149d1bc9a2c349af38d92c7a84203ed https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9376afb25149d1bc9a2c349af38d92c7a84203ed Author: Nicolas Cellier Date: 2020-12-27 (Sun, 27 Dec 2020) Changed paths: M platforms/Cross/plugins/BitBltPlugin/BitBltDispatch.h M src/plugins/BitBltPlugin/BitBltPlugin.c Log Message: ----------- Generate BitBltPlugin wih new alpha blending combination rules from VMMaker.oscog-nice.2909 Provide intelligible names for the new ops in cross platform BitBltDispatch.h if ever someone wants to implement an accelerated version This is WIP for issue #505 From notifications at github.com Sun Dec 27 15:36:36 2020 From: notifications at github.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 07:36:36 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Proposal for new BitBlt rules (#505) In-Reply-To: References: Message-ID: I won't provide any accelerated assembler for the new ops, not my cup of tea. But as I understand it, the PI will fall back to the code generated for the BitBlt plugin when no accelerated path is provided, so it should continue to work. What would be nice now would be to start writing image side code & unit tests in either Cuis or Squeak. -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505#issuecomment-751481672 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sun Dec 27 18:33:36 2020 From: notifications at github.com (Nicolas Cellier) Date: Sun, 27 Dec 2020 10:33:36 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Proposal for new BitBlt rules (#505) In-Reply-To: References: Message-ID: http://source.squeak.org/inbox/GraphicsTests-nice.57.diff http://source.squeak.org/inbox/Graphics-nice.442.diff -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505#issuecomment-751501404 -------------- next part -------------- An HTML attachment was scrubbed... URL: From karlramberg at gmail.com Sun Dec 27 20:42:47 2020 From: karlramberg at gmail.com (karl ramberg) Date: Sun, 27 Dec 2020 21:42:47 +0100 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2909.mcz In-Reply-To: References: Message-ID: Finally :-D Best, Karl On Wed, Dec 23, 2020 at 9:55 PM wrote: > > Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: > http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2909.mcz > > ==================== Summary ==================== > > Name: VMMaker.oscog-nice.2909 > Author: nice > Time: 23 December 2020, 9:54:51.201058 pm > UUID: 6869c4f1-9d80-40c3-8409-7c05e087edf5 > Ancestors: VMMaker.oscog-eem.2908 > > WIP: implement new BitBlt ops (rules) for alpha compositing > > "42" alphaScale:with: > "43" alphaUnscale:with: > "44" alphaBlendUnscaled:with: > > This is a proposal implementation for > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505 > > The generated C code compiles, but it's otherwise mostly yet unused and > untested code. I commit it before I loose it. > There's probably more to do for letting accelerated code work (PI). > > =============== Diff against VMMaker.oscog-eem.2908 =============== > > Item was changed: > SmartSyntaxInterpreterPlugin subclass: #BitBltSimulation > instanceVariableNames: 'destForm sourceForm halftoneForm > combinationRule destX destY width height sourceX sourceY clipX clipY > clipWidth clipHeight sourceWidth sourceHeight sourceDepth sourcePitch > sourceBits sourcePPW sourceMSB destWidth destHeight destDepth destPitch > destBits destPPW destMSB bitCount skew mask1 mask2 preload nWords destMask > hDir vDir sourceIndex sourceDelta destIndex destDelta sx sy dx dy bbW bbH > halftoneHeight noSource noHalftone halftoneBase sourceAlpha srcBitShift > dstBitShift bitBltOop affectedL affectedR affectedT affectedB opTable > maskTable ditherMatrix4x4 ditherThresholds16 ditherValues16 hasSurfaceLock > warpSrcShift warpSrcMask warpAlignShift warpAlignMask warpBitShiftTable > querySurfaceFn lockSurfaceFn unlockSurfaceFn isWarping cmFlags cmMask > cmShiftTable cmMaskTable cmLookupTable cmBitsPerColor dither8Lookup > componentAlphaModeColor componentAlphaModeAlpha ungammaLookupTable > gammaLookupTable numGCsOnInvocation bitBltIsReceiver endOfDestination > endOfSource' > classVariableNames: 'AllOnes AlphaIndex BBClipHeightIndex > BBClipWidthIndex BBClipXIndex BBClipYIndex BBColorMapIndex BBDestFormIndex > BBDestXIndex BBDestYIndex BBHalftoneFormIndex BBHeightIndex BBLastIndex > BBRuleIndex BBSourceFormIndex BBSourceXIndex BBSourceYIndex BBWarpBase > BBWidthIndex BBXTableIndex BEBitBltIndex BinaryPoint BlueIndex > ColorMapFixedPart ColorMapIndexedPart ColorMapNewStyle ColorMapPresent > CrossedX EndOfRun FixedPt1 FormBitsIndex FormDepthIndex FormHeightIndex > FormWidthIndex GreenIndex OpTable OpTableSize RedIndex' > poolDictionaries: '' > category: 'VMMaker-Interpreter'! > > + !BitBltSimulation commentStamp: 'nice 10/31/2020 23:39' prior: 0! > - !BitBltSimulation commentStamp: 'tpr 3/25/2013 16:50' prior: 0! > This class implements BitBlt, much as specified in the Blue Book spec. > > Performance has been enhanced through the use of pointer variables such > as sourceIndex and destIndex, and by separating several special cases of > the inner loop. > > Operation has been extended to color, with support for 1, 2, 4, 8, 16, > and 32-bit pixel sizes. Conversion between different pixel sizes is > facilitated by accepting an optional color map. > > In addition to the original 16 combination rules, this BitBlt supports > 16 fail (for old paint mode) > 17 fail (for old mask mode) > 18 sourceWord + destinationWord > 19 sourceWord - destinationWord > 20 rgbAdd: sourceWord with: destinationWord > 21 rgbSub: sourceWord with: destinationWord > 22 OLDrgbDiff: sourceWord with: destinationWord > 23 OLDtallyIntoMap: destinationWord -- old vers doesn't clip > to bit boundary > 24 alphaBlend: sourceWord with: destinationWord > 25 pixPaint: sourceWord with: destinationWord > 26 pixMask: sourceWord with: destinationWord > 27 rgbMax: sourceWord with: destinationWord > 28 rgbMin: sourceWord with: destinationWord > 29 rgbMin: sourceWord bitInvert32 with: destinationWord > 30 alphaBlendConst: sourceWord with: destinationWord -- alpha > passed as an arg > 31 alphaPaintConst: sourceWord with: destinationWord -- alpha > passed as an arg > 32 rgbDiff: sourceWord with: destinationWord > 33 tallyIntoMap: destinationWord > 34 alphaBlendScaled: sourceWord with: destinationWord > 35 alphaBlendScaled: sourceWord with: "unused here - only used > by FXBlt" > 36 alphaBlendScaled: sourceWord with: "unused here - only used > by FXBlt" > 37 rgbMul: sourceWord with: destinationWord > 38 pixSwap: sourceWord with: destinationWord > 39 pixClear: sourceWord with: destinationWord > 40 fixAlpha: sourceWord with: destinationWord > 41 rgbComponentAlpha: sourceWord with: destinationWord > + 42 alphaScale: ignoredSourceWord with: destinationWord > + 43 alphaUnscale: ignoredSourceWord with: destinationWord > + 44 alphaBlendUnscaled: sourceWord with: destinationWord > > This implementation has also been fitted with an experimental "warp > drive" that allows abritrary scaling and rotation (and even limited affine > deformations) with all BitBlt storage modes supported. > > To add a new rule to BitBlt... > 1. add the new rule method or methods in the category > 'combination rules' of BBSim > 2. describe it in the class comment of BBSim and in the class > comment for BitBlt > 3. add refs to initializeRuleTable in proper positions > 4. add refs to initBBOpTable, following the pattern > ! > > Item was changed: > ----- Method: BitBltSimulation class>>initializeRuleTable (in category > 'initialization') ----- > initializeRuleTable > "BitBltSimulation initializeRuleTable" > "**WARNING** You MUST change initBBOpTable if you change this" > OpTable := #( > "0" clearWord:with: > "1" bitAnd:with: > "2" bitAndInvert:with: > "3" sourceWord:with: > "4" bitInvertAnd:with: > "5" destinationWord:with: > "6" bitXor:with: > "7" bitOr:with: > "8" bitInvertAndInvert:with: > "9" bitInvertXor:with: > "10" bitInvertDestination:with: > "11" bitOrInvert:with: > "12" bitInvertSource:with: > "13" bitInvertOr:with: > "14" bitInvertOrInvert:with: > "15" destinationWord:with: > "16" destinationWord:with: "unused - was old paint" > "17" destinationWord:with: "unused - was old mask" > "18" addWord:with: > "19" subWord:with: > "20" rgbAdd:with: > "21" rgbSub:with: > "22" OLDrgbDiff:with: > "23" OLDtallyIntoMap:with: > "24" alphaBlend:with: > "25" pixPaint:with: > "26" pixMask:with: > "27" rgbMax:with: > "28" rgbMin:with: > "29" rgbMinInvert:with: > "30" alphaBlendConst:with: > "31" alphaPaintConst:with: > "32" rgbDiff:with: > "33" tallyIntoMap:with: > "34" alphaBlendScaled:with: > > "35" alphaBlendScaled:with: "unused here - only used > by FXBlt" > "36" alphaBlendScaled:with: "unused here - only used > by FXBlt" > "37" rgbMul:with: > "38" pixSwap:with: > "39" pixClear:with: > "40" fixAlpha:with: > "41" rgbComponentAlpha:with: > + "42" alphaScale:with: > + "43" alphaUnscale:with: > + "44" alphaBlendUnscaled:with: > ). > OpTableSize := OpTable size + 1. "0-origin indexing" > ! > > Item was added: > + ----- Method: BitBltSimulation>>alphaBlendUnscaled:with: (in category > 'combination rules') ----- > + alphaBlendUnscaled: sourceWord with: destinationWord > + "Blend sourceWord with destinationWord using the alpha value from > both sourceWord and destinationWord. > + Alpha is encoded as 0 meaning 0.0, and 255 meaning 1.0. > + The alpha channel and color produced are > + > + srcAlpha + (destAlpha*(1-srcAlpha)) > + (srcAlpha*srcColor + (destAlpha*(1-srcAlpha)*dstColor)) / > (srcAlpha + (destAlpha*(1-srcAlpha))) > + > + In contrast to alphaBlend:with: the method does not assume that > destination form is opaque. > + In contrast to alphaBlendScaled:with: the method does not assume > that colors have been pre-scaled (muliplied) by alpha channel." > + | alpha blendA result blendRB blendG | > + > + > + > + > + > + > + > + > + > + alpha := sourceWord >> 24. "High 8 bits of source pixel, assuming > ARGB encoding" > + alpha = 0 ifTrue: [ ^ destinationWord ]. > + alpha = 255 ifTrue: [ ^ sourceWord ]. > + > + blendA := 16rFF * alpha + (16rFF - alpha * (destinationWord >> > 24)) + 16rFF. "blend alpha channels" > + blendA := blendA + (blendA - 1 >> 8 bitAnd: 16rFF) >> 8 bitAnd: > 16rFF. "divide by 255" > + > + blendRB := ((sourceWord bitAnd: 16rFF00FF) * alpha) + > + ((destinationWord bitAnd: 16rFF00FF) * > (blendA-alpha)) > + / blendA. "blend red and blue" > + > + blendG := ((sourceWord bitAnd: 16r00FF00) * alpha) + > + ((destinationWord bitAnd: 16r00FF00) * > (blendA-alpha)) > + / blendA. "blend green" > + result := (blendRB bitOr: blendG) bitOr: blendA << 24. > + ^ result > + ! > > Item was added: > + ----- Method: BitBltSimulation>>alphaScale:with: (in category > 'combination rules') ----- > + alphaScale: sourceWord with: destinationWord > + "Scale (premultiply) the destination with its alpha channel. > + Note that sourceWord is ignored." > + | alpha rb g | > + "Do NOT inline this into optimized loops" > + > + > + > + > + > + > + alpha := destinationWord >> 24. "High 8 bits is opacity (ARGB > format)" > + rb := ((destinationWord bitAnd: 16rFF00FF) * alpha >> 8 bitAnd: > 16rFF00FF). "scale red and blue components" > + g := ((destinationWord bitAnd: 16r00FF00) * alpha >> 8 bitAnd: > 16r00FF00). "scale green component" > + ^(g bitOr: rb) bitOr: (destinationWord bitAnd: 16rFF000000) > "recompose"! > > Item was added: > + ----- Method: BitBltSimulation>>alphaUnscale:with: (in category > 'combination rules') ----- > + alphaUnscale: sourceWord with: destinationWord > + "Unscale (divide) the destination with its alpha channel. > + Note that sourceWord is ignored." > + | alpha rb g rgb carry | > + "Do NOT inline this into optimized loops" > + > + > + > + > + > + > + > + > + alpha := destinationWord >> 24. "High 8 bits is opacity (ARGB > format)" > + alpha = 0 ifTrue: [^0]. > + rb := (destinationWord bitAnd: 16rFF00FF) << 8 / alpha. "unscale > red and blue components" > + g := (destinationWord bitAnd: 16r00FF00) / alpha. "unscale green > component" > + carry := ((rb >> 8 bitAnd: 16rAA00AA) >> 1 bitOr: (rb >> 8 bitAnd: > 16r550055) << 1) > + bitOr: ((g bitAnd: 16r00AA00) >> 1 bitOr: (g bitAnd: > 16r005500) << 1). > + carry := (carry bitAnd: 16rCCCCCC) >> 2 bitOr: (carry bitAnd: > 16r333333) << 2. > + carry := (carry bitAnd: 16rF0F0F0) >> 4 bitOr: (carry bitAnd: > 16r0F0F0F) << 4. > + rgb := (rb bitAnd: 16rFF00FF) bitOr: (g << 8 bitAnd: 16r00FF00). > + rgb := rgb bitOr: carry. "saturate RGB components if division > overflows" > + ^rgb bitOr: (destinationWord bitAnd: 16rFF000000) "restore alpha"! > > Item was changed: > ----- Method: BitBltSimulation>>initBBOpTable (in category > 'initialize-release') ----- > initBBOpTable > self cCode: 'opTable[0+1] = (void *)clearWordwith'. > self cCode: 'opTable[1+1] = (void *)bitAndwith'. > self cCode: 'opTable[2+1] = (void *)bitAndInvertwith'. > self cCode: 'opTable[3+1] = (void *)sourceWordwith'. > self cCode: 'opTable[4+1] = (void *)bitInvertAndwith'. > self cCode: 'opTable[5+1] = (void *)destinationWordwith'. > self cCode: 'opTable[6+1] = (void *)bitXorwith'. > self cCode: 'opTable[7+1] = (void *)bitOrwith'. > self cCode: 'opTable[8+1] = (void *)bitInvertAndInvertwith'. > self cCode: 'opTable[9+1] = (void *)bitInvertXorwith'. > self cCode: 'opTable[10+1] = (void *)bitInvertDestinationwith'. > self cCode: 'opTable[11+1] = (void *)bitOrInvertwith'. > self cCode: 'opTable[12+1] = (void *)bitInvertSourcewith'. > self cCode: 'opTable[13+1] = (void *)bitInvertOrwith'. > self cCode: 'opTable[14+1] = (void *)bitInvertOrInvertwith'. > self cCode: 'opTable[15+1] = (void *)destinationWordwith'. > self cCode: 'opTable[16+1] = (void *)destinationWordwith'. > self cCode: 'opTable[17+1] = (void *)destinationWordwith'. > self cCode: 'opTable[18+1] = (void *)addWordwith'. > self cCode: 'opTable[19+1] = (void *)subWordwith'. > self cCode: 'opTable[20+1] = (void *)rgbAddwith'. > self cCode: 'opTable[21+1] = (void *)rgbSubwith'. > self cCode: 'opTable[22+1] = (void *)OLDrgbDiffwith'. > self cCode: 'opTable[23+1] = (void *)OLDtallyIntoMapwith'. > self cCode: 'opTable[24+1] = (void *)alphaBlendwith'. > self cCode: 'opTable[25+1] = (void *)pixPaintwith'. > self cCode: 'opTable[26+1] = (void *)pixMaskwith'. > self cCode: 'opTable[27+1] = (void *)rgbMaxwith'. > self cCode: 'opTable[28+1] = (void *)rgbMinwith'. > self cCode: 'opTable[29+1] = (void *)rgbMinInvertwith'. > self cCode: 'opTable[30+1] = (void *)alphaBlendConstwith'. > self cCode: 'opTable[31+1] = (void *)alphaPaintConstwith'. > self cCode: 'opTable[32+1] = (void *)rgbDiffwith'. > self cCode: 'opTable[33+1] = (void *)tallyIntoMapwith'. > self cCode: 'opTable[34+1] = (void *)alphaBlendScaledwith'. > self cCode: 'opTable[35+1] = (void *)alphaBlendScaledwith'. > self cCode: 'opTable[36+1] = (void *)alphaBlendScaledwith'. > self cCode: 'opTable[37+1] = (void *)rgbMulwith'. > self cCode: 'opTable[38+1] = (void *)pixSwapwith'. > self cCode: 'opTable[39+1] = (void *)pixClearwith'. > self cCode: 'opTable[40+1] = (void *)fixAlphawith'. > + self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'. > + self cCode: 'opTable[42+1] = (void *)alphaScalewith'. > + self cCode: 'opTable[43+1] = (void *)alphaUnscalewith'. > + self cCode: 'opTable[44+1] = (void *)alphaBlendUnscaledwith'.! > - self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'.! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Sun Dec 27 21:24:53 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 27 Dec 2020 16:24:53 -0500 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2909.mcz In-Reply-To: References: Message-ID: <20201227212453.GB94403@shell.msen.com> Bravo! Thank you Nicolas. Dave On Sun, Dec 27, 2020 at 09:42:47PM +0100, karl ramberg wrote: > > Finally :-D > > Best, > Karl > > > On Wed, Dec 23, 2020 at 9:55 PM wrote: > > > > > Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: > > http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2909.mcz > > > > ==================== Summary ==================== > > > > Name: VMMaker.oscog-nice.2909 > > Author: nice > > Time: 23 December 2020, 9:54:51.201058 pm > > UUID: 6869c4f1-9d80-40c3-8409-7c05e087edf5 > > Ancestors: VMMaker.oscog-eem.2908 > > > > WIP: implement new BitBlt ops (rules) for alpha compositing > > > > "42" alphaScale:with: > > "43" alphaUnscale:with: > > "44" alphaBlendUnscaled:with: > > > > This is a proposal implementation for > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/505 > > > > The generated C code compiles, but it's otherwise mostly yet unused and > > untested code. I commit it before I loose it. > > There's probably more to do for letting accelerated code work (PI). > > > > =============== Diff against VMMaker.oscog-eem.2908 =============== > > > > Item was changed: > > SmartSyntaxInterpreterPlugin subclass: #BitBltSimulation > > instanceVariableNames: 'destForm sourceForm halftoneForm > > combinationRule destX destY width height sourceX sourceY clipX clipY > > clipWidth clipHeight sourceWidth sourceHeight sourceDepth sourcePitch > > sourceBits sourcePPW sourceMSB destWidth destHeight destDepth destPitch > > destBits destPPW destMSB bitCount skew mask1 mask2 preload nWords destMask > > hDir vDir sourceIndex sourceDelta destIndex destDelta sx sy dx dy bbW bbH > > halftoneHeight noSource noHalftone halftoneBase sourceAlpha srcBitShift > > dstBitShift bitBltOop affectedL affectedR affectedT affectedB opTable > > maskTable ditherMatrix4x4 ditherThresholds16 ditherValues16 hasSurfaceLock > > warpSrcShift warpSrcMask warpAlignShift warpAlignMask warpBitShiftTable > > querySurfaceFn lockSurfaceFn unlockSurfaceFn isWarping cmFlags cmMask > > cmShiftTable cmMaskTable cmLookupTable cmBitsPerColor dither8Lookup > > componentAlphaModeColor componentAlphaModeAlpha ungammaLookupTable > > gammaLookupTable numGCsOnInvocation bitBltIsReceiver endOfDestination > > endOfSource' > > classVariableNames: 'AllOnes AlphaIndex BBClipHeightIndex > > BBClipWidthIndex BBClipXIndex BBClipYIndex BBColorMapIndex BBDestFormIndex > > BBDestXIndex BBDestYIndex BBHalftoneFormIndex BBHeightIndex BBLastIndex > > BBRuleIndex BBSourceFormIndex BBSourceXIndex BBSourceYIndex BBWarpBase > > BBWidthIndex BBXTableIndex BEBitBltIndex BinaryPoint BlueIndex > > ColorMapFixedPart ColorMapIndexedPart ColorMapNewStyle ColorMapPresent > > CrossedX EndOfRun FixedPt1 FormBitsIndex FormDepthIndex FormHeightIndex > > FormWidthIndex GreenIndex OpTable OpTableSize RedIndex' > > poolDictionaries: '' > > category: 'VMMaker-Interpreter'! > > > > + !BitBltSimulation commentStamp: 'nice 10/31/2020 23:39' prior: 0! > > - !BitBltSimulation commentStamp: 'tpr 3/25/2013 16:50' prior: 0! > > This class implements BitBlt, much as specified in the Blue Book spec. > > > > Performance has been enhanced through the use of pointer variables such > > as sourceIndex and destIndex, and by separating several special cases of > > the inner loop. > > > > Operation has been extended to color, with support for 1, 2, 4, 8, 16, > > and 32-bit pixel sizes. Conversion between different pixel sizes is > > facilitated by accepting an optional color map. > > > > In addition to the original 16 combination rules, this BitBlt supports > > 16 fail (for old paint mode) > > 17 fail (for old mask mode) > > 18 sourceWord + destinationWord > > 19 sourceWord - destinationWord > > 20 rgbAdd: sourceWord with: destinationWord > > 21 rgbSub: sourceWord with: destinationWord > > 22 OLDrgbDiff: sourceWord with: destinationWord > > 23 OLDtallyIntoMap: destinationWord -- old vers doesn't clip > > to bit boundary > > 24 alphaBlend: sourceWord with: destinationWord > > 25 pixPaint: sourceWord with: destinationWord > > 26 pixMask: sourceWord with: destinationWord > > 27 rgbMax: sourceWord with: destinationWord > > 28 rgbMin: sourceWord with: destinationWord > > 29 rgbMin: sourceWord bitInvert32 with: destinationWord > > 30 alphaBlendConst: sourceWord with: destinationWord -- alpha > > passed as an arg > > 31 alphaPaintConst: sourceWord with: destinationWord -- alpha > > passed as an arg > > 32 rgbDiff: sourceWord with: destinationWord > > 33 tallyIntoMap: destinationWord > > 34 alphaBlendScaled: sourceWord with: destinationWord > > 35 alphaBlendScaled: sourceWord with: "unused here - only used > > by FXBlt" > > 36 alphaBlendScaled: sourceWord with: "unused here - only used > > by FXBlt" > > 37 rgbMul: sourceWord with: destinationWord > > 38 pixSwap: sourceWord with: destinationWord > > 39 pixClear: sourceWord with: destinationWord > > 40 fixAlpha: sourceWord with: destinationWord > > 41 rgbComponentAlpha: sourceWord with: destinationWord > > + 42 alphaScale: ignoredSourceWord with: destinationWord > > + 43 alphaUnscale: ignoredSourceWord with: destinationWord > > + 44 alphaBlendUnscaled: sourceWord with: destinationWord > > > > This implementation has also been fitted with an experimental "warp > > drive" that allows abritrary scaling and rotation (and even limited affine > > deformations) with all BitBlt storage modes supported. > > > > To add a new rule to BitBlt... > > 1. add the new rule method or methods in the category > > 'combination rules' of BBSim > > 2. describe it in the class comment of BBSim and in the class > > comment for BitBlt > > 3. add refs to initializeRuleTable in proper positions > > 4. add refs to initBBOpTable, following the pattern > > ! > > > > Item was changed: > > ----- Method: BitBltSimulation class>>initializeRuleTable (in category > > 'initialization') ----- > > initializeRuleTable > > "BitBltSimulation initializeRuleTable" > > "**WARNING** You MUST change initBBOpTable if you change this" > > OpTable := #( > > "0" clearWord:with: > > "1" bitAnd:with: > > "2" bitAndInvert:with: > > "3" sourceWord:with: > > "4" bitInvertAnd:with: > > "5" destinationWord:with: > > "6" bitXor:with: > > "7" bitOr:with: > > "8" bitInvertAndInvert:with: > > "9" bitInvertXor:with: > > "10" bitInvertDestination:with: > > "11" bitOrInvert:with: > > "12" bitInvertSource:with: > > "13" bitInvertOr:with: > > "14" bitInvertOrInvert:with: > > "15" destinationWord:with: > > "16" destinationWord:with: "unused - was old paint" > > "17" destinationWord:with: "unused - was old mask" > > "18" addWord:with: > > "19" subWord:with: > > "20" rgbAdd:with: > > "21" rgbSub:with: > > "22" OLDrgbDiff:with: > > "23" OLDtallyIntoMap:with: > > "24" alphaBlend:with: > > "25" pixPaint:with: > > "26" pixMask:with: > > "27" rgbMax:with: > > "28" rgbMin:with: > > "29" rgbMinInvert:with: > > "30" alphaBlendConst:with: > > "31" alphaPaintConst:with: > > "32" rgbDiff:with: > > "33" tallyIntoMap:with: > > "34" alphaBlendScaled:with: > > > > "35" alphaBlendScaled:with: "unused here - only used > > by FXBlt" > > "36" alphaBlendScaled:with: "unused here - only used > > by FXBlt" > > "37" rgbMul:with: > > "38" pixSwap:with: > > "39" pixClear:with: > > "40" fixAlpha:with: > > "41" rgbComponentAlpha:with: > > + "42" alphaScale:with: > > + "43" alphaUnscale:with: > > + "44" alphaBlendUnscaled:with: > > ). > > OpTableSize := OpTable size + 1. "0-origin indexing" > > ! > > > > Item was added: > > + ----- Method: BitBltSimulation>>alphaBlendUnscaled:with: (in category > > 'combination rules') ----- > > + alphaBlendUnscaled: sourceWord with: destinationWord > > + "Blend sourceWord with destinationWord using the alpha value from > > both sourceWord and destinationWord. > > + Alpha is encoded as 0 meaning 0.0, and 255 meaning 1.0. > > + The alpha channel and color produced are > > + > > + srcAlpha + (destAlpha*(1-srcAlpha)) > > + (srcAlpha*srcColor + (destAlpha*(1-srcAlpha)*dstColor)) / > > (srcAlpha + (destAlpha*(1-srcAlpha))) > > + > > + In contrast to alphaBlend:with: the method does not assume that > > destination form is opaque. > > + In contrast to alphaBlendScaled:with: the method does not assume > > that colors have been pre-scaled (muliplied) by alpha channel." > > + | alpha blendA result blendRB blendG | > > + > > + > > + > > + > > + > > + > > + > > + > > + > > + alpha := sourceWord >> 24. "High 8 bits of source pixel, assuming > > ARGB encoding" > > + alpha = 0 ifTrue: [ ^ destinationWord ]. > > + alpha = 255 ifTrue: [ ^ sourceWord ]. > > + > > + blendA := 16rFF * alpha + (16rFF - alpha * (destinationWord >> > > 24)) + 16rFF. "blend alpha channels" > > + blendA := blendA + (blendA - 1 >> 8 bitAnd: 16rFF) >> 8 bitAnd: > > 16rFF. "divide by 255" > > + > > + blendRB := ((sourceWord bitAnd: 16rFF00FF) * alpha) + > > + ((destinationWord bitAnd: 16rFF00FF) * > > (blendA-alpha)) > > + / blendA. "blend red and blue" > > + > > + blendG := ((sourceWord bitAnd: 16r00FF00) * alpha) + > > + ((destinationWord bitAnd: 16r00FF00) * > > (blendA-alpha)) > > + / blendA. "blend green" > > + result := (blendRB bitOr: blendG) bitOr: blendA << 24. > > + ^ result > > + ! > > > > Item was added: > > + ----- Method: BitBltSimulation>>alphaScale:with: (in category > > 'combination rules') ----- > > + alphaScale: sourceWord with: destinationWord > > + "Scale (premultiply) the destination with its alpha channel. > > + Note that sourceWord is ignored." > > + | alpha rb g | > > + "Do NOT inline this into optimized loops" > > + > > + > > + > > + > > + > > + > > + alpha := destinationWord >> 24. "High 8 bits is opacity (ARGB > > format)" > > + rb := ((destinationWord bitAnd: 16rFF00FF) * alpha >> 8 bitAnd: > > 16rFF00FF). "scale red and blue components" > > + g := ((destinationWord bitAnd: 16r00FF00) * alpha >> 8 bitAnd: > > 16r00FF00). "scale green component" > > + ^(g bitOr: rb) bitOr: (destinationWord bitAnd: 16rFF000000) > > "recompose"! > > > > Item was added: > > + ----- Method: BitBltSimulation>>alphaUnscale:with: (in category > > 'combination rules') ----- > > + alphaUnscale: sourceWord with: destinationWord > > + "Unscale (divide) the destination with its alpha channel. > > + Note that sourceWord is ignored." > > + | alpha rb g rgb carry | > > + "Do NOT inline this into optimized loops" > > + > > + > > + > > + > > + > > + > > + > > + > > + alpha := destinationWord >> 24. "High 8 bits is opacity (ARGB > > format)" > > + alpha = 0 ifTrue: [^0]. > > + rb := (destinationWord bitAnd: 16rFF00FF) << 8 / alpha. "unscale > > red and blue components" > > + g := (destinationWord bitAnd: 16r00FF00) / alpha. "unscale green > > component" > > + carry := ((rb >> 8 bitAnd: 16rAA00AA) >> 1 bitOr: (rb >> 8 bitAnd: > > 16r550055) << 1) > > + bitOr: ((g bitAnd: 16r00AA00) >> 1 bitOr: (g bitAnd: > > 16r005500) << 1). > > + carry := (carry bitAnd: 16rCCCCCC) >> 2 bitOr: (carry bitAnd: > > 16r333333) << 2. > > + carry := (carry bitAnd: 16rF0F0F0) >> 4 bitOr: (carry bitAnd: > > 16r0F0F0F) << 4. > > + rgb := (rb bitAnd: 16rFF00FF) bitOr: (g << 8 bitAnd: 16r00FF00). > > + rgb := rgb bitOr: carry. "saturate RGB components if division > > overflows" > > + ^rgb bitOr: (destinationWord bitAnd: 16rFF000000) "restore alpha"! > > > > Item was changed: > > ----- Method: BitBltSimulation>>initBBOpTable (in category > > 'initialize-release') ----- > > initBBOpTable > > self cCode: 'opTable[0+1] = (void *)clearWordwith'. > > self cCode: 'opTable[1+1] = (void *)bitAndwith'. > > self cCode: 'opTable[2+1] = (void *)bitAndInvertwith'. > > self cCode: 'opTable[3+1] = (void *)sourceWordwith'. > > self cCode: 'opTable[4+1] = (void *)bitInvertAndwith'. > > self cCode: 'opTable[5+1] = (void *)destinationWordwith'. > > self cCode: 'opTable[6+1] = (void *)bitXorwith'. > > self cCode: 'opTable[7+1] = (void *)bitOrwith'. > > self cCode: 'opTable[8+1] = (void *)bitInvertAndInvertwith'. > > self cCode: 'opTable[9+1] = (void *)bitInvertXorwith'. > > self cCode: 'opTable[10+1] = (void *)bitInvertDestinationwith'. > > self cCode: 'opTable[11+1] = (void *)bitOrInvertwith'. > > self cCode: 'opTable[12+1] = (void *)bitInvertSourcewith'. > > self cCode: 'opTable[13+1] = (void *)bitInvertOrwith'. > > self cCode: 'opTable[14+1] = (void *)bitInvertOrInvertwith'. > > self cCode: 'opTable[15+1] = (void *)destinationWordwith'. > > self cCode: 'opTable[16+1] = (void *)destinationWordwith'. > > self cCode: 'opTable[17+1] = (void *)destinationWordwith'. > > self cCode: 'opTable[18+1] = (void *)addWordwith'. > > self cCode: 'opTable[19+1] = (void *)subWordwith'. > > self cCode: 'opTable[20+1] = (void *)rgbAddwith'. > > self cCode: 'opTable[21+1] = (void *)rgbSubwith'. > > self cCode: 'opTable[22+1] = (void *)OLDrgbDiffwith'. > > self cCode: 'opTable[23+1] = (void *)OLDtallyIntoMapwith'. > > self cCode: 'opTable[24+1] = (void *)alphaBlendwith'. > > self cCode: 'opTable[25+1] = (void *)pixPaintwith'. > > self cCode: 'opTable[26+1] = (void *)pixMaskwith'. > > self cCode: 'opTable[27+1] = (void *)rgbMaxwith'. > > self cCode: 'opTable[28+1] = (void *)rgbMinwith'. > > self cCode: 'opTable[29+1] = (void *)rgbMinInvertwith'. > > self cCode: 'opTable[30+1] = (void *)alphaBlendConstwith'. > > self cCode: 'opTable[31+1] = (void *)alphaPaintConstwith'. > > self cCode: 'opTable[32+1] = (void *)rgbDiffwith'. > > self cCode: 'opTable[33+1] = (void *)tallyIntoMapwith'. > > self cCode: 'opTable[34+1] = (void *)alphaBlendScaledwith'. > > self cCode: 'opTable[35+1] = (void *)alphaBlendScaledwith'. > > self cCode: 'opTable[36+1] = (void *)alphaBlendScaledwith'. > > self cCode: 'opTable[37+1] = (void *)rgbMulwith'. > > self cCode: 'opTable[38+1] = (void *)pixSwapwith'. > > self cCode: 'opTable[39+1] = (void *)pixClearwith'. > > self cCode: 'opTable[40+1] = (void *)fixAlphawith'. > > + self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'. > > + self cCode: 'opTable[42+1] = (void *)alphaScalewith'. > > + self cCode: 'opTable[43+1] = (void *)alphaUnscalewith'. > > + self cCode: 'opTable[44+1] = (void *)alphaBlendUnscaledwith'.! > > - self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'.! > > > > From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 28 12:23:47 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 28 Dec 2020 12:23:47 +0000 Subject: [Vm-dev] [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: References: Message-ID: <80c84f2088494ec2abcf9775fd0cf2d6@student.hpi.uni-potsdam.de> Hi Fabio, thanks for the hint! I can reproduce this neither on Win 2004/OSVM 202010232046 nor Ubuntu 18/OSVM 202008211759, each with the latest trunk update. Could you maybe share the entire stack trace/SqueakDebug.log with us? :) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von Fabio Niephaus Gesendet: Freitag, 11. Dezember 2020 16:47:32 An: Squeak Virtual Machine Development Discussion; squeak-dev at lists.squeakfoundation.org Betreff: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Hi all, I'm not sure this is already known, but CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly crashes the VM on macOS. I tried it with an older VM from last year and the latest bleeding edge (202012050134). Best, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christoph.Thiede at student.hpi.uni-potsdam.de Mon Dec 28 12:26:32 2020 From: Christoph.Thiede at student.hpi.uni-potsdam.de (Thiede, Christoph) Date: Mon, 28 Dec 2020 12:26:32 +0000 Subject: [Vm-dev] [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM In-Reply-To: <80c84f2088494ec2abcf9775fd0cf2d6@student.hpi.uni-potsdam.de> References: , <80c84f2088494ec2abcf9775fd0cf2d6@student.hpi.uni-potsdam.de> Message-ID: Nevermind, I should have read all the new unread 198 mails in my squeak-dev inbox folder before answering any of them ... Thanks for fixing, Eliot! :-) Best, Christoph ________________________________ Von: Thiede, Christoph Gesendet: Montag, 28. Dezember 2020 13:23:47 An: Squeak Virtual Machine Development Discussion; squeak-dev at lists.squeakfoundation.org Betreff: AW: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Hi Fabio, thanks for the hint! I can reproduce this neither on Win 2004/OSVM 202010232046 nor Ubuntu 18/OSVM 202008211759, each with the latest trunk update. Could you maybe share the entire stack trace/SqueakDebug.log with us? :) Best, Christoph ________________________________ Von: Squeak-dev im Auftrag von Fabio Niephaus Gesendet: Freitag, 11. Dezember 2020 16:47:32 An: Squeak Virtual Machine Development Discussion; squeak-dev at lists.squeakfoundation.org Betreff: [squeak-dev] CompiledCodeInspectorTest>>testValuePaneModifyLiteral crashes the VM Hi all, I'm not sure this is already known, but CompiledCodeInspectorTest>>testValuePaneModifyLiteral reproducibly crashes the VM on macOS. I tried it with an older VM from last year and the latest bleeding edge (202012050134). Best, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Mon Dec 28 15:17:50 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Mon, 28 Dec 2020 10:17:50 -0500 Subject: [Vm-dev] Small discrepancy in fileTimesInUTC between simulation & VM In-Reply-To: References: Message-ID: <20201228151750.GA67042@shell.msen.com> On Sun, Dec 27, 2020 at 02:51:44PM +0100, Nicolas Cellier wrote: > > Hi all, Eliot, > > Simulation says: > > ^(Smalltalk vmParameterAt: 48) anyMask: 128 > > VM says: > > ^imageHeaderFlags anyMask: 512 > > Is the difference intentional? Eliot will give a better answer, but I am fairly sure that this is intentional. See StackInterpreter>>getImageHeaderFlagsParameter for example. At first glance this looks like a conversion from Smalltalk Integer to C int, but I think that is just a coincidence. The getImageHeaderFlags method gives the value that is written to the snapshot file header, but the first two bits of that value are not of interest for the VM parameter, hence the shift right by 2 to get the value used for the VM parameter. As an aside, I find the use of bit masks (anyMask: or allMask:) for bit testing to be hard to read, maybe it would be good to have this: Integer>>testBit: bitNumber "Answer whether the bit at bitNumber is set" ^ 0 ~= (self bitAt: bitNumber) Dave From eliot.miranda at gmail.com Tue Dec 29 04:52:06 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 28 Dec 2020 20:52:06 -0800 Subject: [Vm-dev] Small discrepancy in fileTimesInUTC between simulation & VM In-Reply-To: References: Message-ID: Hi Nicolas, On Sun, Dec 27, 2020 at 5:52 AM Nicolas Cellier < nicolas.cellier.aka.nice at gmail.com> wrote: > > Hi all, Eliot, > > Simulation says: > > ^(Smalltalk vmParameterAt: 48) anyMask: 128 > > VM says: > > ^imageHeaderFlags anyMask: 512 > > Is the difference intentional? > It is, and it's a confusing mess for which I apologize. The issue is that the least significant two bits of the flags word are the full screen flag and the "vm is big endian" flag. Neither of these needs a setter since the full screen flag is set via the toggle full screen primitive and the "vm is big endian" is a constant depending on the VM. Hence Smalltalk vmParameterAt: 48 answers the flags bit shifted right 2 bits. I get bit by this all the time and wish I had not introduced the shift. Back in early October in VMMaker.oscog-eem.2837 I wrote completely incorrect code that screwed up several flags until VMMaker.oscog-eem.2848 that I fixed a week later. But unfortunately the damage is done. All we can do is comment the situation, while I beg forgiveness and forbearance. _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 29 05:06:05 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 28 Dec 2020 21:06:05 -0800 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2912.mcz In-Reply-To: References: Message-ID: Hi Nicolas, re "((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * 3)", I *love* it! I hadn't thought of this way. That's great. I/we should add some comments to indicate what we're wanting to achieve. P.S. modifying the bytecode compiler so it respects the base of integer constants when doing pretty printing is IMO something we've needed for years and years. LiteralNode could have an optional base or we could have a NumericLiteralNode subclass. But it is the Scanner that needs to collect the information in the first place. On Sun, Dec 27, 2020 at 7:22 AM wrote: > > Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: > http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2912.mcz > > ==================== Summary ==================== > > Name: VMMaker.oscog-nice.2912 > Author: nice > Time: 27 December 2020, 4:21:39.377922 pm > UUID: 607e7bf3-9cd1-4a6b-ac0c-7261a969519b > Ancestors: VMMaker.oscog-nice.2910 > > Complexify the rule for generating hex literal constants when more > intellegible than decimal. > > This is useful for having a chance to decipher generated code for bit > tricks. > > This replaces VMMaker.oscog-nice.2911 that screwed things up (hex > generates the radix 16r). > VMMaker.oscog-nice.2911 should be thrown away. > > =============== Diff against VMMaker.oscog-nice.2910 =============== > > Item was changed: > ----- Method: CCodeGenerator>>cLiteralFor: (in category 'C code > generator') ----- > cLiteralFor: anObject > "Return a string representing the C literal value for the given > object." > + > anObject isNumber > ifTrue: > [anObject isInteger ifTrue: > + [| hex dec useHexa | > + hex := anObject printStringBase: 16. > + dec := anObject printStringBase: 10. > + useHexa := (anObject > 255 > + and: [(hex > asSet size * 3) <= (dec asSet size * 2) > + > or: [((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * > 3)]]) > + or: [anObject > 0 > - [| hex | > - hex := (anObject > 0 > and: > [(anObject >> anObject lowBit + 1) isPowerOfTwo > and: > [(anObject highBit = anObject lowBit and: [anObject > 65536]) > + > or: [anObject highBit - anObject lowBit >= 4]]]]. > + ^self cLiteralForInteger: anObject hex: > useHexa]. > - > or: [anObject highBit - anObject lowBit >= 4]]]). > - ^self cLiteralForInteger: anObject hex: > hex]. > anObject isFloat ifTrue: > [^anObject printString]] > ifFalse: > [anObject isSymbol ifTrue: > [^self cFunctionNameFor: anObject]. > anObject isString ifTrue: > [^'"', (anObject copyReplaceAll: (String > with: Character cr) with: '\n') , '"']. > anObject == nil ifTrue: [^ 'null' ]. > anObject == true ifTrue: [^ '1' ]. > anObject == false ifTrue: [^ '0' ]. > anObject isCharacter ifTrue: > [^anObject == $' > ifTrue: ['''\'''''] "i.e. '\''" > ifFalse: [anObject asString > printString]]]. > self error: 'Warning: A Smalltalk literal could not be translated > into a C constant: ', anObject printString. > ^'"XXX UNTRANSLATABLE CONSTANT XXX"'! > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Dec 29 05:20:39 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 28 Dec 2020 21:20:39 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 509468: Salvage the stack builds In-Reply-To: References: Message-ID: Hi Nicolas, the fix really belongs in specific platform makefiles because the labelling is exactly intended for profiling the stack VMs. Bugs in the clang compiler when using -Os (small size) cause it to duplicate the labels and consequently for the assembler stage to fail. On Sun, Dec 27, 2020 at 3:25 AM Nicolas Cellier wrote: > > Branch: refs/heads/Cog > Home: https://github.com/OpenSmalltalk/opensmalltalk-vm > Commit: 5094685a21c0c283228b5246855084e4e91c3e8f > > https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/5094685a21c0c283228b5246855084e4e91c3e8f > Author: Nicolas Cellier > Date: 2020-12-27 (Sun, 27 Dec 2020) > > Changed paths: > M platforms/Mac OS/vm/sqPlatformSpecific.h > M platforms/iOS/vm/OSX/sqPlatformSpecific.h > M platforms/iOS/vm/iPhone/sqPlatformSpecific.h > M platforms/minheadless/unix/sqPlatformSpecific-Unix.h > M platforms/minheadless/windows/sqPlatformSpecific-Win32.h > M platforms/unix/vm/sqPlatformSpecific.h > M platforms/win32/vm/sqPlatformSpecific.h > > Log Message: > ----------- > Salvage the stack builds > > For some reasons (?) the VM_LABEL macro is now barking like this: > > >../../spurstack64src/vm/gcc3x-interp.c:9419:5: error: invalid symbol > redefinition > > VM_LABEL(extPushPseudoVariable); > > ^ > >In file included from ../../spurstack64src/vm/gcc3x-interp.c:29: > >In file included from ../../platforms/iOS/vm/Common/sqGnu.h:46: > >In file included from ../../platforms/Cross/vm/sq.h:252: > >../../platforms/iOS/vm/OSX/sqPlatformSpecific.h:174:52: note: expanded > from macro 'VM_LABEL' > ># define VM_LABEL(foo) asm("\n.globl _L" #foo "\n_L" #foo ":") > > ^ > >:3:1: note: instantiated into assembly here > >_LextPushPseudoVariable: > >^ > > Since this does not happen in cog builds, avoid brainstorming and just use > the same workaround. > > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From Das.Linux at gmx.de Tue Dec 29 09:04:20 2020 From: Das.Linux at gmx.de (Tobias Pape) Date: Tue, 29 Dec 2020 10:04:20 +0100 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2912.mcz In-Reply-To: References: Message-ID: Hi > On 29. Dec 2020, at 06:06, Eliot Miranda wrote: > > Hi Nicolas, > > re "((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * 3)", I *love* it! I hadn't thought of this way. That's great. I/we should add some comments to indicate what we're wanting to achieve. > shouldnt that be ((hex as: RunArray) runs size * 4) < ((dec as: RunArray) runs size * 3) instead of ((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * 3) ? -t > P.S. modifying the bytecode compiler so it respects the base of integer constants when doing pretty printing is IMO something we've needed for years and years. LiteralNode could have an optional base or we could have a NumericLiteralNode subclass. But it is the Scanner that needs to collect the information in the first place. > > On Sun, Dec 27, 2020 at 7:22 AM wrote: > > Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: > http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2912.mcz > > ==================== Summary ==================== > > Name: VMMaker.oscog-nice.2912 > Author: nice > Time: 27 December 2020, 4:21:39.377922 pm > UUID: 607e7bf3-9cd1-4a6b-ac0c-7261a969519b > Ancestors: VMMaker.oscog-nice.2910 > > Complexify the rule for generating hex literal constants when more intellegible than decimal. > > This is useful for having a chance to decipher generated code for bit tricks. > > This replaces VMMaker.oscog-nice.2911 that screwed things up (hex generates the radix 16r). > VMMaker.oscog-nice.2911 should be thrown away. > > =============== Diff against VMMaker.oscog-nice.2910 =============== > > Item was changed: > ----- Method: CCodeGenerator>>cLiteralFor: (in category 'C code generator') ----- > cLiteralFor: anObject > "Return a string representing the C literal value for the given object." > + > anObject isNumber > ifTrue: > [anObject isInteger ifTrue: > + [| hex dec useHexa | > + hex := anObject printStringBase: 16. > + dec := anObject printStringBase: 10. > + useHexa := (anObject > 255 > + and: [(hex asSet size * 3) <= (dec asSet size * 2) > + or: [((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * 3)]]) > + or: [anObject > 0 > - [| hex | > - hex := (anObject > 0 > and: [(anObject >> anObject lowBit + 1) isPowerOfTwo > and: [(anObject highBit = anObject lowBit and: [anObject > 65536]) > + or: [anObject highBit - anObject lowBit >= 4]]]]. > + ^self cLiteralForInteger: anObject hex: useHexa]. > - or: [anObject highBit - anObject lowBit >= 4]]]). > - ^self cLiteralForInteger: anObject hex: hex]. > anObject isFloat ifTrue: > [^anObject printString]] > ifFalse: > [anObject isSymbol ifTrue: > [^self cFunctionNameFor: anObject]. > anObject isString ifTrue: > [^'"', (anObject copyReplaceAll: (String with: Character cr) with: '\n') , '"']. > anObject == nil ifTrue: [^ 'null' ]. > anObject == true ifTrue: [^ '1' ]. > anObject == false ifTrue: [^ '0' ]. > anObject isCharacter ifTrue: > [^anObject == $' > ifTrue: ['''\'''''] "i.e. '\''" > ifFalse: [anObject asString printString]]]. > self error: 'Warning: A Smalltalk literal could not be translated into a C constant: ', anObject printString. > ^'"XXX UNTRANSLATABLE CONSTANT XXX"'! From nicolas.cellier.aka.nice at gmail.com Tue Dec 29 09:29:37 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 29 Dec 2020 10:29:37 +0100 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2912.mcz In-Reply-To: References: Message-ID: Oh my, 3 pairs of eyes are better than 2! And yes, it would be simpler to retain the literal node format, at least the base... We could also use special formatting rules for operands of bit ops... Le mar. 29 déc. 2020 à 10:04, Tobias Pape a écrit : > > Hi > > > > On 29. Dec 2020, at 06:06, Eliot Miranda > wrote: > > > > Hi Nicolas, > > > > re "((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size > * 3)", I *love* it! I hadn't thought of this way. That's great. I/we > should add some comments to indicate what we're wanting to achieve. > > > > shouldnt that be > ((hex as: RunArray) runs size * 4) < ((dec as: RunArray) runs size * 3) > instead of > ((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * 3) > > ? > -t > > > P.S. modifying the bytecode compiler so it respects the base of integer > constants when doing pretty printing is IMO something we've needed for > years and years. LiteralNode could have an optional base or we could have > a NumericLiteralNode subclass. But it is the Scanner that needs to collect > the information in the first place. > > > > On Sun, Dec 27, 2020 at 7:22 AM wrote: > > > > Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: > > http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2912.mcz > > > > ==================== Summary ==================== > > > > Name: VMMaker.oscog-nice.2912 > > Author: nice > > Time: 27 December 2020, 4:21:39.377922 pm > > UUID: 607e7bf3-9cd1-4a6b-ac0c-7261a969519b > > Ancestors: VMMaker.oscog-nice.2910 > > > > Complexify the rule for generating hex literal constants when more > intellegible than decimal. > > > > This is useful for having a chance to decipher generated code for bit > tricks. > > > > This replaces VMMaker.oscog-nice.2911 that screwed things up (hex > generates the radix 16r). > > VMMaker.oscog-nice.2911 should be thrown away. > > > > =============== Diff against VMMaker.oscog-nice.2910 =============== > > > > Item was changed: > > ----- Method: CCodeGenerator>>cLiteralFor: (in category 'C code > generator') ----- > > cLiteralFor: anObject > > "Return a string representing the C literal value for the given > object." > > + > > anObject isNumber > > ifTrue: > > [anObject isInteger ifTrue: > > + [| hex dec useHexa | > > + hex := anObject printStringBase: 16. > > + dec := anObject printStringBase: 10. > > + useHexa := (anObject > 255 > > + and: > [(hex asSet size * 3) <= (dec asSet size * 2) > > + > or: [((hex as: RunArray) runs size * 4) < ((hex as: RunArray) runs size * > 3)]]) > > + or: [anObject > 0 > > - [| hex | > > - hex := (anObject > 0 > > and: > [(anObject >> anObject lowBit + 1) isPowerOfTwo > > and: > [(anObject highBit = anObject lowBit and: [anObject > 65536]) > > + > or: [anObject highBit - anObject lowBit >= 4]]]]. > > + ^self cLiteralForInteger: anObject hex: > useHexa]. > > - > or: [anObject highBit - anObject lowBit >= 4]]]). > > - ^self cLiteralForInteger: anObject hex: > hex]. > > anObject isFloat ifTrue: > > [^anObject printString]] > > ifFalse: > > [anObject isSymbol ifTrue: > > [^self cFunctionNameFor: anObject]. > > anObject isString ifTrue: > > [^'"', (anObject copyReplaceAll: (String > with: Character cr) with: '\n') , '"']. > > anObject == nil ifTrue: [^ 'null' ]. > > anObject == true ifTrue: [^ '1' ]. > > anObject == false ifTrue: [^ '0' ]. > > anObject isCharacter ifTrue: > > [^anObject == $' > > ifTrue: ['''\'''''] "i.e. '\''" > > ifFalse: [anObject asString > printString]]]. > > self error: 'Warning: A Smalltalk literal could not be > translated into a C constant: ', anObject printString. > > ^'"XXX UNTRANSLATABLE CONSTANT XXX"'! > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Dec 29 13:35:25 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 29 Dec 2020 13:35:25 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2913.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2913.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2913 Author: nice Time: 29 December 2020, 2:35:15.410054 pm UUID: 7424bace-30d6-4cff-87e5-8bed5d7709fc Ancestors: VMMaker.oscog-nice.2910 Complexify the rule for generating hex literal constants when more intellegible than decimal. This is useful for having a chance to decipher generated code for bit tricks. Document the intended behavior with a small test. This replaces VMMaker.oscog-nice.2912 that screwed things up (had a copy/paste bug). VMMaker.oscog-nice.2912 should be thrown away as well as previus attempt VMMaker.oscog-nice.2911 =============== Diff against VMMaker.oscog-nice.2910 =============== Item was changed: ----- Method: CCodeGenerator>>cLiteralFor: (in category 'C code generator') ----- cLiteralFor: anObject "Return a string representing the C literal value for the given object." + anObject isNumber ifTrue: [anObject isInteger ifTrue: + [| hex dec useHexa | + hex := anObject printStringBase: 16. + dec := anObject printStringBase: 10. + useHexa := (anObject > 255 + and: [(hex asSet size * 3) <= (dec asSet size * 2) + or: [((hex as: RunArray) runs size * 4) < ((dec as: RunArray) runs size * 3)]]) + or: [anObject > 0 - [| hex | - hex := (anObject > 0 and: [(anObject >> anObject lowBit + 1) isPowerOfTwo and: [(anObject highBit = anObject lowBit and: [anObject > 65536]) + or: [anObject highBit - anObject lowBit >= 4]]]]. + ^self cLiteralForInteger: anObject hex: useHexa]. - or: [anObject highBit - anObject lowBit >= 4]]]). - ^self cLiteralForInteger: anObject hex: hex]. anObject isFloat ifTrue: [^anObject printString]] ifFalse: [anObject isSymbol ifTrue: [^self cFunctionNameFor: anObject]. anObject isString ifTrue: [^'"', (anObject copyReplaceAll: (String with: Character cr) with: '\n') , '"']. anObject == nil ifTrue: [^ 'null' ]. anObject == true ifTrue: [^ '1' ]. anObject == false ifTrue: [^ '0' ]. anObject isCharacter ifTrue: [^anObject == $' ifTrue: ['''\'''''] "i.e. '\''" ifFalse: [anObject asString printString]]]. self error: 'Warning: A Smalltalk literal could not be translated into a C constant: ', anObject printString. ^'"XXX UNTRANSLATABLE CONSTANT XXX"'! Item was changed: ----- Method: CCodeGeneratorTests>>testIntegerGeneration (in category 'tests') ----- testIntegerGeneration + "Test the 32-bit integers. They need to be marked as unsigned. - "Test the 32-bit integers. They need to be marked as unsigned longs. Test 16rFFFFFFFF, 16rFFFFFFFE, ... through to ..., 16rC0000000, 16r80000000" ((0 to: 31) collect: [:shift| 16rFFFFFFFF bitClear: (1 bitShift: shift) - 1]) do: + [:number| | literal isHex isDec | - [:number| | literal | literal := self cg cLiteralFor: number. + isHex := (literal beginsWith: '0x') and: [((literal allButFirst: 2) allButLast: 1) allSatisfy: [:c| '0123456789CEF' includes: c]]. + isDec := (literal allButLast: 1) allSatisfy: [:c| c isDigit]. + self assert: isHex | isDec. + self assert: (literal endsWith: 'U'). - self assert: ((literal allButLast: 2) allSatisfy: [:c| c isDigit]). - self assert: (literal endsWith: 'UL'). literal := self cg cLiteralFor: number name: 'Mask'. self assert: (literal beginsWith: '0x'). + self assert: (((literal allButFirst: 2) allButLast: 1) allSatisfy: [:c| '0123456789CEF' includes: c]). + self assert: (literal endsWith: 'U')]. - self assert: (((literal allButFirst: 2) allButLast: 2) allSatisfy: [:c| '0123456789CEF' includes: c]). - self assert: (literal endsWith: 'UL')]. "Test the 64-bit integers. They need to be marked as unsigned long longs." ((32 to: 63) collect: [:shift| 16rFFFFFFFFFFFFFFFF bitClear: (1 bitShift: shift) - 1]) do: + [:number| | literal isHex isDec | - [:number| | literal | literal := self cg cLiteralFor: number. + isHex := (literal beginsWith: '0x') and: [((literal allButFirst: 2) allButLast: 3) allSatisfy: [:c| '0123456789CEF' includes: c]]. + isDec := (literal allButLast: 3) allSatisfy: [:c| c isDigit]. + self assert: isHex | isDec. - self assert: ((literal allButLast: 3) allSatisfy: [:c| c isDigit]). self assert: (literal endsWith: 'ULL'). literal := self cg cLiteralFor: number name: 'Mask'. self assert: (literal beginsWith: '0x'). self assert: (((literal allButFirst: 2) allButLast: 3) allSatisfy: [:c| '0123456789CEF' includes: c]). self assert: (literal endsWith: 'ULL')]! Item was added: + ----- Method: CCodeGeneratorTests>>testIntegerGenerationHexOrDec (in category 'tests') ----- + testIntegerGenerationHexOrDec + | decPrefered hexPrefered | + hexPrefered := #( + 16r100 16r400 16r10000 "powers of two (more than 8 bits)" + 16r1F 16r3FF 16rFFFF "powers of two minus 1 - with at least 5 bits set" + 16r3E 16r3FF00 16r1FE0 "shifted powers of two minus 1 - wih at least 5 bit set..." + 16r38000 "... or having highBit >= 16" + 16rC00 "... or requiring 1.5 times less different characters than decimal form - here 2 instead of 4" + 16r1F1F 16rCCCC 16r112233 "some regular bit patterns" + 2r111000111000111000111 "not necessarily falling on 4 bits boundaries" + ). + decPrefered := #( + 0 1 2 3 4 5 6 7 8 9 "single digit" + 10 100 1000 10000 "powers of ten" + 9 99 999 9999 "powers of ten minus 1" + 16r10 16r20 16r40 16r80 "small powers of two" + 16r60 16rC0 16rF0 16r1E00 "shifted powers of two minus 1 - with less than 5 bits set" + 112233 15341 "random patterns when no hex rule apply" + 2r1111100000111110000011111000001111100000 "regular bit pattern if the decimal form appear somehow also regular - here it uses a pattern of only 4 different digits : 1066193093600"). + hexPrefered do: [:number || literal | + literal := self cg cLiteralFor: number. + self assert: (literal beginsWith: '0x')]. + decPrefered do: [:number || literal | + literal := self cg cLiteralFor: number. + self deny: (literal beginsWith: '0x')].! Item was changed: ----- Method: SlangTests>>testSimpleMethod (in category 'tests') ----- testSimpleMethod | codeGenerator tMethod code | codeGenerator := CCodeGenerator new. tMethod := codeGenerator compileToTMethodSelector: #extBBytecode in: StackInterpreter. self assert: #( #'[' byte #':=' self fetchByte #'.' self fetchNextBytecode #'.' extB #':=' #(numExtB #= 0 and: #'[' byte #> 127 #']') ifTrue: #'[' byte #- 256 #']' ifFalse: #'[' #(extB bitShift: 8) #+ byte #']' #'.' numExtB #':=' numExtB #+ 1 #'.' #'^' self #']') equals: (Scanner new scanTokens: tMethod parseTree printString). code := String streamContents: [:s| tMethod emitCCodeOn: s generator: codeGenerator]. code := code allButFirst: (code indexOfSubCollection: 'sqInt') - 1. self assert: #('sqInt' 'extBBytecode(void)' '{' 'sqInt' 'byte;' 'byte' '=' 'fetchByte();' 'fetchNextBytecode();' 'extB' '=' '((numExtB' '==' '0)' '&&' '(byte' '>' '0x7F)' + '?' 'byte' '-' '0x100' + ':' '((((sqInt)((usqInt)(extB)' '<<' '8))))' '+' 'byte);' - '?' 'byte' '-' '256' - ':' '(((usqInt)' 'extB' '<<' '8))' '+' 'byte);' 'numExtB' '+=' '1;' 'return' 'self;' '}') equals: (code findTokens: Character separators) asArray ! From noreply at github.com Tue Dec 29 20:38:59 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 29 Dec 2020 12:38:59 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 5479a7: Add command line arg (so far on iOS only) to speci... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 5479a787d03b8140c4398c2b8088d0002901045f https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/5479a787d03b8140c4398c2b8088d0002901045f Author: Eliot Miranda Date: 2020-12-29 (Tue, 29 Dec 2020) Changed paths: M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m Log Message: ----------- Add command line arg (so far on iOS only) to specify event tracing mask. So now via e.g. open --stderr `tty` `pwd`/Squeak.app --args -eventtrace -4 one can see input events coming into the system. [ci skip] From notifications at github.com Wed Dec 30 15:10:19 2020 From: notifications at github.com (Christoph Thiede) Date: Wed, 30 Dec 2020 07:10:19 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) Message-ID: Sorry for the complex title. I'm not yet sure what is the error in my particular configuration. I'm trying to write a Dockerfile to run Squeak on my raspberry pi (4b+, set up with 64 bit). I downloaded this release: `squeak.cog.spur_linux64x64_202003021730` and tried to execute it without any arguments for the beginning: ``` root at cadc927632ce:/# ./sqcogspur64linuxht/squeak not a dynamic executable Error. Could not determine platform's libc path for VM. Try forcing $PLATFORMLIBDIR in ./sqcogspur64linuxht/squeak, based on LIBC_SO. Please report what works to squeak [vm-dev] mail list. LIBC_SO= DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS" NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04" VERSION_CODENAME=focal UBUNTU_CODENAME=focal UNAME=Linux cadc927632ce 5.4.79-v8+ #1373 SMP PREEMPT Mon Nov 23 13:32:41 GMT 2020 aarch64 aarch64 aarch64 GNU/Linux System seems to be 64 bit. You may need to (re)install the 32-bit libraries. ``` What does this error message want to tell me? Which libraries should I install? I already gave this \[\] a try, but I only get 404 errors for i386 repository - [it looks as if it is not available for Ubuntu 20.](https://eofla.wordpress.com/2020/04/01/ubuntu-20-04-lts-i386-repository-fade-out/) Can you help me? What libraries and packages do I need to install to get a (headful, planning to use `ssh -X`) running in my container? (PS: Probably a Squeak alternative for http://get.pharo.org/ could be helpful, too. :-)) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Wed Dec 30 15:29:21 2020 From: notifications at github.com (Stephan Eggermont) Date: Wed, 30 Dec 2020 07:29:21 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: I would not expect an x64 binary to run on arm -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752662061 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Wed Dec 30 16:44:15 2020 From: notifications at github.com (Christoph Thiede) Date: Wed, 30 Dec 2020 08:44:15 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: Can you elaborate on that, please? I thought aarch64 would be a 64-bit system. Getting the same error with `linux32x86` ... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752685925 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Wed Dec 30 16:59:14 2020 From: notifications at github.com (Tobias Pape) Date: Wed, 30 Dec 2020 08:59:14 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: The Pi is an ARM system, not an Intel system. It runs with the ARM 64-bit instruction set, called `aarch64`. The VM you have is for "intel" 64-bit, aka `x64`, or `x86_64` or `amd64` and so on. The VN is not for your processor. you need to download the ARM variant ( “Linux (ARM)” in the Screenshot ) Bildschirmfoto 2020-12-30 um 17 57 04 Note that you probably need some libraries, too, because the VM is for the Raspberry-Pi 2 and 3 compatible ARMv6 instruction set (which is a 32-bit one) so you might need some multi-arch support in ubuntu. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752690082 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Wed Dec 30 17:02:21 2020 From: notifications at github.com (Tobias Pape) Date: Wed, 30 Dec 2020 09:02:21 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: The respective names in the repo are `linux64ARMv8`, `linux32ARMv7`, and `build.linux32ARMv6`. (we do not have auto-built VMs for the 64ARMv8 yet, so you might need to compile it yourself if you want to use that) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752691066 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Wed Dec 30 17:44:45 2020 From: notifications at github.com (Christoph Thiede) Date: Wed, 30 Dec 2020 09:44:45 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: I have tried my luck now with `squeak.cog.spur_linux32ARMv6_202003021730`, but I keep getting the same error message. A docker container will always use the same architecture/bitness as the host system, won't it? I am a bit confused: From my Windows Subsystem for Linux (x64), I am used to seeing some kind of "cannot execute binary file: Exec format error" messages if I run a 32-bit application so the bitness does not match. Why don't I see errors like this in my docker container? It looks as if the VM executable itself can be run. > Note that you probably need some libraries, too, because the VM is for the Raspberry-Pi 2 and 3 compatible ARMv6 instruction set (which is a 32-bit one) so you might need some multi-arch support in ubuntu. Can you give me a pointer on how to find these libraries? I also tried to compile `linux64ARMv8` manually, but how can I cross-compile this from my Intel x64 Ubuntu system? The mvm script terminates with: "configure: error: C compiler cannot create executables" and `config.log` contains "cc1: error: bad value ('armv8-a') for '-march=' switch". The internet says I should use `aarch64-linux-gnu-gcc` or `arm-linux-gnueabi-gcc` (not sure which) instead of `gcc`, but how can I tell mvm to use this? 🤯 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752703288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Dec 30 18:28:41 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 30 Dec 2020 10:28:41 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: <0ECDFA0A-C4D7-4364-A4BB-0E2B2720943F@rowledge.org> ARM64 VM works just fine on suitable Raspberry Pi's. And indeed on a suitable phone. Outside of simply connecting to a few docker-like containers I have no knowledge that would help with docker details, but... > On 2020-12-30, at 9:44 AM, Christoph Thiede wrote: > > I also tried to compile linux64ARMv8 manually, but how can I cross-compile this from my Intel x64 Ubuntu system? Why on earth would you do that? why go to all the trouble of messing with cross-compiler setups (which will certainly involve you getting cross) when you can just do it on the actual machine? It takes a whole couple of minutes to compile on a Pi 4 for example. Do the stuff to mount your git related directory tree to the Pi, run a terminal on the Pi, cd to the right build directory and go. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim "Bo***x" said Pooh when Piglet kneed him in the groin. From noreply at github.com Wed Dec 30 18:54:17 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 30 Dec 2020 10:54:17 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 564777: Win32 SoundPlugin: Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 564777b9465f67aea28888f290e14caf509560f2 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/564777b9465f67aea28888f290e14caf509560f2 Author: Eliot Miranda Date: 2020-12-30 (Wed, 30 Dec 2020) Changed paths: M platforms/win32/plugins/SoundPlugin/sqWin32DPRINTF.h M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c Log Message: ----------- Win32 SoundPlugin: Do not release and recreate the DirectSoundCapture8 instance and CaptureBuffer on start/stop recording. Do release them on plugin shutdown. If interperating with the Terf AEC code do make sure that both the DirectX and the AEC recording state is shutdown on stop recording. Complexify the logging support to separate logging of input/microphone from that of output/speaker, and to separate out verbose logging from state change logging. The macrology for this is still in progress cuz one has to control it with the SOundPlugin Makefile. If the DirectSoundCapture8 instance and CaptureBuffer are released and recreated on stop recording then after only a handful of sutch releases CaptureBuffer allocation fails once. It can be fixed by subsequent release/recreation after a few minutes, but there is a debilitating period when input is broken. Commit: 85708ef49584576d6ddbc575c068b044eaf19108 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/85708ef49584576d6ddbc575c068b044eaf19108 Author: Eliot Miranda Date: 2020-12-30 (Wed, 30 Dec 2020) Changed paths: M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m Log Message: ----------- Merge branch 'Cog' of https://github.com/OpenSmalltalk/opensmalltalk-vm into Cog Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/5479a787d03b...85708ef49584 From no-reply at appveyor.com Wed Dec 30 19:00:29 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 30 Dec 2020 19:00:29 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2333 Message-ID: <20201230190029.1.4FFBBA8CD5343CDF@appveyor.com> An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Wed Dec 30 21:06:23 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Wed, 30 Dec 2020 13:06:23 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> <4064FEFA-E1A9-45E8-BCB7-8CF72D41087A@rowledge.org> <94DC8077-F3A3-4C6B-9FEB-5E405649C7AB@rowledge.org> Message-ID: I finally dug up the Asteroid Blaster project (thanks to Abe-san) and tried it on the last VM built from the head of Cog branch. I cannot tell the "odd hesitation", Is there something else I should check? On Fri, Dec 18, 2020 at 10:44 AM Yoshiki Ohshima wrote: > Where can I try the Asteroid Blaster? My workaround was just divide the > wait time by 1000 and I'm curious to see if that has different effects on a > different example. > > On Mon, Dec 14, 2020 at 10:01 AM tim Rowledge wrote: > >> >> >> >> > On 2020-12-14, at 9:31 AM, Yoshiki Ohshima >> wrote: >> > >> > Thanks. >> > >> > I had a workaround but was not for real. Levente's patch works for me. >> >> It's a big improvement but there is still something making for odd >> hesitations in Asteroid Blaster; which is obviously one of the most >> important benchmarks imaginable. Probably not a VM thing though >> >> >> tim >> -- >> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim >> Earth is 98% full...please delete anyone you can. >> >> >> > > -- > -- Yoshiki > > -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Thu Dec 31 00:45:53 2020 From: notifications at github.com (Christoph Thiede) Date: Wed, 30 Dec 2020 16:45:53 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: Thanks for the help, Tim! > Why on earth would you do that? I didn't want to pollute my raspi with that compilation stuff ... However, now I did it (also thanks to the [help by Bruce](http://forum.world.st/Fwd-OpenSmalltalk-opensmalltalk-vm-Trouble-running-OSVM-in-an-Ubuntu-20-aarch64-docker-raspi-544-td5125719.html)) and succeeded to compile! Next problem: ``` root at 96fa02af4449:/# /bin/squeak/squeak /image/Squeak6.0alpha-20135-64bit.image -headless mprotect(x,y,PROT_READ | PROT_EXEC): Permission denied Segmentation fault (core dumped) ``` You mentioned the same problem [here](http://forum.world.st/nuSqueak-source-td5123803i20.html#a5124155:~:text=mprotect), but above you write that "ARM64 VM works just fine on suitable Raspberry Pi's". Could you resolve the problem in the mean time, or did you find another workaround? :-) -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752803523 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Thu Dec 31 00:52:24 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 30 Dec 2020 16:52:24 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: <64A3F2D4-3989-4F08-BBAF-B3CAB0998BF9@rowledge.org> > On 2020-12-30, at 4:45 PM, Christoph Thiede wrote: > > > Thanks for the help, Tim! > > Why on earth would you do that? > > I didn't want to pollute my raspi with that compilation stuff ... However, now I did it (also thanks to the help by Bruce) and succeeded to compile! But all the compiler/tools stuff is already there. Remember, this is a full development workstation with more power than we fantasised about not so long ago. > > Next problem: > > root at 96fa02af4449:/# /bin/squeak/squeak /image/Squeak6.0alpha-20135-64bit.image -headless > mprotect(x,y,PROT_READ | PROT_EXEC): Permission denied > Segmentation fault (core dumped) install libevdev seems to fix it. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Useful random insult:- Teflon brain -- nothing sticks. From notifications at github.com Thu Dec 31 01:00:00 2020 From: notifications at github.com (Christoph Thiede) Date: Wed, 30 Dec 2020 17:00:00 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: > But all the compiler/tools stuff is already there. Remember, this is a full development workstation with more power than we fantasised about not so long ago. True :D > install libevdev seems to fix it. Which one are you referring to? ``` root at 96fa02af4449:/# apt search libevdev Sorting... Done Full Text Search... Done libevdev-dev/focal-updates 1.9.0+dfsg-1ubuntu0.1 arm64 wrapper library for evdev devices - development files libevdev-doc/focal-updates 1.9.0+dfsg-1ubuntu0.1 all wrapper library for evdev devices - development docs libevdev-tools/focal-updates 1.9.0+dfsg-1ubuntu0.1 arm64 wrapper library for evdev devices - tools libevdev2/focal-updates 1.9.0+dfsg-1ubuntu0.1 arm64 wrapper library for evdev devices ``` -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752805876 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Thu Dec 31 01:12:21 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 30 Dec 2020 17:12:21 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: <1E8A1D87-B401-4CC7-B0E5-28405F146B65@rowledge.org> > On 2020-12-30, at 5:00 PM, Christoph Thiede wrote: > > > But all the compiler/tools stuff is already there. Remember, this is a full development workstation with more power than we fantasised about not so long ago. > > True :D > > install libevdev seems to fix it. > > Which one are you referring to? Sorry - libevdev-dev - which may be the most redundantly redundant library name I've redundantly seen repeated. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Fractured Idiom:- MERCI RIEN - Thanks for nothin'. From commits at source.squeak.org Thu Dec 31 09:06:50 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 31 Dec 2020 09:06:50 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2914.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2914.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2914 Author: nice Time: 31 December 2020, 10:06:40.613299 am UUID: 0e1f0f1f-96ba-41ec-8f4f-c0d2fb618a21 Ancestors: VMMaker.oscog-nice.2913 A few fixes for the VM tests - enable using a WordArray as simulation memory - concretizeAt: does not answer the instruction size but the next address =============== Diff against VMMaker.oscog-nice.2913 =============== Item was changed: ----- Method: AbstractInstructionTests>>generateInstructions (in category 'generating machine code') ----- generateInstructions "See Cogit>>computeMaximumSizes, generateInstructionsAt: & outputInstructionsAt:. This is a pure Smalltalk (non-Slang) version of that trio of methods." | address pcDependentInstructions instructions | address := 0. pcDependentInstructions := OrderedCollection new. opcodes do: [:abstractInstruction| abstractInstruction address: address; maxSize: abstractInstruction computeMaximumSize. address := address + abstractInstruction maxSize]. address := 0. opcodes do: [:abstractInstruction| abstractInstruction isPCDependent ifTrue: [abstractInstruction sizePCDependentInstructionAt: address. pcDependentInstructions addLast: abstractInstruction. address := address + abstractInstruction machineCodeSize] ifFalse: [address := abstractInstruction concretizeAt: address]]. pcDependentInstructions do: [:abstractInstruction| abstractInstruction concretizeAt: abstractInstruction address]. instructions := ByteArray new: address. address := 0. opcodes do: [:abstractInstruction| | machineCodeBytes | self assert: abstractInstruction address = address. machineCodeBytes := self memoryAsBytes: abstractInstruction machineCode object. 1 to: abstractInstruction machineCodeSize do: [:j| + instructions at: address + 1 put: (machineCodeBytes byteAt: j). - instructions at: address + 1 put: (machineCodeBytes at: j). address := address + 1]]. ^instructions! Item was changed: ----- Method: AbstractInstructionTests>>runAddCwR: (in category 'running') ----- runAddCwR: assertPrintBar "self defaultTester runAddCwR: false" self concreteCompilerClass dataRegistersWithAccessorsDo: [:reg :rgetter :rsetter| self pairs: (-2 to: 2) do: [:a :b| | inst len bogus memory | inst := self gen: AddCwR operand: a operand: reg. len := inst concretizeAt: 0. memory := self memoryAsBytes: inst machineCode. self processor reset; perform: rsetter with: (self processor convertIntegerToInternal: b). [[processor pc < len] whileTrue: + [processor singleStepIn: memory]] - [self processor singleStepIn: memory]] on: Error do: [:ex| ]. "self processor printRegistersOn: Transcript. Transcript show: (self processor disassembleInstructionAt: 0 In: memory); cr" assertPrintBar ifTrue: [self assert: processor pc = inst machineCodeSize. self assertCheckLongArithOpCodeSize: inst machineCodeSize] ifFalse: [bogus := processor pc ~= inst machineCodeSize]. self concreteCompilerClass dataRegistersWithAccessorsDo: [:ireg :getter :setter| | expected | (self concreteCompilerClass isRISCTempRegister: ireg) ifFalse: [expected := getter == rgetter ifTrue: [b + a] ifFalse: [0]. assertPrintBar ifTrue: [self assert: (self processor convertInternalToInteger: (self processor perform: getter)) equals: expected] ifFalse: [(self processor convertInternalToInteger: (self processor perform: getter)) ~= expected ifTrue: [bogus := true]]]. assertPrintBar ifFalse: [Transcript nextPutAll: rgetter; nextPut: $(; print: b; nextPutAll: ') + '; print: a; nextPutAll: ' = '; print: (self processor convertInternalToInteger: (self processor perform: rgetter)); cr; flush. bogus ifTrue: [self processor printRegistersOn: Transcript. Transcript show: (self processor disassembleInstructionAt: 0 In: memory); cr]]]]]! Item was changed: ----- Method: AbstractInstructionTests>>testNegateR (in category 'running') ----- testNegateR "self defaultTester testNegateR" self concreteCompilerClass dataRegistersWithAccessorsDo: [:reg :rgetter :rsetter| -2 to: 2 do: [:a| | inst len memory | inst := self gen: NegateR operand: reg. len := inst concretizeAt: 0. memory := self memoryAsBytes: inst machineCode. self processor reset; perform: rsetter with: (processor convertIntegerToInternal: a). [[processor pc < len] whileTrue: + [processor singleStepIn: memory]] - [self processor singleStepIn: memory]] on: Error do: [:ex| ]. "self processor printRegistersOn: Transcript. Transcript show: (self processor disassembleInstructionAt: 0 In: memory); cr" self assert: processor pc equals: inst machineCodeSize. self concreteCompilerClass dataRegistersWithAccessorsDo: [:ireg :getter :setter| | expected | expected := getter == rgetter ifTrue: [ a negated ] ifFalse: [0]. self assert: (processor convertInternalToInteger: (processor perform: getter)) equals: expected]]]! Item was changed: ----- Method: CogARMCompilerForTests>>concretizeAt: (in category 'generate machine code') ----- concretizeAt: actualAddress "Override to check maxSize and machineCodeSize" + | maxAddress nextAddress | - | size | maxSize ifNil: [maxSize := self computeMaximumSize]. + maxAddress := actualAddress + maxSize. + nextAddress := super concretizeAt: actualAddress. - size := super concretizeAt: actualAddress. self assert: (maxSize notNil and: [self isPCDependent + ifTrue: [maxAddress >= nextAddress] + ifFalse: [maxAddress = nextAddress]]). + ^nextAddress! - ifTrue: [maxSize >= size] - ifFalse: [maxSize = size]]). - ^size! Item was changed: ----- Method: CogIA32CompilerForTests>>concretizeAt: (in category 'generate machine code') ----- concretizeAt: actualAddress "Override to check maxSize and machineCodeSize" + | maxAddress nextAddress | - | size | maxSize ifNil: [maxSize := self computeMaximumSize]. + maxAddress := actualAddress + maxSize. + nextAddress := super concretizeAt: actualAddress. - size := super concretizeAt: actualAddress. self assert: (maxSize notNil and: [self isPCDependent + ifTrue: [maxAddress >= nextAddress] + ifFalse: [maxAddress = nextAddress]]). + ^nextAddress! - ifTrue: [maxSize >= size] - ifFalse: [maxSize = size]]). - ^size! Item was changed: ----- Method: CogX64CompilerForTests>>concretizeAt: (in category 'generate machine code') ----- concretizeAt: actualAddress "Override to check maxSize and machineCodeSize" + | maxAddress nextAddress | - | size | maxSize ifNil: [maxSize := self computeMaximumSize]. + maxAddress := actualAddress + maxSize. + nextAddress := super concretizeAt: actualAddress. - size := super concretizeAt: actualAddress. self assert: (maxSize notNil and: [self isPCDependent + ifTrue: [maxAddress >= nextAddress] + ifFalse: [maxAddress = nextAddress]]). + ^nextAddress! - ifTrue: [maxSize >= size] - ifFalse: [maxSize = size]]). - ^size! Item was changed: VMClass subclass: #OutOfLineLiteralsManager instanceVariableNames: 'cogit objectMemory objectRepresentation firstOpcodeIndex nextLiteralIndex lastDumpedLiteralIndex literals literalsSize savedFirstOpcodeIndex savedNextLiteralIndex savedLastDumpedLiteralIndex' classVariableNames: '' poolDictionaries: 'CogAbstractRegisters CogCompilationConstants CogRTLOpcodes' category: 'VMMaker-JIT'! + !OutOfLineLiteralsManager commentStamp: 'nice 12/31/2020 09:14' prior: 0! + An OutOfLineLiteralsManager manages the dumping of literals for backends that want to keep literals out-of-line, accessed by pc-relative addressing. - !OutOfLineLiteralsManager commentStamp: 'eem 6/7/2015 12:10' prior: 0! - An OutOfLineLiteralsManager manages the dumping of literals for backends that wat to keep literals out-of-line, accessed by pc-relative addressing. Instance Variables cogit: ! Item was added: + ----- Method: RawBitsArray>>byteAt: (in category '*VMMaker-simulation') ----- + byteAt: anInteger + "emulate an access to raw (unsigned) bytes, as if the receiver was a ByteArray" + + | element p | + p := self bytesPerBasicElement. + p = 1 ifTrue: [^self basicAt: 1]. + element := self basicAt: anInteger + p - 1 // p. + ^Smalltalk isLittleEndian + ifTrue: [element digitAt: anInteger - 1 \\ p + 1] + ifFalse: [element digitAt: p - (anInteger \\ p)] + ! Item was added: + ----- Method: WordArray>>unsignedLongAt:bigEndian: (in category '*VMMaker-JITsimulation') ----- + unsignedLongAt: byteIndex bigEndian: bigEndian + "Compatiblity with the ByteArray & Alien methods of the same name." + | wordIndex lowBits word hiWord | + wordIndex := byteIndex - 1 // 4 + 1. + lowBits := byteIndex - 1 bitAnd: 3. + word := self at: wordIndex. + lowBits > 0 ifTrue: "access straddles two words" + [hiWord := self at: wordIndex + 1. + word := (word bitShift: lowBits * -8) + (hiWord bitShift: 4 - lowBits * 8)]. + word := word bitAnd: 16rFFFFFFFF. + bigEndian + ifTrue: + [word := ((word bitShift: -24) bitAnd: 16rFF) + + ((word bitShift: -8) bitAnd: 16rFF00) + + ((word bitAnd: 16rFF00) bitShift: 8) + + ((word bitAnd: 16rFF) bitShift: 24)]. + ^word! From commits at source.squeak.org Thu Dec 31 09:08:46 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 31 Dec 2020 09:08:46 0000 Subject: [Vm-dev] VM Maker: Cog-nice.429.mcz Message-ID: Nicolas Cellier uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-nice.429.mcz ==================== Summary ==================== Name: Cog-nice.429 Author: nice Time: 31 December 2020, 10:08:44.719565 am UUID: 3b588f4d-7263-43c7-87b9-e3f1d9a7bd85 Ancestors: Cog-eem.428 Enable using a WordArray or other RawBitsArray species as simulation memory. This implies using byteSize at a few places. =============== Diff against Cog-eem.428 =============== Item was changed: ----- Method: CogProcessorAlien>>singleStepIn: (in category 'execution') ----- singleStepIn: aMemory | result | + result := self primitiveSingleStepInMemory: aMemory minimumAddress: 0 readOnlyBelow: aMemory byteSize. - result := self primitiveSingleStepInMemory: aMemory minimumAddress: 0 readOnlyBelow: aMemory size. result ~~ self ifTrue: [self error: 'eek!!']! Item was changed: ----- Method: MIPSSimulator>>initializeWithMemory: (in category 'as yet unclassified') ----- + initializeWithMemory: aRawBitsArray + memory := aRawBitsArray. - initializeWithMemory: aByteArray - memory := aByteArray. readableBase := 0. writableBase := 0. executableBase := 0. + readableLimit := memory byteSize. + writableLimit := memory byteSize. + executableLimit := memory byteSize.! - readableLimit := memory size. - writableLimit := memory size. - executableLimit := memory size.! From notifications at github.com Thu Dec 31 12:18:58 2020 From: notifications at github.com (Christoph Thiede) Date: Thu, 31 Dec 2020 04:18:58 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: I have tried that and built the VM again, but I keep getting the same mprotect error message :( Any other ideas? -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752942612 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.dickey at whidbey.com Thu Dec 31 14:10:28 2020 From: ken.dickey at whidbey.com (ken.dickey at whidbey.com) Date: Thu, 31 Dec 2020 06:10:28 -0800 Subject: [Vm-dev] Vm-dev Digest, Vol 174, Issue 28 In-Reply-To: References: Message-ID: On 2020-12-31 04:19, vm-dev-request at lists.squeakfoundation.org wrote: > Send Vm-dev mailing list submissions to > vm-dev at lists.squeakfoundation.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.squeakfoundation.org/mailman/listinfo/vm-dev > or, via email, send a message with subject or body 'help' to > vm-dev-request at lists.squeakfoundation.org > > You can reach the person managing the list at > vm-dev-owner at lists.squeakfoundation.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Vm-dev digest..." > > > Today's Topics: > > 1. Re: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in > an Ubuntu 20/aarch64 docker (raspi) (#544) (tim Rowledge) > 2. Re: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in > an Ubuntu 20/aarch64 docker (raspi) (#544) (Christoph Thiede) > 3. Re: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in > an Ubuntu 20/aarch64 docker (raspi) (#544) (tim Rowledge) > 4. VM Maker: VMMaker.oscog-nice.2914.mcz (commits at source.squeak.org) > 5. VM Maker: Cog-nice.429.mcz (commits at source.squeak.org) > 6. Re: [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in > an Ubuntu 20/aarch64 docker (raspi) (#544) (Christoph Thiede) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 30 Dec 2020 16:52:24 -0800 > From: tim Rowledge > To: OpenSmalltalk/opensmalltalk-vm > , > Squeak Virtual Machine Development Discussion > > Cc: OpenSmalltalk/opensmalltalk-vm > > Subject: Re: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running > OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) > Message-ID: <64A3F2D4-3989-4F08-BBAF-B3CAB0998BF9 at rowledge.org> > Content-Type: text/plain; charset=us-ascii > > > >> On 2020-12-30, at 4:45 PM, Christoph Thiede >> wrote: >> >> >> Thanks for the help, Tim! >> >> Why on earth would you do that? >> >> I didn't want to pollute my raspi with that compilation stuff ... >> However, now I did it (also thanks to the help by Bruce) and succeeded >> to compile! > > > But all the compiler/tools stuff is already there. Remember, this is a > full development workstation with more power than we fantasised about > not so long ago. > >> >> Next problem: >> >> root at 96fa02af4449:/# /bin/squeak/squeak >> /image/Squeak6.0alpha-20135-64bit.image -headless >> mprotect(x,y,PROT_READ | PROT_EXEC): Permission denied >> Segmentation fault (core dumped) > > install libevdev seems to fix it. > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Useful random insult:- Teflon brain -- nothing sticks. > > > > > ------------------------------ > > Message: 2 > Date: Wed, 30 Dec 2020 17:00:00 -0800 > From: Christoph Thiede > To: OpenSmalltalk/opensmalltalk-vm > > Cc: Comment , OpenSmalltalk-Bot > > Subject: Re: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running > OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) > Message-ID: > > Content-Type: text/plain; charset="utf-8" > >> But all the compiler/tools stuff is already there. Remember, this is a >> full development workstation with more power than we fantasised about >> not so long ago. > > True :D > >> install libevdev seems to fix it. > > Which one are you referring to? > > ``` > root at 96fa02af4449:/# apt search libevdev > Sorting... Done > Full Text Search... Done > libevdev-dev/focal-updates 1.9.0+dfsg-1ubuntu0.1 arm64 > wrapper library for evdev devices - development files > > libevdev-doc/focal-updates 1.9.0+dfsg-1ubuntu0.1 all > wrapper library for evdev devices - development docs > > libevdev-tools/focal-updates 1.9.0+dfsg-1ubuntu0.1 arm64 > wrapper library for evdev devices - tools > > libevdev2/focal-updates 1.9.0+dfsg-1ubuntu0.1 arm64 > wrapper library for evdev devices > ``` > > -- > You are receiving this because you commented. > Reply to this email directly or view it on GitHub: > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/544#issuecomment-752805876 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Wed, 30 Dec 2020 17:12:21 -0800 > From: tim Rowledge > To: OpenSmalltalk/opensmalltalk-vm > , > Squeak Virtual Machine Development Discussion > > Subject: Re: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running > OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) > Message-ID: <1E8A1D87-B401-4CC7-B0E5-28405F146B65 at rowledge.org> > Content-Type: text/plain; charset=us-ascii > > > >> On 2020-12-30, at 5:00 PM, Christoph Thiede >> wrote: >> >> >> But all the compiler/tools stuff is already there. Remember, this is a >> full development workstation with more power than we fantasised about >> not so long ago. >> >> True :D >> >> install libevdev seems to fix it. >> >> Which one are you referring to? > > Sorry - libevdev-dev - which may be the most redundantly redundant > library name I've redundantly seen repeated. > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Fractured Idiom:- MERCI RIEN - Thanks for nothin'. > > > > > ------------------------------ > > Message: 4 > Date: Thu, 31 Dec 2020 09:06:50 0000 > From: commits at source.squeak.org > To: vm-dev at lists.squeakfoundation.org > Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2914.mcz > Message-ID: > > Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: > http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2914.mcz > > ==================== Summary ==================== > > Name: VMMaker.oscog-nice.2914 > Author: nice > Time: 31 December 2020, 10:06:40.613299 am > UUID: 0e1f0f1f-96ba-41ec-8f4f-c0d2fb618a21 > Ancestors: VMMaker.oscog-nice.2913 > > A few fixes for the VM tests > - enable using a WordArray as simulation memory > - concretizeAt: does not answer the instruction size but the next > address > > =============== Diff against VMMaker.oscog-nice.2913 =============== > > Item was changed: > ----- Method: AbstractInstructionTests>>generateInstructions (in > category 'generating machine code') ----- > generateInstructions > "See Cogit>>computeMaximumSizes, generateInstructionsAt: & > outputInstructionsAt:. > This is a pure Smalltalk (non-Slang) version of that trio of > methods." > | address pcDependentInstructions instructions | > address := 0. > pcDependentInstructions := OrderedCollection new. > opcodes do: > [:abstractInstruction| > abstractInstruction > address: address; > maxSize: abstractInstruction computeMaximumSize. > address := address + abstractInstruction maxSize]. > address := 0. > opcodes do: > [:abstractInstruction| > abstractInstruction isPCDependent > ifTrue: > [abstractInstruction sizePCDependentInstructionAt: address. > pcDependentInstructions addLast: abstractInstruction. > address := address + abstractInstruction machineCodeSize] > ifFalse: > [address := abstractInstruction concretizeAt: address]]. > pcDependentInstructions do: > [:abstractInstruction| > abstractInstruction concretizeAt: abstractInstruction address]. > instructions := ByteArray new: address. > address := 0. > opcodes do: > [:abstractInstruction| | machineCodeBytes | > self assert: abstractInstruction address = address. > machineCodeBytes := self memoryAsBytes: abstractInstruction > machineCode object. > 1 to: abstractInstruction machineCodeSize do: > [:j| > + instructions at: address + 1 put: (machineCodeBytes byteAt: j). > - instructions at: address + 1 put: (machineCodeBytes at: j). > address := address + 1]]. > ^instructions! > > Item was changed: > ----- Method: AbstractInstructionTests>>runAddCwR: (in category > 'running') ----- > runAddCwR: assertPrintBar > "self defaultTester runAddCwR: false" > self concreteCompilerClass dataRegistersWithAccessorsDo: > [:reg :rgetter :rsetter| > self pairs: (-2 to: 2) do: > [:a :b| | inst len bogus memory | > inst := self gen: AddCwR operand: a operand: reg. > len := inst concretizeAt: 0. > memory := self memoryAsBytes: inst machineCode. > self processor > reset; > perform: rsetter with: (self processor convertIntegerToInternal: > b). > [[processor pc < len] whileTrue: > + [processor singleStepIn: memory]] > - [self processor singleStepIn: memory]] > on: Error > do: [:ex| ]. > "self processor printRegistersOn: Transcript. > Transcript show: (self processor disassembleInstructionAt: 0 In: > memory); cr" > assertPrintBar > ifTrue: [self assert: processor pc = inst machineCodeSize. > self assertCheckLongArithOpCodeSize: inst machineCodeSize] > ifFalse: [bogus := processor pc ~= inst machineCodeSize]. > self concreteCompilerClass dataRegistersWithAccessorsDo: > [:ireg :getter :setter| | expected | > (self concreteCompilerClass isRISCTempRegister: ireg) ifFalse: > [expected := getter == rgetter ifTrue: [b + a] ifFalse: [0]. > assertPrintBar > ifTrue: [self assert: (self processor > convertInternalToInteger: (self processor perform: getter)) equals: > expected] > ifFalse: > [(self processor convertInternalToInteger: (self processor > perform: getter)) ~= expected ifTrue: > [bogus := true]]]. > assertPrintBar ifFalse: > [Transcript > nextPutAll: rgetter; nextPut: $(; print: b; nextPutAll: ') + > '; print: a; nextPutAll: ' = '; > print: (self processor convertInternalToInteger: (self > processor perform: rgetter)); cr; flush. > bogus ifTrue: > [self processor printRegistersOn: Transcript. > Transcript show: (self processor disassembleInstructionAt: 0 > In: memory); cr]]]]]! > > Item was changed: > ----- Method: AbstractInstructionTests>>testNegateR (in category > 'running') ----- > testNegateR > "self defaultTester testNegateR" > self concreteCompilerClass dataRegistersWithAccessorsDo: > [:reg :rgetter :rsetter| > -2 to: 2 do: > [:a| | inst len memory | > inst := self gen: NegateR operand: reg. > len := inst concretizeAt: 0. > memory := self memoryAsBytes: inst machineCode. > self processor > reset; > perform: rsetter with: (processor convertIntegerToInternal: a). > [[processor pc < len] whileTrue: > + [processor singleStepIn: memory]] > - [self processor singleStepIn: memory]] > on: Error > do: [:ex| ]. > "self processor printRegistersOn: Transcript. > Transcript show: (self processor disassembleInstructionAt: 0 In: > memory); cr" > self assert: processor pc equals: inst machineCodeSize. > self concreteCompilerClass dataRegistersWithAccessorsDo: > [:ireg :getter :setter| | expected | > expected := getter == rgetter ifTrue: [ a negated ] ifFalse: [0]. > self assert: (processor convertInternalToInteger: (processor > perform: getter)) equals: expected]]]! > > Item was changed: > ----- Method: CogARMCompilerForTests>>concretizeAt: (in category > 'generate machine code') ----- > concretizeAt: actualAddress > "Override to check maxSize and machineCodeSize" > > + | maxAddress nextAddress | > - | size | > maxSize ifNil: [maxSize := self computeMaximumSize]. > + maxAddress := actualAddress + maxSize. > + nextAddress := super concretizeAt: actualAddress. > - size := super concretizeAt: actualAddress. > self assert: (maxSize notNil > and: [self isPCDependent > + ifTrue: [maxAddress >= nextAddress] > + ifFalse: [maxAddress = nextAddress]]). > + ^nextAddress! > - ifTrue: [maxSize >= size] > - ifFalse: [maxSize = size]]). > - ^size! > > Item was changed: > ----- Method: CogIA32CompilerForTests>>concretizeAt: (in category > 'generate machine code') ----- > concretizeAt: actualAddress > "Override to check maxSize and machineCodeSize" > > + | maxAddress nextAddress | > - | size | > maxSize ifNil: [maxSize := self computeMaximumSize]. > + maxAddress := actualAddress + maxSize. > + nextAddress := super concretizeAt: actualAddress. > - size := super concretizeAt: actualAddress. > self assert: (maxSize notNil > and: [self isPCDependent > + ifTrue: [maxAddress >= nextAddress] > + ifFalse: [maxAddress = nextAddress]]). > + ^nextAddress! > - ifTrue: [maxSize >= size] > - ifFalse: [maxSize = size]]). > - ^size! > > Item was changed: > ----- Method: CogX64CompilerForTests>>concretizeAt: (in category > 'generate machine code') ----- > concretizeAt: actualAddress > "Override to check maxSize and machineCodeSize" > > + | maxAddress nextAddress | > - | size | > maxSize ifNil: [maxSize := self computeMaximumSize]. > + maxAddress := actualAddress + maxSize. > + nextAddress := super concretizeAt: actualAddress. > - size := super concretizeAt: actualAddress. > self assert: (maxSize notNil > and: [self isPCDependent > + ifTrue: [maxAddress >= nextAddress] > + ifFalse: [maxAddress = nextAddress]]). > + ^nextAddress! > - ifTrue: [maxSize >= size] > - ifFalse: [maxSize = size]]). > - ^size! > > Item was changed: > VMClass subclass: #OutOfLineLiteralsManager > instanceVariableNames: 'cogit objectMemory objectRepresentation > firstOpcodeIndex nextLiteralIndex lastDumpedLiteralIndex literals > literalsSize savedFirstOpcodeIndex savedNextLiteralIndex > savedLastDumpedLiteralIndex' > classVariableNames: '' > poolDictionaries: 'CogAbstractRegisters CogCompilationConstants > CogRTLOpcodes' > category: 'VMMaker-JIT'! > > + !OutOfLineLiteralsManager commentStamp: 'nice 12/31/2020 09:14' > prior: 0! > + An OutOfLineLiteralsManager manages the dumping of literals for > backends that want to keep literals out-of-line, accessed by > pc-relative addressing. > - !OutOfLineLiteralsManager commentStamp: 'eem 6/7/2015 12:10' prior: > 0! > - An OutOfLineLiteralsManager manages the dumping of literals for > backends that wat to keep literals out-of-line, accessed by > pc-relative addressing. > > Instance Variables > cogit: ! > > Item was added: > + ----- Method: RawBitsArray>>byteAt: (in category > '*VMMaker-simulation') ----- > + byteAt: anInteger > + "emulate an access to raw (unsigned) bytes, as if the receiver was > a ByteArray" > + > + | element p | > + p := self bytesPerBasicElement. > + p = 1 ifTrue: [^self basicAt: 1]. > + element := self basicAt: anInteger + p - 1 // p. > + ^Smalltalk isLittleEndian > + ifTrue: [element digitAt: anInteger - 1 \\ p + 1] > + ifFalse: [element digitAt: p - (anInteger \\ p)] > + ! > > Item was added: > + ----- Method: WordArray>>unsignedLongAt:bigEndian: (in category > '*VMMaker-JITsimulation') ----- > + unsignedLongAt: byteIndex bigEndian: bigEndian > + "Compatiblity with the ByteArray & Alien methods of the same name." > + | wordIndex lowBits word hiWord | > + wordIndex := byteIndex - 1 // 4 + 1. > + lowBits := byteIndex - 1 bitAnd: 3. > + word := self at: wordIndex. > + lowBits > 0 ifTrue: "access straddles two words" > + [hiWord := self at: wordIndex + 1. > + word := (word bitShift: lowBits * -8) + (hiWord bitShift: 4 - > lowBits * 8)]. > + word := word bitAnd: 16rFFFFFFFF. > + bigEndian > + ifTrue: > + [word := ((word bitShift: -24) bitAnd: 16rFF) > + + ((word bitShift: -8) bitAnd: 16rFF00) > + + ((word bitAnd: 16rFF00) bitShift: 8) > + + ((word bitAnd: 16rFF) bitShift: 24)]. > + ^word! > > > > ------------------------------ > > Message: 5 > Date: Thu, 31 Dec 2020 09:08:46 0000 > From: commits at source.squeak.org > To: vm-dev at lists.squeakfoundation.org > Subject: [Vm-dev] VM Maker: Cog-nice.429.mcz > Message-ID: > > Nicolas Cellier uploaded a new version of Cog to project VM Maker: > http://source.squeak.org/VMMaker/Cog-nice.429.mcz > > ==================== Summary ==================== > > Name: Cog-nice.429 > Author: nice > Time: 31 December 2020, 10:08:44.719565 am > UUID: 3b588f4d-7263-43c7-87b9-e3f1d9a7bd85 > Ancestors: Cog-eem.428 > > Enable using a WordArray or other RawBitsArray species as simulation > memory. > This implies using byteSize at a few places. > > =============== Diff against Cog-eem.428 =============== > > Item was changed: > ----- Method: CogProcessorAlien>>singleStepIn: (in category > 'execution') ----- > singleStepIn: aMemory > | result | > + result := self primitiveSingleStepInMemory: aMemory minimumAddress: > 0 readOnlyBelow: aMemory byteSize. > - result := self primitiveSingleStepInMemory: aMemory minimumAddress: > 0 readOnlyBelow: aMemory size. > result ~~ self ifTrue: > [self error: 'eek!!']! > > Item was changed: > ----- Method: MIPSSimulator>>initializeWithMemory: (in category 'as > yet unclassified') ----- > + initializeWithMemory: aRawBitsArray > + memory := aRawBitsArray. > - initializeWithMemory: aByteArray > - memory := aByteArray. > readableBase := 0. > writableBase := 0. > executableBase := 0. > + readableLimit := memory byteSize. > + writableLimit := memory byteSize. > + executableLimit := memory byteSize.! > - readableLimit := memory size. > - writableLimit := memory size. > - executableLimit := memory size.! > > > > ------------------------------ > > Message: 6 > Date: Thu, 31 Dec 2020 04:18:58 -0800 > From: Christoph Thiede > To: OpenSmalltalk/opensmalltalk-vm > > Cc: Comment , OpenSmalltalk-Bot > > Subject: Re: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running > OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > I have tried that and built the VM again, but I keep getting the same > mprotect error message :( Any other ideas? From: oscogvm/build.linux64ARMv8/HowToBuild: vvv======vvv If running the resultant squeak vm gives an error something like mprotect(x,y,PROT_READ|PROT_EXEC) or memory_alias_map: shm_open: Permission denied you need to enable shared memory for the COG JIT. As root: chmod 777 /dev/shm echo 'none /dev/shm tmpfs rw,nosuid,nodev 0 0' >> /etc/fstab mount /dev/shm The squeak vm should now work. ^^^======^^^ From ken.dickey at whidbey.com Thu Dec 31 14:15:41 2020 From: ken.dickey at whidbey.com (ken.dickey at whidbey.com) Date: Thu, 31 Dec 2020 06:15:41 -0800 Subject: [Vm-dev] Sorry, Sorry! [WAS: Trouble running OSVM in an Ubuntu 20/aarch64 docker] Message-ID: <9d904b233a0d7d4fff0407bc1a9ef52f@whidbey.com> Apologies to all, I though I had trimmed the header on this.. -KenD ============= Message: 6 Date: Thu, 31 Dec 2020 04:18:58 -0800 From: Christoph Thiede To: OpenSmalltalk/opensmalltalk-vm Cc: Comment , OpenSmalltalk-Bot Subject: Re: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) Message-ID: Content-Type: text/plain; charset="utf-8" I have tried that and built the VM again, but I keep getting the same mprotect error message :( Any other ideas? From: oscogvm/build.linux64ARMv8/HowToBuild: vvv======vvv If running the resultant squeak vm gives an error something like mprotect(x,y,PROT_READ|PROT_EXEC) or memory_alias_map: shm_open: Permission denied you need to enable shared memory for the COG JIT. As root: chmod 777 /dev/shm echo 'none /dev/shm tmpfs rw,nosuid,nodev 0 0' >> /etc/fstab mount /dev/shm The squeak vm should now work. ^^^======^^^ From commits at source.squeak.org Thu Dec 31 15:30:52 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 31 Dec 2020 15:30:52 0000 Subject: [Vm-dev] VM Maker: VMMaker-dtl.421.mcz Message-ID: David T. Lewis uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-dtl.421.mcz ==================== Summary ==================== Name: VMMaker-dtl.421 Author: dtl Time: 30 December 2020, 7:24:34.889 pm UUID: 4859ee92-e4d3-4a0a-9dc0-bc2a845ff019 Ancestors: VMMaker-dtl.420 VMMaker 4.19.4 The global session identifier must be updated when the intepreter resumes into a new image via primitiveResumeFromSnapshot. Refactoring - move duplicated variables and methods from StackInterpreter and ContextInterpreter up to Interpreter. =============== Diff against VMMaker-dtl.420 =============== Item was changed: Interpreter subclass: #ContextInterpreter + instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext localReturnContext localReturnValue messageSelector currentBytecode primitiveIndex primitiveFunctionPointer methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptPending savedWindowSize deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks newNativeMethod methodClass receiverClass interpreterVersion imageFormatVersionNumber interpreterProxy showSurfaceFn interruptCheckCounter interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable primitiveTableDefaults jmpBuf jmpDepth jmpMax suspendedCallbacks suspendedMethods imageFormatInitialVersion allowAccessBeyondSP' - instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext localReturnContext localReturnValue messageSelector currentBytecode primitiveIndex primitiveFunctionPointer methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptPending savedWindowSize deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks newNativeMethod methodClass receiverClass interpreterVersion imageFormatVersionNumber interpreterProxy showSurfaceFn interruptCheckCounter interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable primitiveTableDefaults globalSessionID jmpBuf jmpDepth jmpMax suspendedCallbacks suspendedMethods imageFormatInitialVersion allowAccessBeyondSP' classVariableNames: 'BlockArgumentCountIndex BytecodeTable CacheProbeMax CallerIndex CompilerHooksSize DirBadPath DirEntryFound DirNoMoreEntries DoBalanceChecks HomeIndex InitialIPIndex MaxJumpBuf MessageDictionaryIndex MethodCacheNative TempFrameStart' poolDictionaries: 'VMMethodCacheConstants VMSqueakV3BytecodeConstants' category: 'VMMaker-Interpreter'! !ContextInterpreter commentStamp: '' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. It has been modernized with 32-bit pointers, better management of Contexts, and attention to variable use that allows the CCodeGenerator (qv) to keep, eg, the instruction pointer and stack pointer in registers as well as keeping most simple variables in a global array that seems to improve performance for most platforms. In addition to SmallInteger arithmetic and Floats, it supports logic on 32-bit PositiveLargeIntegers, thus allowing it to simulate itself much more effectively than would otherwise be the case. NOTE: Here follows a list of things to be borne in mind when working on this code, or when making changes for the future. 1. There are a number of things that should be done the next time we plan to release a copletely incompatible image format. These include unifying the instanceSize field of the class format word -- see instantiateClass:indexableSize:, and unifying the bits of the method primitive index (if we decide we need more than 512, after all) -- see primitiveIndexOf:. Also, contexts should be given a special format code (see next item). 2. There are several fast checks for contexts (see isContextHeader: and isMethodContextHeader:) which will fail if the compact class indices of BlockContext or MethodContext change. This is necessary because the oops may change during a compaction when the oops are being adjusted. It's important to be aware of this when writing a new image using the systemTracer. A better solution would be to reserve one of the format codes for Contexts only. 3. We have made normal files tolerant to size and positions up to 32 bits. This has not been done for async files, since they are still experimental. The code in size, at: and at:put: should work with sizes and indices up to 31 bits, although I have not tested it (di 12/98); it might or might not work with 32-bit sizes. 4. Note that 0 is used in a couple of places as an impossible oop. This should be changed to a constant that really is impossible (or perhaps there is code somewhere that guarantees it --if so it should be put in this comment). The places include the method cache and the at cache. ! Item was removed: - ----- Method: ContextInterpreter>>getThisSessionID (in category 'plugin support') ----- - getThisSessionID - "return the global session ID value" - - ^globalSessionID! Item was changed: ----- Method: ContextInterpreter>>initializeInterpreter: (in category 'initialization') ----- initializeInterpreter: bytesToShift "Initialize Interpreter state before starting execution of a new image." self initializeInterpreter. interpreterProxy := self sqGetInterpreterProxy. self dummyReferToProxy. objectMemory initializeObjectMemory: bytesToShift. self initCompilerHooks. activeContext := objectMemory getNilObj. theHomeContext := objectMemory getNilObj. method := objectMemory getNilObj. receiver := objectMemory getNilObj. messageSelector := objectMemory getNilObj. newMethod := objectMemory getNilObj. methodClass := objectMemory getNilObj. lkupClass := objectMemory getNilObj. receiverClass := objectMemory getNilObj. newNativeMethod := objectMemory getNilObj. self flushMethodCache. self loadInitialContext. self initialCleanup. interruptCheckCounter := 0. interruptCheckCounterFeedBackReset := 1000. interruptChecksEveryNms := 1. nextPollTick := 0. nextWakeupTick := 0. lastTick := 0. interruptKeycode := 2094. "cmd-. as used for Mac but no other OS" interruptPending := false. deferDisplayUpdates := false. pendingFinalizationSignals := 0. - globalSessionID := 0. - [globalSessionID = 0] - whileTrue: [globalSessionID := self - cCode: 'time(NULL) + ioMSecs()' - inSmalltalk: [(Random new next * SmallInteger maxVal) asInteger]]. jmpDepth := 0. jmpMax := MaxJumpBuf. "xxxx: Must match the definition of jmpBuf and suspendedCallbacks" ! Item was changed: ----- Method: ContextInterpreter>>snapshotResume:heapSize:swapBytes:oldBaseAddr:specialObjectsOop:lastHash:savedWindowSize:fullScreenFlag:extraVMMemory: (in category 'snapshot utility primitives') ----- snapshotResume: byteArrayOrBitmap heapSize: desiredHeapSize swapBytes: swapBytes oldBaseAddr: oldBaseAddr specialObjectsOop: specialObjects lastHash: hashValue savedWindowSize: windowSize fullScreenFlag: fullScreen extraVMMemory: extraMemory "Arrange for the interpreter to resume execution from a snapshot of saved memory and interpreter state. The current object memory and interpreter state is discarded, and the interpreter resumes execution at the point of the supplied image snapshot." | dataSize sourceBytes mem | "Notes - The parameters windowSize, fullScreen and extraMemory are currently not used when resuming the VM in a new image. The display size and fullscreen mode are probably best set from the image by calling primitiveSetDisplayMode prior to primitiveResumeFromSnapshot. The extraMemory parameter is ignored here because we are simply copying the new object memory over a previously allocated heap space." dataSize := objectMemory byteSizeOf: byteArrayOrBitmap. sourceBytes := objectMemory firstIndexableField: byteArrayOrBitmap. objectMemory setSpecialObjectsOop: specialObjects. objectMemory setLastHash: hashValue. "Copy object memory into allocated space" objectMemory setMemoryLimits: dataSize heapSize: desiredHeapSize. mem := objectMemory pointerForOop: objectMemory getMemory. self mem: mem cp: sourceBytes y: dataSize. self swapBytesAndPrepareToInterpret: swapBytes oldBaseAddr: oldBaseAddr. + self initializeSessionID. self interpret. "Resume interpreter execution in the snapshot." ! Item was changed: InterpreterPrimitives subclass: #Interpreter + instanceVariableNames: 'semaphoresUseBufferA semaphoresToSignalA semaphoresToSignalCountA semaphoresToSignalB semaphoresToSignalCountB extraVMMemory globalSessionID' - instanceVariableNames: 'semaphoresUseBufferA semaphoresToSignalA semaphoresToSignalCountA semaphoresToSignalB semaphoresToSignalCountB extraVMMemory' classVariableNames: 'AtCacheEntries AtCacheFixedFields AtCacheFmt AtCacheMask AtCacheOop AtCacheSize AtCacheTotalSize AtPutBase MaxExternalPrimitiveTableSize MaxPrimitiveIndex SemaphoresToSignalSize' poolDictionaries: '' category: 'VMMaker-Interpreter'! !Interpreter commentStamp: 'dtl 4/22/2016 22:14' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. ContextInterpreter is the Squeak interpreter VM as originally implemented by Dan Ingalls. StackInterpreter is the stack mapped interpreter by Eliot Miranda, which provides the basis for later Cog and Spur VMs.! Item was added: + ----- Method: Interpreter>>getThisSessionID (in category 'plugin support') ----- + getThisSessionID + "return the global session ID value" + + ^globalSessionID! Item was changed: ----- Method: Interpreter>>initializeInterpreter (in category 'initialization') ----- initializeInterpreter semaphoresUseBufferA := true. semaphoresToSignalCountA := 0. semaphoresToSignalCountB := 0. + self initializeSessionID. ! Item was added: + ----- Method: Interpreter>>initializeSessionID (in category 'initialization') ----- + initializeSessionID + globalSessionID := 0. + [globalSessionID = 0] + whileTrue: [globalSessionID := self + cCode: 'time(NULL) + ioMSecs()' + inSmalltalk: [(Random new next * SmallInteger maxVal) asInteger]]. + ! Item was changed: Interpreter subclass: #StackInterpreter + instanceVariableNames: 'currentBytecode localFP localIP localSP stackLimit stackPage stackPages method instructionPointer stackPointer framePointer localReturnValue primitiveFunctionPointer methodCache atCache lkupClass highestRunnableProcessPriority nextWakeupUsecs nextPollUsecs inIOProcessEvents interruptPending savedWindowSize imageHeaderFlags deferDisplayUpdates pendingFinalizationSignals interpreterProxy showSurfaceFn externalPrimitiveTable externalPrimitiveTableFirstFreeIndex overflowedPage extraFramesToMoveOnOverflow jmpBuf jmpDepth suspendedCallbacks suspendedMethods numStackPages desiredNumStackPages desiredEdenBytes classNameIndex thisClassIndex metaclassSizeBytes interruptCheckChain suppressHeartbeatFlag breakSelector breakSelectorLength longRunningPrimitiveCheckMethod longRunningPrimitiveCheckSemaphore longRunningPrimitiveStartUsecs longRunningPrimitiveStopUsecs longRunningPrimitiveGCUsecs longRunningPrimitiveCheckSequenceNumber longRunningPrimitiveSignalUndelivered te mpOop statForceInterruptCheck statStackOverflow statStackPageDivorce statCheckForEvents statProcessSwitch statIOProcessEvents theUnknownShort imageFloatsBigEndian maxExtSemTabSizeSet lastMethodCacheProbeWrite statPendingFinalizationSignals classByteArrayCompactIndex messageSelector profileProcess nextProfileTick profileMethod profileSemaphore' - instanceVariableNames: 'currentBytecode localFP localIP localSP stackLimit stackPage stackPages method instructionPointer stackPointer framePointer localReturnValue primitiveFunctionPointer methodCache atCache lkupClass highestRunnableProcessPriority nextWakeupUsecs nextPollUsecs inIOProcessEvents interruptPending savedWindowSize imageHeaderFlags deferDisplayUpdates pendingFinalizationSignals interpreterProxy showSurfaceFn externalPrimitiveTable externalPrimitiveTableFirstFreeIndex overflowedPage extraFramesToMoveOnOverflow globalSessionID jmpBuf jmpDepth suspendedCallbacks suspendedMethods numStackPages desiredNumStackPages desiredEdenBytes classNameIndex thisClassIndex metaclassSizeBytes interruptCheckChain suppressHeartbeatFlag breakSelector breakSelectorLength longRunningPrimitiveCheckMethod longRunningPrimitiveCheckSemaphore longRunningPrimitiveStartUsecs longRunningPrimitiveStopUsecs longRunningPrimitiveGCUsecs longRunningPrimitiveCheckSequenceNumber longRunningPrimitiveSign alUndelivered tempOop statForceInterruptCheck statStackOverflow statStackPageDivorce statCheckForEvents statProcessSwitch statIOProcessEvents theUnknownShort imageFloatsBigEndian maxExtSemTabSizeSet lastMethodCacheProbeWrite statPendingFinalizationSignals classByteArrayCompactIndex messageSelector profileProcess nextProfileTick profileMethod profileSemaphore' classVariableNames: 'BytecodeTable BytesPerWord COGMTVM COGVM CacheProbeMax DirBadPath DirEntryFound DirNoMoreEntries DumpStackOnLowSpace EnclosingMixinIndex EnclosingObjectIndex FailImbalancedPrimitives HeaderFlagBitPosition IMMUTABILITY MULTIPLEBYTECODESETS MaxJumpBuf MaxQuickPrimitiveIndex MixinIndex NewspeakVM STACKVM VMBIGENDIAN' poolDictionaries: 'VMBasicConstants VMMethodCacheConstants VMObjectIndices VMSqueakV3BytecodeConstants VMSqueakV3ObjectRepresentationConstants VMStackFrameOffsets' category: 'VMMaker-Interpreter'! !StackInterpreter commentStamp: '' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. This VM supports Closures but *not* old-style BlockContexts. It has been modernized with 32-bit pointers, better management of Contexts (see next item), and attention to variable use that allows the CCodeGenerator (qv) to keep, eg, the instruction pointer and stack pointer in registers as well as keeping most simple variables in a global array that seems to improve performance for most platforms. The VM does not use Contexts directly. Instead Contexts serve as proxies for a more conventional stack format that is invisible to the image. There is considerable explanation at http://www.mirandabanda.org/cogblog/2009/01/14/under-cover-contexts-and-the-big-frame-up. The VM maintains a fixed-size stack zone divided into pages, each page being capable of holding several method/block activations. A send establishes a new frame in the current stack page, a return returns to the previous frame. This eliminates allocation/deallocation of contexts and the moving of receiver and arguments from caller to callee on each send/return. Contexts are created lazily when an activation needs a context (creating a block, explicit use of thisContext, access to sender when sender is a frame, or linking of stack pages together). Contexts are either conventional and heap-resident ("single") or "married" and serve as proxies for their corresponding frame or "widowed", meaning that their spouse f rame has been returned from (died). A married context is specially marked (more details in the code) and refers to its frame. Likewise a married frame is specially marked and refers to its context. In addition to SmallInteger arithmetic and Floats, the VM supports logic on 32-bit PositiveLargeIntegers, thus allowing it to simulate itself much more effectively than would otherwise be the case. NOTE: Here follows a list of things to be borne in mind when working on this code, or when making changes for the future. 1. There are a number of things that should be done the next time we plan to release a completely incompatible image format. These include unifying the instanceSize field of the class format word -- see instantiateClass:indexableSize:, and unifying the bits of the method primitive index (if we decide we need more than 512, after all) -- see primitiveIndexOf:. Also, contexts should be given a special format code (see next item). 2. There are several fast checks for contexts (see isContextHeader: and isMethodContextHeader:) which will fail if the compact class indices of BlockContext or MethodContext change. This is necessary because the oops may change during a compaction when the oops are being adjusted. It's important to be aware of this when writing a new image using the SystemTracer. A better solution would be to reserve one of the format codes for Contexts only. 3. We have made normal files tolerant to size and positions up to 32 bits. This has not been done for async files, since they are still experimental. The code in size, at: and at:put: should work with sizes and indices up to 31 bits, although I have not tested it (di 12/98); it might or might not work with 32-bit sizes. 4. Note that 0 is used in a couple of places as an impossible oop. This should be changed to a constant that really is impossible (or perhaps there is code somewhere that guarantees it --if so it should be put in this comment). The places include the method cache and the at cache. 5. Moving to a 2 bit immediate tag and having immediate Characters is a good choice for Unicode and the JIT 6. If Eliot Miranda's 2 word header scheme is acceptable in terms of footprint (we estimate about a 10% increase in image size with about 35 reclaimed by better representation of CompiledMethod - loss of MethodProperties) then the in-line cache for the JIT is simplified, class access is faster and header access is the same in 32-bit and full 64-bit images.! Item was removed: - ----- Method: StackInterpreter>>getThisSessionID (in category 'plugin support') ----- - getThisSessionID - "return the global session ID value" - - ^globalSessionID! Item was changed: ----- Method: StackInterpreter>>initializeInterpreter: (in category 'initialization') ----- initializeInterpreter: bytesToShift "Initialize Interpreter state before starting execution of a new image." self initializeInterpreter. interpreterProxy := self sqGetInterpreterProxy. self dummyReferToProxy. objectMemory initializeObjectMemory: bytesToShift. self checkAssumedCompactClasses. primFailCode := 0. self initializeExtraClassInstVarIndices. stackLimit := 0. "This is also the initialization flag for the stack system." stackPage := overflowedPage := 0. extraFramesToMoveOnOverflow := 0. self setMethod: objectMemory nilObject. messageSelector := objectMemory nilObject. newMethod := objectMemory nilObject. lkupClass := objectMemory nilObject. self flushMethodCache. self flushAtCache. self initialCleanup. highestRunnableProcessPriority := 0. nextProfileTick := 0. profileSemaphore := objectMemory nilObject. profileProcess := objectMemory nilObject. profileMethod := objectMemory nilObject. nextPollUsecs := 0. nextWakeupUsecs := 0. tempOop := 0. interruptKeycode := 2094. "cmd-. as used for Mac but no other OS" interruptPending := false. inIOProcessEvents := 0. deferDisplayUpdates := false. pendingFinalizationSignals := statPendingFinalizationSignals := 0. - globalSessionID := 0. - [globalSessionID = 0] - whileTrue: [globalSessionID := self - cCode: 'time(NULL) + ioMSecs()' - inSmalltalk: [(Random new next * SmallInteger maxVal) asInteger]]. jmpDepth := 0. longRunningPrimitiveStartUsecs := longRunningPrimitiveStopUsecs := 0. maxExtSemTabSizeSet := false. statForceInterruptCheck := 0. statStackOverflow := 0. statCheckForEvents := 0. statProcessSwitch := 0. statIOProcessEvents := 0. statStackPageDivorce := 0! Item was changed: ----- Method: VMMaker class>>versionString (in category 'version testing') ----- versionString "VMMaker versionString" + ^'4.19.4'! - ^'4.19.3'! From commits at source.squeak.org Thu Dec 31 15:31:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 31 Dec 2020 15:31:15 0000 Subject: [Vm-dev] VM Maker: VMMaker-dtl.422.mcz Message-ID: David T. Lewis uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-dtl.422.mcz ==================== Summary ==================== Name: VMMaker-dtl.422 Author: dtl Time: 30 December 2020, 8:11:52.023 pm UUID: dfc32d36-1caa-4251-9d0d-824cf8222611 Ancestors: VMMaker-dtl.421 VMMaker 4.19.5 Refactoring - move duplicated variables and methods from StackInterpreter and ContextInterpreter up to Interpreter. Remove stack interpreter support methods from ContextInterpreter, they are only sent from NewObjectMemory and StackInterpreter. Move duplicated stack bytecodes methods up to Interpreter. Move primitiveSetGCSemaphore up to Interpreter. Move duplicated common selector sends methods up to Interpreter. Move duplicated bitbit support methods up to Interpreter. Move duplicated array primitive support methods up to Interpreter. Move duplicated arithmetic primitive support methods up to Interpreter and remove unsent checkIntegerResult:.. Move duplicated I/O primitive methods up to Interpreter. =============== Diff against VMMaker-dtl.421 =============== Item was changed: Interpreter subclass: #ContextInterpreter + instanceVariableNames: 'activeContext theHomeContext receiver localHomeContext localReturnContext primitiveIndex reclaimableContextCount nextPollTick nextWakeupTick lastTick compilerInitialized compilerHooks newNativeMethod methodClass receiverClass interpreterVersion imageFormatVersionNumber interruptCheckCounter interruptCheckCounterFeedBackReset interruptChecksEveryNms primitiveTableDefaults jmpMax imageFormatInitialVersion allowAccessBeyondSP' + classVariableNames: 'BlockArgumentCountIndex BytecodeTable CacheProbeMax CallerIndex CompilerHooksSize DirBadPath DirEntryFound DirNoMoreEntries DoBalanceChecks HomeIndex InitialIPIndex MessageDictionaryIndex MethodCacheNative TempFrameStart' - instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext localReturnContext localReturnValue messageSelector currentBytecode primitiveIndex primitiveFunctionPointer methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptPending savedWindowSize deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks newNativeMethod methodClass receiverClass interpreterVersion imageFormatVersionNumber interpreterProxy showSurfaceFn interruptCheckCounter interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable primitiveTableDefaults jmpBuf jmpDepth jmpMax suspendedCallbacks suspendedMethods imageFormatInitialVersion allowAccessBeyondSP' - classVariableNames: 'BlockArgumentCountIndex BytecodeTable CacheProbeMax CallerIndex CompilerHooksSize DirBadPath DirEntryFound DirNoMoreEntries DoBalanceChecks HomeIndex InitialIPIndex MaxJumpBuf MessageDictionaryIndex MethodCacheNative TempFrameStart' poolDictionaries: 'VMMethodCacheConstants VMSqueakV3BytecodeConstants' category: 'VMMaker-Interpreter'! !ContextInterpreter commentStamp: '' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. It has been modernized with 32-bit pointers, better management of Contexts, and attention to variable use that allows the CCodeGenerator (qv) to keep, eg, the instruction pointer and stack pointer in registers as well as keeping most simple variables in a global array that seems to improve performance for most platforms. In addition to SmallInteger arithmetic and Floats, it supports logic on 32-bit PositiveLargeIntegers, thus allowing it to simulate itself much more effectively than would otherwise be the case. NOTE: Here follows a list of things to be borne in mind when working on this code, or when making changes for the future. 1. There are a number of things that should be done the next time we plan to release a copletely incompatible image format. These include unifying the instanceSize field of the class format word -- see instantiateClass:indexableSize:, and unifying the bits of the method primitive index (if we decide we need more than 512, after all) -- see primitiveIndexOf:. Also, contexts should be given a special format code (see next item). 2. There are several fast checks for contexts (see isContextHeader: and isMethodContextHeader:) which will fail if the compact class indices of BlockContext or MethodContext change. This is necessary because the oops may change during a compaction when the oops are being adjusted. It's important to be aware of this when writing a new image using the systemTracer. A better solution would be to reserve one of the format codes for Contexts only. 3. We have made normal files tolerant to size and positions up to 32 bits. This has not been done for async files, since they are still experimental. The code in size, at: and at:put: should work with sizes and indices up to 31 bits, although I have not tested it (di 12/98); it might or might not work with 32-bit sizes. 4. Note that 0 is used in a couple of places as an impossible oop. This should be changed to a constant that really is impossible (or perhaps there is code somewhere that guarantees it --if so it should be put in this comment). The places include the method cache and the at cache. ! Item was changed: ----- Method: ContextInterpreter class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator aCCodeGenerator addHeaderFile: ''. - aCCodeGenerator var: #interpreterProxy type: #'struct VirtualMachine*'. - "declare primitiveTable as an array of pointers to a function returning void, taking no arguments" - aCCodeGenerator var: #primitiveFunctionPointer declareC: 'void (*primitiveFunctionPointer)(void)'. - aCCodeGenerator var: #methodCache declareC: 'long methodCache[' , (MethodCacheSize + 1) printString , ']'. - aCCodeGenerator var: #atCache declareC: 'sqInt atCache[' , (AtCacheTotalSize + 1) printString , ']'. aCCodeGenerator var: #statGCTime type: #sqLong. aCCodeGenerator var: #statFullGCMSecs type: #sqLong. aCCodeGenerator var: #statIGCDeltaTime type: #sqLong. aCCodeGenerator var: #statIncrGCMSecs type: #sqLong. - aCCodeGenerator var: #localIP type: #'char*'. - aCCodeGenerator var: #localSP type: #'char*'. - aCCodeGenerator var: #showSurfaceFn type: #'void*'. aCCodeGenerator var: #compilerHooks declareC: 'sqInt (*compilerHooks[' , (CompilerHooksSize + 1) printString , '])()'. aCCodeGenerator var: #interpreterVersion declareC: 'const char *interpreterVersion = "' , SmalltalkImage current datedVersion , ' [' , SmalltalkImage current lastUpdateString , ']"'. + self declareCAsOop: {#newMethod. #activeContext. #theHomeContext} in: aCCodeGenerator. - self declareCAsOop: {#instructionPointer. #method. #newMethod. #activeContext. #theHomeContext. #stackPointer} in: aCCodeGenerator. - aCCodeGenerator var: #jmpBuf declareC: 'jmp_buf jmpBuf[' , (MaxJumpBuf + 1) printString , ']'. - aCCodeGenerator var: #suspendedCallbacks declareC: 'sqInt suspendedCallbacks[' , (MaxJumpBuf + 1) printString , ']'. - aCCodeGenerator var: #suspendedMethods declareC: 'sqInt suspendedMethods[' , (MaxJumpBuf + 1) printString , ']'. "Reinitialized at interpreter entry by #initializeImageFormatVersion" aCCodeGenerator var: #imageFormatVersionNumber declareC: 'sqInt imageFormatVersionNumber = 0'. "Declared here to prevent inclusion in foo struct by CCodeGeneratorGlobalStructure" aCCodeGenerator var: #imageFormatInitialVersion declareC: 'sqInt imageFormatInitialVersion = 0'. aCCodeGenerator var: #primitiveTable declareC: 'void (*primitiveTable[', MaxPrimitiveIndex asString, '])(void)'. aCCodeGenerator var: #primitiveTableDefaults declareC: 'void (*primitiveTableDefaults[' , (MaxPrimitiveIndex + 2) printString , '] )(void)= ' , self primitiveTableString. - aCCodeGenerator var: #externalPrimitiveTable declareC: 'void (*externalPrimitiveTable[' , (MaxExternalPrimitiveTableSize + 1) printString , '])(void)'. ! Item was changed: ----- Method: ContextInterpreter class>>initialize (in category 'initialization') ----- initialize "Interpreter initialize" super initialize. "initialize ObjectMemory constants" self initializeAssociationIndex. self initializeBytecodeTable. self initializeCaches. self initializeCharacterIndex. self initializeCharacterScannerIndices. self initializeClassIndices. self initializeCompilerHooks. self initializeContextIndices. self initializeDirectoryLookupResultCodes. self initializeMessageIndices. self initializeMethodIndices. self initializePointIndices. self initializePrimitiveTable. self initializeSchedulerIndices. self initializeStreamIndices. self initializeInterpreterSourceVersion. PrimitiveExternalCallIndex := 117. "Primitive index for #primitiveExternalCall" MillisecondClockMask := 16r1FFFFFFF. - MaxJumpBuf := 32. "max. callback depth" - "Translation flags (booleans that control code generation via conditional translation):" DoBalanceChecks := false. "generate stack balance checks" ! Item was removed: - ----- Method: ContextInterpreter>>argCount (in category 'message sending') ----- - argCount - ^ argumentCount! Item was removed: - ----- Method: ContextInterpreter>>asciiOfCharacter: (in category 'array primitive support') ----- - asciiOfCharacter: characterObj "Returns an integer object" - - - self assertClassOf: characterObj is: (objectMemory splObj: ClassCharacter). - self successful - ifTrue: [^ objectMemory fetchPointer: CharacterValueIndex ofObject: characterObj] - ifFalse: [^ ConstZero] "in case some code needs an int"! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimAdd (in category 'common selector sends') ----- - bytecodePrimAdd - | rcvr arg result | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) - ifTrue: [result := (objectMemory integerValueOf: rcvr) + (objectMemory integerValueOf: arg). - (objectMemory isIntegerValue: result) ifTrue: - [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). - ^ self fetchNextBytecode "success"]] - ifFalse: [self initPrimCall. - self externalizeIPandSP. - self primitiveFloatAdd: rcvr toArg: arg. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]]. - - messageSelector := self specialSelector: 0. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimAtEnd (in category 'common selector sends') ----- - bytecodePrimAtEnd - messageSelector := self specialSelector: 21. - argumentCount := 0. - self normalSend.! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimBitAnd (in category 'common selector sends') ----- - bytecodePrimBitAnd - - self initPrimCall. - self externalizeIPandSP. - self primitiveBitAnd. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 14. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimBitOr (in category 'common selector sends') ----- - bytecodePrimBitOr - - self initPrimCall. - self externalizeIPandSP. - self primitiveBitOr. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 15. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimBitShift (in category 'common selector sends') ----- - bytecodePrimBitShift - - self initPrimCall. - self externalizeIPandSP. - self primitiveBitShift. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 12. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimDiv (in category 'common selector sends') ----- - bytecodePrimDiv - | quotient | - self initPrimCall. - quotient := self doPrimitiveDiv: (self internalStackValue: 1) by: (self internalStackValue: 0). - self successful ifTrue: [self internalPop: 2 thenPush: (objectMemory integerObjectOf: quotient). - ^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 13. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimDivide (in category 'common selector sends') ----- - bytecodePrimDivide - | rcvr arg result | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) - ifTrue: [rcvr := objectMemory integerValueOf: rcvr. - arg := objectMemory integerValueOf: arg. - (arg ~= 0 and: [rcvr \\ arg = 0]) - ifTrue: [result := rcvr // arg. - "generates C / operation" - (objectMemory isIntegerValue: result) - ifTrue: [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). - ^ self fetchNextBytecode"success"]]] - ifFalse: [self initPrimCall. - self externalizeIPandSP. - self primitiveFloatDivide: rcvr byArg: arg. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode"success"]]. - - messageSelector := self specialSelector: 9. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimDo (in category 'common selector sends') ----- - bytecodePrimDo - - messageSelector := self specialSelector: 27. - argumentCount := 1. - self normalSend. - ! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimEqual (in category 'common selector sends') ----- - bytecodePrimEqual - | rcvr arg aBool | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) ifTrue: [^self booleanCheat: rcvr = arg]. - - self initPrimCall. - aBool := self primitiveFloatEqual: rcvr toArg: arg. - self successful ifTrue: [^self booleanCheat: aBool]. - - messageSelector := self specialSelector: 6. - argumentCount := 1. - self normalSend - ! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimEquivalent (in category 'common selector sends') ----- - bytecodePrimEquivalent - - | rcvr arg | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - self booleanCheat: rcvr = arg.! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimMakePoint (in category 'common selector sends') ----- - bytecodePrimMakePoint - - self initPrimCall. - self externalizeIPandSP. - self primitiveMakePoint. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 11. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimMod (in category 'common selector sends') ----- - bytecodePrimMod - | mod | - self initPrimCall. - mod := self doPrimitiveMod: (self internalStackValue: 1) by: (self internalStackValue: 0). - self successful ifTrue: - [self internalPop: 2 thenPush: (objectMemory integerObjectOf: mod). - ^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 10. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimNew (in category 'common selector sends') ----- - bytecodePrimNew - - messageSelector := self specialSelector: 28. - argumentCount := 0. - self normalSend. - ! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimNewWithArg (in category 'common selector sends') ----- - bytecodePrimNewWithArg - - messageSelector := self specialSelector: 29. - argumentCount := 1. - self normalSend. - ! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimNext (in category 'common selector sends') ----- - bytecodePrimNext - messageSelector := self specialSelector: 19. - argumentCount := 0. - self normalSend.! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimNextPut (in category 'common selector sends') ----- - bytecodePrimNextPut - messageSelector := self specialSelector: 20. - argumentCount := 1. - self normalSend.! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimNotEqual (in category 'common selector sends') ----- - bytecodePrimNotEqual - | rcvr arg aBool | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) ifTrue: [^self booleanCheat: rcvr ~= arg]. - - self initPrimCall. - aBool := self primitiveFloatEqual: rcvr toArg: arg. - self successful ifTrue: [^self booleanCheat: aBool not]. - - messageSelector := self specialSelector: 7. - argumentCount := 1. - self normalSend - ! Item was removed: - ----- Method: ContextInterpreter>>bytecodePrimSubtract (in category 'common selector sends') ----- - bytecodePrimSubtract - | rcvr arg result | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) - ifTrue: [result := (objectMemory integerValueOf: rcvr) - (objectMemory integerValueOf: arg). - (objectMemory isIntegerValue: result) ifTrue: - [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). - ^self fetchNextBytecode "success"]] - ifFalse: [self initPrimCall. - self externalizeIPandSP. - self primitiveFloatSubtract: rcvr fromArg: arg. - self internalizeIPandSP. - self successful ifTrue: [^self fetchNextBytecode "success"]]. - - messageSelector := self specialSelector: 1. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: ContextInterpreter>>characterForAscii: (in category 'array primitive support') ----- - characterForAscii: ascii "Arg must lie in range 0-255!!" - - ^ objectMemory fetchPointer: ascii ofObject: (objectMemory splObj: CharacterTable)! Item was removed: - ----- Method: ContextInterpreter>>checkBooleanResult: (in category 'arithmetic primitive support') ----- - checkBooleanResult: result - self successful - ifTrue: [self pushBool: result] - ifFalse: [self unPop: 2]! Item was removed: - ----- Method: ContextInterpreter>>checkCodeIntegrity: (in category 'stack interpreter support') ----- - checkCodeIntegrity: fullGCFlag - "This is a no-op in the Interpreter and the StackVM" - ^true! Item was removed: - ----- Method: ContextInterpreter>>checkIntegerResult: (in category 'arithmetic primitive support') ----- - checkIntegerResult: integerResult - (self successful and: [objectMemory isIntegerValue: integerResult]) - ifTrue: [self pushInteger: integerResult] - ifFalse: [self unPop: 2]! Item was removed: - ----- Method: ContextInterpreter>>checkInterpreterIntegrity (in category 'stack interpreter support') ----- - checkInterpreterIntegrity - "Perform an integrity/leak check using the heapMap. Assume - clearLeakMapAndMapAccessibleObjects has set a bit at each - object's header. Check that all oops in the interpreter's state - points to a header. Answer if all checks pass." - - ^true! Item was removed: - ----- Method: ContextInterpreter>>checkStackIntegrity (in category 'stack interpreter support') ----- - checkStackIntegrity - "Perform an integrity/leak check using the heapMap. Assume - clearLeakMapAndMapAccessibleObjects has set a bit at each - object's header. Scan all objects accessible from the stack - checking that every pointer points to a header. Answer if no - dangling pointers were detected." - - ^true! Item was removed: - ----- Method: ContextInterpreter>>compare31or32Bits:equal: (in category 'arithmetic primitive support') ----- - compare31or32Bits: obj1 equal: obj2 - "May set success to false" - - "First compare two ST integers..." - ((objectMemory isIntegerObject: obj1) - and: [objectMemory isIntegerObject: obj2]) - ifTrue: [^ obj1 = obj2]. - - "Now compare, assuming positive integers, but setting fail if not" - ^ (self positive32BitValueOf: obj1) = (self positive32BitValueOf: obj2)! Item was removed: - ----- Method: ContextInterpreter>>copyBits (in category 'bitblt support') ----- - copyBits - "This entry point needs to be implemented for the interpreter proxy. - Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBits - and call it. This entire mechanism should eventually go away and be - replaced with a dynamic lookup from BitBltPlugin itself but for backward - compatibility this stub is provided" - - | fn | - - fn := self ioLoadFunction: 'copyBits' From: 'BitBltPlugin'. - fn = 0 ifTrue: [^self primitiveFail]. - ^self cCode: '((sqInt (*)(void))fn)()'! Item was removed: - ----- Method: ContextInterpreter>>copyBitsFrom:to:at: (in category 'bitblt support') ----- - copyBitsFrom: x0 to: x1 at: y - "This entry point needs to be implemented for the interpreter proxy. - Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBitsFrom:to:at: - and call it. This entire mechanism should eventually go away and be - replaced with a dynamic lookup from BitBltPlugin itself but for backward - compatibility this stub is provided" - - | fn | - - fn := self ioLoadFunction: 'copyBitsFromtoat' From: 'BitBltPlugin'. - fn = 0 ifTrue: [^self primitiveFail]. - ^self cCode: '((sqInt (*)(sqInt, sqInt, sqInt))fn)(x0, x1, y)'! Item was removed: - ----- Method: ContextInterpreter>>displayBitsOf:Left:Top:Right:Bottom: (in category 'I/O primitives') ----- - displayBitsOf: aForm Left: l Top: t Right: r Bottom: b - "Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object." - - | displayObj dispBits w h dispBitsIndex d left right top bottom surfaceHandle | - displayObj := objectMemory splObj: TheDisplay. - aForm = displayObj ifFalse: [^ nil]. - self success: ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]). - self successful ifTrue: [ - dispBits := objectMemory fetchPointer: 0 ofObject: displayObj. - w := self fetchInteger: 1 ofObject: displayObj. - h := self fetchInteger: 2 ofObject: displayObj. - d := self fetchInteger: 3 ofObject: displayObj. - ]. - l < 0 ifTrue:[left := 0] ifFalse: [left := l]. - r > w ifTrue: [right := w] ifFalse: [right := r]. - t < 0 ifTrue: [top := 0] ifFalse: [top := t]. - b > h ifTrue: [bottom := h] ifFalse: [bottom := b]. - ((left <= right) and: [top <= bottom]) ifFalse: [^nil]. - self successful ifTrue: [ - (objectMemory isIntegerObject: dispBits) ifTrue: [ - surfaceHandle := objectMemory integerValueOf: dispBits. - showSurfaceFn = 0 ifTrue: [ - showSurfaceFn := self ioLoadFunction: 'ioShowSurface' From: 'SurfacePlugin'. - showSurfaceFn = 0 ifTrue: [^self success: false]]. - self cCode:'((sqInt (*)(sqInt, sqInt, sqInt, sqInt, sqInt))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top)'. - ] ifFalse: [ - dispBitsIndex := dispBits + objectMemory baseHeaderSize. "index in memory byte array" - self cCode: 'ioShowDisplay(dispBitsIndex, w, h, d, left, right, top, bottom)' - inSmalltalk: [self showDisplayBits: dispBitsIndex - w: w h: h d: d - left: left right: right top: top bottom: bottom] - ]. - ].! Item was removed: - ----- Method: ContextInterpreter>>doPrimitiveDiv:by: (in category 'arithmetic primitive support') ----- - doPrimitiveDiv: rcvr by: arg - "Rounds negative results towards negative infinity, rather than zero." - | result posArg posRcvr integerRcvr integerArg | - (self areIntegers: rcvr and: arg) - ifTrue: [integerRcvr := objectMemory integerValueOf: rcvr. - integerArg := objectMemory integerValueOf: arg. - self success: integerArg ~= 0] - ifFalse: [self primitiveFail]. - self successful ifFalse: [^ 1 "fail"]. - - integerRcvr > 0 - ifTrue: [integerArg > 0 - ifTrue: [result := integerRcvr // integerArg] - ifFalse: ["round negative result toward negative infinity" - posArg := 0 - integerArg. - result := 0 - ((integerRcvr + (posArg - 1)) // posArg)]] - ifFalse: [posRcvr := 0 - integerRcvr. - integerArg > 0 - ifTrue: ["round negative result toward negative infinity" - result := 0 - ((posRcvr + (integerArg - 1)) // integerArg)] - ifFalse: [posArg := 0 - integerArg. - result := posRcvr // posArg]]. - self success: (objectMemory isIntegerValue: result). - ^ result! Item was removed: - ----- Method: ContextInterpreter>>doPrimitiveMod:by: (in category 'arithmetic primitive support') ----- - doPrimitiveMod: rcvr by: arg - | integerResult integerRcvr integerArg | - (self areIntegers: rcvr and: arg) - ifTrue: [integerRcvr := objectMemory integerValueOf: rcvr. - integerArg := objectMemory integerValueOf: arg. - self success: integerArg ~= 0] - ifFalse: [self primitiveFail]. - self successful ifFalse: [^ 1 "fail"]. - - integerResult := integerRcvr \\ integerArg. - - "ensure that the result has the same sign as the integerArg" - integerArg < 0 - ifTrue: [integerResult > 0 - ifTrue: [integerResult := integerResult + integerArg]] - ifFalse: [integerResult < 0 - ifTrue: [integerResult := integerResult + integerArg]]. - self success: (objectMemory isIntegerValue: integerResult). - ^ integerResult - ! Item was removed: - ----- Method: ContextInterpreter>>duplicateTopBytecode (in category 'stack bytecodes') ----- - duplicateTopBytecode - - self fetchNextBytecode. - self internalPush: self internalStackTop. - ! Item was removed: - ----- Method: ContextInterpreter>>extendedPushBytecode (in category 'stack bytecodes') ----- - extendedPushBytecode - - | descriptor variableType variableIndex | - descriptor := self fetchByte. - self fetchNextBytecode. - variableType := (descriptor >> 6) bitAnd: 16r3. - variableIndex := descriptor bitAnd: 16r3F. - variableType=0 ifTrue: [^self pushReceiverVariable: variableIndex]. - variableType=1 ifTrue: [^self pushTemporaryVariable: variableIndex]. - variableType=2 ifTrue: [^self pushLiteralConstant: variableIndex]. - variableType=3 ifTrue: [^self pushLiteralVariable: variableIndex]. - ! Item was removed: - ----- Method: ContextInterpreter>>fetchByte (in category 'interpreter shell') ----- - fetchByte - "This method uses the preIncrement builtin function which has no Smalltalk equivalent. Thus, it must be overridden in the simulator." - - ^ objectMemory byteAtPointer: localIP preIncrement! Item was removed: - ----- Method: ContextInterpreter>>fullDisplayUpdate (in category 'I/O primitive support') ----- - fullDisplayUpdate - "Repaint the entire smalltalk screen, ignoring the affected rectangle. Used in some platform's code when the Smalltalk window is brought to the front or uncovered." - - | displayObj w h | - displayObj := objectMemory splObj: TheDisplay. - ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]) ifTrue: [ - w := self fetchInteger: 1 ofObject: displayObj. - h := self fetchInteger: 2 ofObject: displayObj. - self displayBitsOf: displayObj Left: 0 Top: 0 Right: w Bottom: h. - self ioForceDisplayUpdate]. - ! Item was removed: - ----- Method: ContextInterpreter>>getCurrentBytecode (in category 'interpreter shell') ----- - getCurrentBytecode - "currentBytecode will be private to the main dispatch loop in the generated code. This method allows the currentBytecode to be retrieved from global variables." - - ^ objectMemory byteAt: instructionPointer! Item was removed: - ----- Method: ContextInterpreter>>interpreterAllocationReserveBytes (in category 'stack interpreter support') ----- - interpreterAllocationReserveBytes - "Extra allocation space in the object memory required by StackInterpreter" - ^ 0 - ! Item was removed: - ----- Method: ContextInterpreter>>isMarriedOrWidowedContext: (in category 'stack interpreter support') ----- - isMarriedOrWidowedContext: aContext - ^false! Item was removed: - ----- Method: ContextInterpreter>>jump: (in category 'jump bytecodes') ----- - jump: offset - - localIP := localIP + offset + 1. - currentBytecode := objectMemory byteAtPointer: localIP. - ! Item was removed: - ----- Method: ContextInterpreter>>loadBitBltFrom: (in category 'bitblt support') ----- - loadBitBltFrom: bb - "This entry point needs to be implemented for the interpreter proxy. - Since BitBlt is now a plugin we need to look up BitBltPlugin:=loadBitBltFrom - and call it. This entire mechanism should eventually go away and be - replaced with a dynamic lookup from BitBltPlugin itself but for backward - compatibility this stub is provided" - | fn | - - fn := self ioLoadFunction: 'loadBitBltFrom' From: 'BitBltPlugin'. - fn = 0 ifTrue: [^self primitiveFail]. - ^self cCode: '((sqInt (*)(sqInt))fn)(bb)'! Item was removed: - ----- Method: ContextInterpreter>>longJumpIfFalse (in category 'jump bytecodes') ----- - longJumpIfFalse - - self jumplfFalseBy: ((currentBytecode bitAnd: 3) * 256) + self fetchByte.! Item was removed: - ----- Method: ContextInterpreter>>longJumpIfTrue (in category 'jump bytecodes') ----- - longJumpIfTrue - - self jumplfTrueBy: ((currentBytecode bitAnd: 3) * 256) + self fetchByte.! Item was removed: - ----- Method: ContextInterpreter>>markAndTraceAndMaybeFreeStackPages: (in category 'stack interpreter support') ----- - markAndTraceAndMaybeFreeStackPages: fullGCFlag - "This is a no-op in Interpreter" - ! Item was removed: - ----- Method: ContextInterpreter>>markAndTraceOrFreeMachineCode: (in category 'stack interpreter support') ----- - markAndTraceOrFreeMachineCode: fullGCFlag - "This is a no-op in Interpreter" - ! Item was removed: - ----- Method: ContextInterpreter>>popStackBytecode (in category 'stack bytecodes') ----- - popStackBytecode - - self fetchNextBytecode. - self internalPop: 1. - ! Item was removed: - ----- Method: ContextInterpreter>>primitiveSetGCSemaphore (in category 'memory space primitives') ----- - primitiveSetGCSemaphore - "Primitive. Indicate the semaphore to be signalled for upon garbage collection" - | index | - - index := self stackIntegerValue: 0. - self successful ifTrue:[ - objectMemory setGcSemaphoreIndex: index. - self pop: argumentCount. - ].! Item was removed: - ----- Method: ContextInterpreter>>pushConstantMinusOneBytecode (in category 'stack bytecodes') ----- - pushConstantMinusOneBytecode - - self fetchNextBytecode. - self internalPush: ConstMinusOne. - ! Item was removed: - ----- Method: ContextInterpreter>>pushConstantOneBytecode (in category 'stack bytecodes') ----- - pushConstantOneBytecode - - self fetchNextBytecode. - self internalPush: ConstOne. - ! Item was removed: - ----- Method: ContextInterpreter>>pushConstantTwoBytecode (in category 'stack bytecodes') ----- - pushConstantTwoBytecode - - self fetchNextBytecode. - self internalPush: ConstTwo. - ! Item was removed: - ----- Method: ContextInterpreter>>pushConstantZeroBytecode (in category 'stack bytecodes') ----- - pushConstantZeroBytecode - - self fetchNextBytecode. - self internalPush: ConstZero. - ! Item was removed: - ----- Method: ContextInterpreter>>pushFloat: (in category 'stack bytecodes') ----- - pushFloat: f - - - self push: (self floatObjectOf: f).! Item was removed: - ----- Method: ContextInterpreter>>pushLiteralConstant: (in category 'stack bytecodes') ----- - pushLiteralConstant: literalIndex - - self internalPush: (self literal: literalIndex).! Item was removed: - ----- Method: ContextInterpreter>>pushLiteralVariable: (in category 'stack bytecodes') ----- - pushLiteralVariable: literalIndex - - self internalPush: - (objectMemory fetchPointer: ValueIndex ofObject: (self literal: literalIndex)).! Item was removed: - ----- Method: ContextInterpreter>>pushRemoteTempLongBytecode (in category 'stack bytecodes') ----- - pushRemoteTempLongBytecode - | remoteTempIndex tempVectorIndex | - remoteTempIndex := self fetchByte. - tempVectorIndex := self fetchByte. - self fetchNextBytecode. - self pushRemoteTemp: remoteTempIndex inVectorAt: tempVectorIndex! Item was removed: - ----- Method: ContextInterpreter>>shortConditionalJump (in category 'jump bytecodes') ----- - shortConditionalJump - - self jumplfFalseBy: (currentBytecode bitAnd: 7) + 1.! Item was removed: - ----- Method: ContextInterpreter>>showDisplayBits:Left:Top:Right:Bottom: (in category 'I/O primitive support') ----- - showDisplayBits: aForm Left: l Top: t Right: r Bottom: b - "Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object." - deferDisplayUpdates ifTrue: [^ nil]. - self displayBitsOf: aForm Left: l Top: t Right: r Bottom: b! Item was removed: - ----- Method: ContextInterpreter>>specialSelector: (in category 'message sending') ----- - specialSelector: index - - ^ objectMemory fetchPointer: (index * 2) ofObject: (objectMemory splObj: SpecialSelectors)! Item was removed: - ----- Method: ContextInterpreter>>storeAndPopRemoteTempLongBytecode (in category 'stack bytecodes') ----- - storeAndPopRemoteTempLongBytecode - self storeRemoteTempLongBytecode. - self internalPop: 1! Item was removed: - ----- Method: ContextInterpreter>>storeRemoteTempLongBytecode (in category 'stack bytecodes') ----- - storeRemoteTempLongBytecode - | remoteTempIndex tempVectorIndex | - remoteTempIndex := self fetchByte. - tempVectorIndex := self fetchByte. - self fetchNextBytecode. - self storeRemoteTemp: remoteTempIndex inVectorAt: tempVectorIndex! Item was removed: - ----- Method: ContextInterpreter>>superclassOf: (in category 'message sending') ----- - superclassOf: classPointer - - ^ objectMemory fetchPointer: SuperclassIndex ofObject: classPointer! Item was changed: InterpreterPrimitives subclass: #Interpreter + instanceVariableNames: 'currentBytecode semaphoresUseBufferA semaphoresToSignalA semaphoresToSignalCountA semaphoresToSignalB semaphoresToSignalCountB extraVMMemory globalSessionID method instructionPointer stackPointer localIP localSP localReturnValue messageSelector currentByteCode primitiveFunctionPointer methodCache atCache lkupClass interruptPending savedWindowSize deferDisplayUpdates pendingFinalizationSignals interpreterProxy showSurfaceFn externalPrimitiveTable jmpBuf jmpDepth suspendedCallbacks suspendedMethods' + classVariableNames: 'AtCacheEntries AtCacheFixedFields AtCacheFmt AtCacheMask AtCacheOop AtCacheSize AtCacheTotalSize AtPutBase MaxExternalPrimitiveTableSize MaxJumpBuf MaxPrimitiveIndex SemaphoresToSignalSize' + poolDictionaries: 'VMMethodCacheConstants' - instanceVariableNames: 'semaphoresUseBufferA semaphoresToSignalA semaphoresToSignalCountA semaphoresToSignalB semaphoresToSignalCountB extraVMMemory globalSessionID' - classVariableNames: 'AtCacheEntries AtCacheFixedFields AtCacheFmt AtCacheMask AtCacheOop AtCacheSize AtCacheTotalSize AtPutBase MaxExternalPrimitiveTableSize MaxPrimitiveIndex SemaphoresToSignalSize' - poolDictionaries: '' category: 'VMMaker-Interpreter'! !Interpreter commentStamp: 'dtl 4/22/2016 22:14' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. ContextInterpreter is the Squeak interpreter VM as originally implemented by Dan Ingalls. StackInterpreter is the stack mapped interpreter by Eliot Miranda, which provides the basis for later Cog and Spur VMs.! Item was changed: ----- Method: Interpreter class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator + aCCodeGenerator + var: #interpreterProxy type: #'struct VirtualMachine*'. aCCodeGenerator var: 'semaphoresToSignalA' declareC: 'sqInt semaphoresToSignalA[' , (SemaphoresToSignalSize + 1) printString , ']'. aCCodeGenerator var: 'semaphoresToSignalB' declareC: 'sqInt semaphoresToSignalB[' , (SemaphoresToSignalSize + 1) printString , ']'. + self declareC: #(instructionPointer method) + as: #usqInt + in: aCCodeGenerator. + self declareC: #(stackPointer localIP localSP) + as: #'char *' + in: aCCodeGenerator. + aCCodeGenerator + var: #primitiveFunctionPointer + declareC: 'void (*primitiveFunctionPointer)()'. + aCCodeGenerator + var: #methodCache + declareC: 'long methodCache[MethodCacheSize + 1 /* ', (MethodCacheSize + 1) printString, ' */]'. + aCCodeGenerator + var: #atCache + declareC: 'sqInt atCache[AtCacheTotalSize + 1 /* ', (AtCacheTotalSize + 1) printString, ' */]'. + aCCodeGenerator + var: #showSurfaceFn + type: #'void *'. + aCCodeGenerator + var: #externalPrimitiveTable + declareC: 'void (*externalPrimitiveTable[' , (MaxExternalPrimitiveTableSize + 1) printString , '])(void)'. + aCCodeGenerator + var: #jmpBuf + declareC: 'jmp_buf jmpBuf[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. + aCCodeGenerator + var: #suspendedCallbacks + declareC: 'usqInt suspendedCallbacks[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. + aCCodeGenerator + var: #suspendedMethods + declareC: 'usqInt suspendedMethods[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. + + ! Item was changed: ----- Method: Interpreter class>>initialize (in category 'initialization') ----- initialize "Note: The external primitive table should actually be dynamically sized but for the sake of inferior platforms (e.g., Mac :-) who cannot allocate memory in any reasonable way, we keep it static (and cross our fingers...)" MaxExternalPrimitiveTableSize := 4096. "entries" + MaxJumpBuf := 32. "max. callback depth" self initializeCaches. SemaphoresToSignalSize := 500. ! Item was added: + ----- Method: Interpreter>>asciiOfCharacter: (in category 'indexing primitive support') ----- + asciiOfCharacter: characterObj "Returns an integer object" + + + self assertClassOf: characterObj is: (objectMemory splObj: ClassCharacter). + self successful + ifTrue: [^ objectMemory fetchPointer: CharacterValueIndex ofObject: characterObj] + ifFalse: [^ ConstZero] "in case some code needs an int"! Item was added: + ----- Method: Interpreter>>bytecodePrimAdd (in category 'common selector sends') ----- + bytecodePrimAdd + | rcvr arg result | + rcvr := self internalStackValue: 1. + arg := self internalStackValue: 0. + (self areIntegers: rcvr and: arg) + ifTrue: [result := (objectMemory integerValueOf: rcvr) + (objectMemory integerValueOf: arg). + (objectMemory isIntegerValue: result) ifTrue: + [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). + ^ self fetchNextBytecode "success"]] + ifFalse: [self initPrimCall. + self externalizeIPandSP. + self primitiveFloatAdd: rcvr toArg: arg. + self internalizeIPandSP. + self successful ifTrue: [^ self fetchNextBytecode "success"]]. + + messageSelector := self specialSelector: 0. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimAtEnd (in category 'common selector sends') ----- + bytecodePrimAtEnd + messageSelector := self specialSelector: 21. + argumentCount := 0. + self normalSend.! Item was added: + ----- Method: Interpreter>>bytecodePrimBitAnd (in category 'common selector sends') ----- + bytecodePrimBitAnd + + self initPrimCall. + self externalizeIPandSP. + self primitiveBitAnd. + self internalizeIPandSP. + self successful ifTrue: [^ self fetchNextBytecode "success"]. + + messageSelector := self specialSelector: 14. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimBitOr (in category 'common selector sends') ----- + bytecodePrimBitOr + + self initPrimCall. + self externalizeIPandSP. + self primitiveBitOr. + self internalizeIPandSP. + self successful ifTrue: [^ self fetchNextBytecode "success"]. + + messageSelector := self specialSelector: 15. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimBitShift (in category 'common selector sends') ----- + bytecodePrimBitShift + + self initPrimCall. + self externalizeIPandSP. + self primitiveBitShift. + self internalizeIPandSP. + self successful ifTrue: [^ self fetchNextBytecode "success"]. + + messageSelector := self specialSelector: 12. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimDiv (in category 'common selector sends') ----- + bytecodePrimDiv + | quotient | + self initPrimCall. + quotient := self doPrimitiveDiv: (self internalStackValue: 1) by: (self internalStackValue: 0). + self successful ifTrue: [self internalPop: 2 thenPush: (objectMemory integerObjectOf: quotient). + ^ self fetchNextBytecode "success"]. + + messageSelector := self specialSelector: 13. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimDivide (in category 'common selector sends') ----- + bytecodePrimDivide + | rcvr arg result | + rcvr := self internalStackValue: 1. + arg := self internalStackValue: 0. + (self areIntegers: rcvr and: arg) + ifTrue: [rcvr := objectMemory integerValueOf: rcvr. + arg := objectMemory integerValueOf: arg. + (arg ~= 0 and: [rcvr \\ arg = 0]) + ifTrue: [result := rcvr // arg. + "generates C / operation" + (objectMemory isIntegerValue: result) + ifTrue: [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). + ^ self fetchNextBytecode"success"]]] + ifFalse: [self initPrimCall. + self externalizeIPandSP. + self primitiveFloatDivide: rcvr byArg: arg. + self internalizeIPandSP. + self successful ifTrue: [^ self fetchNextBytecode"success"]]. + + messageSelector := self specialSelector: 9. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimDo (in category 'common selector sends') ----- + bytecodePrimDo + + messageSelector := self specialSelector: 27. + argumentCount := 1. + self normalSend. + ! Item was added: + ----- Method: Interpreter>>bytecodePrimEqual (in category 'common selector sends') ----- + bytecodePrimEqual + | rcvr arg aBool | + rcvr := self internalStackValue: 1. + arg := self internalStackValue: 0. + (self areIntegers: rcvr and: arg) ifTrue: [^self booleanCheat: rcvr = arg]. + + self initPrimCall. + aBool := self primitiveFloatEqual: rcvr toArg: arg. + self successful ifTrue: [^self booleanCheat: aBool]. + + messageSelector := self specialSelector: 6. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimEquivalent (in category 'common selector sends') ----- + bytecodePrimEquivalent + + | rcvr arg | + rcvr := self internalStackValue: 1. + arg := self internalStackValue: 0. + self booleanCheat: rcvr = arg.! Item was added: + ----- Method: Interpreter>>bytecodePrimMakePoint (in category 'common selector sends') ----- + bytecodePrimMakePoint + + self initPrimCall. + self externalizeIPandSP. + self primitiveMakePoint. + self internalizeIPandSP. + self successful ifTrue: [^ self fetchNextBytecode "success"]. + + messageSelector := self specialSelector: 11. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimMod (in category 'common selector sends') ----- + bytecodePrimMod + | mod | + self initPrimCall. + mod := self doPrimitiveMod: (self internalStackValue: 1) by: (self internalStackValue: 0). + self successful ifTrue: + [self internalPop: 2 thenPush: (objectMemory integerObjectOf: mod). + ^ self fetchNextBytecode "success"]. + + messageSelector := self specialSelector: 10. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimNew (in category 'common selector sends') ----- + bytecodePrimNew + + messageSelector := self specialSelector: 28. + argumentCount := 0. + self normalSend. + ! Item was added: + ----- Method: Interpreter>>bytecodePrimNewWithArg (in category 'common selector sends') ----- + bytecodePrimNewWithArg + + messageSelector := self specialSelector: 29. + argumentCount := 1. + self normalSend. + ! Item was added: + ----- Method: Interpreter>>bytecodePrimNext (in category 'common selector sends') ----- + bytecodePrimNext + messageSelector := self specialSelector: 19. + argumentCount := 0. + self normalSend.! Item was added: + ----- Method: Interpreter>>bytecodePrimNextPut (in category 'common selector sends') ----- + bytecodePrimNextPut + messageSelector := self specialSelector: 20. + argumentCount := 1. + self normalSend.! Item was added: + ----- Method: Interpreter>>bytecodePrimNotEqual (in category 'common selector sends') ----- + bytecodePrimNotEqual + | rcvr arg aBool | + rcvr := self internalStackValue: 1. + arg := self internalStackValue: 0. + (self areIntegers: rcvr and: arg) ifTrue: [^self booleanCheat: rcvr ~= arg]. + + self initPrimCall. + aBool := self primitiveFloatEqual: rcvr toArg: arg. + self successful ifTrue: [^self booleanCheat: aBool not]. + + messageSelector := self specialSelector: 7. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>bytecodePrimSubtract (in category 'common selector sends') ----- + bytecodePrimSubtract + | rcvr arg result | + rcvr := self internalStackValue: 1. + arg := self internalStackValue: 0. + (self areIntegers: rcvr and: arg) + ifTrue: [result := (objectMemory integerValueOf: rcvr) - (objectMemory integerValueOf: arg). + (objectMemory isIntegerValue: result) ifTrue: + [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). + ^self fetchNextBytecode "success"]] + ifFalse: [self initPrimCall. + self externalizeIPandSP. + self primitiveFloatSubtract: rcvr fromArg: arg. + self internalizeIPandSP. + self successful ifTrue: [^self fetchNextBytecode "success"]]. + + messageSelector := self specialSelector: 1. + argumentCount := 1. + self normalSend! Item was added: + ----- Method: Interpreter>>characterForAscii: (in category 'indexing primitive support') ----- + characterForAscii: ascii "Arg must lie in range 0-255!!" + + ^ objectMemory fetchPointer: ascii ofObject: (objectMemory splObj: CharacterTable)! Item was added: + ----- Method: Interpreter>>checkBooleanResult: (in category 'arithmetic primitive support') ----- + checkBooleanResult: result + self successful + ifTrue: [self pushBool: result] + ifFalse: [self unPop: 2]! Item was added: + ----- Method: Interpreter>>compare31or32Bits:equal: (in category 'arithmetic primitive support') ----- + compare31or32Bits: obj1 equal: obj2 + "May set success to false" + + "First compare two ST integers..." + ((objectMemory isIntegerObject: obj1) + and: [objectMemory isIntegerObject: obj2]) + ifTrue: [^ obj1 = obj2]. + + "Now compare, assuming positive integers, but setting fail if not" + ^ (self positive32BitValueOf: obj1) = (self positive32BitValueOf: obj2)! Item was added: + ----- Method: Interpreter>>copyBits (in category 'bitblt support') ----- + copyBits + "This entry point needs to be implemented for the interpreter proxy. + Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBits + and call it. This entire mechanism should eventually go away and be + replaced with a dynamic lookup from BitBltPlugin itself but for backward + compatibility this stub is provided" + + | fn | + + fn := self ioLoadFunction: 'copyBits' From: 'BitBltPlugin'. + fn = 0 ifTrue: [^self primitiveFail]. + ^self cCode: '((sqInt (*)(void))fn)()'! Item was added: + ----- Method: Interpreter>>copyBitsFrom:to:at: (in category 'bitblt support') ----- + copyBitsFrom: x0 to: x1 at: y + "This entry point needs to be implemented for the interpreter proxy. + Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBitsFrom:to:at: + and call it. This entire mechanism should eventually go away and be + replaced with a dynamic lookup from BitBltPlugin itself but for backward + compatibility this stub is provided" + + | fn | + + fn := self ioLoadFunction: 'copyBitsFromtoat' From: 'BitBltPlugin'. + fn = 0 ifTrue: [^self primitiveFail]. + ^self cCode: '((sqInt (*)(sqInt, sqInt, sqInt))fn)(x0, x1, y)'! Item was added: + ----- Method: Interpreter>>displayBitsOf:Left:Top:Right:Bottom: (in category 'I/O primitives') ----- + displayBitsOf: aForm Left: l Top: t Right: r Bottom: b + "Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object." + + | displayObj dispBits w h dispBitsIndex d left right top bottom surfaceHandle | + displayObj := objectMemory splObj: TheDisplay. + aForm = displayObj ifFalse: [^ nil]. + self success: ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]). + self successful ifTrue: [ + dispBits := objectMemory fetchPointer: 0 ofObject: displayObj. + w := self fetchInteger: 1 ofObject: displayObj. + h := self fetchInteger: 2 ofObject: displayObj. + d := self fetchInteger: 3 ofObject: displayObj. + ]. + l < 0 ifTrue:[left := 0] ifFalse: [left := l]. + r > w ifTrue: [right := w] ifFalse: [right := r]. + t < 0 ifTrue: [top := 0] ifFalse: [top := t]. + b > h ifTrue: [bottom := h] ifFalse: [bottom := b]. + ((left <= right) and: [top <= bottom]) ifFalse: [^nil]. + self successful ifTrue: [ + (objectMemory isIntegerObject: dispBits) ifTrue: [ + surfaceHandle := objectMemory integerValueOf: dispBits. + showSurfaceFn = 0 ifTrue: [ + showSurfaceFn := self ioLoadFunction: 'ioShowSurface' From: 'SurfacePlugin'. + showSurfaceFn = 0 ifTrue: [^self success: false]]. + self cCode:'((sqInt (*)(sqInt, sqInt, sqInt, sqInt, sqInt))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top)'. + ] ifFalse: [ + dispBitsIndex := dispBits + objectMemory baseHeaderSize. "index in memory byte array" + self cCode: 'ioShowDisplay(dispBitsIndex, w, h, d, left, right, top, bottom)' + inSmalltalk: [self showDisplayBits: dispBitsIndex + w: w h: h d: d + left: left right: right top: top bottom: bottom] + ]. + ].! Item was added: + ----- Method: Interpreter>>doPrimitiveDiv:by: (in category 'arithmetic primitive support') ----- + doPrimitiveDiv: rcvr by: arg + "Rounds negative results towards negative infinity, rather than zero." + | result posArg posRcvr integerRcvr integerArg | + (self areIntegers: rcvr and: arg) + ifTrue: [integerRcvr := objectMemory integerValueOf: rcvr. + integerArg := objectMemory integerValueOf: arg. + self success: integerArg ~= 0] + ifFalse: [self primitiveFail]. + self successful ifFalse: [^ 1 "fail"]. + + integerRcvr > 0 + ifTrue: [integerArg > 0 + ifTrue: [result := integerRcvr // integerArg] + ifFalse: ["round negative result toward negative infinity" + posArg := 0 - integerArg. + result := 0 - ((integerRcvr + (posArg - 1)) // posArg)]] + ifFalse: [posRcvr := 0 - integerRcvr. + integerArg > 0 + ifTrue: ["round negative result toward negative infinity" + result := 0 - ((posRcvr + (integerArg - 1)) // integerArg)] + ifFalse: [posArg := 0 - integerArg. + result := posRcvr // posArg]]. + self success: (objectMemory isIntegerValue: result). + ^ result! Item was added: + ----- Method: Interpreter>>doPrimitiveMod:by: (in category 'arithmetic primitive support') ----- + doPrimitiveMod: rcvr by: arg + | integerResult integerRcvr integerArg | + (self areIntegers: rcvr and: arg) + ifTrue: [integerRcvr := objectMemory integerValueOf: rcvr. + integerArg := objectMemory integerValueOf: arg. + self success: integerArg ~= 0] + ifFalse: [self primitiveFail]. + self successful ifFalse: [^ 1 "fail"]. + + integerResult := integerRcvr \\ integerArg. + + "ensure that the result has the same sign as the integerArg" + integerArg < 0 + ifTrue: [integerResult > 0 + ifTrue: [integerResult := integerResult + integerArg]] + ifFalse: [integerResult < 0 + ifTrue: [integerResult := integerResult + integerArg]]. + self success: (objectMemory isIntegerValue: integerResult). + ^ integerResult! Item was added: + ----- Method: Interpreter>>duplicateTopBytecode (in category 'stack bytecodes') ----- + duplicateTopBytecode + + self fetchNextBytecode. + self internalPush: self internalStackTop. + ! Item was added: + ----- Method: Interpreter>>extendedPushBytecode (in category 'stack bytecodes') ----- + extendedPushBytecode + + | descriptor variableType variableIndex | + descriptor := self fetchByte. + self fetchNextBytecode. + variableType := (descriptor >> 6) bitAnd: 16r3. + variableIndex := descriptor bitAnd: 16r3F. + variableType=0 ifTrue: [^self pushReceiverVariable: variableIndex]. + variableType=1 ifTrue: [^self pushTemporaryVariable: variableIndex]. + variableType=2 ifTrue: [^self pushLiteralConstant: variableIndex]. + variableType=3 ifTrue: [^self pushLiteralVariable: variableIndex]. + ! Item was added: + ----- Method: Interpreter>>fetchByte (in category 'interpreter shell') ----- + fetchByte + "This method uses the preIncrement builtin function which has no Smalltalk equivalent. Thus, it must be overridden in the simulator." + + ^objectMemory byteAtPointer: localIP preIncrement! Item was added: + ----- Method: Interpreter>>fullDisplayUpdate (in category 'I/O primitive support') ----- + fullDisplayUpdate + "Repaint the entire smalltalk screen, ignoring the affected rectangle. Used in some platform's code when the Smalltalk window is brought to the front or uncovered." + + | displayObj w h | + displayObj := objectMemory splObj: TheDisplay. + ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]) ifTrue: [ + w := self fetchInteger: 1 ofObject: displayObj. + h := self fetchInteger: 2 ofObject: displayObj. + self displayBitsOf: displayObj Left: 0 Top: 0 Right: w Bottom: h. + self ioForceDisplayUpdate]. + ^nil! Item was added: + ----- Method: Interpreter>>getCurrentBytecode (in category 'interpreter shell') ----- + getCurrentBytecode + "currentBytecode will be private to the main dispatch loop in the generated code. This method allows the currentBytecode to be retrieved from global variables." + + ^objectMemory byteAt: instructionPointer! Item was added: + ----- Method: Interpreter>>jump: (in category 'jump bytecodes') ----- + jump: offset + localIP := localIP + offset + 1. + currentBytecode := objectMemory byteAtPointer: localIP! Item was added: + ----- Method: Interpreter>>loadBitBltFrom: (in category 'bitblt support') ----- + loadBitBltFrom: bb + "This entry point needs to be implemented for the interpreter proxy. + Since BitBlt is now a plugin we need to look up BitBltPlugin:=loadBitBltFrom + and call it. This entire mechanism should eventually go away and be + replaced with a dynamic lookup from BitBltPlugin itself but for backward + compatibility this stub is provided" + | fn | + + fn := self ioLoadFunction: 'loadBitBltFrom' From: 'BitBltPlugin'. + fn = 0 ifTrue: [^self primitiveFail]. + ^self cCode: '((sqInt (*)(sqInt))fn)(bb)'! Item was added: + ----- Method: Interpreter>>longJumpIfFalse (in category 'jump bytecodes') ----- + longJumpIfFalse + + self jumplfFalseBy: ((currentBytecode bitAnd: 3) * 256) + self fetchByte.! Item was added: + ----- Method: Interpreter>>longJumpIfTrue (in category 'jump bytecodes') ----- + longJumpIfTrue + + self jumplfTrueBy: ((currentBytecode bitAnd: 3) * 256) + self fetchByte.! Item was added: + ----- Method: Interpreter>>popStackBytecode (in category 'stack bytecodes') ----- + popStackBytecode + + self fetchNextBytecode. + self internalPop: 1. + ! Item was added: + ----- Method: Interpreter>>primitiveSetGCSemaphore (in category 'memory space primitives') ----- + primitiveSetGCSemaphore + "Primitive. Indicate the semaphore to be signalled for upon garbage collection" + | index | + + index := self stackIntegerValue: 0. + self successful ifTrue:[ + objectMemory setGcSemaphoreIndex: index. + self pop: argumentCount. + ].! Item was added: + ----- Method: Interpreter>>pushConstantMinusOneBytecode (in category 'stack bytecodes') ----- + pushConstantMinusOneBytecode + + self fetchNextBytecode. + self internalPush: ConstMinusOne. + ! Item was added: + ----- Method: Interpreter>>pushConstantOneBytecode (in category 'stack bytecodes') ----- + pushConstantOneBytecode + + self fetchNextBytecode. + self internalPush: ConstOne. + ! Item was added: + ----- Method: Interpreter>>pushConstantTwoBytecode (in category 'stack bytecodes') ----- + pushConstantTwoBytecode + + self fetchNextBytecode. + self internalPush: ConstTwo. + ! Item was added: + ----- Method: Interpreter>>pushConstantZeroBytecode (in category 'stack bytecodes') ----- + pushConstantZeroBytecode + + self fetchNextBytecode. + self internalPush: ConstZero. + ! Item was added: + ----- Method: Interpreter>>pushFloat: (in category 'stack bytecodes') ----- + pushFloat: f + + + self push: (self floatObjectOf: f).! Item was added: + ----- Method: Interpreter>>pushLiteralConstant: (in category 'stack bytecodes') ----- + pushLiteralConstant: literalIndex + + self internalPush: (self literal: literalIndex).! Item was added: + ----- Method: Interpreter>>pushLiteralVariable: (in category 'stack bytecodes') ----- + pushLiteralVariable: literalIndex + + self internalPush: + (objectMemory fetchPointer: ValueIndex ofObject: (self literal: literalIndex)).! Item was added: + ----- Method: Interpreter>>pushRemoteTempLongBytecode (in category 'stack bytecodes') ----- + pushRemoteTempLongBytecode + | remoteTempIndex tempVectorIndex | + remoteTempIndex := self fetchByte. + tempVectorIndex := self fetchByte. + self fetchNextBytecode. + self pushRemoteTemp: remoteTempIndex inVectorAt: tempVectorIndex! Item was added: + ----- Method: Interpreter>>shortConditionalJump (in category 'jump bytecodes') ----- + shortConditionalJump + + self jumplfFalseBy: (currentBytecode bitAnd: 7) + 1.! Item was added: + ----- Method: Interpreter>>showDisplayBits:Left:Top:Right:Bottom: (in category 'I/O primitive support') ----- + showDisplayBits: aForm Left: l Top: t Right: r Bottom: b + "Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object." + deferDisplayUpdates ifTrue: [^ nil]. + self displayBitsOf: aForm Left: l Top: t Right: r Bottom: b! Item was added: + ----- Method: Interpreter>>specialSelector: (in category 'message sending') ----- + specialSelector: index + + ^ objectMemory fetchPointer: (index * 2) ofObject: (objectMemory splObj: SpecialSelectors)! Item was added: + ----- Method: Interpreter>>storeAndPopRemoteTempLongBytecode (in category 'stack bytecodes') ----- + storeAndPopRemoteTempLongBytecode + self storeRemoteTempLongBytecode. + self internalPop: 1! Item was added: + ----- Method: Interpreter>>storeRemoteTempLongBytecode (in category 'stack bytecodes') ----- + storeRemoteTempLongBytecode + | remoteTempIndex tempVectorIndex | + remoteTempIndex := self fetchByte. + tempVectorIndex := self fetchByte. + self fetchNextBytecode. + self storeRemoteTemp: remoteTempIndex inVectorAt: tempVectorIndex! Item was added: + ----- Method: Interpreter>>superclassOf: (in category 'message sending') ----- + superclassOf: classPointer + + ^ objectMemory fetchPointer: SuperclassIndex ofObject: classPointer! Item was changed: Interpreter subclass: #StackInterpreter + instanceVariableNames: 'localFP stackLimit stackPage stackPages framePointer highestRunnableProcessPriority nextWakeupUsecs nextPollUsecs inIOProcessEvents imageHeaderFlags externalPrimitiveTableFirstFreeIndex overflowedPage extraFramesToMoveOnOverflow numStackPages desiredNumStackPages desiredEdenBytes classNameIndex thisClassIndex metaclassSizeBytes interruptCheckChain suppressHeartbeatFlag breakSelector breakSelectorLength longRunningPrimitiveCheckMethod longRunningPrimitiveCheckSemaphore longRunningPrimitiveStartUsecs longRunningPrimitiveStopUsecs longRunningPrimitiveGCUsecs longRunningPrimitiveCheckSequenceNumber longRunningPrimitiveSignalUndelivered tempOop statForceInterruptCheck statStackOverflow statStackPageDivorce statCheckForEvents statProcessSwitch statIOProcessEvents theUnknownShort imageFloatsBigEndian maxExtSemTabSizeSet lastMethodCacheProbeWrite statPendingFinalizationSignals classByteArrayCompactIndex profileProcess nextProfileTick profileMethod profileSemaphore' + classVariableNames: 'BytecodeTable BytesPerWord COGMTVM COGVM CacheProbeMax DirBadPath DirEntryFound DirNoMoreEntries DumpStackOnLowSpace EnclosingMixinIndex EnclosingObjectIndex FailImbalancedPrimitives HeaderFlagBitPosition IMMUTABILITY MULTIPLEBYTECODESETS MaxQuickPrimitiveIndex MixinIndex NewspeakVM STACKVM VMBIGENDIAN' - instanceVariableNames: 'currentBytecode localFP localIP localSP stackLimit stackPage stackPages method instructionPointer stackPointer framePointer localReturnValue primitiveFunctionPointer methodCache atCache lkupClass highestRunnableProcessPriority nextWakeupUsecs nextPollUsecs inIOProcessEvents interruptPending savedWindowSize imageHeaderFlags deferDisplayUpdates pendingFinalizationSignals interpreterProxy showSurfaceFn externalPrimitiveTable externalPrimitiveTableFirstFreeIndex overflowedPage extraFramesToMoveOnOverflow jmpBuf jmpDepth suspendedCallbacks suspendedMethods numStackPages desiredNumStackPages desiredEdenBytes classNameIndex thisClassIndex metaclassSizeBytes interruptCheckChain suppressHeartbeatFlag breakSelector breakSelectorLength longRunningPrimitiveCheckMethod longRunningPrimitiveCheckSemaphore longRunningPrimitiveStartUsecs longRunningPrimitiveStopUsecs longRunningPrimitiveGCUsecs longRunningPrimitiveCheckSequenceNumber longRunningPrimitiveSignalUndelivered te mpOop statForceInterruptCheck statStackOverflow statStackPageDivorce statCheckForEvents statProcessSwitch statIOProcessEvents theUnknownShort imageFloatsBigEndian maxExtSemTabSizeSet lastMethodCacheProbeWrite statPendingFinalizationSignals classByteArrayCompactIndex messageSelector profileProcess nextProfileTick profileMethod profileSemaphore' - classVariableNames: 'BytecodeTable BytesPerWord COGMTVM COGVM CacheProbeMax DirBadPath DirEntryFound DirNoMoreEntries DumpStackOnLowSpace EnclosingMixinIndex EnclosingObjectIndex FailImbalancedPrimitives HeaderFlagBitPosition IMMUTABILITY MULTIPLEBYTECODESETS MaxJumpBuf MaxQuickPrimitiveIndex MixinIndex NewspeakVM STACKVM VMBIGENDIAN' poolDictionaries: 'VMBasicConstants VMMethodCacheConstants VMObjectIndices VMSqueakV3BytecodeConstants VMSqueakV3ObjectRepresentationConstants VMStackFrameOffsets' category: 'VMMaker-Interpreter'! !StackInterpreter commentStamp: '' prior: 0! This class is a complete implementation of the Smalltalk-80 virtual machine, derived originally from the Blue Book specification but quite different in some areas. This VM supports Closures but *not* old-style BlockContexts. It has been modernized with 32-bit pointers, better management of Contexts (see next item), and attention to variable use that allows the CCodeGenerator (qv) to keep, eg, the instruction pointer and stack pointer in registers as well as keeping most simple variables in a global array that seems to improve performance for most platforms. The VM does not use Contexts directly. Instead Contexts serve as proxies for a more conventional stack format that is invisible to the image. There is considerable explanation at http://www.mirandabanda.org/cogblog/2009/01/14/under-cover-contexts-and-the-big-frame-up. The VM maintains a fixed-size stack zone divided into pages, each page being capable of holding several method/block activations. A send establishes a new frame in the current stack page, a return returns to the previous frame. This eliminates allocation/deallocation of contexts and the moving of receiver and arguments from caller to callee on each send/return. Contexts are created lazily when an activation needs a context (creating a block, explicit use of thisContext, access to sender when sender is a frame, or linking of stack pages together). Contexts are either conventional and heap-resident ("single") or "married" and serve as proxies for their corresponding frame or "widowed", meaning that their spouse f rame has been returned from (died). A married context is specially marked (more details in the code) and refers to its frame. Likewise a married frame is specially marked and refers to its context. In addition to SmallInteger arithmetic and Floats, the VM supports logic on 32-bit PositiveLargeIntegers, thus allowing it to simulate itself much more effectively than would otherwise be the case. NOTE: Here follows a list of things to be borne in mind when working on this code, or when making changes for the future. 1. There are a number of things that should be done the next time we plan to release a completely incompatible image format. These include unifying the instanceSize field of the class format word -- see instantiateClass:indexableSize:, and unifying the bits of the method primitive index (if we decide we need more than 512, after all) -- see primitiveIndexOf:. Also, contexts should be given a special format code (see next item). 2. There are several fast checks for contexts (see isContextHeader: and isMethodContextHeader:) which will fail if the compact class indices of BlockContext or MethodContext change. This is necessary because the oops may change during a compaction when the oops are being adjusted. It's important to be aware of this when writing a new image using the SystemTracer. A better solution would be to reserve one of the format codes for Contexts only. 3. We have made normal files tolerant to size and positions up to 32 bits. This has not been done for async files, since they are still experimental. The code in size, at: and at:put: should work with sizes and indices up to 31 bits, although I have not tested it (di 12/98); it might or might not work with 32-bit sizes. 4. Note that 0 is used in a couple of places as an impossible oop. This should be changed to a constant that really is impossible (or perhaps there is code somewhere that guarantees it --if so it should be put in this comment). The places include the method cache and the at cache. 5. Moving to a 2 bit immediate tag and having immediate Characters is a good choice for Unicode and the JIT 6. If Eliot Miranda's 2 word header scheme is acceptable in terms of footprint (we estimate about a 10% increase in image size with about 35 reclaimed by better representation of CompiledMethod - loss of MethodProperties) then the in-line cache for the JIT is simplified, class access is faster and header access is the same in 32-bit and full 64-bit images.! Item was changed: ----- Method: StackInterpreter class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator self class == thisContext methodClass ifFalse: [^self]. "Don't duplicate decls in subclasses" aCCodeGenerator addHeaderFile:' /* for e.g. alloca */'; addHeaderFile:''; addHeaderFile:'"vmCallback.h"'. self declareInterpreterVersionIn: aCCodeGenerator defaultName: 'Stack'. aCCodeGenerator - var: #interpreterProxy type: #'struct VirtualMachine*'. - aCCodeGenerator declareVar: #sendTrace type: 'volatile int'; declareVar: #byteCount type: 'unsigned long'. "These need to be pointers or unsigned." + self declareC: #(newMethod) - 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: #(localFP framePointer stackLimit stackMemory) - self declareC: #(localIP localSP localFP stackPointer framePointer stackLimit stackMemory) as: #'char *' in: aCCodeGenerator. self declareC: #(stackPage overflowedPage) as: #'StackPage *' in: aCCodeGenerator. aCCodeGenerator removeVariable: 'stackPages'. "this is an implicit receiver in the translated code." - aCCodeGenerator - var: #methodCache - declareC: 'long methodCache[MethodCacheSize + 1 /* ', (MethodCacheSize + 1) printString, ' */]'. - aCCodeGenerator - var: #atCache - declareC: 'sqInt atCache[AtCacheTotalSize + 1 /* ', (AtCacheTotalSize + 1) printString, ' */]'. self primitiveTable do: [:symbolOrNot| (symbolOrNot isSymbol and: [symbolOrNot ~~ #primitiveFail]) ifTrue: [(aCCodeGenerator methodNamed: symbolOrNot) ifNotNilDo: [:tMethod| tMethod returnType: #void]]]. aCCodeGenerator - var: #primitiveFunctionPointer - declareC: 'void (*primitiveFunctionPointer)()'. - aCCodeGenerator var: #showSurfaceFn type: #'void *'. - aCCodeGenerator - var: #jmpBuf - declareC: 'jmp_buf jmpBuf[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. - aCCodeGenerator - var: #suspendedCallbacks - declareC: 'usqInt suspendedCallbacks[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. - aCCodeGenerator - var: #suspendedMethods - declareC: 'usqInt suspendedMethods[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. - aCCodeGenerator var: #interruptCheckChain declareC: 'void (*interruptCheckChain)(void) = 0'. aCCodeGenerator var: #breakSelector type: #'char *'; var: #breakSelectorLength declareC: 'sqInt breakSelectorLength = -1'. self declareC: #(nextPollUsecs nextWakeupUsecs longRunningPrimitiveGCUsecs longRunningPrimitiveStartUsecs longRunningPrimitiveStopUsecs) as: #usqLong in: aCCodeGenerator. aCCodeGenerator var: #nextProfileTick type: #sqLong. aCCodeGenerator var: #primitiveTable declareC: 'void (*primitiveTable[' , (MaxPrimitiveIndex + 2) printString , '] )(void)= ' , self primitiveTableString. - aCCodeGenerator var: #externalPrimitiveTable declareC: 'void (*externalPrimitiveTable[' , (MaxExternalPrimitiveTableSize + 1) printString , '])(void)'. ! Item was changed: ----- Method: StackInterpreter class>>initializeMiscConstantsWith: (in category 'initialization') ----- initializeMiscConstantsWith: optionsDictionary super initializeMiscConstantsWith: optionsDictionary. STACKVM := true. NewspeakVM := optionsDictionary at: #NewspeakVM ifAbsent: [false]. "N.B. Not yet implemented!!!!" IMMUTABILITY := optionsDictionary at: #IMMUTABILITY ifAbsent: [false]. DumpStackOnLowSpace := 0. PrimitiveExternalCallIndex := 117. "Primitive index for #primitiveExternalCall" MillisecondClockMask := 16r1FFFFFFF. - MaxJumpBuf := 32. "max. callback depth" FailImbalancedPrimitives := true! Item was removed: - ----- Method: StackInterpreter>>asciiOfCharacter: (in category 'indexing primitive support') ----- - asciiOfCharacter: characterObj "Returns an integer object" - - - self assertClassOf: characterObj is: (objectMemory splObj: ClassCharacter). - self successful - ifTrue: [^ objectMemory fetchPointer: CharacterValueIndex ofObject: characterObj] - ifFalse: [^ ConstZero] "in case some code needs an int"! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimAdd (in category 'common selector sends') ----- - bytecodePrimAdd - | rcvr arg result | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) - ifTrue: [result := (objectMemory integerValueOf: rcvr) + (objectMemory integerValueOf: arg). - (objectMemory isIntegerValue: result) ifTrue: - [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). - ^ self fetchNextBytecode "success"]] - ifFalse: [self initPrimCall. - self externalizeIPandSP. - self primitiveFloatAdd: rcvr toArg: arg. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]]. - - messageSelector := self specialSelector: 0. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimAtEnd (in category 'common selector sends') ----- - bytecodePrimAtEnd - messageSelector := self specialSelector: 21. - argumentCount := 0. - self normalSend.! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimBitAnd (in category 'common selector sends') ----- - bytecodePrimBitAnd - - self initPrimCall. - self externalizeIPandSP. - self primitiveBitAnd. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 14. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimBitOr (in category 'common selector sends') ----- - bytecodePrimBitOr - - self initPrimCall. - self externalizeIPandSP. - self primitiveBitOr. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 15. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimBitShift (in category 'common selector sends') ----- - bytecodePrimBitShift - - self initPrimCall. - self externalizeIPandSP. - self primitiveBitShift. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 12. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimDiv (in category 'common selector sends') ----- - bytecodePrimDiv - | quotient | - self initPrimCall. - quotient := self doPrimitiveDiv: (self internalStackValue: 1) by: (self internalStackValue: 0). - self successful ifTrue: [self internalPop: 2 thenPush: (objectMemory integerObjectOf: quotient). - ^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 13. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimDivide (in category 'common selector sends') ----- - bytecodePrimDivide - | rcvr arg result | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) - ifTrue: [rcvr := objectMemory integerValueOf: rcvr. - arg := objectMemory integerValueOf: arg. - (arg ~= 0 and: [rcvr \\ arg = 0]) - ifTrue: [result := rcvr // arg. - "generates C / operation" - (objectMemory isIntegerValue: result) - ifTrue: [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). - ^ self fetchNextBytecode"success"]]] - ifFalse: [self initPrimCall. - self externalizeIPandSP. - self primitiveFloatDivide: rcvr byArg: arg. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode"success"]]. - - messageSelector := self specialSelector: 9. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimDo (in category 'common selector sends') ----- - bytecodePrimDo - - messageSelector := self specialSelector: 27. - argumentCount := 1. - self normalSend. - ! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimEqual (in category 'common selector sends') ----- - bytecodePrimEqual - | rcvr arg aBool | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) ifTrue: [^self booleanCheat: rcvr = arg]. - - self initPrimCall. - aBool := self primitiveFloatEqual: rcvr toArg: arg. - self successful ifTrue: [^self booleanCheat: aBool]. - - messageSelector := self specialSelector: 6. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimEquivalent (in category 'common selector sends') ----- - bytecodePrimEquivalent - - | rcvr arg | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - self booleanCheat: rcvr = arg.! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimMakePoint (in category 'common selector sends') ----- - bytecodePrimMakePoint - - self initPrimCall. - self externalizeIPandSP. - self primitiveMakePoint. - self internalizeIPandSP. - self successful ifTrue: [^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 11. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimMod (in category 'common selector sends') ----- - bytecodePrimMod - | mod | - self initPrimCall. - mod := self doPrimitiveMod: (self internalStackValue: 1) by: (self internalStackValue: 0). - self successful ifTrue: - [self internalPop: 2 thenPush: (objectMemory integerObjectOf: mod). - ^ self fetchNextBytecode "success"]. - - messageSelector := self specialSelector: 10. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimNew (in category 'common selector sends') ----- - bytecodePrimNew - - messageSelector := self specialSelector: 28. - argumentCount := 0. - self normalSend. - ! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimNewWithArg (in category 'common selector sends') ----- - bytecodePrimNewWithArg - - messageSelector := self specialSelector: 29. - argumentCount := 1. - self normalSend. - ! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimNext (in category 'common selector sends') ----- - bytecodePrimNext - messageSelector := self specialSelector: 19. - argumentCount := 0. - self normalSend.! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimNextPut (in category 'common selector sends') ----- - bytecodePrimNextPut - messageSelector := self specialSelector: 20. - argumentCount := 1. - self normalSend.! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimNotEqual (in category 'common selector sends') ----- - bytecodePrimNotEqual - | rcvr arg aBool | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) ifTrue: [^self booleanCheat: rcvr ~= arg]. - - self initPrimCall. - aBool := self primitiveFloatEqual: rcvr toArg: arg. - self successful ifTrue: [^self booleanCheat: aBool not]. - - messageSelector := self specialSelector: 7. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>bytecodePrimSubtract (in category 'common selector sends') ----- - bytecodePrimSubtract - | rcvr arg result | - rcvr := self internalStackValue: 1. - arg := self internalStackValue: 0. - (self areIntegers: rcvr and: arg) - ifTrue: [result := (objectMemory integerValueOf: rcvr) - (objectMemory integerValueOf: arg). - (objectMemory isIntegerValue: result) ifTrue: - [self internalPop: 2 thenPush: (objectMemory integerObjectOf: result). - ^self fetchNextBytecode "success"]] - ifFalse: [self initPrimCall. - self externalizeIPandSP. - self primitiveFloatSubtract: rcvr fromArg: arg. - self internalizeIPandSP. - self successful ifTrue: [^self fetchNextBytecode "success"]]. - - messageSelector := self specialSelector: 1. - argumentCount := 1. - self normalSend! Item was removed: - ----- Method: StackInterpreter>>characterForAscii: (in category 'indexing primitive support') ----- - characterForAscii: ascii "Arg must lie in range 0-255!!" - - ^ objectMemory fetchPointer: ascii ofObject: (objectMemory splObj: CharacterTable)! Item was removed: - ----- Method: StackInterpreter>>checkBooleanResult: (in category 'arithmetic primitive support') ----- - checkBooleanResult: result - self successful - ifTrue: [self pushBool: result] - ifFalse: [self unPop: 2]! Item was removed: - ----- Method: StackInterpreter>>compare31or32Bits:equal: (in category 'arithmetic primitive support') ----- - compare31or32Bits: obj1 equal: obj2 - "May set success to false" - - "First compare two ST integers..." - ((objectMemory isIntegerObject: obj1) - and: [objectMemory isIntegerObject: obj2]) - ifTrue: [^ obj1 = obj2]. - - "Now compare, assuming positive integers, but setting fail if not" - ^ (self positive32BitValueOf: obj1) = (self positive32BitValueOf: obj2)! Item was removed: - ----- Method: StackInterpreter>>copyBits (in category 'bitblt support') ----- - copyBits - "This entry point needs to be implemented for the interpreter proxy. - Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBits - and call it. This entire mechanism should eventually go away and be - replaced with a dynamic lookup from BitBltPlugin itself but for backward - compatibility this stub is provided" - - | fn | - - fn := self ioLoadFunction: 'copyBits' From: 'BitBltPlugin'. - fn = 0 ifTrue: [^self primitiveFail]. - ^self cCode: '((sqInt (*)(void))fn)()'! Item was removed: - ----- Method: StackInterpreter>>copyBitsFrom:to:at: (in category 'bitblt support') ----- - copyBitsFrom: x0 to: x1 at: y - "This entry point needs to be implemented for the interpreter proxy. - Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBitsFrom:to:at: - and call it. This entire mechanism should eventually go away and be - replaced with a dynamic lookup from BitBltPlugin itself but for backward - compatibility this stub is provided" - - | fn | - - fn := self ioLoadFunction: 'copyBitsFromtoat' From: 'BitBltPlugin'. - fn = 0 ifTrue: [^self primitiveFail]. - ^self cCode: '((sqInt (*)(sqInt, sqInt, sqInt))fn)(x0, x1, y)'! Item was removed: - ----- Method: StackInterpreter>>displayBitsOf:Left:Top:Right:Bottom: (in category 'I/O primitives') ----- - displayBitsOf: aForm Left: l Top: t Right: r Bottom: b - "Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object." - - | displayObj dispBits w h dispBitsIndex d left right top bottom surfaceHandle | - displayObj := objectMemory splObj: TheDisplay. - aForm = displayObj ifFalse: [^ nil]. - self success: ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]). - self successful ifTrue: [ - dispBits := objectMemory fetchPointer: 0 ofObject: displayObj. - w := self fetchInteger: 1 ofObject: displayObj. - h := self fetchInteger: 2 ofObject: displayObj. - d := self fetchInteger: 3 ofObject: displayObj. - ]. - l < 0 ifTrue:[left := 0] ifFalse: [left := l]. - r > w ifTrue: [right := w] ifFalse: [right := r]. - t < 0 ifTrue: [top := 0] ifFalse: [top := t]. - b > h ifTrue: [bottom := h] ifFalse: [bottom := b]. - ((left <= right) and: [top <= bottom]) ifFalse: [^nil]. - self successful ifTrue: [ - (objectMemory isIntegerObject: dispBits) ifTrue: [ - surfaceHandle := objectMemory integerValueOf: dispBits. - showSurfaceFn = 0 ifTrue: [ - showSurfaceFn := self ioLoadFunction: 'ioShowSurface' From: 'SurfacePlugin'. - showSurfaceFn = 0 ifTrue: [^self success: false]]. - self cCode:'((sqInt (*)(sqInt, sqInt, sqInt, sqInt, sqInt))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top)'. - ] ifFalse: [ - dispBitsIndex := dispBits + objectMemory baseHeaderSize. "index in memory byte array" - self cCode: 'ioShowDisplay(dispBitsIndex, w, h, d, left, right, top, bottom)' - inSmalltalk: [self showDisplayBits: dispBitsIndex - w: w h: h d: d - left: left right: right top: top bottom: bottom] - ]. - ]! Item was removed: - ----- Method: StackInterpreter>>doPrimitiveDiv:by: (in category 'arithmetic primitive support') ----- - doPrimitiveDiv: rcvr by: arg - "Rounds negative results towards negative infinity, rather than zero." - | result posArg posRcvr integerRcvr integerArg | - (self areIntegers: rcvr and: arg) - ifTrue: [integerRcvr := objectMemory integerValueOf: rcvr. - integerArg := objectMemory integerValueOf: arg. - self success: integerArg ~= 0] - ifFalse: [self primitiveFail]. - self successful ifFalse: [^ 1 "fail"]. - - integerRcvr > 0 - ifTrue: [integerArg > 0 - ifTrue: [result := integerRcvr // integerArg] - ifFalse: ["round negative result toward negative infinity" - posArg := 0 - integerArg. - result := 0 - ((integerRcvr + (posArg - 1)) // posArg)]] - ifFalse: [posRcvr := 0 - integerRcvr. - integerArg > 0 - ifTrue: ["round negative result toward negative infinity" - result := 0 - ((posRcvr + (integerArg - 1)) // integerArg)] - ifFalse: [posArg := 0 - integerArg. - result := posRcvr // posArg]]. - self success: (objectMemory isIntegerValue: result). - ^ result! Item was removed: - ----- Method: StackInterpreter>>doPrimitiveMod:by: (in category 'arithmetic primitive support') ----- - doPrimitiveMod: rcvr by: arg - | integerResult integerRcvr integerArg | - (self areIntegers: rcvr and: arg) - ifTrue: [integerRcvr := objectMemory integerValueOf: rcvr. - integerArg := objectMemory integerValueOf: arg. - self success: integerArg ~= 0] - ifFalse: [self primitiveFail]. - self successful ifFalse: [^ 1 "fail"]. - - integerResult := integerRcvr \\ integerArg. - - "ensure that the result has the same sign as the integerArg" - integerArg < 0 - ifTrue: [integerResult > 0 - ifTrue: [integerResult := integerResult + integerArg]] - ifFalse: [integerResult < 0 - ifTrue: [integerResult := integerResult + integerArg]]. - self success: (objectMemory isIntegerValue: integerResult). - ^ integerResult! Item was removed: - ----- Method: StackInterpreter>>duplicateTopBytecode (in category 'stack bytecodes') ----- - duplicateTopBytecode - - self fetchNextBytecode. - self internalPush: self internalStackTop. - ! Item was removed: - ----- Method: StackInterpreter>>extendedPushBytecode (in category 'stack bytecodes') ----- - extendedPushBytecode - - | descriptor variableType variableIndex | - descriptor := self fetchByte. - self fetchNextBytecode. - variableType := (descriptor >> 6) bitAnd: 16r3. - variableIndex := descriptor bitAnd: 16r3F. - variableType=0 ifTrue: [^self pushReceiverVariable: variableIndex]. - variableType=1 ifTrue: [^self pushTemporaryVariable: variableIndex]. - variableType=2 ifTrue: [^self pushLiteralConstant: variableIndex]. - variableType=3 ifTrue: [^self pushLiteralVariable: variableIndex]. - ! Item was removed: - ----- Method: StackInterpreter>>fetchByte (in category 'interpreter shell') ----- - fetchByte - "This method uses the preIncrement builtin function which has no Smalltalk equivalent. Thus, it must be overridden in the simulator." - - ^objectMemory byteAtPointer: localIP preIncrement! Item was removed: - ----- Method: StackInterpreter>>fullDisplayUpdate (in category 'I/O primitive support') ----- - fullDisplayUpdate - "Repaint the entire smalltalk screen, ignoring the affected rectangle. Used in some platform's code when the Smalltalk window is brought to the front or uncovered." - - | displayObj w h | - displayObj := objectMemory splObj: TheDisplay. - ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]) ifTrue: [ - w := self fetchInteger: 1 ofObject: displayObj. - h := self fetchInteger: 2 ofObject: displayObj. - self displayBitsOf: displayObj Left: 0 Top: 0 Right: w Bottom: h. - self ioForceDisplayUpdate]. - ^nil! Item was removed: - ----- Method: StackInterpreter>>getCurrentBytecode (in category 'interpreter shell') ----- - getCurrentBytecode - "currentBytecode will be private to the main dispatch loop in the generated code. This method allows the currentBytecode to be retrieved from global variables." - - ^objectMemory byteAt: instructionPointer! Item was removed: - ----- Method: StackInterpreter>>jump: (in category 'jump bytecodes') ----- - jump: offset - localIP := localIP + offset + 1. - currentBytecode := objectMemory byteAtPointer: localIP! Item was removed: - ----- Method: StackInterpreter>>loadBitBltFrom: (in category 'bitblt support') ----- - loadBitBltFrom: bb - "This entry point needs to be implemented for the interpreter proxy. - Since BitBlt is now a plugin we need to look up BitBltPlugin:=loadBitBltFrom - and call it. This entire mechanism should eventually go away and be - replaced with a dynamic lookup from BitBltPlugin itself but for backward - compatibility this stub is provided" - | fn | - - fn := self ioLoadFunction: 'loadBitBltFrom' From: 'BitBltPlugin'. - fn = 0 ifTrue: [^self primitiveFail]. - ^self cCode: '((sqInt (*)(sqInt))fn)(bb)'! Item was removed: - ----- Method: StackInterpreter>>longJumpIfFalse (in category 'jump bytecodes') ----- - longJumpIfFalse - - self jumplfFalseBy: ((currentBytecode bitAnd: 3) * 256) + self fetchByte.! Item was removed: - ----- Method: StackInterpreter>>longJumpIfTrue (in category 'jump bytecodes') ----- - longJumpIfTrue - - self jumplfTrueBy: ((currentBytecode bitAnd: 3) * 256) + self fetchByte.! Item was removed: - ----- Method: StackInterpreter>>popStackBytecode (in category 'stack bytecodes') ----- - popStackBytecode - - self fetchNextBytecode. - self internalPop: 1. - ! Item was removed: - ----- Method: StackInterpreter>>pushConstantMinusOneBytecode (in category 'stack bytecodes') ----- - pushConstantMinusOneBytecode - - self fetchNextBytecode. - self internalPush: ConstMinusOne. - ! Item was removed: - ----- Method: StackInterpreter>>pushConstantOneBytecode (in category 'stack bytecodes') ----- - pushConstantOneBytecode - - self fetchNextBytecode. - self internalPush: ConstOne. - ! Item was removed: - ----- Method: StackInterpreter>>pushConstantTwoBytecode (in category 'stack bytecodes') ----- - pushConstantTwoBytecode - - self fetchNextBytecode. - self internalPush: ConstTwo. - ! Item was removed: - ----- Method: StackInterpreter>>pushConstantZeroBytecode (in category 'stack bytecodes') ----- - pushConstantZeroBytecode - - self fetchNextBytecode. - self internalPush: ConstZero. - ! Item was removed: - ----- Method: StackInterpreter>>pushFloat: (in category 'stack bytecodes') ----- - pushFloat: f - - - self push: (self floatObjectOf: f).! Item was removed: - ----- Method: StackInterpreter>>pushLiteralConstant: (in category 'stack bytecodes') ----- - pushLiteralConstant: literalIndex - - self internalPush: (self literal: literalIndex).! Item was removed: - ----- Method: StackInterpreter>>pushLiteralVariable: (in category 'stack bytecodes') ----- - pushLiteralVariable: literalIndex - - self internalPush: - (objectMemory fetchPointer: ValueIndex ofObject: (self literal: literalIndex)).! Item was removed: - ----- Method: StackInterpreter>>pushRemoteTempLongBytecode (in category 'stack bytecodes') ----- - pushRemoteTempLongBytecode - | remoteTempIndex tempVectorIndex | - remoteTempIndex := self fetchByte. - tempVectorIndex := self fetchByte. - self fetchNextBytecode. - self pushRemoteTemp: remoteTempIndex inVectorAt: tempVectorIndex! Item was removed: - ----- Method: StackInterpreter>>shortConditionalJump (in category 'jump bytecodes') ----- - shortConditionalJump - - self jumplfFalseBy: (currentBytecode bitAnd: 7) + 1.! Item was removed: - ----- Method: StackInterpreter>>showDisplayBits:Left:Top:Right:Bottom: (in category 'I/O primitive support') ----- - showDisplayBits: aForm Left: l Top: t Right: r Bottom: b - "Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object." - deferDisplayUpdates ifTrue: [^ nil]. - self displayBitsOf: aForm Left: l Top: t Right: r Bottom: b! Item was removed: - ----- Method: StackInterpreter>>specialSelector: (in category 'message sending') ----- - specialSelector: index - - ^ objectMemory fetchPointer: (index * 2) ofObject: (objectMemory splObj: SpecialSelectors)! Item was removed: - ----- Method: StackInterpreter>>storeAndPopRemoteTempLongBytecode (in category 'stack bytecodes') ----- - storeAndPopRemoteTempLongBytecode - self storeRemoteTempLongBytecode. - self internalPop: 1! Item was removed: - ----- Method: StackInterpreter>>storeRemoteTempLongBytecode (in category 'stack bytecodes') ----- - storeRemoteTempLongBytecode - | remoteTempIndex tempVectorIndex | - remoteTempIndex := self fetchByte. - tempVectorIndex := self fetchByte. - self fetchNextBytecode. - self storeRemoteTemp: remoteTempIndex inVectorAt: tempVectorIndex! Item was removed: - ----- Method: StackInterpreter>>superclassOf: (in category 'message sending') ----- - superclassOf: classPointer - - ^objectMemory fetchPointer: SuperclassIndex ofObject: classPointer! Item was removed: - ----- Method: StackInterpreterPrimitives>>primitiveSetGCSemaphore (in category 'memory space primitives') ----- - primitiveSetGCSemaphore - "Primitive. Indicate the semaphore to be signalled for upon garbage collection" - | index | - - index := self stackIntegerValue: 0. - self successful ifTrue:[ - objectMemory setGcSemaphoreIndex: index. - self pop: argumentCount. - ]! Item was changed: ----- Method: VMMaker class>>versionString (in category 'version testing') ----- versionString "VMMaker versionString" + ^'4.19.5'! - ^'4.19.4'! From eliot.miranda at gmail.com Thu Dec 31 21:18:19 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Thu, 31 Dec 2020 13:18:19 -0800 Subject: [Vm-dev] Sorry, Sorry! [WAS: Trouble running OSVM in an Ubuntu 20/aarch64 docker] In-Reply-To: <9d904b233a0d7d4fff0407bc1a9ef52f@whidbey.com> References: <9d904b233a0d7d4fff0407bc1a9ef52f@whidbey.com> Message-ID: <0713D0C3-056E-44A0-BB10-4CC38BE18C27@gmail.com> Hi Ken, thanks for this!! I’ll try and add an error message to the failure to point users to the fix. This is another one like not being able to set the heartbeat thread priority that the vm needs to report as helpfully as possible. _,,,^..^,,,_ (phone) > On Dec 31, 2020, at 6:15 AM, Ken.Dickey at whidbey.com wrote: > > Apologies to all, I though I had trimmed the header on this.. > -KenD > ============= > Message: 6 > Date: Thu, 31 Dec 2020 04:18:58 -0800 > From: Christoph Thiede > To: OpenSmalltalk/opensmalltalk-vm > > Cc: Comment , OpenSmalltalk-Bot > > Subject: Re: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running > OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > I have tried that and built the VM again, but I keep getting the same > mprotect error message :( Any other ideas? > > From: oscogvm/build.linux64ARMv8/HowToBuild: > > vvv======vvv > > If running the resultant squeak vm gives an error something like > mprotect(x,y,PROT_READ|PROT_EXEC) > or > memory_alias_map: shm_open: Permission denied > you need to enable shared memory for the COG JIT. > > As root: > chmod 777 /dev/shm > echo 'none /dev/shm tmpfs rw,nosuid,nodev 0 0' >> /etc/fstab > mount /dev/shm > > The squeak vm should now work. > ^^^======^^^ From tim at rowledge.org Thu Dec 31 23:52:32 2020 From: tim at rowledge.org (tim Rowledge) Date: Thu, 31 Dec 2020 15:52:32 -0800 Subject: [Vm-dev] Small problem compiling stackspur vm on phone Message-ID: <6F4009F9-8D7D-4AC7-8ACD-FC9F0FBEC998@rowledge.org> For reasons I've been trying to compile a vm to run on an ubuntu container running on a samsung galaxy 7phone. I know, right? Who'd want an Android phone? Nasty tacky OS. Anyway, the cog vm compiles and happily starts with '-h' ... but any attempt to open on an image crashes with a very unhelpful Illegal Instruction and no crash file or any other help. I'll get around to trying a debug version some day. In the meantime the stack VM was a bit interesting to compile. It hits a fatal link error because sqUnixMain wants to refer to sendTrace from the interp.c file. It lists a very strange error opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1561:(.text+0x2744): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `sendTrace' defined in COMMON section in vm/vm.a(gcc3x-interp.o) /root/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1561: warning: One possible cause of this error is that the symbol is being referenced in the indicated code as if it had a larger alignment than was declared where it was defined. collect2: error: ld returned 1 exit status The google results for 'relocation truncated to fit' are ... interesting. If, that is, you want to know inner arcane details of C compilation. Which I don't, anymore. A successful work-around is to comment out the lines #if (STACKVM || NewspeakVM) && !COGVM else if (!strcmp(argv[0], VMOPTION("sendtrace"))) { extern sqInt sendTrace; sendTrace = 1; return 1; } #endif in sqUnix.c Oh - the phone runs that VM and manages about 85 MBC/s & 5MSend/s which suggest roughly Pi 3 performance, so it should be ok once Cog runs. Happy new year all - let's hope 20/20 vision is an improvement. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim The gains I make don't make me a hero; all the work I do is just to get back to Zero