From commits at source.squeak.org Sat Jan 2 05:13:57 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 05:13:57 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2915.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2915.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2915 Author: eem Time: 1 January 2021, 9:13:50.54602 pm UUID: 58f28da2-d908-4533-971a-8d938c1bcc78 Ancestors: VMMaker.oscog-nice.2914 Spur Cogit: Fix the broken value range checking code wot I wrote for signed bits array at:put:. Simulation: Fix mapping of break pcs on code compaction when break pc is an array of pcs. =============== Diff against VMMaker.oscog-nice.2914 =============== Item was changed: ----- Method: CogObjectRepresentationFor32BitSpur>>genPrimitiveAtPutSigned: (in category 'primitive generators') ----- genPrimitiveAtPutSigned: signedVersion "Generate the code for primitives 61 & 165, at:put:/basicAt:put: & integerAt:put:. If signedVersion is true then generate signed accesses to the bits classes (a la 164 & 165). If signedVersion is false, generate unsigned accesses (a la 60, 61, 63 & 64)." | formatReg nSlotsOrBytesReg methodInBounds jumpImmediate jumpBadIndex jumpImmutable jumpNotIndexablePointers jumpNotIndexableBits jumpIsContext jumpIsCompiledMethod jumpIsBytes jumpIsShorts jumpHasFixedFields jumpArrayOutOfBounds jumpFixedFieldsOutOfBounds jumpWordsOutOfBounds jumpShortsOutOfBounds jumpBytesOutOfBounds jumpShortsOutOfRange jumpWordsOutOfRange jumpBytesOutOfRange jumpNonSmallIntegerValue jumpNotPointers | + self break. "c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: fixedFieldsOf:format:length:" nSlotsOrBytesReg := ClassReg. cogit genLoadArgAtDepth: 1 into: Arg0Reg. cogit genLoadArgAtDepth: 0 into: Arg1Reg. jumpImmediate := self genJumpImmediate: ReceiverResultReg. jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg. self genConvertSmallIntegerToIntegerInReg: Arg0Reg. cogit SubCq: 1 R: Arg0Reg. "1-rel => 0-rel" "formatReg := self formatOf: ReceiverResultReg" self cppIf: IMMUTABILITY ifTrue: [ self genGetFormatOf: ReceiverResultReg into: (formatReg := SendNumArgsReg) leastSignificantHalfOfBaseHeaderIntoScratch: TempReg. jumpImmutable := self genJumpBaseHeaderImmutable: TempReg ] ifFalse: [ self genGetFormatOf: ReceiverResultReg into: (formatReg := SendNumArgsReg) leastSignificantHalfOfBaseHeaderIntoScratch: NoReg ]. self genGetNumSlotsOf: ReceiverResultReg into: nSlotsOrBytesReg. "dispatch on format in a combination of highest dynamic frequency order first and convenience. 0 = 0 sized objects (UndefinedObject True False et al) 1 = non-indexable objects with inst vars (Point et al) 2 = indexable objects with no inst vars (Array et al) 3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al) 4 = weak indexable objects with inst vars (WeakArray et al) 5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron) 6 unused, reserved for exotic pointer objects? 7 Forwarded Object, 1st field is pointer, rest of fields are ignored 8 unused, reserved for exotic non-pointer objects? 9 64-bit indexable 10 - 11 32-bit indexable 12 - 15 16-bit indexable 16 - 23 byte indexable 24 - 31 compiled method" cogit CmpCq: objectMemory weakArrayFormat R: formatReg. jumpNotPointers := cogit JumpAbove: 0. "optimistic store check; assume index in range (almost always is)." self genStoreCheckReceiverReg: ReceiverResultReg valueReg: Arg1Reg scratchReg: TempReg inFrame: false. cogit CmpCq: objectMemory arrayFormat R: formatReg. jumpNotIndexablePointers := cogit JumpBelow: 0. jumpHasFixedFields := cogit JumpNonZero: 0. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpArrayOutOfBounds := cogit JumpBelowOrEqual: 0. cogit AddCq: objectMemory baseHeaderSize >> objectMemory shiftForWord R: Arg0Reg. cogit MoveR: Arg1Reg Xwr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. jumpHasFixedFields jmpTarget: cogit Label. self genGetClassIndexOfNonImm: ReceiverResultReg into: formatReg. cogit CmpCq: ClassMethodContextCompactIndex R: formatReg. jumpIsContext := cogit JumpZero: 0. "get # fixed fields in formatReg" cogit PushR: nSlotsOrBytesReg. self genGetClassObjectOfClassIndex: formatReg into: nSlotsOrBytesReg scratchReg: TempReg. self genLoadSlot: InstanceSpecificationIndex sourceReg: nSlotsOrBytesReg destReg: formatReg. cogit PopR: nSlotsOrBytesReg. self genConvertSmallIntegerToIntegerInReg: formatReg. cogit AndCq: objectMemory fixedFieldsOfClassFormatMask R: formatReg. cogit SubR: formatReg R: nSlotsOrBytesReg. cogit AddCq: objectMemory baseHeaderSize >> objectMemory shiftForWord R: formatReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpFixedFieldsOutOfBounds := cogit JumpBelowOrEqual: 0. cogit AddR: formatReg R: Arg0Reg. cogit MoveR: Arg1Reg Xwr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. jumpNotPointers jmpTarget: cogit Label. jumpNonSmallIntegerValue := self genJumpNotSmallInteger: Arg1Reg scratchReg: TempReg. cogit CmpCq: objectMemory firstByteFormat R: formatReg. jumpIsBytes := cogit JumpAboveOrEqual: 0. cogit CmpCq: objectMemory firstShortFormat R: formatReg. jumpIsShorts := cogit JumpAboveOrEqual: 0. cogit CmpCq: objectMemory firstLongFormat R: formatReg. "For now ignore 64-bit indexability." jumpNotIndexableBits := cogit JumpBelow: 0. "fall through to words" cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpWordsOutOfBounds := cogit JumpBelowOrEqual: 0. cogit MoveR: Arg1Reg R: TempReg. self genConvertSmallIntegerToIntegerInReg: TempReg. signedVersion ifFalse: [(cogit lastOpcode setsConditionCodesFor: JumpLess) ifFalse: [cogit CmpCq: 0 R: TempReg]. "N.B. FLAGS := TempReg - 0" jumpWordsOutOfRange := cogit JumpLess: 0]. cogit AddCq: objectMemory baseHeaderSize >> objectMemory shiftForWord R: Arg0Reg. cogit MoveR: TempReg Xwr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. signedVersion ifTrue: [jumpIsBytes jmpTarget: + (cogit ArithmeticShiftRightCq: 7 + objectMemory numSmallIntegerTagBits R: Arg1Reg R: TempReg). "Maps in range to -1,0". - (cogit MoveR: SendNumArgsReg R: TempReg). - cogit ArithmeticShiftRightCq: 7 R: TempReg. "Maps in range to -1,0". cogit AddCq: 1 R: TempReg. "Maps in range to 0,1" cogit CmpCq: 1 R: TempReg] ifFalse: [jumpIsBytes jmpTarget: (cogit CmpCq: (objectMemory integerObjectOf: 255) R: Arg1Reg)]. jumpBytesOutOfRange := cogit JumpAbove: 0. cogit LogicalShiftLeftCq: objectMemory shiftForWord R: nSlotsOrBytesReg. cogit AndCq: objectMemory wordSize - 1 R: formatReg R: TempReg. cogit SubR: TempReg R: nSlotsOrBytesReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpBytesOutOfBounds := cogit JumpBelowOrEqual: 0. cogit CmpCq: objectMemory firstCompiledMethodFormat R: formatReg. jumpIsCompiledMethod := cogit JumpAboveOrEqual: 0. methodInBounds := cogit MoveR: Arg1Reg R: TempReg. self genConvertSmallIntegerToIntegerInReg: TempReg. cogit AddCq: objectMemory baseHeaderSize R: Arg0Reg. cogit MoveR: TempReg Xbr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. signedVersion ifTrue: [jumpIsShorts jmpTarget: + (cogit ArithmeticShiftRightCq: 15 + objectMemory numSmallIntegerTagBits R: Arg1Reg R: TempReg). "Maps in range to -1,0". - (cogit MoveR: SendNumArgsReg R: TempReg). - cogit ArithmeticShiftRightCq: 15 R: TempReg. "Maps in range to -1,0". cogit AddCq: 1 R: TempReg. "Maps in range to 0,1" cogit CmpCq: 1 R: TempReg] ifFalse: [jumpIsShorts jmpTarget: (cogit CmpCq: (objectMemory integerObjectOf: 65535) R: Arg1Reg)]. jumpShortsOutOfRange := cogit JumpAbove: 0. cogit LogicalShiftLeftCq: objectMemory shiftForWord - 1 R: nSlotsOrBytesReg. cogit AndCq: objectMemory wordSize / 2 - 1 R: formatReg. cogit SubR: formatReg R: nSlotsOrBytesReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpShortsOutOfBounds := cogit JumpBelowOrEqual: 0. cogit MoveR: Arg1Reg R: TempReg. self genConvertSmallIntegerToIntegerInReg: TempReg. cogit AddR: Arg0Reg R: ReceiverResultReg. cogit AddR: Arg0Reg R: ReceiverResultReg. cogit MoveR: TempReg M16: objectMemory baseHeaderSize r: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. "Now check that the index is beyond the method's literals..." jumpIsCompiledMethod jmpTarget: cogit Label. self getLiteralCountOf: ReceiverResultReg plusOne: true inBytes: true into: nSlotsOrBytesReg scratch: TempReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. cogit JumpBelow: methodInBounds. jumpIsContext jmpTarget: (jumpNotIndexableBits jmpTarget: (jumpBytesOutOfRange jmpTarget: (jumpShortsOutOfRange jmpTarget: (jumpIsCompiledMethod jmpTarget: (jumpArrayOutOfBounds jmpTarget: (jumpBytesOutOfBounds jmpTarget: (jumpShortsOutOfBounds jmpTarget: (jumpWordsOutOfBounds jmpTarget: (jumpNotIndexablePointers jmpTarget: (jumpNonSmallIntegerValue jmpTarget: (jumpFixedFieldsOutOfBounds jmpTarget: cogit Label))))))))))). signedVersion ifFalse: [jumpWordsOutOfRange jmpTarget: jumpIsContext getJmpTarget]. self cppIf: IMMUTABILITY ifTrue: [jumpImmutable jmpTarget: jumpIsContext getJmpTarget]. cogit AddCq: 1 R: Arg0Reg. "0-rel => 1-rel" self genConvertIntegerToSmallIntegerInReg: Arg0Reg. jumpBadIndex jmpTarget: (jumpImmediate jmpTarget: cogit Label). ^0 "Can't be complete because of contexts."! Item was changed: ----- Method: CogObjectRepresentationFor64BitSpur>>genPrimitiveAtPutSigned: (in category 'primitive generators') ----- (excessive size, no diff calculated) Item was changed: ----- Method: Cogit>>codeMemmove:_:_: (in category 'generate machine code - dual mapped zone support') ----- codeMemmove: dest _: src _: bytes "Move memory (copy allowing for overlap), applying the codeToDataDelta. This is used for code compaction and so works on readable addresses (delta is required)." "production uses the macro..." self codeWriteBreakpoint: dest. "simulation writes twice if simulating dual mapping..." codeToDataDelta ~= 0 ifTrue: [objectMemory memmove: dest asUnsignedInteger + codeToDataDelta _: src _: bytes]. objectMemory memmove: dest _: src _: bytes. + "and as a convenience, relocate the breakPC(s) if in this method..." + breakPC ifNotNil: + [breakPC isArray + ifTrue: + [breakPC withIndexDo: + [:pc :idx| + (pc between: src and: src + bytes - 1) ifTrue: + [breakPC at: idx put: pc - (src asInteger - dest asInteger)]]] + ifFalse: + [(breakPC between: src and: src + bytes - 1) ifTrue: + [breakPC := breakPC - (src asInteger - dest asInteger)]]]! - "and as a convenience, relocate the breakPC if it is in this method" - (breakPC notNil and: [breakPC between: src and: src + bytes - 1]) ifTrue: - [breakPC := breakPC - (src - dest)]! From noreply at github.com Sat Jan 2 05:23:32 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 01 Jan 2021 21:23:32 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f6199b: CogVM source as per VMMaker.oscog-eem.2915/VMMaker... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f6199b3bd8a63b3e573307f48b419632c14e2477 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f6199b3bd8a63b3e573307f48b419632c14e2477 Author: Eliot Miranda Date: 2021-01-01 (Fri, 01 Jan 2021) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.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 M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2915/VMMaker.oscog-nice.2913 Spur Cogit: Fix broken value range checking code for signed bits array at:put:. Complexify the rule for generating hex literal constants when more intellegible than decimal. Useful for deciphering generated code for bit tricks. From no-reply at appveyor.com Sat Jan 2 05:28:41 2021 From: no-reply at appveyor.com (AppVeyor) Date: Sat, 02 Jan 2021 05:28:41 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2334 Message-ID: <20210102052841.1.E0AD1856096DA679@appveyor.com> An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Sat Jan 2 08:33:42 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Sat, 2 Jan 2021 09:33:42 +0100 Subject: [Vm-dev] Small discrepancy in fileTimesInUTC between simulation & VM In-Reply-To: References: Message-ID: Hi both, thanks for the hint, it's not obvious indeed ! We may eventually do like the simulation, always shift the flags, something like: ^self shiftedImageHeaderFlags anyMask: 128 The shift method would always be inlined, and I guess that the C compiler would generate equally efficient code for those two expressions (flags >> 2) & 128. flags & 512. Anyway, we do not check flags in tight loops, do we? Le mar. 29 déc. 2020 à 05:52, Eliot Miranda a écrit : > > 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 noreply at github.com Sat Jan 2 09:21:44 2021 From: noreply at github.com (Nicolas Cellier) Date: Sat, 02 Jan 2021 01:21:44 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 08a50c: Update sqWin32Sound.c Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 08a50c25315697ae144965a26cabbe77c8657e8b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/08a50c25315697ae144965a26cabbe77c8657e8b Author: Nicolas Cellier Date: 2021-01-02 (Sat, 02 Jan 2021) Changed paths: M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c Log Message: ----------- Update sqWin32Sound.c Let win32 sound compile on gcc/clang From bruce.oneel at pckswarms.ch Sat Jan 2 09:58:44 2021 From: bruce.oneel at pckswarms.ch (Bruce O'Neel) Date: Sat, 02 Jan 2021 10:58:44 +0100 Subject: [Vm-dev] Sorry, Sorry! [WAS: Trouble running OSVM in an Ubuntu 20/aarch64 docker] In-Reply-To: <0713D0C3-056E-44A0-BB10-4CC38BE18C27@gmail.com> References: <0713D0C3-056E-44A0-BB10-4CC38BE18C27@gmail.com> <9d904b233a0d7d4fff0407bc1a9ef52f@whidbey.com> Message-ID: <1609581524-d3707b5f422a8360a2be2812ba60a676@pckswarms.ch> Hi, The chmod should be chmod 1777 /dev/shm  ls -alh /dev/shm total 4.0K drwxrwxrwt  2 root root   60 Dez 21 12:06 . drwxr-xr-x 17 root root 5.6K Dez 21 12:06 .. -rw----rw-  1 root root 4.0K Dez 21 12:06 PHS-5723 That 1 before the 777 sets the sticky bit. **RESTRICTED****DELETION****FLAG****OR****STICKY****BIT**        The  restricted  deletion  flag  or  sticky  bit is a single bit, whose        interpretation depends on the file type.  For directories, it  prevents        unprivileged  users  from  removing or renaming a file in the directory        unless they  own  the  file  or  the  directory;  this  is  called  the        restricted  deletion  flag  for the directory, and is commonly found on        world-writable directories like **/tmp**.  For regular files on some  older        systems,  the  bit saves the program's text image on the swap device so        it will load more quickly when run; this is called the stickybit. The sticky bit  plus 777 lets /tmp and /dev/shm work correctly by letting everyone create and delete files, but unless they are root only they can delete only their own files. It won't fail on a single user system if you just use 777, but, it is a security leak on a multi user system since it lets me manipulate your shared memory segments etc. cheers bruce > 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. > > ^^^======^^^ -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Sat Jan 2 12:22:55 2021 From: no-reply at appveyor.com (AppVeyor) Date: Sat, 02 Jan 2021 12:22:55 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2335 Message-ID: <20210102122255.1.B8CDA65D1BD009A5@appveyor.com> An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Sat Jan 2 17:02:48 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sat, 2 Jan 2021 09:02:48 -0800 Subject: [Vm-dev] Small discrepancy in fileTimesInUTC between simulation & VM In-Reply-To: References: Message-ID: <9C04CFD2-A95A-44E2-AAA5-D15A2065FAC9@gmail.com> Hi Nicolas, > On Jan 2, 2021, at 12:33 AM, Nicolas Cellier wrote: > >  > Hi both, > thanks for the hint, it's not obvious indeed ! > We may eventually do like the simulation, always shift the flags, something like: > > ^self shiftedImageHeaderFlags anyMask: 128 > > The shift method would always be inlined, and I guess that the C compiler would generate equally efficient code for those two expressions > (flags >> 2) & 128. > flags & 512. > Anyway, we do not check flags in tight loops, do we? No, abd actually the flags are only processed at startup, snapshot, and the vmParameter primitives. Any flags which have an effect on execution (such as the fail-for-mixed-arithmetic flag) are extracted into variables at startup or in vmParameterAtPut abd read back into a flag bit from the variable at snapshot time. > >> Le mar. 29 déc. 2020 à 05:52, Eliot Miranda a écrit : >> >> Hi Nicolas, >> >>> On Sun, Dec 27, 2020 at 5:52 AM Nicolas Cellier 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 commits at source.squeak.org Sat Jan 2 17:36:46 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 17:36:46 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2916.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2916.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2916 Author: nice Time: 2 January 2021, 6:36:37.586827 pm UUID: 54320c7b-5fee-4999-8bf3-53731ca0f088 Ancestors: VMMaker.oscog-eem.2915 Save the slang tests provided by Pierre Misse in mailing list - as is. Thanks Pierre! =============== Diff against VMMaker.oscog-eem.2915 =============== Item was added: + TestCase subclass: #SlangAbstractTestCase + instanceVariableNames: 'ccg' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: SlangAbstractTestCase>>setUp (in category 'running') ----- + setUp + super setUp. + ccg := CCodeGenerator new. + ! Item was added: + SlangAbstractTestCase subclass: #SlangBasicTypeInferenceTest + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! + + !SlangBasicTypeInferenceTest commentStamp: '' prior: 0! + Basic tests for the type inference used in CCodeGenerator. + Support methods are in SlangTypeInferenceTestClass. + There is only one possible type by node, no ambiguities. + + 1 Constant + test constantNode in a method. + tests are tailor made for the current TConstantNode >> #typeOrNilFrom:in:. + + 2 Return-constant + test return a constant node in a method. + uses the previous categorie's values. + + 3 Return-temp-assigned-constant + assign a temporary node with a constant + then returns the temporary variable in the next statement. + + 4 Return-temp-assigned-message + assign a temporary node with a message + then returns the temporary variable in the next statement. + + 5 Return-explicit-temp + returns a temporary typed by a pragma #var:type:. + + 6 Return-explicit-arg + returns an argument typed by a pragma #var:type:.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>setUp (in category 'running') ----- + setUp + super setUp. + ccg addClass: SlangBasicTypeInferenceTestClass. + ccg inferTypesForImplicitlyTypedVariablesAndMethods. + ! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testABigNegativeIntegerConstantNode (in category 'constant') ----- + testABigNegativeIntegerConstantNode + | tMethod | + tMethod := ccg methodNamed: #aBigNegativeIntegerConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAFalseConstantNode (in category 'constant') ----- + testAFalseConstantNode + | tMethod | + tMethod := ccg methodNamed: #aFalseConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAFloatConstantNode (in category 'constant') ----- + testAFloatConstantNode + | tMethod | + tMethod := ccg methodNamed: #aFloatConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testANilConstantNode (in category 'constant') ----- + testANilConstantNode + | tMethod | + tMethod := ccg methodNamed: #aNilConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testASmallNegativeIntegerConstantNode (in category 'constant') ----- + testASmallNegativeIntegerConstantNode + | tMethod | + tMethod := ccg methodNamed: #aSmallNegativeIntegerConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAStringConstantNode (in category 'constant') ----- + testAStringConstantNode + | tMethod | + tMethod := ccg methodNamed: #aStringConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testATrueConstantNode (in category 'constant') ----- + testATrueConstantNode + | tMethod | + tMethod := ccg methodNamed: #aTrueConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAnIntEqual32ConstantNode (in category 'constant') ----- + testAnIntEqual32ConstantNode + | tMethod | + tMethod := ccg methodNamed: #anIntEqual32ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAnIntEqual64ConstantNode (in category 'constant') ----- + testAnIntEqual64ConstantNode + | tMethod | + tMethod := ccg methodNamed: #anIntEqual64ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAnIntGreater64ConstantNode (in category 'constant') ----- + testAnIntGreater64ConstantNode + | tMethod | + tMethod := ccg methodNamed: #anIntGreater64ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testAnIntLess32ConstantNode (in category 'constant') ----- + testAnIntLess32ConstantNode + | tMethod | + tMethod := ccg methodNamed: #anIntLesser32ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + ! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnABigNegativeIntegerConstantNode (in category 'return-constant') ----- + testReturnABigNegativeIntegerConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnABigNegativeIntegerConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. + self assert: tMethod returnType equals: #sqLong! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnABigNegativeIntegerMessageSend (in category 'return-message-send') ----- + testReturnABigNegativeIntegerMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnABigNegativeIntegerMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqLong. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqLong. + self assert: tMethod returnType equals: #sqLong.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAFalseConstantNode (in category 'return-constant') ----- + testReturnAFalseConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAFalseConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAFalseMessageSend (in category 'return-message-send') ----- + testReturnAFalseMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAFalseMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAFloatMessageSend (in category 'return-message-send') ----- + testReturnAFloatMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAFloatMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #double. + self assert: tMethod returnType equals: #double.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnANilConstantNode (in category 'return-constant') ----- + testReturnANilConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnANilConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnANilMessageSend (in category 'return-message-send') ----- + testReturnANilMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnANilMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnASmallNegativeIntegerConstantNode (in category 'return-constant') ----- + testReturnASmallNegativeIntegerConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnASmallNegativeIntegerConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnASmallNegativeIntegerMessageSend (in category 'return-message-send') ----- + testReturnASmallNegativeIntegerMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnASmallNegativeIntegerMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAStringConstantNode (in category 'return-constant') ----- + testReturnAStringConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAStringConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. + self assert: tMethod returnType equals: #'char *'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAStringMessageSend (in category 'return-message-send') ----- + testReturnAStringMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAStringMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'char *'. + self assert: tMethod returnType equals: #'char *'.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnATrueConstantNode (in category 'return-constant') ----- + testReturnATrueConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnATrueConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnATrueMessageSend (in category 'return-message-send') ----- + testReturnATrueMessageSend + | tMethod | + tMethod := ccg methodNamed: #returnATrueMessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual32ConstantNode (in category 'return-constant') ----- + testReturnAnIntEqual32ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAnIntEqual32ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. + self assert: tMethod returnType equals: #sqInt + "returning an integer constants is the same as returning nothing" + "this therefore return a sqInt" + "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual32MessageSend (in category 'return-message-send') ----- + testReturnAnIntEqual32MessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAnIntEqual32MessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt. + "the method return type is sqint, so it's coherent, see testReturnAnIntEqual32MessageSend"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual64ConstantNode (in category 'return-constant') ----- + testReturnAnIntEqual64ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAnIntEqual64ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. + self assert: tMethod returnType equals: #sqInt + "returning an integer constants is the same as returning nothing" + "this therefore return a sqInt" + "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual64MessageSend (in category 'return-message-send') ----- + testReturnAnIntEqual64MessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAnIntEqual64MessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt. + "the method return type is sqint, so it's coherent, see testReturnAnIntEqual64MessageSend"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntGreater64ConstantNode (in category 'return-constant') ----- + testReturnAnIntGreater64ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAnIntGreater64ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. + self assert: tMethod returnType equals: #sqInt + "returning an integer constants is the same as returning nothing" + "this therefore return a sqInt" + "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntGreater64MessageSend (in category 'return-message-send') ----- + testReturnAnIntGreater64MessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAnIntGreater64MessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt. + "the method return type is sqint, so it's coherent, see testReturnAnIntGreater64MessageSend"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntLess32ConstantNode (in category 'return-constant') ----- + testReturnAnIntLess32ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAnIntLesser32ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt + "returning constants is the same as returning nothing" + "this therefore return a sqInt" + "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntLesser32MessageSend (in category 'return-message-send') ----- + testReturnAnIntLesser32MessageSend + | tMethod | + tMethod := ccg methodNamed: #returnAnIntLesser32MessageSend. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt. + "the method return type is sqint, so it's coherent, see testReturnAnIntLesser64MessageSend"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgDouble (in category 'return-explicit-arg') ----- + testReturnExplicitArgDouble + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgDouble:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. + self assert: tMethod returnType equals: #double! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgFloat (in category 'return-explicit-arg') ----- + testReturnExplicitArgFloat + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgFloat:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #float. + self assert: tMethod returnType equals: #float! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgInt (in category 'return-explicit-arg') ----- + testReturnExplicitArgInt + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgInt:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgLongLong (in category 'return-explicit-arg') ----- + testReturnExplicitArgLongLong + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgLongLong:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. + self assert: tMethod returnType equals: #sqLong! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgRandom (in category 'return-explicit-arg') ----- + testReturnExplicitArgRandom + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgRandom:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #completelyRandom. + self assert: tMethod returnType equals: #completelyRandom! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgString (in category 'return-explicit-arg') ----- + testReturnExplicitArgString + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgString:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. + self assert: tMethod returnType equals: #'char *'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgUnsignedInt (in category 'return-explicit-arg') ----- + testReturnExplicitArgUnsignedInt + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgUnsignedInt:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. + self assert: tMethod returnType equals: #usqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgUnsignedLongLong (in category 'return-explicit-arg') ----- + testReturnExplicitArgUnsignedLongLong + | tMethod | + tMethod := ccg methodNamed: #returnExplicitArgUnsignedLongLong:. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. + self assert: tMethod returnType equals: #usqLong! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempDouble (in category 'return-explicit-temp') ----- + testReturnExplicitTempDouble + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempDouble. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. + self assert: tMethod returnType equals: #double! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempFloat (in category 'return-explicit-temp') ----- + testReturnExplicitTempFloat + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempFloat. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #float. + self assert: tMethod returnType equals: #float! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempInt (in category 'return-explicit-temp') ----- + testReturnExplicitTempInt + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempInt. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. + self assert: tMethod returnType equals: #sqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempLongLong (in category 'return-explicit-temp') ----- + testReturnExplicitTempLongLong + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempLongLong. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. + self assert: tMethod returnType equals: #sqLong! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempRandom (in category 'return-explicit-temp') ----- + testReturnExplicitTempRandom + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempRandom. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #completelyRandom. + self assert: tMethod returnType equals: #completelyRandom! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempString (in category 'return-explicit-temp') ----- + testReturnExplicitTempString + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempString. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. + self assert: tMethod returnType equals: #'char *'! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempUnsignedInt (in category 'return-explicit-temp') ----- + testReturnExplicitTempUnsignedInt + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempUnsignedInt. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. + self assert: tMethod returnType equals: #usqInt! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempUnsignedLongLong (in category 'return-explicit-temp') ----- + testReturnExplicitTempUnsignedLongLong + | tMethod | + tMethod := ccg methodNamed: #returnExplicitTempUnsignedLongLong. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. + self assert: tMethod returnType equals: #usqLong! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnFloatConstantNode (in category 'return-constant') ----- + testReturnFloatConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnAFloatConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. + self assert: tMethod returnType equals: #double + ! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempBigNegativeIntegerConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempBigNegativeIntegerConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempBigNegativeIntegerConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'long long'. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion, shouldn't it be a sqLong?"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempBigNegativeIntegerMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempBigNegativeIntegerMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempBigNegativeIntegerMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqLong. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqLong. + self assert: tMethod returnType equals: #sqLong.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFalseConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempFalseConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempFalseConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFalseMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempFalseMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempFalseMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFloatConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempFloatConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempFloatConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #double. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "type lost"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFloatMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempFloatMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempFloatMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt. + + self assert: false "wait what"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual32ConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempIntEqual32ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntEqual32ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'unsigned int'. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual32MessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempIntEqual32MessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntEqual32MessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual64ConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempIntEqual64ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntEqual64ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'unsigned long long'. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion, shouldn't it at least be an sqLong? or better, an uSqLong"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual64MessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempIntEqual64MessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntEqual64MessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntGreater64ConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempIntGreater64ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntGreater64ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'long long'. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion, shouldn't it be at least an sqLong?"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntGreater64MessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempIntGreater64MessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntGreater64MessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntLesser32ConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempIntLesser32ConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntLesser32ConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntLesser32MessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempIntLesser32MessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempIntLesser32MessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempNilConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempNilConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempNilConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempNilMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempNilMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempNilMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempSmallNegativeIntegerConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempSmallNegativeIntegerConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempSmallNegativeIntegerConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "unexpected type conversion"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempSmallNegativeIntegerMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempSmallNegativeIntegerMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempSmallNegativeIntegerMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempStringConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempStringConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempStringConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'char *'. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "type lost"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempStringMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempStringMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempStringMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #'char *'. + self assert: tMethod returnType equals: #'char *'.! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempTrueConstantNode (in category 'return-temp-assigned-const') ----- + testReturnTempTrueConstantNode + | tMethod | + tMethod := ccg methodNamed: #returnTempTrueConstantNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " + self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " + self assert: tMethod returnType equals: #sqInt. + + self assert: false "Unexpected conversion"! Item was added: + ----- Method: SlangBasicTypeInferenceTest>>testReturnTempTrueMessageNode (in category 'return-temp-assigned-message') ----- + testReturnTempTrueMessageNode + | tMethod | + tMethod := ccg methodNamed: #returnTempTrueMessageNode. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. + self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. + self assert: tMethod returnType equals: #sqInt.! Item was added: + InterpreterPlugin subclass: #SlangBasicTypeInferenceTestClass + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aBigNegativeIntegerConstantNode (in category 'constant') ----- + aBigNegativeIntegerConstantNode + "SmallInteger maxVal on a 64bit system" + -1152921504606846975! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aFalseConstantNode (in category 'constant') ----- + aFalseConstantNode + false! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aFloatConstantNode (in category 'constant') ----- + aFloatConstantNode + 1.0! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aNilConstantNode (in category 'constant') ----- + aNilConstantNode + nil! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aSmallNegativeIntegerConstantNode (in category 'constant') ----- + aSmallNegativeIntegerConstantNode + -30! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aStringConstantNode (in category 'constant') ----- + aStringConstantNode + 'aString'! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>aTrueConstantNode (in category 'constant') ----- + aTrueConstantNode + true! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>anIntEqual32ConstantNode (in category 'constant') ----- + anIntEqual32ConstantNode + " 2 ^ 32 - 1" + 4294967295! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>anIntEqual64ConstantNode (in category 'constant') ----- + anIntEqual64ConstantNode + " 2 raisedTo: 64 " + 18446744073709551615! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>anIntGreater64ConstantNode (in category 'constant') ----- + anIntGreater64ConstantNode + "SmallInteger maxVal on a 64bit system" + 1152921504606846975! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>anIntLesser32ConstantNode (in category 'constant') ----- + anIntLesser32ConstantNode + 30! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnABigNegativeIntegerConstantNode (in category 'return-constant') ----- + returnABigNegativeIntegerConstantNode + "SmallInteger maxVal on a 64bit system" + ^ -1152921504606846975 + ! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnABigNegativeIntegerMessageSend (in category 'return-message-send') ----- + returnABigNegativeIntegerMessageSend + ^ self returnABigNegativeIntegerConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAFalseConstantNode (in category 'return-constant') ----- + returnAFalseConstantNode + ^ false! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAFalseMessageSend (in category 'return-message-send') ----- + returnAFalseMessageSend + ^ self returnAFalseConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAFloatConstantNode (in category 'return-constant') ----- + returnAFloatConstantNode + ^ 1.0! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAFloatMessageSend (in category 'return-message-send') ----- + returnAFloatMessageSend + ^ self returnAFloatConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnANilConstantNode (in category 'return-constant') ----- + returnANilConstantNode + ^ nil! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnANilMessageSend (in category 'return-message-send') ----- + returnANilMessageSend + ^ self returnANilConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnASmallNegativeIntegerConstantNode (in category 'return-constant') ----- + returnASmallNegativeIntegerConstantNode + ^ -30! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnASmallNegativeIntegerMessageSend (in category 'return-message-send') ----- + returnASmallNegativeIntegerMessageSend + ^ self returnASmallNegativeIntegerConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAStringConstantNode (in category 'return-constant') ----- + returnAStringConstantNode + ^ 'aString'! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAStringMessageSend (in category 'return-message-send') ----- + returnAStringMessageSend + ^ self returnAStringConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnATrueConstantNode (in category 'return-constant') ----- + returnATrueConstantNode + ^ true! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnATrueMessageSend (in category 'return-message-send') ----- + returnATrueMessageSend + ^ self returnATrueConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntEqual32ConstantNode (in category 'return-constant') ----- + returnAnIntEqual32ConstantNode + " 2 ^ 32 - 1" + ^ 4294967295! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntEqual32MessageSend (in category 'return-message-send') ----- + returnAnIntEqual32MessageSend + ^ self returnAnIntEqual32ConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntEqual64ConstantNode (in category 'return-constant') ----- + returnAnIntEqual64ConstantNode + " 2 raisedTo: 64 " + ^ 18446744073709551615! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntEqual64MessageSend (in category 'return-message-send') ----- + returnAnIntEqual64MessageSend + ^ self returnAnIntEqual64ConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntGreater64ConstantNode (in category 'return-constant') ----- + returnAnIntGreater64ConstantNode + "SmallInteger maxVal on a 64bit system" + ^ 1152921504606846975! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntGreater64MessageSend (in category 'return-message-send') ----- + returnAnIntGreater64MessageSend + ^ self returnAnIntGreater64ConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntLesser32ConstantNode (in category 'return-constant') ----- + returnAnIntLesser32ConstantNode + ^ 30! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnAnIntLesser32MessageSend (in category 'return-message-send') ----- + returnAnIntLesser32MessageSend + ^ self returnAnIntLesser32ConstantNode! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgDouble: (in category 'return-explicit-arg') ----- + returnExplicitArgDouble: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgFloat: (in category 'return-explicit-arg') ----- + returnExplicitArgFloat: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgInt: (in category 'return-explicit-arg') ----- + returnExplicitArgInt: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgLongLong: (in category 'return-explicit-arg') ----- + returnExplicitArgLongLong: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgRandom: (in category 'return-explicit-arg') ----- + returnExplicitArgRandom: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgString: (in category 'return-explicit-arg') ----- + returnExplicitArgString: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgUnsignedInt: (in category 'return-explicit-arg') ----- + returnExplicitArgUnsignedInt: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitArgUnsignedLongLong: (in category 'return-explicit-arg') ----- + returnExplicitArgUnsignedLongLong: t + + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempDouble (in category 'return-explicit-temp') ----- + returnExplicitTempDouble + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempFloat (in category 'return-explicit-temp') ----- + returnExplicitTempFloat + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempInt (in category 'return-explicit-temp') ----- + returnExplicitTempInt + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempLongLong (in category 'return-explicit-temp') ----- + returnExplicitTempLongLong + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempRandom (in category 'return-explicit-temp') ----- + returnExplicitTempRandom + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempString (in category 'return-explicit-temp') ----- + returnExplicitTempString + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempUnsignedInt (in category 'return-explicit-temp') ----- + returnExplicitTempUnsignedInt + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnExplicitTempUnsignedLongLong (in category 'return-explicit-temp') ----- + returnExplicitTempUnsignedLongLong + + | t | + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempBigNegativeIntegerConstantNode (in category 'return-temp-assigned-const') ----- + returnTempBigNegativeIntegerConstantNode + | t | + "SmallInteger maxVal on a 64bit system" + t := -1152921504606846975. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempBigNegativeIntegerMessageNode (in category 'return-temp-assigned-message') ----- + returnTempBigNegativeIntegerMessageNode + | t | + t := self returnABigNegativeIntegerConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempFalseConstantNode (in category 'return-temp-assigned-const') ----- + returnTempFalseConstantNode + | t | + t := false. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempFalseMessageNode (in category 'return-temp-assigned-message') ----- + returnTempFalseMessageNode + | t | + t := self returnAFalseConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempFloatConstantNode (in category 'return-temp-assigned-const') ----- + returnTempFloatConstantNode + | t | + t := 1.0. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempFloatMessageNode (in category 'return-temp-assigned-message') ----- + returnTempFloatMessageNode + | t | + t := self returnAFloatMessageSend. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntEqual32ConstantNode (in category 'return-temp-assigned-const') ----- + returnTempIntEqual32ConstantNode + " 2 ^ 32 - 1" + | t | + t := 4294967295. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntEqual32MessageNode (in category 'return-temp-assigned-message') ----- + returnTempIntEqual32MessageNode + | t | + t := self returnAnIntEqual32ConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntEqual64ConstantNode (in category 'return-temp-assigned-const') ----- + returnTempIntEqual64ConstantNode + " 2 raisedTo: 64 " + | t | + t := 18446744073709551615. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntEqual64MessageNode (in category 'return-temp-assigned-message') ----- + returnTempIntEqual64MessageNode + | t | + t := self returnAnIntEqual64ConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntGreater64ConstantNode (in category 'return-temp-assigned-const') ----- + returnTempIntGreater64ConstantNode + | t | + "SmallInteger maxVal on a 64bit system" + t := 1152921504606846975. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntGreater64MessageNode (in category 'return-temp-assigned-message') ----- + returnTempIntGreater64MessageNode + | t | + t := self returnAnIntGreater64ConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntLesser32ConstantNode (in category 'return-temp-assigned-const') ----- + returnTempIntLesser32ConstantNode + | t | + t := 30. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempIntLesser32MessageNode (in category 'return-temp-assigned-message') ----- + returnTempIntLesser32MessageNode + | t | + t := self returnAnIntLesser32ConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempNilConstantNode (in category 'return-temp-assigned-const') ----- + returnTempNilConstantNode + | t | + t := nil. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempNilMessageNode (in category 'return-temp-assigned-message') ----- + returnTempNilMessageNode + | t | + t := self returnANilConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempSmallNegativeIntegerConstantNode (in category 'return-temp-assigned-const') ----- + returnTempSmallNegativeIntegerConstantNode + | t | + t := -30. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempSmallNegativeIntegerMessageNode (in category 'return-temp-assigned-message') ----- + returnTempSmallNegativeIntegerMessageNode + | t | + t := self returnASmallNegativeIntegerConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempStringConstantNode (in category 'return-temp-assigned-const') ----- + returnTempStringConstantNode + | t | + t := 'aString'. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempStringMessageNode (in category 'return-temp-assigned-message') ----- + returnTempStringMessageNode + | t | + t := self returnAStringConstantNode. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempTrueConstantNode (in category 'return-temp-assigned-const') ----- + returnTempTrueConstantNode + | t | + t := true. + ^ t! Item was added: + ----- Method: SlangBasicTypeInferenceTestClass>>returnTempTrueMessageNode (in category 'return-temp-assigned-message') ----- + returnTempTrueMessageNode + | t | + t := self returnATrueConstantNode. + ^ t! Item was added: + SlangAbstractTestCase subclass: #SlangTypeForArithmeticTest + instanceVariableNames: 'visitor propertyName' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: SlangTypeForArithmeticTest>>setUp (in category 'running') ----- + setUp + super setUp. + ccg addClass: SlangTypeForDereferenceTestClass + ! Item was added: + ----- Method: SlangTypeForArithmeticTest>>testAtOnMatrix (in category 'tests') ----- + testAtOnMatrix + | tMethod | + tMethod := ccg methodNamed: #aMethodReturningAnAtOnAMatrix. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt."at: node" + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt."returnNode" + self assert: tMethod returnType equals: #sqInt. " euuu, looks weird. Did i do something wrong?"! Item was added: + SlangAbstractTestCase subclass: #SlangTypeForDereferenceTest + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: SlangTypeForDereferenceTest>>setUp (in category 'running') ----- + setUp + super setUp. + ccg addClass: SlangTypeForDereferenceTestClass. + ccg inferTypesForImplicitlyTypedVariablesAndMethods.! Item was added: + ----- Method: SlangTypeForDereferenceTest>>testAtOnArray (in category 'tests') ----- + testAtOnArray + | tMethod | + tMethod := ccg methodNamed: #aMethodReturningAnAtOnAnArray. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #int."at: node" + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int."returnNode" + self assert: tMethod returnType equals: #sqInt. + + self assert: false. "Unexpected type conversion"! Item was added: + ----- Method: SlangTypeForDereferenceTest>>testAtOnMatrix (in category 'tests') ----- + testAtOnMatrix + | tMethod | + tMethod := ccg methodNamed: #aMethodReturningAnAtOnAMatrix. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'int *'."at: node" + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'int *'."returnNode" + self assert: tMethod returnType equals: #'int *'.! Item was added: + ----- Method: SlangTypeForDereferenceTest>>testReturnPointerTypeExplicitTempVariable (in category 'tests') ----- + testReturnPointerTypeExplicitTempVariable + | tMethod | + tMethod := ccg methodNamed: #aMethodReturningAPointerType. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'int *'."variable node" + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'int *'."return node" + self assert: tMethod returnType equals: #'int *'! Item was added: + ----- Method: SlangTypeForDereferenceTest>>testSelfMessageReturningPointerType (in category 'tests') ----- + testSelfMessageReturningPointerType + | tMethod | + tMethod := ccg methodNamed: #aMethodReturningAPointerType. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'int *'."message node" + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'int *'."returnNode" + self assert: tMethod returnType equals: #'int *'! Item was added: + ----- Method: SlangTypeForDereferenceTest>>testTwoAtOnMatrix (in category 'tests') ----- + testTwoAtOnMatrix + | tMethod | + tMethod := ccg methodNamed: #aMethodReturningTwoAtOnAMatrix. + + self assert: tMethod isNotNil. + self assert: (ccg typeFor: tMethod statements first expression receiver in: tMethod) equals: #'int *'."inner at:" + self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #int."outer at:" + self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int."return node" + self assert: tMethod returnType equals: #sqInt. + + self assert: false. "Unexpected type conversion"! Item was added: + InterpreterPlugin subclass: #SlangTypeForDereferenceTestClass + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: SlangTypeForDereferenceTestClass>>aMethodReturningAMessageSendToSelf (in category 'as yet unclassified') ----- + aMethodReturningAMessageSendToSelf + ^ self aMethodReturningAPointerType! Item was added: + ----- Method: SlangTypeForDereferenceTestClass>>aMethodReturningAPointerType (in category 'as yet unclassified') ----- + aMethodReturningAPointerType + + | a | + ^ a! Item was added: + ----- Method: SlangTypeForDereferenceTestClass>>aMethodReturningAnAtOnAMatrix (in category 'as yet unclassified') ----- + aMethodReturningAnAtOnAMatrix + + | a | + ^ a at: 2! Item was added: + ----- Method: SlangTypeForDereferenceTestClass>>aMethodReturningAnAtOnAnArray (in category 'as yet unclassified') ----- + aMethodReturningAnAtOnAnArray + + | a | + ^ a at: 2! Item was added: + ----- Method: SlangTypeForDereferenceTestClass>>aMethodReturningTwoAtOnAMatrix (in category 'as yet unclassified') ----- + aMethodReturningTwoAtOnAMatrix + + | a | + ^ (a at: 2) at: 2! Item was added: + SlangAbstractTestCase subclass: #SlangTypePromotionTest + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: SlangTypePromotionTest>>testCharAndChar (in category 'integer-types') ----- + testCharAndChar + "representative of two types smaller than sizeOf(int) with same size" + | firstType secondType resType | + firstType := #char. + secondType := #char. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #int. + + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #char). + self assert: (ccg sizeOfIntegralCType: #char) equals: 1.! Item was added: + ----- Method: SlangTypePromotionTest>>testCharAndFloat (in category 'float-types') ----- + testCharAndFloat + "representative of two types bigger than sizeOf(int) and with same size" + | firstType secondType resType | + firstType := #char. + secondType := #float. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #float. + self assert: (ccg isFloatingPointCType: resType).! Item was added: + ----- Method: SlangTypePromotionTest>>testCharAndLongLong (in category 'integer-types') ----- + testCharAndLongLong + "representative of two types bigger than sizeOf(int) and with same size" + | firstType secondType resType | + firstType := #char. + secondType := #'long long'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'long long'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #char). + self assert: (ccg sizeOfIntegralCType: #char) equals: 1. + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8.! Item was added: + ----- Method: SlangTypePromotionTest>>testDoubleAndDouble (in category 'float-types') ----- + testDoubleAndDouble + | firstType secondType resType | + firstType := #double. + secondType := #double. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #double. + self assert: (ccg isFloatingPointCType: resType).! Item was added: + ----- Method: SlangTypePromotionTest>>testDoubleAndFloat (in category 'float-types') ----- + testDoubleAndFloat + | firstType secondType resType | + firstType := #double. + secondType := #float. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #double. + self assert: (ccg isFloatingPointCType: resType). + ! Item was added: + ----- Method: SlangTypePromotionTest>>testFloatAndDouble (in category 'float-types') ----- + testFloatAndDouble + | firstType secondType resType | + firstType := #float. + secondType := #double. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #double. + self assert: (ccg isFloatingPointCType: resType). + ! Item was added: + ----- Method: SlangTypePromotionTest>>testFloatAndFloat (in category 'float-types') ----- + testFloatAndFloat + | firstType secondType resType | + firstType := #float. + secondType := #float. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #float. + self assert: (ccg isFloatingPointCType: resType). + ! Item was added: + ----- Method: SlangTypePromotionTest>>testFloatAndNil (in category 'general') ----- + testFloatAndNil + | firstType secondType resType | + firstType := #float. + secondType := nil. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #float. + + "this feels wrong" + "inconsistent with integer types too" + self assert: false.! Item was added: + ----- Method: SlangTypePromotionTest>>testIntAndFloat (in category 'float-types') ----- + testIntAndFloat + | firstType secondType resType | + firstType := #int. + secondType := #float. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #float. + self assert: (ccg isFloatingPointCType: resType). + ! Item was added: + ----- Method: SlangTypePromotionTest>>testIntAndInt (in category 'integer-types') ----- + testIntAndInt + "representative of two types with size = sizeOf(int) of same size" + | firstType secondType resType | + firstType := #int. + secondType := #int. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #int. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #int). + self assert: (ccg sizeOfIntegralCType: #int) equals: 4.! Item was added: + ----- Method: SlangTypePromotionTest>>testIntAndLongLong (in category 'integer-types') ----- + testIntAndLongLong + "representative of a different size types" + | firstType secondType resType | + firstType := #int . + secondType := #'long long'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'long long'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #int). + self assert: (ccg sizeOfIntegralCType: #int) equals: 4. + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8.! Item was added: + ----- Method: SlangTypePromotionTest>>testIntAndNil (in category 'general') ----- + testIntAndNil + | firstType secondType resType | + firstType := #int. + secondType := nil. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: nil. + ! Item was added: + ----- Method: SlangTypePromotionTest>>testIntAndUnsignedChar (in category 'unsigned-priority') ----- + testIntAndUnsignedChar + "representative of an unsigned that is ignored because of integerType promotion" + | firstType secondType resType | + firstType := #int. + secondType := #'unsigned char'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #int. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #int). + self assert: (ccg sizeOfIntegralCType: #int) equals: 4. + self assert: (ccg isIntegralCType: #'unsigned char'). + self assert: (ccg sizeOfIntegralCType: #'unsigned char') equals: 1.! Item was added: + ----- Method: SlangTypePromotionTest>>testIntAndUnsignedInt (in category 'unsigned-priority') ----- + testIntAndUnsignedInt + "representative of two types bigger than sizeOf(int) and with same size" + | firstType secondType resType | + firstType := #int. + secondType := #'unsigned int'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'unsigned int'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #int). + self assert: (ccg sizeOfIntegralCType: #int) equals: 4. + self assert: (ccg isIntegralCType: #'unsigned int'). + self assert: (ccg sizeOfIntegralCType: #'unsigned int') equals: 4.! Item was added: + ----- Method: SlangTypePromotionTest>>testLongLongAndChar (in category 'integer-types') ----- + testLongLongAndChar + "representative of different sized types" + | firstType secondType resType | + firstType := #'long long'. + secondType := #char. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'long long'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8. + self assert: (ccg isIntegralCType: #char). + self assert: (ccg sizeOfIntegralCType: #char) equals: 1.! Item was added: + ----- Method: SlangTypePromotionTest>>testLongLongAndFloat (in category 'float-types') ----- + testLongLongAndFloat + | firstType secondType resType | + firstType := #'long long'. + secondType := #float. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #float. + self assert: (ccg isFloatingPointCType: resType). + ! Item was added: + ----- Method: SlangTypePromotionTest>>testLongLongAndInt (in category 'integer-types') ----- + testLongLongAndInt + "representative of different sized types" + | firstType secondType resType | + firstType := #'long long'. + secondType := #int. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'long long'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8. + self assert: (ccg isIntegralCType: #int). + self assert: (ccg sizeOfIntegralCType: #int) equals: 4.! Item was added: + ----- Method: SlangTypePromotionTest>>testLongLongAndSqLong (in category 'integer-types') ----- + testLongLongAndSqLong + "representative of two types bigger than sizeOf(int)" + | firstType secondType resType | + firstType := #'long long'. + secondType := #sqLong. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'long long'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8. + self assert: (ccg isIntegralCType: #sqLong). + self assert: (ccg sizeOfIntegralCType: #sqLong) equals: 8.! Item was added: + ----- Method: SlangTypePromotionTest>>testNilAndFloat (in category 'general') ----- + testNilAndFloat + | firstType secondType resType | + firstType := nil. + secondType := #float. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #float. + + "this feels wrong" + "inconsistent with integer types too" + self assert: false.! Item was added: + ----- Method: SlangTypePromotionTest>>testNilAndInt (in category 'general') ----- + testNilAndInt + | firstType secondType resType | + firstType := nil. + secondType := #int. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: nil. + ! Item was added: + ----- Method: SlangTypePromotionTest>>testNilAndNil (in category 'general') ----- + testNilAndNil + | firstType secondType resType | + firstType := nil. + secondType := nil. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: nil. + ! Item was added: + ----- Method: SlangTypePromotionTest>>testUnsignedIntAndInt (in category 'unsigned-priority') ----- + testUnsignedIntAndInt + "representative of two types bigger than sizeOf(int) and with same size" + | firstType secondType resType | + firstType := #'unsigned int'. + secondType := #'int'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'unsigned int'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #'unsigned int'). + self assert: (ccg sizeOfIntegralCType: #'unsigned int') equals: 4. + self assert: (ccg isIntegralCType: #int). + self assert: (ccg sizeOfIntegralCType: #int) equals: 4.! Item was added: + ----- Method: SlangTypePromotionTest>>testUnsignedIntAndLongLong (in category 'unsigned-priority') ----- + testUnsignedIntAndLongLong + "representative of an unsigned that is ignored because of integerType promotion" + | firstType secondType resType | + firstType := #'unsigned int'. + secondType := #'long long'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #'long long'. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #'unsigned int'). + self assert: (ccg sizeOfIntegralCType: #'unsigned int') equals: 4. + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8.! Item was added: + ----- Method: SlangTypePromotionTest>>testsqLongAndLongLong (in category 'integer-types') ----- + testsqLongAndLongLong + "representative of two types bigger than sizeOf(int) and with same size" + | firstType secondType resType | + firstType := #sqLong. + secondType := #'long long'. + resType := ccg promoteArithmeticTypes: firstType and: secondType. + + self assert: resType equals: #sqLong. + + "check that the system is in the assumed state." + self assert: (ccg isIntegralCType: #sqLong). + self assert: (ccg sizeOfIntegralCType: #sqLong) equals: 8. + self assert: (ccg isIntegralCType: #'long long'). + self assert: (ccg sizeOfIntegralCType: #'long long') equals: 8.! From commits at source.squeak.org Sat Jan 2 17:53:14 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 17:53:14 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-nice.2917.mcz Message-ID: Nicolas Cellier uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2917.mcz ==================== Summary ==================== Name: VMMaker.oscog-nice.2917 Author: nice Time: 2 January 2021, 6:53:04.133826 pm UUID: 0440464e-a091-4fa2-8ab8-5f0e2f86364d Ancestors: VMMaker.oscog-nice.2916 Squeakize the slang tests (isNotNil -> notNil) IMHO, this kind of refactorings is completely useless, except if the goal is to maximize uncompatibilities. =============== Diff against VMMaker.oscog-nice.2916 =============== Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testABigNegativeIntegerConstantNode (in category 'constant') ----- testABigNegativeIntegerConstantNode | tMethod | tMethod := ccg methodNamed: #aBigNegativeIntegerConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAFalseConstantNode (in category 'constant') ----- testAFalseConstantNode | tMethod | tMethod := ccg methodNamed: #aFalseConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAFloatConstantNode (in category 'constant') ----- testAFloatConstantNode | tMethod | tMethod := ccg methodNamed: #aFloatConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testANilConstantNode (in category 'constant') ----- testANilConstantNode | tMethod | tMethod := ccg methodNamed: #aNilConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testASmallNegativeIntegerConstantNode (in category 'constant') ----- testASmallNegativeIntegerConstantNode | tMethod | tMethod := ccg methodNamed: #aSmallNegativeIntegerConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAStringConstantNode (in category 'constant') ----- testAStringConstantNode | tMethod | tMethod := ccg methodNamed: #aStringConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testATrueConstantNode (in category 'constant') ----- testATrueConstantNode | tMethod | tMethod := ccg methodNamed: #aTrueConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAnIntEqual32ConstantNode (in category 'constant') ----- testAnIntEqual32ConstantNode | tMethod | tMethod := ccg methodNamed: #anIntEqual32ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAnIntEqual64ConstantNode (in category 'constant') ----- testAnIntEqual64ConstantNode | tMethod | tMethod := ccg methodNamed: #anIntEqual64ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAnIntGreater64ConstantNode (in category 'constant') ----- testAnIntGreater64ConstantNode | tMethod | tMethod := ccg methodNamed: #anIntGreater64ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testAnIntLess32ConstantNode (in category 'constant') ----- testAnIntLess32ConstantNode | tMethod | tMethod := ccg methodNamed: #anIntLesser32ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. ! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnABigNegativeIntegerConstantNode (in category 'return-constant') ----- testReturnABigNegativeIntegerConstantNode | tMethod | tMethod := ccg methodNamed: #returnABigNegativeIntegerConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. self assert: tMethod returnType equals: #sqLong! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnABigNegativeIntegerMessageSend (in category 'return-message-send') ----- testReturnABigNegativeIntegerMessageSend | tMethod | tMethod := ccg methodNamed: #returnABigNegativeIntegerMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqLong. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqLong. self assert: tMethod returnType equals: #sqLong.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAFalseConstantNode (in category 'return-constant') ----- testReturnAFalseConstantNode | tMethod | tMethod := ccg methodNamed: #returnAFalseConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAFalseMessageSend (in category 'return-message-send') ----- testReturnAFalseMessageSend | tMethod | tMethod := ccg methodNamed: #returnAFalseMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAFloatMessageSend (in category 'return-message-send') ----- testReturnAFloatMessageSend | tMethod | tMethod := ccg methodNamed: #returnAFloatMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #double. self assert: tMethod returnType equals: #double.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnANilConstantNode (in category 'return-constant') ----- testReturnANilConstantNode | tMethod | tMethod := ccg methodNamed: #returnANilConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnANilMessageSend (in category 'return-message-send') ----- testReturnANilMessageSend | tMethod | tMethod := ccg methodNamed: #returnANilMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnASmallNegativeIntegerConstantNode (in category 'return-constant') ----- testReturnASmallNegativeIntegerConstantNode | tMethod | tMethod := ccg methodNamed: #returnASmallNegativeIntegerConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnASmallNegativeIntegerMessageSend (in category 'return-message-send') ----- testReturnASmallNegativeIntegerMessageSend | tMethod | tMethod := ccg methodNamed: #returnASmallNegativeIntegerMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAStringConstantNode (in category 'return-constant') ----- testReturnAStringConstantNode | tMethod | tMethod := ccg methodNamed: #returnAStringConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. self assert: tMethod returnType equals: #'char *'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAStringMessageSend (in category 'return-message-send') ----- testReturnAStringMessageSend | tMethod | tMethod := ccg methodNamed: #returnAStringMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'char *'. self assert: tMethod returnType equals: #'char *'.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnATrueConstantNode (in category 'return-constant') ----- testReturnATrueConstantNode | tMethod | tMethod := ccg methodNamed: #returnATrueConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnATrueMessageSend (in category 'return-message-send') ----- testReturnATrueMessageSend | tMethod | tMethod := ccg methodNamed: #returnATrueMessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual32ConstantNode (in category 'return-constant') ----- testReturnAnIntEqual32ConstantNode | tMethod | tMethod := ccg methodNamed: #returnAnIntEqual32ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. self assert: tMethod returnType equals: #sqInt "returning an integer constants is the same as returning nothing" "this therefore return a sqInt" "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual32MessageSend (in category 'return-message-send') ----- testReturnAnIntEqual32MessageSend | tMethod | tMethod := ccg methodNamed: #returnAnIntEqual32MessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt. "the method return type is sqint, so it's coherent, see testReturnAnIntEqual32MessageSend"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual64ConstantNode (in category 'return-constant') ----- testReturnAnIntEqual64ConstantNode | tMethod | tMethod := ccg methodNamed: #returnAnIntEqual64ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. self assert: tMethod returnType equals: #sqInt "returning an integer constants is the same as returning nothing" "this therefore return a sqInt" "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntEqual64MessageSend (in category 'return-message-send') ----- testReturnAnIntEqual64MessageSend | tMethod | tMethod := ccg methodNamed: #returnAnIntEqual64MessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt. "the method return type is sqint, so it's coherent, see testReturnAnIntEqual64MessageSend"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntGreater64ConstantNode (in category 'return-constant') ----- testReturnAnIntGreater64ConstantNode | tMethod | tMethod := ccg methodNamed: #returnAnIntGreater64ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. self assert: tMethod returnType equals: #sqInt "returning an integer constants is the same as returning nothing" "this therefore return a sqInt" "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntGreater64MessageSend (in category 'return-message-send') ----- testReturnAnIntGreater64MessageSend | tMethod | tMethod := ccg methodNamed: #returnAnIntGreater64MessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt. "the method return type is sqint, so it's coherent, see testReturnAnIntGreater64MessageSend"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntLess32ConstantNode (in category 'return-constant') ----- testReturnAnIntLess32ConstantNode | tMethod | tMethod := ccg methodNamed: #returnAnIntLesser32ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt "returning constants is the same as returning nothing" "this therefore return a sqInt" "see start of the CCodeGenerator >> harmonizeReturnTypesIn: method"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnAnIntLesser32MessageSend (in category 'return-message-send') ----- testReturnAnIntLesser32MessageSend | tMethod | tMethod := ccg methodNamed: #returnAnIntLesser32MessageSend. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt. "the method return type is sqint, so it's coherent, see testReturnAnIntLesser64MessageSend"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgDouble (in category 'return-explicit-arg') ----- testReturnExplicitArgDouble | tMethod | tMethod := ccg methodNamed: #returnExplicitArgDouble:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. self assert: tMethod returnType equals: #double! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgFloat (in category 'return-explicit-arg') ----- testReturnExplicitArgFloat | tMethod | tMethod := ccg methodNamed: #returnExplicitArgFloat:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #float. self assert: tMethod returnType equals: #float! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgInt (in category 'return-explicit-arg') ----- testReturnExplicitArgInt | tMethod | tMethod := ccg methodNamed: #returnExplicitArgInt:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgLongLong (in category 'return-explicit-arg') ----- testReturnExplicitArgLongLong | tMethod | tMethod := ccg methodNamed: #returnExplicitArgLongLong:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. self assert: tMethod returnType equals: #sqLong! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgRandom (in category 'return-explicit-arg') ----- testReturnExplicitArgRandom | tMethod | tMethod := ccg methodNamed: #returnExplicitArgRandom:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #completelyRandom. self assert: tMethod returnType equals: #completelyRandom! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgString (in category 'return-explicit-arg') ----- testReturnExplicitArgString | tMethod | tMethod := ccg methodNamed: #returnExplicitArgString:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. self assert: tMethod returnType equals: #'char *'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgUnsignedInt (in category 'return-explicit-arg') ----- testReturnExplicitArgUnsignedInt | tMethod | tMethod := ccg methodNamed: #returnExplicitArgUnsignedInt:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. self assert: tMethod returnType equals: #usqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitArgUnsignedLongLong (in category 'return-explicit-arg') ----- testReturnExplicitArgUnsignedLongLong | tMethod | tMethod := ccg methodNamed: #returnExplicitArgUnsignedLongLong:. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. self assert: tMethod returnType equals: #usqLong! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempDouble (in category 'return-explicit-temp') ----- testReturnExplicitTempDouble | tMethod | tMethod := ccg methodNamed: #returnExplicitTempDouble. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. self assert: tMethod returnType equals: #double! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempFloat (in category 'return-explicit-temp') ----- testReturnExplicitTempFloat | tMethod | tMethod := ccg methodNamed: #returnExplicitTempFloat. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #float. self assert: tMethod returnType equals: #float! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempInt (in category 'return-explicit-temp') ----- testReturnExplicitTempInt | tMethod | tMethod := ccg methodNamed: #returnExplicitTempInt. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. self assert: tMethod returnType equals: #sqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempLongLong (in category 'return-explicit-temp') ----- testReturnExplicitTempLongLong | tMethod | tMethod := ccg methodNamed: #returnExplicitTempLongLong. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. self assert: tMethod returnType equals: #sqLong! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempRandom (in category 'return-explicit-temp') ----- testReturnExplicitTempRandom | tMethod | tMethod := ccg methodNamed: #returnExplicitTempRandom. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #completelyRandom. self assert: tMethod returnType equals: #completelyRandom! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempString (in category 'return-explicit-temp') ----- testReturnExplicitTempString | tMethod | tMethod := ccg methodNamed: #returnExplicitTempString. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. self assert: tMethod returnType equals: #'char *'! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempUnsignedInt (in category 'return-explicit-temp') ----- testReturnExplicitTempUnsignedInt | tMethod | tMethod := ccg methodNamed: #returnExplicitTempUnsignedInt. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. self assert: tMethod returnType equals: #usqInt! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnExplicitTempUnsignedLongLong (in category 'return-explicit-temp') ----- testReturnExplicitTempUnsignedLongLong | tMethod | tMethod := ccg methodNamed: #returnExplicitTempUnsignedLongLong. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. self assert: tMethod returnType equals: #usqLong! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnFloatConstantNode (in category 'return-constant') ----- testReturnFloatConstantNode | tMethod | tMethod := ccg methodNamed: #returnAFloatConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. self assert: tMethod returnType equals: #double ! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempBigNegativeIntegerConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempBigNegativeIntegerConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempBigNegativeIntegerConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'long long'. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion, shouldn't it be a sqLong?"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempBigNegativeIntegerMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempBigNegativeIntegerMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempBigNegativeIntegerMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqLong. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqLong. self assert: tMethod returnType equals: #sqLong.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFalseConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempFalseConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempFalseConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFalseMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempFalseMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempFalseMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFloatConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempFloatConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempFloatConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #double. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "type lost"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempFloatMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempFloatMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempFloatMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #double. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt. self assert: false "wait what"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual32ConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempIntEqual32ConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempIntEqual32ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned int'. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'unsigned int'. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual32MessageNode (in category 'return-temp-assigned-message') ----- testReturnTempIntEqual32MessageNode | tMethod | tMethod := ccg methodNamed: #returnTempIntEqual32MessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual64ConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempIntEqual64ConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempIntEqual64ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'unsigned long long'. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'unsigned long long'. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion, shouldn't it at least be an sqLong? or better, an uSqLong"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntEqual64MessageNode (in category 'return-temp-assigned-message') ----- testReturnTempIntEqual64MessageNode | tMethod | tMethod := ccg methodNamed: #returnTempIntEqual64MessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntGreater64ConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempIntGreater64ConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempIntGreater64ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'long long'. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'long long'. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion, shouldn't it be at least an sqLong?"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntGreater64MessageNode (in category 'return-temp-assigned-message') ----- testReturnTempIntGreater64MessageNode | tMethod | tMethod := ccg methodNamed: #returnTempIntGreater64MessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntLesser32ConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempIntLesser32ConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempIntLesser32ConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempIntLesser32MessageNode (in category 'return-temp-assigned-message') ----- testReturnTempIntLesser32MessageNode | tMethod | tMethod := ccg methodNamed: #returnTempIntLesser32MessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempNilConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempNilConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempNilConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempNilMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempNilMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempNilMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempSmallNegativeIntegerConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempSmallNegativeIntegerConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempSmallNegativeIntegerConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "unexpected type conversion"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempSmallNegativeIntegerMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempSmallNegativeIntegerMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempSmallNegativeIntegerMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempStringConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempStringConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempStringConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #'char *'. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "type lost"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempStringMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempStringMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempStringMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'char *'. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #'char *'. self assert: tMethod returnType equals: #'char *'.! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempTrueConstantNode (in category 'return-temp-assigned-const') ----- testReturnTempTrueConstantNode | tMethod | tMethod := ccg methodNamed: #returnTempTrueConstantNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int. " assignementNode " self assert: (ccg typeFor: tMethod statements first value in: tMethod) equals: #int. " value, constantNode " self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. " variable, temporaryNode " self assert: tMethod returnType equals: #sqInt. self assert: false "Unexpected conversion"! Item was changed: ----- Method: SlangBasicTypeInferenceTest>>testReturnTempTrueMessageNode (in category 'return-temp-assigned-message') ----- testReturnTempTrueMessageNode | tMethod | tMethod := ccg methodNamed: #returnTempTrueMessageNode. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt. self assert: (ccg typeFor: tMethod statements first variable in: tMethod) equals: #sqInt. self assert: tMethod returnType equals: #sqInt.! Item was changed: ----- Method: SlangTypeForArithmeticTest>>testAtOnMatrix (in category 'tests') ----- testAtOnMatrix | tMethod | tMethod := ccg methodNamed: #aMethodReturningAnAtOnAMatrix. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #sqInt."at: node" self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #sqInt."returnNode" self assert: tMethod returnType equals: #sqInt. " euuu, looks weird. Did i do something wrong?"! Item was changed: ----- Method: SlangTypeForDereferenceTest>>testAtOnArray (in category 'tests') ----- testAtOnArray | tMethod | tMethod := ccg methodNamed: #aMethodReturningAnAtOnAnArray. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #int."at: node" self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int."returnNode" self assert: tMethod returnType equals: #sqInt. self assert: false. "Unexpected type conversion"! Item was changed: ----- Method: SlangTypeForDereferenceTest>>testAtOnMatrix (in category 'tests') ----- testAtOnMatrix | tMethod | tMethod := ccg methodNamed: #aMethodReturningAnAtOnAMatrix. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'int *'."at: node" self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'int *'."returnNode" self assert: tMethod returnType equals: #'int *'.! Item was changed: ----- Method: SlangTypeForDereferenceTest>>testReturnPointerTypeExplicitTempVariable (in category 'tests') ----- testReturnPointerTypeExplicitTempVariable | tMethod | tMethod := ccg methodNamed: #aMethodReturningAPointerType. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'int *'."variable node" self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'int *'."return node" self assert: tMethod returnType equals: #'int *'! Item was changed: ----- Method: SlangTypeForDereferenceTest>>testSelfMessageReturningPointerType (in category 'tests') ----- testSelfMessageReturningPointerType | tMethod | tMethod := ccg methodNamed: #aMethodReturningAPointerType. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #'int *'."message node" self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #'int *'."returnNode" self assert: tMethod returnType equals: #'int *'! Item was changed: ----- Method: SlangTypeForDereferenceTest>>testTwoAtOnMatrix (in category 'tests') ----- testTwoAtOnMatrix | tMethod | tMethod := ccg methodNamed: #aMethodReturningTwoAtOnAMatrix. + self assert: tMethod notNil. - self assert: tMethod isNotNil. self assert: (ccg typeFor: tMethod statements first expression receiver in: tMethod) equals: #'int *'."inner at:" self assert: (ccg typeFor: tMethod statements first expression in: tMethod) equals: #int."outer at:" self assert: (ccg typeFor: tMethod statements first in: tMethod) equals: #int."return node" self assert: tMethod returnType equals: #sqInt. self assert: false. "Unexpected type conversion"! From commits at source.squeak.org Sat Jan 2 21:21:17 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 21:21:17 0000 Subject: [Vm-dev] VM Maker: Cog-eem.430.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.430.mcz ==================== Summary ==================== Name: Cog-eem.430 Author: eem Time: 2 January 2021, 1:21:15.936867 pm UUID: 5fbaa4e2-e023-459c-b431-2899e4145610 Ancestors: Cog-nice.429 Fix a bad estimate of needed heap size in 64=>32 bit image conversions. Provide a convenience for invoking image conversions. Fix a speeling rorre. =============== Diff against Cog-nice.429 =============== Item was changed: ----- Method: BochsIA32Alien>>abiUnmarshal: (in category 'accessing-abstract') ----- abiUnmarshal: nArgs + "Remove nArgs from the stack of a leaf call" - "Remove nArgs form teh stack of a leaf call" self esp: self esp + (nArgs * 4)! Item was changed: ----- Method: Spur64to32BitImageConverter>>on: (in category 'public access') ----- on: imageName (sourceInterpreter := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur64BitMemoryManager)) openOn: imageName extraMemory: 0. sourceHeap := sourceInterpreter objectMemory. imageHeaderFlags := sourceInterpreter getImageHeaderFlags. savedWindowSize := sourceInterpreter savedWindowSize. targetInterpreter := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur32BitMemoryManager). targetHeap := targetInterpreter objectMemory. targetHeap + allocateMemoryOfSize: sourceHeap oldSpaceSize * 3 // 4 "LargeInteger and Float objects are created for out-of-range immediates" - allocateMemoryOfSize: sourceHeap oldSpaceSize * 5 // 8 "LargeInteger and Float objects are created for out-of-range immediates" newSpaceSize: 8 * 1024 * 1024 stackSize: 16 * 1024 codeSize: 0. targetHeap bootstrapping: true. numCompiledCode := numReadOnly := 0. "these are used to guess if literals are read-only..." self initMaps ! Item was added: + ----- Method: SpurMtoNBitImageConverter class>>bootstrapImage: (in category 'instance creation') ----- + bootstrapImage: imageName + ^self new bootstrapImage: imageName! From commits at source.squeak.org Sat Jan 2 21:22:29 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 21:22:29 0000 Subject: [Vm-dev] VM Maker: VMMakerUI-eem.35.mcz Message-ID: Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.35.mcz ==================== Summary ==================== Name: VMMakerUI-eem.35 Author: eem Time: 2 January 2021, 1:22:27.912176 pm UUID: c7b0db6a-9e59-4a22-a650-35f2efbdb0ad Ancestors: VMMakerUI-eem.34 Fix event delivery for 32-bit simulations. The event timestamp must be truncated. Pull queueForwardedEvent: into this package. =============== Diff against VMMakerUI-eem.34 =============== Item was changed: ----- Method: SimulatorEventTransformer>>degenerateKeyboardEvent:for: (in category 'event transformation') ----- degenerateKeyboardEvent: aMorphicEvent for: aClient "Convert the keyboard event into a low-level event for the VM simulator (aClient). See HandMorph>>generateKeyboardEvent and EventSensor class comment" aClient queueForwardedEvent: { EventTypeKeyboard. + aClient eventTimestamp. - aClient ioUTCMicroseconds // 1000. aMorphicEvent keyValue. "<--this is wrong. See nextCharFrom:firstEvt: for what needs to be undone. hooo boy" aMorphicEvent type caseOf: { [#keyDown] -> [EventKeyDown]. [#keyUp] -> [EventKeyUp]. [#keystroke] -> [EventKeyChar] }. modifiers. aMorphicEvent keyValue. 0. self windowIndex }! Item was changed: ----- Method: SimulatorEventTransformer>>degenerateMouseEvent:for: (in category 'event transformation') ----- degenerateMouseEvent: aMorphicEvent for: aClient "Convert the mouse event into low-level events for the VM simulator (aClient). Filter-out mouse moves, and generate a fake mouse move before each button press. See HandMorph>>generateMouseEvent" | translated newMouseEvent | modifiers := aMorphicEvent buttons >> 3. "Sad, but modifiers come in on mouse move events..." "filter-out mouse moves unless buttons are pressed, so simulation doesn't get window leave events when we leave its window" aMorphicEvent type == #mouseMove ifTrue: [(aClient displayView bounds containsPoint: aMorphicEvent position) ifFalse: [^self]]. translated := aMorphicEvent position - aClient displayView bounds origin. newMouseEvent := { EventTypeMouse. + aClient eventTimestamp. - aClient ioUTCMicroseconds // 1000. translated x. translated y. aMorphicEvent buttons bitAnd: 7. "thanks Ron T." modifiers. "Thanks dtl" aMorphicEvent class == MouseButtonEvent ifTrue: [aMorphicEvent nClicks] ifFalse: [0]. self windowIndex }. aClient eventQueue withinPeekLastDo: [:event| "Squash mouse move events..." (#[1 5 6 7 8] allSatisfy: [:index| (event at: index) = (newMouseEvent at: index)]) ifTrue: [^event replaceFrom: 2 to: 4 with: newMouseEvent startingAt: 2]]. aClient queueForwardedEvent: newMouseEvent! Item was added: + ----- Method: StackInterpreter>>eventTimestamp (in category '*VMMakerUI-user interface') ----- + eventTimestamp + + ^BytesPerWord = 4 + ifTrue: [self ioUTCMicroseconds // 1000 bitAnd: MillisecondClockMask] + ifFalse: [self ioUTCMicroseconds // 1000]! Item was added: + ----- Method: StackInterpreter>>queueForwardedEvent: (in category '*VMMakerUI-user interface') ----- + queueForwardedEvent: event + "SimulatorMorphicModel browse" + + self eventQueue nextPut: event. + self inputSemaphoreIndex + ifNotNil: + [:isi| self signalSemaphoreWithIndex: isi] + ifNil: + [nextPollUsecs := self ioUTCMicroseconds. + self forceInterruptCheck]! From commits at source.squeak.org Sat Jan 2 21:29:15 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 21:29:15 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2918.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2918.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2918 Author: eem Time: 2 January 2021, 1:29:06.750497 pm UUID: 17130111-28bf-421b-b6f1-722773efdaee Ancestors: VMMaker.oscog-nice.2917 Simulator: Fix C stack alignment checking for non-RISC simulators. With the changes to invoking the interpreter via ceInvokeInterpreter and ceReturnToInterpreter we need to change the simulation machinery to better mimic the production VM, and so handleCallOrJumpSimulationTrap: sends simulateJumpCallOf:memory: immediately before raising ReturnToInterpreter, and getReturnAddress will answer #enterSmalltalkExecutiveImplementation rather than #initialEnterSmalltalkExecutive Get rid of a break accidentally left behind =============== Diff against VMMaker.oscog-nice.2917 =============== Item was changed: ----- Method: CogObjectRepresentationFor32BitSpur>>genPrimitiveAtPutSigned: (in category 'primitive generators') ----- genPrimitiveAtPutSigned: signedVersion "Generate the code for primitives 61 & 165, at:put:/basicAt:put: & integerAt:put:. If signedVersion is true then generate signed accesses to the bits classes (a la 164 & 165). If signedVersion is false, generate unsigned accesses (a la 60, 61, 63 & 64)." | formatReg nSlotsOrBytesReg methodInBounds jumpImmediate jumpBadIndex jumpImmutable jumpNotIndexablePointers jumpNotIndexableBits jumpIsContext jumpIsCompiledMethod jumpIsBytes jumpIsShorts jumpHasFixedFields jumpArrayOutOfBounds jumpFixedFieldsOutOfBounds jumpWordsOutOfBounds jumpShortsOutOfBounds jumpBytesOutOfBounds jumpShortsOutOfRange jumpWordsOutOfRange jumpBytesOutOfRange jumpNonSmallIntegerValue jumpNotPointers | - self break. "c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: fixedFieldsOf:format:length:" nSlotsOrBytesReg := ClassReg. cogit genLoadArgAtDepth: 1 into: Arg0Reg. cogit genLoadArgAtDepth: 0 into: Arg1Reg. jumpImmediate := self genJumpImmediate: ReceiverResultReg. jumpBadIndex := self genJumpNotSmallInteger: Arg0Reg scratchReg: TempReg. self genConvertSmallIntegerToIntegerInReg: Arg0Reg. cogit SubCq: 1 R: Arg0Reg. "1-rel => 0-rel" "formatReg := self formatOf: ReceiverResultReg" self cppIf: IMMUTABILITY ifTrue: [ self genGetFormatOf: ReceiverResultReg into: (formatReg := SendNumArgsReg) leastSignificantHalfOfBaseHeaderIntoScratch: TempReg. jumpImmutable := self genJumpBaseHeaderImmutable: TempReg ] ifFalse: [ self genGetFormatOf: ReceiverResultReg into: (formatReg := SendNumArgsReg) leastSignificantHalfOfBaseHeaderIntoScratch: NoReg ]. self genGetNumSlotsOf: ReceiverResultReg into: nSlotsOrBytesReg. "dispatch on format in a combination of highest dynamic frequency order first and convenience. 0 = 0 sized objects (UndefinedObject True False et al) 1 = non-indexable objects with inst vars (Point et al) 2 = indexable objects with no inst vars (Array et al) 3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al) 4 = weak indexable objects with inst vars (WeakArray et al) 5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron) 6 unused, reserved for exotic pointer objects? 7 Forwarded Object, 1st field is pointer, rest of fields are ignored 8 unused, reserved for exotic non-pointer objects? 9 64-bit indexable 10 - 11 32-bit indexable 12 - 15 16-bit indexable 16 - 23 byte indexable 24 - 31 compiled method" cogit CmpCq: objectMemory weakArrayFormat R: formatReg. jumpNotPointers := cogit JumpAbove: 0. "optimistic store check; assume index in range (almost always is)." self genStoreCheckReceiverReg: ReceiverResultReg valueReg: Arg1Reg scratchReg: TempReg inFrame: false. cogit CmpCq: objectMemory arrayFormat R: formatReg. jumpNotIndexablePointers := cogit JumpBelow: 0. jumpHasFixedFields := cogit JumpNonZero: 0. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpArrayOutOfBounds := cogit JumpBelowOrEqual: 0. cogit AddCq: objectMemory baseHeaderSize >> objectMemory shiftForWord R: Arg0Reg. cogit MoveR: Arg1Reg Xwr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. jumpHasFixedFields jmpTarget: cogit Label. self genGetClassIndexOfNonImm: ReceiverResultReg into: formatReg. cogit CmpCq: ClassMethodContextCompactIndex R: formatReg. jumpIsContext := cogit JumpZero: 0. "get # fixed fields in formatReg" cogit PushR: nSlotsOrBytesReg. self genGetClassObjectOfClassIndex: formatReg into: nSlotsOrBytesReg scratchReg: TempReg. self genLoadSlot: InstanceSpecificationIndex sourceReg: nSlotsOrBytesReg destReg: formatReg. cogit PopR: nSlotsOrBytesReg. self genConvertSmallIntegerToIntegerInReg: formatReg. cogit AndCq: objectMemory fixedFieldsOfClassFormatMask R: formatReg. cogit SubR: formatReg R: nSlotsOrBytesReg. cogit AddCq: objectMemory baseHeaderSize >> objectMemory shiftForWord R: formatReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpFixedFieldsOutOfBounds := cogit JumpBelowOrEqual: 0. cogit AddR: formatReg R: Arg0Reg. cogit MoveR: Arg1Reg Xwr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. jumpNotPointers jmpTarget: cogit Label. jumpNonSmallIntegerValue := self genJumpNotSmallInteger: Arg1Reg scratchReg: TempReg. cogit CmpCq: objectMemory firstByteFormat R: formatReg. jumpIsBytes := cogit JumpAboveOrEqual: 0. cogit CmpCq: objectMemory firstShortFormat R: formatReg. jumpIsShorts := cogit JumpAboveOrEqual: 0. cogit CmpCq: objectMemory firstLongFormat R: formatReg. "For now ignore 64-bit indexability." jumpNotIndexableBits := cogit JumpBelow: 0. "fall through to words" cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpWordsOutOfBounds := cogit JumpBelowOrEqual: 0. cogit MoveR: Arg1Reg R: TempReg. self genConvertSmallIntegerToIntegerInReg: TempReg. signedVersion ifFalse: [(cogit lastOpcode setsConditionCodesFor: JumpLess) ifFalse: [cogit CmpCq: 0 R: TempReg]. "N.B. FLAGS := TempReg - 0" jumpWordsOutOfRange := cogit JumpLess: 0]. cogit AddCq: objectMemory baseHeaderSize >> objectMemory shiftForWord R: Arg0Reg. cogit MoveR: TempReg Xwr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. signedVersion ifTrue: [jumpIsBytes jmpTarget: (cogit ArithmeticShiftRightCq: 7 + objectMemory numSmallIntegerTagBits R: Arg1Reg R: TempReg). "Maps in range to -1,0". cogit AddCq: 1 R: TempReg. "Maps in range to 0,1" cogit CmpCq: 1 R: TempReg] ifFalse: [jumpIsBytes jmpTarget: (cogit CmpCq: (objectMemory integerObjectOf: 255) R: Arg1Reg)]. jumpBytesOutOfRange := cogit JumpAbove: 0. cogit LogicalShiftLeftCq: objectMemory shiftForWord R: nSlotsOrBytesReg. cogit AndCq: objectMemory wordSize - 1 R: formatReg R: TempReg. cogit SubR: TempReg R: nSlotsOrBytesReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpBytesOutOfBounds := cogit JumpBelowOrEqual: 0. cogit CmpCq: objectMemory firstCompiledMethodFormat R: formatReg. jumpIsCompiledMethod := cogit JumpAboveOrEqual: 0. methodInBounds := cogit MoveR: Arg1Reg R: TempReg. self genConvertSmallIntegerToIntegerInReg: TempReg. cogit AddCq: objectMemory baseHeaderSize R: Arg0Reg. cogit MoveR: TempReg Xbr: Arg0Reg R: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. signedVersion ifTrue: [jumpIsShorts jmpTarget: (cogit ArithmeticShiftRightCq: 15 + objectMemory numSmallIntegerTagBits R: Arg1Reg R: TempReg). "Maps in range to -1,0". cogit AddCq: 1 R: TempReg. "Maps in range to 0,1" cogit CmpCq: 1 R: TempReg] ifFalse: [jumpIsShorts jmpTarget: (cogit CmpCq: (objectMemory integerObjectOf: 65535) R: Arg1Reg)]. jumpShortsOutOfRange := cogit JumpAbove: 0. cogit LogicalShiftLeftCq: objectMemory shiftForWord - 1 R: nSlotsOrBytesReg. cogit AndCq: objectMemory wordSize / 2 - 1 R: formatReg. cogit SubR: formatReg R: nSlotsOrBytesReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. jumpShortsOutOfBounds := cogit JumpBelowOrEqual: 0. cogit MoveR: Arg1Reg R: TempReg. self genConvertSmallIntegerToIntegerInReg: TempReg. cogit AddR: Arg0Reg R: ReceiverResultReg. cogit AddR: Arg0Reg R: ReceiverResultReg. cogit MoveR: TempReg M16: objectMemory baseHeaderSize r: ReceiverResultReg. cogit MoveR: Arg1Reg R: ReceiverResultReg. cogit genPrimReturn. "Now check that the index is beyond the method's literals..." jumpIsCompiledMethod jmpTarget: cogit Label. self getLiteralCountOf: ReceiverResultReg plusOne: true inBytes: true into: nSlotsOrBytesReg scratch: TempReg. cogit CmpR: Arg0Reg R: nSlotsOrBytesReg. cogit JumpBelow: methodInBounds. jumpIsContext jmpTarget: (jumpNotIndexableBits jmpTarget: (jumpBytesOutOfRange jmpTarget: (jumpShortsOutOfRange jmpTarget: (jumpIsCompiledMethod jmpTarget: (jumpArrayOutOfBounds jmpTarget: (jumpBytesOutOfBounds jmpTarget: (jumpShortsOutOfBounds jmpTarget: (jumpWordsOutOfBounds jmpTarget: (jumpNotIndexablePointers jmpTarget: (jumpNonSmallIntegerValue jmpTarget: (jumpFixedFieldsOutOfBounds jmpTarget: cogit Label))))))))))). signedVersion ifFalse: [jumpWordsOutOfRange jmpTarget: jumpIsContext getJmpTarget]. self cppIf: IMMUTABILITY ifTrue: [jumpImmutable jmpTarget: jumpIsContext getJmpTarget]. cogit AddCq: 1 R: Arg0Reg. "0-rel => 1-rel" self genConvertIntegerToSmallIntegerInReg: Arg0Reg. jumpBadIndex jmpTarget: (jumpImmediate jmpTarget: cogit Label). ^0 "Can't be complete because of contexts."! Item was changed: ----- Method: CogVMSimulator>>getReturnAddress (in category 'simulation only') ----- getReturnAddress + "In the real VM this answers the return address for its caller, i.e. for interpret. + In the simulator we're playing fast and loose with initialEnterSmalltalkExecutive + and enterSmalltalkExecutiveImplementation and need them to look and act the same." + | selector | + selector := (thisContext findContextSuchThat: [:ctxt| ctxt selector == #interpret]) sender method selector. + ^selector == #initialEnterSmalltalkExecutive + ifTrue: [#enterSmalltalkExecutiveImplementation] + ifFalse: [selector]! - ^(thisContext findContextSuchThat: [:ctxt| ctxt selector == #interpret]) sender method selector! Item was changed: ----- Method: Cogit>>handleCallOrJumpSimulationTrap: (in category 'simulation only') ----- handleCallOrJumpSimulationTrap: aProcessorSimulationTrap | evaluable function memory result savedFramePointer savedStackPointer savedArgumentCount retpc | "This is a hack fix before we revise the simulators. When a jump call is made, the next pc is effectively the return address on the stack, not the instruction following the jump." aProcessorSimulationTrap type == #jump ifTrue: [processor hackFixNextPCOfJumpFor: aProcessorSimulationTrap using: objectMemory]. evaluable := simulatedTrampolines at: aProcessorSimulationTrap address ifAbsent: [self errorProcessingSimulationTrap: aProcessorSimulationTrap in: simulatedTrampolines]. function := evaluable isBlock ifTrue: ['aBlock; probably some plugin primitive'] ifFalse: + [evaluable receiver == backEnd ifTrue: "this is for invoking ARMv5 floating-point intrinsics" - [evaluable receiver == backEnd ifTrue: [^self handleABICallOrJumpSimulationTrap: aProcessorSimulationTrap evaluable: evaluable]. evaluable selector]. memory := coInterpreter memory. function == #interpret ifTrue: "i.e. we're here via ceInvokeInterpret/ceReturnToInterpreterTrampoline and should discard all state back to enterSmalltalkExecutiveImplementation" [self recordInstruction: {'(simulated jump call of '. aProcessorSimulationTrap address. '/'. function. ')'}. + processor simulateJumpCallOf: aProcessorSimulationTrap address memory: memory. - processor smashCallerSavedRegistersWithValuesFrom: 16r80000000 by: objectMemory wordSize. coInterpreter reenterInterpreter. "NOTREACHED" self halt]. function ~~ #ceBaseFrameReturn: ifTrue: [coInterpreter assertValidExternalStackPointers]. (backEnd wantsNearAddressFor: function) ifTrue: [^self perform: function with: aProcessorSimulationTrap]. processor simulateCallOf: aProcessorSimulationTrap address nextpc: aProcessorSimulationTrap nextpc memory: memory. retpc := processor retpcIn: memory. self recordInstruction: {'(simulated call of '. aProcessorSimulationTrap address. '/'. function. ')'}. savedFramePointer := coInterpreter framePointer. savedStackPointer := coInterpreter stackPointer. savedArgumentCount := coInterpreter argumentCount. result := ["self halt: evaluable selector." clickConfirm ifTrue: [(self confirm: 'skip run-time call?') ifFalse: [clickConfirm := false. self halt]]. evaluable valueWithArguments: (processor postCallArgumentsNumArgs: evaluable numArgs in: memory)] on: ReenterMachineCode do: [:ex| ex return: #continueNoReturn]. coInterpreter assertValidExternalStackPointers. "Verify the stack layout assumption compileInterpreterPrimitive: makes, provided we've not called something that has built a frame, such as closure value or evaluate method, or switched frames, such as primitiveSignal, primitiveWait, primitiveResume, primitiveSuspend et al." (function beginsWith: 'primitive') ifTrue: [coInterpreter primFailCode = 0 ifTrue: [(CogVMSimulator stackAlteringPrimitives includes: function) ifFalse: ["This is a rare case (e.g. in Scorch where a married context's sender is set to nil on trapTrpped and hence the stack layout is altered." (function == #primitiveSlotAtPut and: [objectMemory isContext: (coInterpreter frameReceiver: coInterpreter framePointer)]) ifFalse: [self assert: savedFramePointer = coInterpreter framePointer. self assert: savedStackPointer + (savedArgumentCount * objectMemory wordSize) = coInterpreter stackPointer]]] ifFalse: [self assert: savedFramePointer = coInterpreter framePointer. self assert: savedStackPointer = coInterpreter stackPointer]]. result ~~ #continueNoReturn ifTrue: [self recordInstruction: {'(simulated return to '. processor retpcIn: memory. ')'}. processor simulateReturnIn: memory. self assert: processor pc = retpc. processor smashCallerSavedRegistersWithValuesFrom: 16r80000000 by: objectMemory wordSize]. self assert: (result isInteger "an oop result" or: [result == coInterpreter or: [result == objectMemory or: [result == nil or: [result == #continueNoReturn]]]]). processor cResultRegister: (result ifNil: [0] ifNotNil: [result isInteger ifTrue: [result] ifFalse: [16rF00BA222]])! Item was changed: ----- Method: StackInterpreter>>initialEnterSmalltalkExecutive (in category 'initialization') ----- initialEnterSmalltalkExecutive "Main entry-point into the interpreter at system start-up. + In the non-threaded VM this is identical to enterSmalltalkExecutive + + N.B. It also provides the simulator's implementation of ceReturnToInterpreter/ceInvokeInterpreter, which + via a simulation trap raise the ReenterInterpreter signal in handleCallOrJumpSimulationTrap:/reenterInterpreter. + So when ReenterInterpreter is caught this metod invokes interpret directly. " - In the non-threaded VM this is identical to enterSmalltalkExecutive" "Simulation of the setjmp in enterSmalltalkExecutiveImplementation for reentry into interpreter." + | caught | + caught := false. + [([caught + ifFalse: [self enterSmalltalkExecutiveImplementation] + ifTrue: [self interpret]] - [([self enterSmalltalkExecutiveImplementation] on: ReenterInterpreter + do: [:ex| + caught := true. + ex return: ex returnValue]) = ReturnToInterpreter] whileTrue! - do: [:ex| ex return: ex returnValue]) = ReturnToInterpreter] whileTrue! Item was removed: - ----- Method: StackInterpreter>>queueForwardedEvent: (in category 'I/O primitive support') ----- - queueForwardedEvent: event - "SimulatorMorphicModel browse" - - self eventQueue nextPut: event. - self inputSemaphoreIndex - ifNotNil: - [:isi| self signalSemaphoreWithIndex: isi] - ifNil: - [nextPollUsecs := self ioUTCMicroseconds. - self forceInterruptCheck]! From commits at source.squeak.org Sat Jan 2 22:12:37 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 22:12:37 0000 Subject: [Vm-dev] VM Maker: Cog-eem.431.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.431.mcz ==================== Summary ==================== Name: Cog-eem.431 Author: eem Time: 2 January 2021, 2:12:35.69088 pm UUID: 8d16e5f1-d6b0-4302-b154-1f64d9b06e74 Ancestors: Cog-eem.430 Fix printing labels for every ibstructuion in a trampoline when disassembling an entire trampoline. =============== Diff against Cog-eem.430 =============== Item was changed: ----- Method: CogProcessorAlien>>disassembleFrom:to:in:for:labels:on: (in category 'disassembly') ----- disassembleFrom: startAddress to: endAddress in: memory for: aSymbolManager "" labels: labelDictionary on: aStream + | address firstLabel | - | address | address := startAddress. + (aSymbolManager labelForPC: address) ifNotNil: + [:label| + firstLabel := label copyUpThrough: Character space. + firstLabel last = Character space ifFalse: + [firstLabel := firstLabel, ' ']]. [address <= endAddress] whileTrue: [[:sizeArg :stringArg| | size string | size := sizeArg. string := stringArg. (aSymbolManager labelForPC: address) ifNotNil: + [:label| + (firstLabel notNil and: [label beginsWith: firstLabel]) ifFalse: + [aStream nextPutAll: label; nextPut: $:; cr]]. - [:label| aStream nextPutAll: label; nextPut: $:; cr]. (labelDictionary at: address ifAbsent: []) ifNotNil: [:label| (label ~~ #oneWordLiteral and: [label ~~ #twoWordLiteral]) ifTrue: [self printLabel: label on: aStream at: address for: aSymbolManager. label isArray ifTrue: [string := nil. size := label third]]]. string ifNotNil: [aStream nextPutAll: (self decorateDisassembly: string for: aSymbolManager fromAddress: address labels: labelDictionary)]. aStream cr; flush. address := address + size] valueWithArguments: (self primitiveDisassembleAt: address inMemory: memory)]. (labelDictionary at: address ifAbsent: []) ifNotNil: [:label| self printLabel: label on: aStream at: address for: aSymbolManager]! From commits at source.squeak.org Sat Jan 2 22:15:46 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 2 Jan 2021 22:15:46 0000 Subject: [Vm-dev] VM Maker: VMMakerUI-eem.36.mcz Message-ID: Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.36.mcz ==================== Summary ==================== Name: VMMakerUI-eem.36 Author: eem Time: 2 January 2021, 2:15:45.244517 pm UUID: 659bb988-8f11-4268-aa1c-d0ce3c656343 Ancestors: VMMakerUI-eem.35 Simulation: Fix some issues with click step. Make proceed turn off a boolean breakpoint so that proceed actually proceeds rather than immediately stopping. Have the click step dialog inform whether simulation is in machine code or in the interpreter. Avoid the search for open debuggers crashing when debugging the search for open debuggers ;-) =============== Diff against VMMakerUI-eem.35 =============== Item was added: + ----- Method: Cogit>>inMachineCode (in category '*VMMakerUI-accessing') ----- + inMachineCode + + "Answer if the processor's sp & fp are the current valid system frame pointers." + ^processor pc between: guardPageSize and: methodZone zoneEnd! Item was changed: ----- Method: Cogit>>processorFrameValid (in category '*VMMakerUI-accessing') ----- processorFrameValid + "Answer if the processor's sp & fp are the current valid system frame pointers." ^processorFrameValid! Item was changed: ----- Method: Cogit>>promptClickStep (in category '*VMMakerUI-user interface') ----- promptClickStep ^UserDialogBoxMorph confirm: 'step?' orExtraValue: #proceed label: 'proceed' + title: (self inMachineCode ifTrue: ['In machine code'] ifFalse: ['In the interpreter']) - title: 'Click step' at: nil! Item was changed: ----- Method: Cogit>>setClickStepBreakBlock (in category '*VMMakerUI-user interface') ----- setClickStepBreakBlock "Set the break block to present a confirmer, breaking if true, and restoring the previous break block. If an open debugger on the receiver can be found, proceed it." | previousBreakBlock previousAtEachStepBlock previousBreakPC previousSingleStep previousClickConfirm result | (breakBlock isNil or: [breakBlock method ~~ thisContext method]) ifTrue: [previousBreakBlock := breakBlock. previousAtEachStepBlock := coInterpreter atEachStepBlock. previousBreakPC := breakPC. previousSingleStep := singleStep. previousClickConfirm := clickConfirm. breakBlock := [:ign| (processor pc ~= previousBreakPC and: [(result := self promptClickStep) == true]) ifTrue: [false] ifFalse: [breakBlock := previousBreakBlock. coInterpreter atEachStepBlock: previousAtEachStepBlock. + breakPC := previousBreakPC == true ifTrue: [false] ifFalse: [previousBreakPC]. - breakPC := previousBreakPC. singleStep := previousSingleStep. clickConfirm := previousClickConfirm. true]]. coInterpreter atEachStepBlock: [previousAtEachStepBlock value. (coInterpreter localIP ~= previousBreakPC and: [(result := self promptClickStep) == true]) ifFalse: [breakBlock := previousBreakBlock. coInterpreter atEachStepBlock: previousAtEachStepBlock. + breakPC := previousBreakPC == true ifTrue: [false] ifFalse: [previousBreakPC]. - breakPC := previousBreakPC. singleStep := previousSingleStep. clickConfirm := previousClickConfirm. self halt]]. singleStep := breakPC := clickConfirm := result ~~ #proceed]. (World submorphs detect: [:m| m model isDebugger + and: [(m model interruptedProcess suspendedContext + ifNil: [false] "happens if we're debugging this very method..." + ifNotNil: + [:suspendedContext| + suspendedContext findContextSuchThat: + [:ctxt| + (ctxt receiver == self + and: [ctxt selector == #simulateCogCodeAt: + or: [ctxt selector == #simulateLeafCallOf:]]) + or: [ctxt receiver == coInterpreter + and: [ctxt selector == #interpret]]]]) notNil]] - and: [(m model interruptedProcess suspendedContext findContextSuchThat: - [:ctxt| - (ctxt receiver == self - and: [ctxt selector == #simulateCogCodeAt: - or: [ctxt selector == #simulateLeafCallOf:]]) - or: [ctxt receiver == coInterpreter - and: [ctxt selector == #interpret]]]) notNil]] ifNone: []) ifNotNil: [:debuggerWindow| WorldState addDeferredUIMessage: [debuggerWindow model proceed]]! From commits at source.squeak.org Sun Jan 3 06:12:37 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 3 Jan 2021 06:12:37 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2919.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2919.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2919 Author: eem Time: 2 January 2021, 10:12:29.080225 pm UUID: 3c606a29-4e7f-4ce7-9d1b-5ba006cff614 Ancestors: VMMaker.oscog-eem.2918 SImulation: Add the halt check to click step when enetering interpret. Fix CoInterpreterMT>>#enterSmalltalkExecutive as per VMMaker.oscog-eem.2918. Refactor getReturnAddress so it can be extracted from ThisContext (the Debugger's version of thisContext). =============== Diff against VMMaker.oscog-eem.2918 =============== Item was added: + ----- Method: CoInterpreterMT>>enterSmalltalkExecutive (in category 'initialization') ----- + enterSmalltalkExecutive + "Main entry-point into the interpreter at each execution level, where an + execution level is either the start of execution or reentry for a callback. + + N.B. It also provides the simulator's implementation of ceReturnToInterpreter/ceInvokeInterpreter, which + via a simulation trap raise the ReenterInterpreter signal in handleCallOrJumpSimulationTrap:/reenterInterpreter. + So when ReenterInterpreter is caught this method invokes interpret directly." + + "Simulation of the setjmp in enterSmalltalkExecutiveImplementation for reentry into interpreter." + | caught | + caught := false. + [[caught + ifFalse: [self enterSmalltalkExecutiveImplementation] + ifTrue: [self interpret]] + on: ReenterInterpreter + do: [:ex| + caught := true. + self assert: ex returnValue = ReturnToInterpreter. + ex return: true]] whileTrue! Item was changed: ----- Method: CogVMSimulator>>getReturnAddress (in category 'simulation only') ----- getReturnAddress "In the real VM this answers the return address for its caller, i.e. for interpret. In the simulator we're playing fast and loose with initialEnterSmalltalkExecutive and enterSmalltalkExecutiveImplementation and need them to look and act the same." | selector | + selector := thisContext getReturnAddress. + ^(selector == #initialEnterSmalltalkExecutive + or: [selector == #enterSmalltalkExecutive]) - selector := (thisContext findContextSuchThat: [:ctxt| ctxt selector == #interpret]) sender method selector. - ^selector == #initialEnterSmalltalkExecutive ifTrue: [#enterSmalltalkExecutiveImplementation] ifFalse: [selector]! Item was changed: ----- Method: Cogit>>handleCallOrJumpSimulationTrap: (in category 'simulation only') ----- handleCallOrJumpSimulationTrap: aProcessorSimulationTrap | evaluable function memory result savedFramePointer savedStackPointer savedArgumentCount retpc | "This is a hack fix before we revise the simulators. When a jump call is made, the next pc is effectively the return address on the stack, not the instruction following the jump." aProcessorSimulationTrap type == #jump ifTrue: [processor hackFixNextPCOfJumpFor: aProcessorSimulationTrap using: objectMemory]. evaluable := simulatedTrampolines at: aProcessorSimulationTrap address ifAbsent: [self errorProcessingSimulationTrap: aProcessorSimulationTrap in: simulatedTrampolines]. function := evaluable isBlock ifTrue: ['aBlock; probably some plugin primitive'] ifFalse: [evaluable receiver == backEnd ifTrue: "this is for invoking ARMv5 floating-point intrinsics" [^self handleABICallOrJumpSimulationTrap: aProcessorSimulationTrap evaluable: evaluable]. evaluable selector]. memory := coInterpreter memory. function == #interpret ifTrue: "i.e. we're here via ceInvokeInterpret/ceReturnToInterpreterTrampoline and should discard all state back to enterSmalltalkExecutiveImplementation" [self recordInstruction: {'(simulated jump call of '. aProcessorSimulationTrap address. '/'. function. ')'}. + "self halt: evaluable selector." + clickConfirm ifTrue: + [(self confirm: 'skip jump to interpret?') ifFalse: + [clickConfirm := false. self halt]]. processor simulateJumpCallOf: aProcessorSimulationTrap address memory: memory. coInterpreter reenterInterpreter. "NOTREACHED" self halt]. function ~~ #ceBaseFrameReturn: ifTrue: [coInterpreter assertValidExternalStackPointers]. (backEnd wantsNearAddressFor: function) ifTrue: [^self perform: function with: aProcessorSimulationTrap]. processor simulateCallOf: aProcessorSimulationTrap address nextpc: aProcessorSimulationTrap nextpc memory: memory. retpc := processor retpcIn: memory. self recordInstruction: {'(simulated call of '. aProcessorSimulationTrap address. '/'. function. ')'}. savedFramePointer := coInterpreter framePointer. savedStackPointer := coInterpreter stackPointer. savedArgumentCount := coInterpreter argumentCount. result := ["self halt: evaluable selector." clickConfirm ifTrue: [(self confirm: 'skip run-time call?') ifFalse: [clickConfirm := false. self halt]]. evaluable valueWithArguments: (processor postCallArgumentsNumArgs: evaluable numArgs in: memory)] on: ReenterMachineCode do: [:ex| ex return: #continueNoReturn]. coInterpreter assertValidExternalStackPointers. "Verify the stack layout assumption compileInterpreterPrimitive: makes, provided we've not called something that has built a frame, such as closure value or evaluate method, or switched frames, such as primitiveSignal, primitiveWait, primitiveResume, primitiveSuspend et al." (function beginsWith: 'primitive') ifTrue: [coInterpreter primFailCode = 0 ifTrue: [(CogVMSimulator stackAlteringPrimitives includes: function) ifFalse: ["This is a rare case (e.g. in Scorch where a married context's sender is set to nil on trapTrpped and hence the stack layout is altered." (function == #primitiveSlotAtPut and: [objectMemory isContext: (coInterpreter frameReceiver: coInterpreter framePointer)]) ifFalse: [self assert: savedFramePointer = coInterpreter framePointer. self assert: savedStackPointer + (savedArgumentCount * objectMemory wordSize) = coInterpreter stackPointer]]] ifFalse: [self assert: savedFramePointer = coInterpreter framePointer. self assert: savedStackPointer = coInterpreter stackPointer]]. result ~~ #continueNoReturn ifTrue: [self recordInstruction: {'(simulated return to '. processor retpcIn: memory. ')'}. processor simulateReturnIn: memory. self assert: processor pc = retpc. processor smashCallerSavedRegistersWithValuesFrom: 16r80000000 by: objectMemory wordSize]. self assert: (result isInteger "an oop result" or: [result == coInterpreter or: [result == objectMemory or: [result == nil or: [result == #continueNoReturn]]]]). processor cResultRegister: (result ifNil: [0] ifNotNil: [result isInteger ifTrue: [result] ifFalse: [16rF00BA222]])! Item was changed: ----- Method: Cogit>>tryLockVMOwnerTo: (in category 'multi-threading') ----- tryLockVMOwnerTo: value "ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner variable with zero and the argument, setting vmOwner to value if it was + zero. It answers if the lock was zero and hence was acquired. + + See CogThreadManager>>#tryLockVMOwnerTo: for the simulation of + processor thread switching which surrounds this method." - zero. It answers if the lock was zero and hence was acquired." processor abiMarshalArg0: value in: objectMemory memory. ^[ | result | result := self simulateLeafCallOf: ceTryLockVMOwner. self assert: (result ~= 0) = (coInterpreter threadManager getVMOwner = value). result ~= 0] ensure: [processor abiUnmarshal: 1]! Item was added: + ----- Method: Context>>getReturnAddress (in category '*VMMaker-simulation') ----- + getReturnAddress + "Simulate access to the return address, used in the CoInterpreter in fast interpreter activation. + For simulaiton map return addresses to sender selectors." + ^(self findContextSuchThat: [:ctxt| ctxt selector == #interpret]) sender method selector! From eliot.miranda at gmail.com Sun Jan 3 06:21:17 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sat, 2 Jan 2021 22:21:17 -0800 Subject: [Vm-dev] Small problem compiling stackspur vm on phone In-Reply-To: <6F4009F9-8D7D-4AC7-8ACD-FC9F0FBEC998@rowledge.org> References: <6F4009F9-8D7D-4AC7-8ACD-FC9F0FBEC998@rowledge.org> Message-ID: Thanks Tim. Fixing this now... On Thu, Dec 31, 2020 at 3:52 PM tim Rowledge wrote: > > 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 > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Sun Jan 3 06:25:18 2021 From: noreply at github.com (Eliot Miranda) Date: Sat, 02 Jan 2021 22:25:18 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d24a66: Fix the type declaration of the sendTrace option v... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d24a669e5964b9a47540a09ba1113ae3fa31d263 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d24a669e5964b9a47540a09ba1113ae3fa31d263 Author: Eliot Miranda Date: 2021-01-02 (Sat, 02 Jan 2021) Changed paths: M platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m M platforms/unix/vm/sqUnixMain.c M platforms/win32/vm/sqWin32Main.c Log Message: ----------- Fix the type declaration of the sendTrace option variable for 64-bit StackVM compiles. Add the missing command-line parser for it on Mac. From no-reply at appveyor.com Sun Jan 3 09:02:55 2021 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 03 Jan 2021 09:02:55 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2336 Message-ID: <20210103090255.1.2446E1D768AA8CB2@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sun Jan 3 17:19:34 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 3 Jan 2021 17:19:34 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2920.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2920.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2920 Author: eem Time: 3 January 2021, 9:19:28.019823 am UUID: 30a49581-87d4-4b92-b7bc-a109c8a430a2 Ancestors: VMMaker.oscog-eem.2919 Cogit: nuke a couple of unused inst vars. =============== Diff against VMMaker.oscog-eem.2919 =============== Item was changed: ----- Method: CogVMSimulator>>initializeThreadSupport (in category 'initialize-release') ----- initializeThreadSupport "Do this post new if you want to simulate with thread support." + cogThreadManager := CogThreadManager new setInterpreter: self cogit: cogit! - cogThreadManager := CogThreadManager new setInterpreter: self cogit: cogit. - cogit setThreadManager: cogThreadManager! Item was changed: CogClass subclass: #Cogit (excessive size, no diff calculated) Item was changed: ----- Method: Cogit>>setInterpreter: (in category 'initialization') ----- setInterpreter: aCoInterpreter "Initialization of the code generator in the simulator. These objects already exist in the generated C VM or are used only in the simulation." coInterpreter := aCoInterpreter. objectMemory := aCoInterpreter objectMemory. - threadManager := aCoInterpreter threadManager. "N.B. may be nil" methodZone := self class methodZoneClass new. objectRepresentation := objectMemory objectRepresentationClass forCogit: self methodZone: methodZone. methodZone setInterpreter: aCoInterpreter objectRepresentation: objectRepresentation cogit: self. generatorTable := self class generatorTable. processor := ProcessorClass new. simulatedAddresses := Dictionary new. coInterpreter class clusteredVariableNames do: [:cvn| self simulatedAddressFor: (cvn first = $C ifTrue: ['get', cvn] ifFalse: [cvn]) asSymbol]. simulatedTrampolines := Dictionary new. simulatedVariableGetters := Dictionary new. simulatedVariableSetters := Dictionary new. traceStores := 0. traceFlags := (self class initializationOptions at: #recordPrimTrace ifAbsent: [true]) ifTrue: [8] "record prim trace on by default (see Cogit class>>decareCVarsIn:)" ifFalse: [0]. singleStep := printRegisters := printInstructions := clickConfirm := false. backEnd := CogCompilerClass for: self. methodLabel := CogCompilerClass for: self. (literalsManager := backEnd class literalsManagerClass new) cogit: self. ordinarySendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). superSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). BytecodeSetHasDirectedSuperSend ifTrue: [directedSuperSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). directedSuperBindingSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). directedSendUsesBinding := false]. NewspeakVM ifTrue: [selfSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). dynamicSuperSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). implicitReceiverSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines). outerSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines)]. "debug metadata" objectReferencesInRuntime := CArrayAccessor on: (Array new: NumObjRefsInRuntime). runtimeObjectRefIndex := 0. "debug metadata" trampolineAddresses := CArrayAccessor on: (Array new: NumTrampolines * 2). trampolineTableIndex := 0. extA := numExtB := extB := 0. compilationTrace ifNil: [compilationTrace := self class initializationOptions at: #compilationTrace ifAbsent: [0]]. debugOpcodeIndices := self class initializationOptions at: #debugOpcodeIndices ifAbsent: [Set new]. debugBytecodePointers := self class initializationOptions at: #debugBytecodePointers ifAbsent: [Set new]. self class initializationOptions at: #breakPC ifPresent: [:pc| breakPC := pc]! Item was removed: - ----- Method: Cogit>>setThreadManager: (in category 'initialization') ----- - setThreadManager: aCogThreadManager - "Initialization of the code generator in the simulator. - Used in the separate VM since this VM does not do a second initialization of the interpreter, - only a second initialization of the objectMemory." - - threadManager := aCogThreadManager "N.B. may be nil"! From commits at source.squeak.org Mon Jan 4 02:20:15 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 4 Jan 2021 02:20:15 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2921.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2921.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2921 Author: eem Time: 3 January 2021, 6:20:07.965503 pm UUID: 43202b09-b01d-4ae5-8014-046b5fcead4f Ancestors: VMMaker.oscog-eem.2920 CoInterpreterMT Simulation: Provide a Mutex to lock the processor to ensure that simulation traps are executed atomically. Halt any other thread executing machine code while executing a leaf call so that tryLockVMOwnerTo: can run in its won thread without interference. Make sure that flush flushes transcript output to the screen even if the TranscriptStream preference says otherwise. =============== Diff against VMMaker.oscog-eem.2920 =============== Item was changed: ----- Method: CogThreadManager>>tryLockVMOwnerTo: (in category 'simulation') ----- tryLockVMOwnerTo: threadIndex "In the real VM this is a direct call of Cogit>>#tryLockVMOwnerTo:/ceTryLockVMOwner. In the simulation this is where register state is saved and switched, simulaitng a thread switch. releaseVM also saves register state. The code here and in registerState allow us to avoid the expensive and complex MultiProcessor hack." + | result | - | prior processor result | self deny: threadIndex = 0. + cogit withProcessorHaltedDo: + [| prior processor | + processor := cogit processor. + prior := processor registerState. + "A thread switch would (have) occur(ed) if it were that the VM were owned other than by threadIndex" + vmOwner ~= threadIndex ifTrue: + [vmOwner ~= 0 ifTrue: + [registerStates at: vmOwner put: prior]. + processor setRegisterState: (registerStates + at: threadIndex + ifAbsentPut: + [self ensureInitializedProcessor: processor forThreadIndex: threadIndex. + processor registerState])]. + result := cogit tryLockVMOwnerTo: threadIndex. + self assert: result = (threadIndex = vmOwner). + registerStates at: threadIndex put: processor registerState. + threadIndex ~= vmOwner ifTrue: "the lock attempt failed; undo the (processor) thread switch." + [processor setRegisterState: prior]]. - processor := cogit processor. - prior := processor registerState. - "A thread switch would (have) occur(ed) if it were that the VM were owned other than by threadIndex" - vmOwner ~= threadIndex ifTrue: - [vmOwner ~= 0 ifTrue: - [registerStates at: vmOwner put: prior]. - processor setRegisterState: (registerStates - at: threadIndex - ifAbsentPut: - [self ensureInitializedProcessor: processor forThreadIndex: threadIndex. - processor registerState])]. - result := cogit tryLockVMOwnerTo: threadIndex. - self assert: result = (threadIndex = vmOwner). - registerStates at: threadIndex put: processor registerState. - threadIndex ~= vmOwner ifTrue: "the lock attempt failed; undo the (processor) thread switch." - [processor setRegisterState: prior]. ^result! Item was changed: ----- Method: CogVMSimulator>>flush (in category 'debug printing') ----- flush + traceOn ifTrue: + [transcript flush. + "We *always* want to make output visible on flush" + TranscriptStream forceUpdate ifFalse: + [transcript changed: #appendEntry]]! - - traceOn ifTrue: [transcript flush]! Item was changed: CogClass subclass: #Cogit (excessive size, no diff calculated) Item was changed: ----- Method: Cogit>>handleCallOrJumpSimulationTrap: (in category 'simulation only') ----- handleCallOrJumpSimulationTrap: aProcessorSimulationTrap | evaluable function memory result savedFramePointer savedStackPointer savedArgumentCount retpc | + "Execution of a single instruction must be within the processorLock critical section to ensure + simulation traps are executed atomically. However, at this point control is leaving machine + code and entering the run-time and hence the lock must be released." + processorLock primitiveExitCriticalSection. - "This is a hack fix before we revise the simulators. When a jump call is made, the next pc is effectively the return address on the stack, not the instruction following the jump." aProcessorSimulationTrap type == #jump ifTrue: [processor hackFixNextPCOfJumpFor: aProcessorSimulationTrap using: objectMemory]. evaluable := simulatedTrampolines at: aProcessorSimulationTrap address ifAbsent: [self errorProcessingSimulationTrap: aProcessorSimulationTrap in: simulatedTrampolines]. function := evaluable isBlock ifTrue: ['aBlock; probably some plugin primitive'] ifFalse: [evaluable receiver == backEnd ifTrue: "this is for invoking ARMv5 floating-point intrinsics" [^self handleABICallOrJumpSimulationTrap: aProcessorSimulationTrap evaluable: evaluable]. evaluable selector]. memory := coInterpreter memory. function == #interpret ifTrue: "i.e. we're here via ceInvokeInterpret/ceReturnToInterpreterTrampoline and should discard all state back to enterSmalltalkExecutiveImplementation" [self recordInstruction: {'(simulated jump call of '. aProcessorSimulationTrap address. '/'. function. ')'}. "self halt: evaluable selector." clickConfirm ifTrue: [(self confirm: 'skip jump to interpret?') ifFalse: [clickConfirm := false. self halt]]. processor simulateJumpCallOf: aProcessorSimulationTrap address memory: memory. coInterpreter reenterInterpreter. "NOTREACHED" self halt]. function ~~ #ceBaseFrameReturn: ifTrue: [coInterpreter assertValidExternalStackPointers]. (backEnd wantsNearAddressFor: function) ifTrue: [^self perform: function with: aProcessorSimulationTrap]. processor simulateCallOf: aProcessorSimulationTrap address nextpc: aProcessorSimulationTrap nextpc memory: memory. retpc := processor retpcIn: memory. self recordInstruction: {'(simulated call of '. aProcessorSimulationTrap address. '/'. function. ')'}. savedFramePointer := coInterpreter framePointer. savedStackPointer := coInterpreter stackPointer. savedArgumentCount := coInterpreter argumentCount. result := ["self halt: evaluable selector." clickConfirm ifTrue: [(self confirm: 'skip run-time call?') ifFalse: [clickConfirm := false. self halt]]. evaluable valueWithArguments: (processor postCallArgumentsNumArgs: evaluable numArgs in: memory)] on: ReenterMachineCode do: [:ex| ex return: #continueNoReturn]. coInterpreter assertValidExternalStackPointers. "Verify the stack layout assumption compileInterpreterPrimitive: makes, provided we've not called something that has built a frame, such as closure value or evaluate method, or switched frames, such as primitiveSignal, primitiveWait, primitiveResume, primitiveSuspend et al." (function beginsWith: 'primitive') ifTrue: [coInterpreter primFailCode = 0 ifTrue: [(CogVMSimulator stackAlteringPrimitives includes: function) ifFalse: ["This is a rare case (e.g. in Scorch where a married context's sender is set to nil on trapTrpped and hence the stack layout is altered." (function == #primitiveSlotAtPut and: [objectMemory isContext: (coInterpreter frameReceiver: coInterpreter framePointer)]) ifFalse: [self assert: savedFramePointer = coInterpreter framePointer. self assert: savedStackPointer + (savedArgumentCount * objectMemory wordSize) = coInterpreter stackPointer]]] ifFalse: [self assert: savedFramePointer = coInterpreter framePointer. self assert: savedStackPointer = coInterpreter stackPointer]]. result ~~ #continueNoReturn ifTrue: [self recordInstruction: {'(simulated return to '. processor retpcIn: memory. ')'}. processor simulateReturnIn: memory. self assert: processor pc = retpc. processor smashCallerSavedRegistersWithValuesFrom: 16r80000000 by: objectMemory wordSize]. self assert: (result isInteger "an oop result" or: [result == coInterpreter or: [result == objectMemory or: [result == nil or: [result == #continueNoReturn]]]]). processor cResultRegister: (result ifNil: [0] ifNotNil: [result isInteger ifTrue: [result] ifFalse: [16rF00BA222]])! Item was changed: ----- Method: Cogit>>initializeProcessor (in category 'initialization') ----- initializeProcessor "Initialize the simulation processor, arranging that its initial stack is somewhere on the rump C stack." guardPageSize := self class guardPageSize. lastNInstructions := OrderedCollection new. processor initializeStackFor: self. self initializeProcessorStack: coInterpreter rumpCStackAddress. coInterpreter setCFramePointer: processor fp setCStackPointer: processor sp. (InitializationOptions at: #UseMultiProcessor ifAbsent: [false]) ifTrue: + [processor := MultiProcessor for: processor coInterpreter: coInterpreter]. + processorLock := Mutex new! - [processor := MultiProcessor for: processor coInterpreter: coInterpreter]! Item was changed: ----- Method: Cogit>>simulateCogCodeAt: (in category 'simulation only') ----- simulateCogCodeAt: address "" | stackZoneBase | stackZoneBase := coInterpreter stackZoneBase. processor pc: address. [[[singleStep ifTrue: [[processor sp < stackZoneBase ifTrue: [self halt]. self recordProcessing. self maybeBreakAt: processor pc] value. "So that the Debugger's Over steps over all this" + processorLock critical: + [processor - processor singleStepIn: coInterpreter memory minimumAddress: guardPageSize + readOnlyBelow: methodZone zoneEnd]] - readOnlyBelow: methodZone zoneEnd] ifFalse: + [processorLock critical: + [processor - [processor runInMemory: coInterpreter memory minimumAddress: guardPageSize + readOnlyBelow: methodZone zoneEnd]]. - readOnlyBelow: methodZone zoneEnd]. "((printRegisters or: [printInstructions]) and: [clickConfirm]) ifTrue: [(self confirm: 'continue?') ifFalse: [clickConfirm := false. self halt]]." true] whileTrue] on: ProcessorSimulationTrap do: [:ex| ex applyTo: self]. true] whileTrue! Item was changed: ----- Method: Cogit>>simulateLeafCallOf: (in category 'simulation only') ----- simulateLeafCallOf: someFunction "Simulate execution of machine code that leaf-calls someFunction, answering the result returned by someFunction." "CogProcessorAlienInspector openFor: coInterpreter" | priorSP priorPC priorLR spOnEntry bogusRetPC | self recordRegisters. priorSP := processor sp. priorPC := processor pc. priorLR := backEnd hasLinkRegister ifTrue: [processor lr]. processor simulateLeafCallOf: someFunction nextpc: (bogusRetPC := 16rBADF00D5 roundTo: backEnd codeGranularity) memory: coInterpreter memory. spOnEntry := processor sp. self recordInstruction: {'(simulated call of '. someFunction. ')'}. + ^[[[processor pc between: self class guardPageSize and: methodZone zoneEnd] whileTrue: + [singleStep - ^[[processor pc between: self class guardPageSize and: methodZone zoneEnd] whileTrue: - [[singleStep ifTrue: [self recordProcessing. self maybeBreakAt: processor pc. + processorLock critical: + [processor + singleStepIn: coInterpreter memory + minimumAddress: guardPageSize + readOnlyBelow: methodZone zoneEnd]] + ifFalse: [processorLock critical: + [processor + runInMemory: coInterpreter memory + minimumAddress: guardPageSize + readOnlyBelow: methodZone zoneEnd]]]] - processor - singleStepIn: coInterpreter memory - minimumAddress: guardPageSize - readOnlyBelow: methodZone zoneEnd] - ifFalse: [processor - runInMemory: coInterpreter memory - minimumAddress: guardPageSize - readOnlyBelow: methodZone zoneEnd]] on: ProcessorSimulationTrap, Error do: [:ex| "Again this is a hack for the processor simulators not properly simulating returns to bogus addresses. In this case BochsX64Alien doesn't do the right thing." processor pc = bogusRetPC ifTrue: [self recordInstruction: {'(simulated (real) return to '. processor pc. ')'}. ^processor cResultRegister]. ex isProcessorSimulationTrap ifFalse: [ex pass]. ex applyTo: self. ex type == #return ifTrue: + [^processor cResultRegister]]. - [^processor cResultRegister]]]. processor pc = bogusRetPC ifTrue: [self recordInstruction: {'(simulated (real) return to '. processor pc. ')'}]. processor cResultRegister] ensure: [processor sp: priorSP. processor pc: priorPC. priorLR ifNotNil: [:lr| processor lr: lr]]! Item was changed: ----- Method: Cogit>>tryLockVMOwnerTo: (in category 'multi-threading') ----- tryLockVMOwnerTo: value "ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner variable with zero and the argument, setting vmOwner to value if it was zero. It answers if the lock was zero and hence was acquired. See CogThreadManager>>#tryLockVMOwnerTo: for the simulation of processor thread switching which surrounds this method." + | breakPCWasTrue | + (thisContext findContextSuchThat: [:ctxt| ctxt selector == #primitiveRelinquishProcessor]) ifNil: + [self halt]. + (breakPCWasTrue := breakPC == true) ifTrue: + [breakPC := nil]. processor abiMarshalArg0: value in: objectMemory memory. ^[ | result | result := self simulateLeafCallOf: ceTryLockVMOwner. self assert: (result ~= 0) = (coInterpreter threadManager getVMOwner = value). result ~= 0] ensure: + [processor abiUnmarshal: 1. + breakPCWasTrue ifTrue: + [breakPC := true]]! - [processor abiUnmarshal: 1]! Item was added: + ----- Method: Cogit>>withProcessorHaltedDo: (in category 'simulation processor access') ----- + withProcessorHaltedDo: aBlock + ^processorLock critical: + [| oldBreakPC oldSingleStep | + oldBreakPC := breakPC. + oldSingleStep := singleStep. + breakPC := singleStep := true. + aBlock ensure: + [singleStep := oldSingleStep. + breakPC := oldBreakPC]]! Item was changed: ----- Method: StackInterpreterSimulator>>flush (in category 'debug printing') ----- flush + traceOn ifTrue: + [transcript flush. + "We *always* want to make output visible on flush" + TranscriptStream forceUpdate ifFalse: + [transcript changed: #appendEntry]]! - traceOn ifTrue: [transcript flush]! From noreply at github.com Mon Jan 4 07:56:48 2021 From: noreply at github.com (Nicolas Cellier) Date: Sun, 03 Jan 2021 23:56:48 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 61faab: Try and rescue macos libpng builds for Pharo Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 61faabba1f68c1b5ba6b161f8571020b0ce755ec https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/61faabba1f68c1b5ba6b161f8571020b0ce755ec Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M build.macos32x86/pharo.cog.spur.lowcode/Makefile M build.macos32x86/pharo.cog.spur.minheadless/Makefile M build.macos32x86/pharo.cog.spur/Makefile M build.macos32x86/pharo.cog.v3/Makefile M build.macos32x86/pharo.sista.spur/Makefile M build.macos32x86/pharo.stack.spur.lowcode/Makefile M build.macos32x86/pharo.stack.spur/Makefile M build.macos32x86/third-party/Makefile.libpng A build.macos32x86/third-party/Makefile.zlib M build.macos64x64/pharo.cog.spur.lowcode/Makefile M build.macos64x64/pharo.cog.spur/Makefile M build.macos64x64/pharo.sista.spur/Makefile M build.macos64x64/pharo.stack.spur.lowcode/Makefile M build.macos64x64/pharo.stack.spur/Makefile M build.macos64x64/squeak.stack.spur/Makefile M build.macos64x64/third-party/Makefile.cairo M build.macos64x64/third-party/Makefile.freetype2 M build.macos64x64/third-party/Makefile.libpng A build.macos64x64/third-party/Makefile.zlib M platforms/iOS/plugins/FT2Plugin/Makefile M third-party/libpng.spec M third-party/zlib.spec Log Message: ----------- Try and rescue macos libpng builds for Pharo On macosx, zlib is a pre-requisite of libpng, so it has to be compiled While at it, upgrade libpng to 1.16.37 due to CVE-2019-7317 - see http://www.libpng.org/pub/png/libpng.html Commit: afe4f5abdc7cc2e6a8a7ab2d74237f0b6e3a8326 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/afe4f5abdc7cc2e6a8a7ab2d74237f0b6e3a8326 Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M third-party/pixman.spec Log Message: ----------- also upgrade pixman to 0.40.0 This is required on macos because newer version of clang do not anymore provide a `__builtin_shuffle` Commit: 8c26fc240e4e50f3a84fb1d3e1ebb734802e0b48 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8c26fc240e4e50f3a84fb1d3e1ebb734802e0b48 Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M build.macos32x86/common/Makefile.lib.extra Log Message: ----------- And let 32 bits builds pollute their own cache (x86 rather than x86_64) Commit: 6c33c2bb3f54acf1f0d302349dcee2e82bb4122c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/6c33c2bb3f54acf1f0d302349dcee2e82bb4122c Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M third-party/cairo.spec Log Message: ----------- And also upgrade cairo to 1.15.14 Commit: 8eb93486803c5fcef43fa088c433a053eaa8515b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8eb93486803c5fcef43fa088c433a053eaa8515b Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M build.win32x86/third-party/Makefile.libpng M build.win64x64/third-party/Makefile.libpng R third-party/libpng.spec.win Log Message: ----------- Nuke win specific libpng.spec Commit: 3abac662759b8cd7bc54ea94b016da83b280b9bc https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3abac662759b8cd7bc54ea94b016da83b280b9bc Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: R third-party/pixman.clang.patch Log Message: ----------- Nuke pixman patch, the upgrade solved the thing Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/61faabba1f68%5E...3abac662759b From noreply at github.com Mon Jan 4 10:06:26 2021 From: noreply at github.com (Nicolas Cellier) Date: Mon, 04 Jan 2021 02:06:26 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d22281: Workaround zlib configure bug for 32bits macos Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d22281a16078ce42efca185db3520f87910359c4 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d22281a16078ce42efca185db3520f87910359c4 Author: Nicolas Cellier Date: 2021-01-04 (Mon, 04 Jan 2021) Changed paths: M build.macos32x86/third-party/Makefile.zlib Log Message: ----------- Workaround zlib configure bug for 32bits macos configure fails to apply $ARCHS flags to $SFLAGS (the compiler options for compiling shared library) It's a single line patch for configure, but rather than patching, just workaround by forcing CFLAGS and LDFLAGS. From no-reply at appveyor.com Mon Jan 4 11:03:01 2021 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 04 Jan 2021 11:03:01 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2337 Message-ID: <20210104110301.1.FDE90161BD205872@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Mon Jan 4 20:27:19 2021 From: noreply at github.com (Eliot Miranda) Date: Mon, 04 Jan 2021 12:27:19 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 8ee88b: More UNICODE support in the WIndows VM. Make sure... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 8ee88b28462a638573f0d23a33d9583a9ec35567 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8ee88b28462a638573f0d23a33d9583a9ec35567 Author: Eliot Miranda Date: 2021-01-04 (Mon, 04 Jan 2021) Changed paths: M build.win32x86/common/Makefile.msvc.tools M build.win64x64/common/Makefile.msvc.tools M platforms/win32/plugins/CameraPlugin/winCameraOps.cpp M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c M platforms/win32/plugins/SqueakSSL/sqWin32SSL.c M platforms/win32/vm/sqWin32.h M platforms/win32/vm/sqWin32ExternalPrims.c M platforms/win32/vm/sqWin32Main.c M platforms/win32/vm/sqWin32Prefs.c M platforms/win32/vm/sqWin32Utils.c Log Message: ----------- More UNICODE support in the WIndows VM. Make sure that the MessageBox warning code used in the FilePlugin is correctly interpreted. Define both UNICODE and _UNICODE in the MSVC Makefiles. Also use _UNICODE where the vm is processing strings. UNICODE is to be used for selecting between FooA and FooW API calls. _UNICODE is to be used for defining TCHAR et al From noreply at github.com Mon Jan 4 21:51:53 2021 From: noreply at github.com (Eliot Miranda) Date: Mon, 04 Jan 2021 13:51:53 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d445a5: Correct the comment for UNICODE & _UNICODE in the ... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d445a5f103f2242b33193d7ea5ac9dbe72944553 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d445a5f103f2242b33193d7ea5ac9dbe72944553 Author: Eliot Miranda Date: 2021-01-04 (Mon, 04 Jan 2021) Changed paths: M build.win32x86/common/Makefile.msvc.tools M build.win64x64/common/Makefile.msvc.tools Log Message: ----------- Correct the comment for UNICODE & _UNICODE in the MSVC Makefiles. [ci skip] From noreply at github.com Mon Jan 4 22:04:22 2021 From: noreply at github.com (Eliot Miranda) Date: Mon, 04 Jan 2021 14:04:22 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f4f840: Fix a slip in bulk register access code in the Boc... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f4f8403725ab008f73599ba5837195b293a762fb https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f4f8403725ab008f73599ba5837195b293a762fb Author: Eliot Miranda Date: 2021-01-04 (Mon, 04 Jan 2021) Changed paths: M platforms/Cross/plugins/BochsIA32Plugin/sqBochsIA32Plugin.cpp M platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp Log Message: ----------- Fix a slip in bulk register access code in the Bochs plugins. [ci skip] From noreply at github.com Tue Jan 5 00:22:44 2021 From: noreply at github.com (Nicolas Cellier) Date: Mon, 04 Jan 2021 16:22:44 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 05907a: SDL 2.0.14 & SSL 1.1.1i Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 05907a069ffbc3eee22cc9bddb3d8c3811197957 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/05907a069ffbc3eee22cc9bddb3d8c3811197957 Author: Nicolas Cellier Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M third-party/libsdl2.spec M third-party/openssl.spec M third-party/openssl.spec.win64 Log Message: ----------- SDL 2.0.14 & SSL 1.1.1i From eliot.miranda at gmail.com Tue Jan 5 04:01:54 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 4 Jan 2021 20:01:54 -0800 Subject: [Vm-dev] URL drop events on MacOS Message-ID: Hi All, I'm plumbing in support for launching the macos application via URL scheme drop events/apple events. I'm asking for review. I think the right way to go is to piggy back off of EventTypeDragDropFiles rather than add another kind of event. If so there's a fork in the road. Either use SQDragDrop (see sq.h) and dropRequestFileName and have dropRequestFileName answer a name prefixed with 'url:', or add e.g. SQDropUrl and add primitiveDropRequestURL/dropRequestURL to the DropPlugin. Opinions? _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnmci at smalltalkconsulting.com Tue Jan 5 05:42:58 2021 From: johnmci at smalltalkconsulting.com (John M McIntosh) Date: Tue, 05 Jan 2021 05:42:58 +0000 Subject: [Vm-dev] URL drop events on MacOS In-Reply-To: References: Message-ID: When we did Sophie we just passed every reference to an asset as a URL so a file: or a url: or a memoryFile: which was very handy to push a blob of data as a file or zip entity. The concrete class for streaming the URL would do the right thing. Sent from ProtonMail Mobile On Mon, Jan 4, 2021 at 20:01, Eliot Miranda wrote: > Hi All, > > I'm plumbing in support for launching the macos application via URL scheme drop events/apple events. I'm asking for review. I think the right way to go is to piggy back off of EventTypeDragDropFiles rather than add another kind of event. If so there's a fork in the road. Either use SQDragDrop (see sq.h) and dropRequestFileName and have dropRequestFileName answer a name prefixed with 'url:', or add e.g. SQDropUrl and add primitiveDropRequestURL/dropRequestURL to the DropPlugin. Opinions? > _,,,^..^,,,_ > best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Tue Jan 5 08:08:26 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 5 Jan 2021 09:08:26 +0100 Subject: [Vm-dev] some stupid failures Message-ID: Hi all, sometimes, some build fail for just 1 test... Here https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 a squeak.stack.v3 RenderBugz ✗ #testSetForward (7ms) TestFailure: Block evaluation took more than the expected 0:00:00:00.004 RenderBugz(TestCase)>>assert:description: RenderBugz(TestCase)>>should:notTakeMoreThan: RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: RenderBugz>>shouldntTakeLong: RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: 180.0 . self assert: ( t forwardDirection = 0.0 ) ] RenderBugz(TestCase)>>performTest 4ms, really? On C.I. infrastructure, anything can happen... Do we really want to keep this kind of test? We eventually could once startup performance is known (see isLowerPerformance discussion on squeak-dev), but in the interim, I suggest we neutralize this specific test in Smalltalk-CI. From marcel.taeumel at hpi.de Tue Jan 5 08:22:02 2021 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Tue, 5 Jan 2021 09:22:02 +0100 Subject: [Vm-dev] some stupid failures In-Reply-To: References: Message-ID: Hi Nicolas. > Do we really want to keep this kind of test? Such benchmarks (and benchmark-like tests) should at least average over several runs and only fail as a test if something actually got slower on average. Or something like that. A single misbehaving run should not be the reason for such a test failure. Maybe we can tweak #should:notTakeMoreThan: to evaluate the block several times? But then it cannot fail early on as it is doing now ... Hmmm... Best, Marcel Am 05.01.2021 09:08:46 schrieb Nicolas Cellier : Hi all, sometimes, some build fail for just 1 test... Here https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 a squeak.stack.v3 RenderBugz ✗ #testSetForward (7ms) TestFailure: Block evaluation took more than the expected 0:00:00:00.004 RenderBugz(TestCase)>>assert:description: RenderBugz(TestCase)>>should:notTakeMoreThan: RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: RenderBugz>>shouldntTakeLong: RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: 180.0 . self assert: ( t forwardDirection = 0.0 ) ] RenderBugz(TestCase)>>performTest 4ms, really? On C.I. infrastructure, anything can happen... Do we really want to keep this kind of test? We eventually could once startup performance is known (see isLowerPerformance discussion on squeak-dev), but in the interim, I suggest we neutralize this specific test in Smalltalk-CI. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Jan 5 16:55:49 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 5 Jan 2021 08:55:49 -0800 Subject: [Vm-dev] URL drop events on MacOS In-Reply-To: References: Message-ID: Hi John, > On Jan 4, 2021, at 9:43 PM, John M McIntosh wrote: > >  When we did Sophie we just passed every reference to an asset as a URL so a file: or a url: or a memoryFile: which was very handy to push a blob of data as a file or zip entity. The concrete class for streaming the URL would do the right thing. Good to know; thanks. That suggests to me I should add a primitiveDropRequestURL/dropRequestURL primitive to the DropPlugin and that that would answer results in url format, prepending file:// for files etc. primitiveDropRequestFile would remain for backwards compatibility. Make sense? > Sent from ProtonMail Mobile > > >> On Mon, Jan 4, 2021 at 20:01, Eliot Miranda wrote: >> Hi All, >> >> I'm plumbing in support for launching the macos application via URL scheme drop events/apple events. I'm asking for review. I think the right way to go is to piggy back off of EventTypeDragDropFiles rather than add another kind of event. If so there's a fork in the road. Either use SQDragDrop (see sq.h) and dropRequestFileName and have dropRequestFileName answer a name prefixed with 'url:', or add e.g. SQDropUrl and add primitiveDropRequestURL/dropRequestURL to the DropPlugin. Opinions? >> _,,,^..^,,,_ >> best, Eliot > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ron at usmedrec.com Tue Jan 5 16:58:46 2021 From: ron at usmedrec.com (Ron Teitelbaum) Date: Tue, 5 Jan 2021 11:58:46 -0500 Subject: [Vm-dev] [squeak-dev] some stupid failures In-Reply-To: References: Message-ID: Seems like more of a warning and not a failure. All the best, Ron Teitelbaum On Tue, Jan 5, 2021 at 3:22 AM Marcel Taeumel wrote: > Hi Nicolas. > > > Do we really want to keep this kind of test? > > Such benchmarks (and benchmark-like tests) should at least average over > several runs and only fail as a test if something actually got slower on > average. Or something like that. A single misbehaving run should not be the > reason for such a test failure. > > Maybe we can tweak #should:notTakeMoreThan: to evaluate the block several > times? But then it cannot fail early on as it is doing now ... Hmmm... > > Best, > Marcel > > Am 05.01.2021 09:08:46 schrieb Nicolas Cellier < > nicolas.cellier.aka.nice at gmail.com>: > > Hi all, > sometimes, some build fail for just 1 test... > > Here > https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 > a squeak.stack.v3 > > RenderBugz > ✗ #testSetForward (7ms) > TestFailure: Block evaluation took more than the expected 0:00:00:00.004 > RenderBugz(TestCase)>>assert:description: > RenderBugz(TestCase)>>should:notTakeMoreThan: > RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: > RenderBugz>>shouldntTakeLong: > RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: > 180.0 . > self assert: ( t forwardDirection = 0.0 ) ] > RenderBugz(TestCase)>>performTest > > 4ms, really? On C.I. infrastructure, anything can happen... > Do we really want to keep this kind of test? > We eventually could once startup performance is known (see > isLowerPerformance discussion on squeak-dev), but in the interim, I > suggest we neutralize this specific test in Smalltalk-CI. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnmci at smalltalkconsulting.com Tue Jan 5 17:06:45 2021 From: johnmci at smalltalkconsulting.com (John M McIntosh) Date: Tue, 05 Jan 2021 17:06:45 +0000 Subject: [Vm-dev] URL drop events on MacOS In-Reply-To: References: Message-ID: <7gN_dHT_-HQla4a66udNQ13LfxsP9869AwTk3tXropnOIuybilePqoLq3D0sc2QVAMSvfNZLb4CQWjvg1VgHvNVeXJccDhi5qx9vcnEydDk=@smalltalkconsulting.com> Yes Sent from ProtonMail Mobile On Tue, Jan 5, 2021 at 08:55, Eliot Miranda wrote: > Hi John, > >> On Jan 4, 2021, at 9:43 PM, John M McIntosh wrote: > >>  When we did Sophie we just passed every reference to an asset as a URL so a file: or a url: or a memoryFile: which was very handy to push a blob of data as a file or zip entity. The concrete class for streaming the URL would do the right thing. > > Good to know; thanks. That suggests to me I should add a primitiveDropRequestURL/dropRequestURL primitive to the DropPlugin and that that would answer results in url format, prepending file:// for files etc. primitiveDropRequestFile would remain for backwards compatibility. Make sense? > >> Sent from ProtonMail Mobile >> >> On Mon, Jan 4, 2021 at 20:01, Eliot Miranda wrote: >> >>> Hi All, >>> >>> I'm plumbing in support for launching the macos application via URL scheme drop events/apple events. I'm asking for review. I think the right way to go is to piggy back off of EventTypeDragDropFiles rather than add another kind of event. If so there's a fork in the road. Either use SQDragDrop (see sq.h) and dropRequestFileName and have dropRequestFileName answer a name prefixed with 'url:', or add e.g. SQDropUrl and add primitiveDropRequestURL/dropRequestURL to the DropPlugin. Opinions? >>> _,,,^..^,,,_ >>> best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Jan 5 20:16:45 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 5 Jan 2021 20:16:45 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2922.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2922.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2922 Author: eem Time: 5 January 2021, 12:16:35.656749 pm UUID: 5a9437e9-a27e-47db-972f-b2864c01bca9 Ancestors: VMMaker.oscog-eem.2921 DropPlugin: Add primitiveDropRequestURI to support launch apple events as drop events on MacOS. =============== Diff against VMMaker.oscog-eem.2921 =============== Item was changed: ----- Method: DropPlugin>>primitiveDropRequestFileHandle (in category 'primitives') ----- primitiveDropRequestFileHandle "Note: File handle creation needs to be handled by specific support code explicitly bypassing the plugin file sand box." - | dropIndex handleOop | + | dropIndex handleOop | + interpreterProxy methodArgumentCount = 1 ifFalse: + [^interpreterProxy primitiveFail]. - - interpreterProxy methodArgumentCount = 1 - ifFalse:[^interpreterProxy primitiveFail]. dropIndex := interpreterProxy stackIntegerValue: 0. + interpreterProxy failed ifFalse: + [handleOop := self dropRequestFileHandle: dropIndex. + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnValue: handleOop]]! - handleOop := self dropRequestFileHandle: dropIndex. - "dropRequestFileHandle needs to return the actual oop returned" - interpreterProxy failed ifFalse:[ - interpreterProxy pop: 2. - interpreterProxy push: handleOop. - ].! Item was changed: ----- Method: DropPlugin>>primitiveDropRequestFileName (in category 'primitives') ----- primitiveDropRequestFileName "Note: File handle creation needs to be handled by specific support code explicitly bypassing the plugin file sand box." - | dropIndex dropName nameLength nameOop namePtr | + | dropIndex | + interpreterProxy methodArgumentCount = 1 ifFalse: + [^interpreterProxy primitiveFail]. - - - - interpreterProxy methodArgumentCount = 1 - ifFalse:[^interpreterProxy primitiveFail]. dropIndex := interpreterProxy stackIntegerValue: 0. + "dropRequestFileName returns name or NULL on error; methodReturnString: fails for nil" + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnString: (self dropRequestFileName: dropIndex)]! - dropName := self dropRequestFileName: dropIndex. - "dropRequestFileName returns name or NULL on error" - dropName == nil - ifTrue:[^interpreterProxy primitiveFail]. - nameLength := self strlen: dropName. - nameOop := interpreterProxy instantiateClass: interpreterProxy classString indexableSize: nameLength. - namePtr := interpreterProxy firstIndexableField: nameOop. - 0 to: nameLength-1 do:[:i| namePtr at: i put: (dropName at: i)]. - interpreterProxy pop: 2. - interpreterProxy push: nameOop. - ! Item was added: + ----- Method: DropPlugin>>primitiveDropRequestURI (in category 'primitives') ----- + primitiveDropRequestURI + "On platforms that don't support URIs (currently Windows) the idea is to use primitiveDropRequestURI, + which will fail, and then fall back on primitiveDropRequestFileName." + + | dropIndex | + interpreterProxy methodArgumentCount = 1 ifFalse: + [^interpreterProxy primitiveFail]. + dropIndex := interpreterProxy stackIntegerValue: 0. + "dropRequestURI returns name or NULL on error; methodReturnString: fails for nil" + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnString: (self dropRequestURI: dropIndex)]! From commits at source.squeak.org Tue Jan 5 20:21:41 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 5 Jan 2021 20:21:41 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2923.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2923.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2923 Author: eem Time: 5 January 2021, 12:21:32.796514 pm UUID: 32f0b442-c9d6-4135-8ca0-2393e253109c Ancestors: VMMaker.oscog-eem.2922 Oops! Remember to nuke the unused setFileAccessCallback: =============== Diff against VMMaker.oscog-eem.2922 =============== Item was removed: - ----- Method: DropPlugin>>setFileAccessCallback: (in category 'primitives') ----- - setFileAccessCallback: address - - ^self sqSecFileAccessCallback: address asVoidPointer! From noreply at github.com Tue Jan 5 20:26:50 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 12:26:50 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] facfd9: CogVM source as per Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: facfd9012e9f95679dc054fde69c13d5d4b514ca https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/facfd9012e9f95679dc054fde69c13d5d4b514ca Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/Cross/plugins/DropPlugin/DropPlugin.h M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c M platforms/unix/vm-display-X11/sqUnixXdnd.c M platforms/win32/plugins/DropPlugin/sqWin32Drop.c M src/plugins/DropPlugin/DropPlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2923 DropPlugin: Add primitiveDropRequestURI to support launch apple events as drop events on MacOS. Nuke the unused setFileAccessCallback:. Delete unused functions from DropPlugin.h and implementors. Currently the only full implememntation (unu=tested) is on X11/Unix. The Mac implementation is skeletal; it should be filled in real soon now. From no-reply at appveyor.com Tue Jan 5 21:04:31 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 05 Jan 2021 21:04:31 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2341 Message-ID: <20210105210431.1.7417B1A19014E351@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 5 21:04:45 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 13:04:45 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 3c8674: Fix slip in platforms/win32/plugins/SoundPlugin/s... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 3c86748664c35905f35a89d8e201b364520d4c7c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3c86748664c35905f35a89d8e201b364520d4c7c Author: Eliot Miranda Date: 2020-12-30 (Wed, 30 Dec 2020) Changed paths: M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c Log Message: ----------- Fix slip in platforms/win32/plugins/SoundPlugin/sqWin32Sound.c Commit: d2d98d47ff11a6637f6f48c10e27159c96561612 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d2d98d47ff11a6637f6f48c10e27159c96561612 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M build.win32x86/common/Makefile.msvc.tools M build.win64x64/common/Makefile.msvc.tools M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M platforms/Cross/plugins/BochsIA32Plugin/sqBochsIA32Plugin.cpp M platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp M platforms/Cross/plugins/DropPlugin/DropPlugin.h M platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c M platforms/unix/vm-display-X11/sqUnixXdnd.c M platforms/unix/vm/sqUnixMain.c M platforms/win32/plugins/CameraPlugin/winCameraOps.cpp M platforms/win32/plugins/DropPlugin/sqWin32Drop.c M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c M platforms/win32/plugins/SqueakSSL/sqWin32SSL.c M platforms/win32/vm/sqWin32.h M platforms/win32/vm/sqWin32ExternalPrims.c M platforms/win32/vm/sqWin32Main.c M platforms/win32/vm/sqWin32Prefs.c M platforms/win32/vm/sqWin32Utils.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M src/plugins/DropPlugin/DropPlugin.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 M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- Merge branch 'Cog' of https://github.com/OpenSmalltalk/opensmalltalk-vm into Cog Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/facfd9012e9f...d2d98d47ff11 From eliot.miranda at gmail.com Tue Jan 5 21:07:35 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 5 Jan 2021 13:07:35 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 3c8674: Fix slip in platforms/win32/plugins/SoundPlugin/s... In-Reply-To: References: Message-ID: Ugh, sorry Nicolas, I didn't mean to squash your commit. I meant to squash mine. I had fixed the same issue as you had with that macro but forgot to push. To day I got my merge wrong. So apologies if this seems like some passive aggressive bullshit. It's actually git incompetence on my part. On Tue, Jan 5, 2021 at 1:04 PM Eliot Miranda wrote: > > Branch: refs/heads/Cog > Home: https://github.com/OpenSmalltalk/opensmalltalk-vm > Commit: 3c86748664c35905f35a89d8e201b364520d4c7c > > https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3c86748664c35905f35a89d8e201b364520d4c7c > Author: Eliot Miranda > Date: 2020-12-30 (Wed, 30 Dec 2020) > > Changed paths: > M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c > > Log Message: > ----------- > Fix slip in platforms/win32/plugins/SoundPlugin/sqWin32Sound.c > > > Commit: d2d98d47ff11a6637f6f48c10e27159c96561612 > > https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d2d98d47ff11a6637f6f48c10e27159c96561612 > Author: Eliot Miranda > Date: 2021-01-05 (Tue, 05 Jan 2021) > > Changed paths: > M build.win32x86/common/Makefile.msvc.tools > M build.win64x64/common/Makefile.msvc.tools > M nsspur64src/vm/cogit.h > M nsspur64src/vm/cogitARMv8.c > M nsspur64src/vm/cogitX64SysV.c > M nsspur64src/vm/cogitX64WIN64.c > M nsspursrc/vm/cogit.h > M nsspursrc/vm/cogitARMv5.c > M nsspursrc/vm/cogitIA32.c > M nsspursrc/vm/cogitMIPSEL.c > M platforms/Cross/plugins/BochsIA32Plugin/sqBochsIA32Plugin.cpp > M platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp > M platforms/Cross/plugins/DropPlugin/DropPlugin.h > M platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c > M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m > M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m > M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m > M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c > M platforms/unix/vm-display-X11/sqUnixXdnd.c > M platforms/unix/vm/sqUnixMain.c > M platforms/win32/plugins/CameraPlugin/winCameraOps.cpp > M platforms/win32/plugins/DropPlugin/sqWin32Drop.c > M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c > M platforms/win32/plugins/SqueakSSL/sqWin32SSL.c > M platforms/win32/vm/sqWin32.h > M platforms/win32/vm/sqWin32ExternalPrims.c > M platforms/win32/vm/sqWin32Main.c > M platforms/win32/vm/sqWin32Prefs.c > M platforms/win32/vm/sqWin32Utils.c > M spur64src/vm/cogit.h > M spur64src/vm/cogitARMv8.c > M spur64src/vm/cogitX64SysV.c > M spur64src/vm/cogitX64WIN64.c > M spurlowcode64src/vm/cogit.h > M spurlowcode64src/vm/cogitARMv8.c > M spurlowcode64src/vm/cogitX64SysV.c > M spurlowcode64src/vm/cogitX64WIN64.c > M spurlowcodesrc/vm/cogit.h > M spurlowcodesrc/vm/cogitARMv5.c > M spurlowcodesrc/vm/cogitIA32.c > M spurlowcodesrc/vm/cogitMIPSEL.c > M spursista64src/vm/cogit.h > M spursista64src/vm/cogitARMv8.c > M spursista64src/vm/cogitX64SysV.c > M spursista64src/vm/cogitX64WIN64.c > M spursistasrc/vm/cogit.h > M spursistasrc/vm/cogitARMv5.c > M spursistasrc/vm/cogitIA32.c > M spursistasrc/vm/cogitMIPSEL.c > M spursrc/vm/cogit.h > M spursrc/vm/cogitARMv5.c > M spursrc/vm/cogitIA32.c > M spursrc/vm/cogitMIPSEL.c > M src/plugins/DropPlugin/DropPlugin.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 > M stacksrc/vm/gcc3x-interp.c > M stacksrc/vm/interp.c > > Log Message: > ----------- > Merge branch 'Cog' of https://github.com/OpenSmalltalk/opensmalltalk-vm > into Cog > > > Compare: > https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/facfd9012e9f...d2d98d47ff11 > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Jan 5 21:44:19 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 05 Jan 2021 21:44:19 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2342 Message-ID: <20210105214419.1.506E4130F7FAC2FD@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 5 21:44:51 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 13:44:51 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] e3ddd1: Fix slip in sqUnixDragDrop.c Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: e3ddd155fc2c48c038edd66c87f66d70a4963d75 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e3ddd155fc2c48c038edd66c87f66d70a4963d75 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c Log Message: ----------- Fix slip in sqUnixDragDrop.c From noreply at github.com Tue Jan 5 22:19:37 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 14:19:37 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 622ec5: Move the internal function declarations from sqVir... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 622ec5509d23ddda3a5387833254ebc145744ba9 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/622ec5509d23ddda3a5387833254ebc145744ba9 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/Cross/vm/sqVirtualMachine.c M platforms/Cross/vm/sqVirtualMachine.h M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c M platforms/unix/vm-display-X11/sqUnixXdnd.c Log Message: ----------- Move the internal function declarations from sqVirtualMachine.c to sqVirtualMachine.h for the benefit of internal plugin code, such as sqUnixDragDrop.c which crashes in 64-bits if instantiateClassindexableSize is declared implciitly. A little bit more cleanup in the Unix d-n-d code. From no-reply at appveyor.com Tue Jan 5 22:22:49 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 05 Jan 2021 22:22:49 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2343 Message-ID: <20210105222249.1.544CDC46EA01BD2E@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 5 22:49:42 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 14:49:42 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a9c648: The changes to sqVirtualMachine.h need to be keyed... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a9c64821a0fae276f1236e87f0e5ee8785ab6f81 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a9c64821a0fae276f1236e87f0e5ee8785ab6f81 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/Cross/vm/sqVirtualMachine.h Log Message: ----------- The changes to sqVirtualMachine.h need to be keyed off of SQUEAK_BUILTIN_PLUGIN, and the interpereters must be insulated from them. From no-reply at appveyor.com Tue Jan 5 23:00:16 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 05 Jan 2021 23:00:16 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2344 Message-ID: <20210105230016.1.40CE78D3AC4FC1CD@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 5 23:07:33 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 05 Jan 2021 15:07:33 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] e38f6a: Also update version of libpng, pixman and cairo in... Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: e38f6acf530b774cced4fbda2c5f701e8e8493fd https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e38f6acf530b774cced4fbda2c5f701e8e8493fd Author: Nicolas Cellier Date: 2021-01-06 (Wed, 06 Jan 2021) Changed paths: M cmake/Cairo.cmake M cmake/FreeType2.cmake M cmake/LibGit2.cmake M cmake/LibPNG.cmake M cmake/LibSSH2.cmake M cmake/Pixman.cmake M cmake/PkgConfig.cmake M cmake/SDL2.cmake M cmake/ThirdPartyDependenciesMacros.cmake Log Message: ----------- Also update version of libpng, pixman and cairo in cmake builds There is no reason why cmake should use a different version. Use whatever hash is given by hosting sites, this is not necessarily SHA256. Change the ThirdPartyDependenciesMacros accordingly. From commits at source.squeak.org Tue Jan 5 23:27:25 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 5 Jan 2021 23:27:25 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2924.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2924.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2924 Author: eem Time: 5 January 2021, 3:27:15.634114 pm UUID: 2e0ffedf-ac42-4dd1-9c66-e74498b366cc Ancestors: VMMaker.oscog-eem.2923 OIbserve stricter type compatibility now that sqVirtualMachine.h's definitions are visible to internal plugins. =============== Diff against VMMaker.oscog-eem.2923 =============== Item was changed: ----- Method: InterpreterProxy>>fullGC (in category 'other') ----- fullGC + - Smalltalk garbageCollect! Item was changed: ----- Method: InterpreterProxy>>ioLoadSymbol:OfLength:FromModule: (in category 'FFI support') ----- ioLoadSymbol: functionNameIndex OfLength: functionLength FromModule: moduleHandle + "Dummy - provided by support code" ^0! From noreply at github.com Tue Jan 5 23:32:07 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 15:32:07 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 2578ce: CogVM source as per VMMaker.oscog-eem.2924 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 2578ce3956ceed79b7dbfeebd76c7eb12a845f8e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2578ce3956ceed79b7dbfeebd76c7eb12a845f8e Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/Cross/vm/sqVirtualMachine.c M platforms/Cross/vm/sqVirtualMachine.h M src/plugins/FilePlugin/FilePlugin.c M src/plugins/IA32ABI/IA32ABI.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2924 Observe stricter type compatibility now that sqVirtualMachine.h's definitions are visible to internal plugins. From no-reply at appveyor.com Tue Jan 5 23:36:10 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 05 Jan 2021 23:36:10 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2345 Message-ID: <20210105233610.1.93B8F989A56DDD34@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Jan 6 00:07:59 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 6 Jan 2021 00:07:59 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2925.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2925.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2925 Author: eem Time: 5 January 2021, 4:07:48.282359 pm UUID: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96 Ancestors: VMMaker.oscog-eem.2924 Cogit: More cleanup given that sqVirtualMachine.h reveals the direct interpreter API to SQUEAK_BUILTIN_PLUGIN which is alas defined for cogit.c. Hence the conflicts between sqVirtualMachine.h and cointerp.h force us to not include sq.h in cogit.c. Maybe this is worse than the disease of sqVirtualMachine.h's API being inaccurate. But ione step at a time. MTVM: Smilaiton time recording of instructions in tryLockVMOwnerTo: while debugging x86_64's implementation. =============== Diff against VMMaker.oscog-eem.2924 =============== Item was changed: ----- Method: CCodeGenerator>>emitCHeaderOn: (in category 'C code generator') ----- emitCHeaderOn: aStream "Emit the initial part of a source file on aStream, comprising the version stamp, the global struct usage flags, the header files and preamble code." | headerClass | headerClass := [vmClass coreInterpreterClass] on: MessageNotUnderstood do: [:ex| vmClass]. aStream nextPutAll: (self fileHeaderVersionStampForSourceClass: headerClass); cr; cr. self emitGlobalStructFlagOn: aStream. + (vmClass isNil or: [vmClass wantsSqDotH]) ifTrue: + [self addHeaderFileFirst: '"sq.h"']. - self addHeaderFileFirst: '"sq.h"'. "Additional header files; include C library ones first." self emitHeaderFiles: (headerFiles select: [:hdr| hdr includes: $<]) on: aStream. "Additional header files; include squeak VM ones last" self emitHeaderFiles: (headerFiles reject: [:hdr| hdr includes: $<]) on: aStream. self maybePutPreambleFor: vmClass on: aStream. aStream cr! Item was changed: ----- Method: CoInterpreter>>interpret (in category 'interpreter shell') ----- interpret "This is the main interpreter loop. In a pure interpreter it loops forever, fetching and executing bytecodes. With the Cogit JIT executing code as well, the interpreter is reentered from machine code whenever the machine code wants to interpret a method instead of executing its machine code. Entry into the interpreter is done via a ''jump call'' in machine code that uses CFramePointer and CStackPointer to find the base of the C stack (set in CoInterpreter>> enterSmalltalkExecutiveImplementation) and substitutes CReturnAddress as the return address in the code so it always appears that interpret has been called from CoInterpreter>>enterSmalltalkExecutiveImplementation, which may be important to, for example, C exception handling inside the VM. When running in the context of a browser plugin VM the interpreter 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." + "If stacklimit is zero then the stack pages have not been initialized." stackLimit = 0 ifTrue: [^self initStackPagesAndInterpret]. "An unchecked write is probably faster, so instead of CReturnAddress ifNil: [CReturnAddress := self cCoerceSimple: self getReturnAddress to: #usqIntptr_t] we have simply" self assert: (CReturnAddress isNil or: [CReturnAddress = (self cCoerceSimple: self getReturnAddress to: #usqIntptr_t)]). CReturnAddress := self cCoerceSimple: self getReturnAddress to: #usqIntptr_t. self useCogitBreakBlockIfNone. "record entry time when running as a browser plug-in" self browserPluginInitialiseIfNeeded. self setMethod: (self iframeMethod: framePointer). self deny: instructionPointer = cogit ceReturnToInterpreterPC. self assertValidExecutionPointe: instructionPointer r: framePointer s: stackPointer imbar: true line: #'__LINE__'. self internalizeIPandSP. self initExtensions. self fetchNextBytecode. [true] whileTrue: [self aboutToDispatchBytecode. self dispatchOn: currentBytecode in: BytecodeTable]. localIP := localIP - 1. "undo the pre-increment of IP before returning" self externalizeIPandSP. ^nil! Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" + "N.B. We *do not* include sq.h; it pulls in conflicting definitions now that sqVirtualMachine.h + declares cointerp's functions, and declares some of them inaccurately for histrical reasons. + We pull in CoInterpreter's api via cointerp.h which is accurate." aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" + addHeaderFile:'"sqConfig.h"'; + addHeaderFile:'"sqMemoryAccess.h"'; addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner declareC: '#if COGMTVM\usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t)\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! Item was added: + ----- Method: Cogit class>>wantsSqDotH (in category 'translation') ----- + wantsSqDotH + ^false! Item was added: + ----- Method: Cogit>>null (in category 'translation') ----- + null + "This is needed since Cogits do not include sq.h." + + ^nil! Item was added: + ----- Method: Cogit>>reportInstructions: (in category 'debugging') ----- + reportInstructions: instructions + + | skipNext printInst | + skipNext := false. + printInst := [:inst| + coInterpreter transcript nextPutAll: + (EagerInstructionDecoration + ifTrue: [inst] + ifFalse: [processor + decorateDisassembly: inst + for: self + fromAddress: ((inst at: 3) = $r + ifTrue: [Integer readFrom: inst readStream] + ifFalse: [Integer readFrom: inst readStream base: 16])]); cr]. + instructions withIndexDo: + [:thing :idx| + skipNext + ifTrue: [skipNext := false] + ifFalse: + [thing isString + ifFalse: + [thing first isString "i.e. { '(simulated return to '. processor retpcIn: coInterpreter memory. ')'}" + ifTrue: + [thing do: + [:stringOrNumber| + coInterpreter transcript nextPutAll: (stringOrNumber isString + ifTrue: [stringOrNumber] + ifFalse: [stringOrNumber hex])]. + coInterpreter transcript cr] + ifFalse: "if possible, add the label to the instruction line to condense the output" + [coInterpreter transcript cr. + (thing at: processor registerStatePCIndex ifAbsent: []) ifNotNil: + [:pc| | next label | + label := self relativeLabelForPC: pc. + ((next := instructions at: idx + 1 ifAbsent: []) notNil + and: [next isString + and: [(Integer readFrom: next readStream radix: 16) = pc]]) + ifTrue: "Decorate instruction and eliminate pc line" + [skipNext := true. + processor printRegisterStateExceptPC: thing on: coInterpreter transcript. + label ifNotNil: [coInterpreter transcript nextPutAll: label; space]. + printInst value: next] + ifFalse: + [label ifNotNil: [coInterpreter transcript nextPutAll: label; nextPut: $:; cr]. + processor printRegisterState: thing on: coInterpreter transcript]]]] + ifTrue: + [printInst value: thing]]]. + coInterpreter transcript flush! Item was changed: ----- Method: Cogit>>reportLastNInstructions (in category 'debugging') ----- reportLastNInstructions + self reportInstructions: lastNInstructions! - | skipNext printInst | - skipNext := false. - printInst := [:inst| - coInterpreter transcript nextPutAll: - (EagerInstructionDecoration - ifTrue: [inst] - ifFalse: [processor - decorateDisassembly: inst - for: self - fromAddress: ((inst at: 3) = $r - ifTrue: [Integer readFrom: inst readStream] - ifFalse: [Integer readFrom: inst readStream base: 16])]); cr]. - lastNInstructions withIndexDo: - [:thing :idx| - skipNext - ifTrue: [skipNext := false] - ifFalse: - [thing isString - ifFalse: - [thing first isString "i.e. { '(simulated return to '. processor retpcIn: coInterpreter memory. ')'}" - ifTrue: - [thing do: - [:stringOrNumber| - coInterpreter transcript nextPutAll: (stringOrNumber isString - ifTrue: [stringOrNumber] - ifFalse: [stringOrNumber hex])]. - coInterpreter transcript cr] - ifFalse: "if possible, add the label to the instruction line to condense the output" - [coInterpreter transcript cr. - (thing at: processor registerStatePCIndex ifAbsent: []) ifNotNil: - [:pc| | next label | - label := self relativeLabelForPC: pc. - ((next := lastNInstructions at: idx + 1 ifAbsent: []) notNil - and: [next isString - and: [(Integer readFrom: next readStream radix: 16) = pc]]) - ifTrue: "Decorate instruction and eliminate pc line" - [skipNext := true. - processor printRegisterStateExceptPC: thing on: coInterpreter transcript. - label ifNotNil: [coInterpreter transcript nextPutAll: label; space]. - printInst value: next] - ifFalse: - [label ifNotNil: [coInterpreter transcript nextPutAll: label; nextPut: $:; cr]. - processor printRegisterState: thing on: coInterpreter transcript]]]] - ifTrue: - [printInst value: thing]]]. - coInterpreter transcript flush! Item was changed: ----- Method: Cogit>>tryLockVMOwnerTo: (in category 'multi-threading') ----- tryLockVMOwnerTo: value "ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner variable with zero and the argument, setting vmOwner to value if it was zero. It answers if the lock was zero and hence was acquired. See CogThreadManager>>#tryLockVMOwnerTo: for the simulation of processor thread switching which surrounds this method." | breakPCWasTrue | + "(thisContext findContextSuchThat: [:ctxt| ctxt selector == #primitiveRelinquishProcessor]) ifNil: + [self halt]." - (thisContext findContextSuchThat: [:ctxt| ctxt selector == #primitiveRelinquishProcessor]) ifNil: - [self halt]. (breakPCWasTrue := breakPC == true) ifTrue: [breakPC := nil]. processor abiMarshalArg0: value in: objectMemory memory. + ^[ | result instructions | + lastNInstructions removeAll. - ^[ | result | result := self simulateLeafCallOf: ceTryLockVMOwner. + instructions := lastNInstructions copy. self assert: (result ~= 0) = (coInterpreter threadManager getVMOwner = value). result ~= 0] ensure: [processor abiUnmarshal: 1. breakPCWasTrue ifTrue: [breakPC := true]]! Item was added: + ----- Method: VMClass class>>wantsSqDotH (in category 'translation') ----- + wantsSqDotH + ^true! From noreply at github.com Wed Jan 6 00:20:22 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 16:20:22 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 54673c: CogVM source as per VMMaker.oscog-eem.2925 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 54673c80163c6be40f7a269ff1346ed7f689ebb5 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/54673c80163c6be40f7a269ff1346ed7f689ebb5 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) 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 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/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/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/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/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/ckformat.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 M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2925 Cogit: More cleanup given that sqVirtualMachine.h reveals the direct interpreter API to SQUEAK_BUILTIN_PLUGIN which is alas defined for cogit.c. Hence the conflicts between sqVirtualMachine.h and cointerp.h force us to not include sq.h in cogit.c. Maybe this is worse than the disease of sqVirtualMachine.h's API being inaccurate. But one step at a time. From noreply at github.com Wed Jan 6 00:43:36 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 16:43:36 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] eb4a89: sqUnixDragDrop.c needs sqAssert.h. ollow Ronie's ... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: eb4a89d2871f9f8c4d31b246a3c02924d2166442 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/eb4a89d2871f9f8c4d31b246a3c02924d2166442 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c M platforms/unix/vm/sqUnixVMProfile.c Log Message: ----------- sqUnixDragDrop.c needs sqAssert.h. ollow Ronie's lead in dealing with sched.h's definition of clone., which conflicts with the interpreter's. From noreply at github.com Wed Jan 6 00:45:10 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 05 Jan 2021 16:45:10 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 49df9d: Oops; we don't need to fix the issue twice [ci skip] Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 49df9d221c2feeb70a0ac846b48f3b3eab7320a1 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/49df9d221c2feeb70a0ac846b48f3b3eab7320a1 Author: Eliot Miranda Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M platforms/unix/vm/sqUnixVMProfile.c Log Message: ----------- Oops; we don't need to fix the issue twice [ci skip] From no-reply at appveyor.com Wed Jan 6 02:22:13 2021 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 06 Jan 2021 02:22:13 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2346 Message-ID: <20210106022213.1.90C3EB946B6C5B9A@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Jan 6 02:27:16 2021 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 06 Jan 2021 02:27:16 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2347 Message-ID: <20210106022716.1.3BB93073D02CF0C7@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Jan 6 02:32:18 2021 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 06 Jan 2021 02:32:18 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2348 Message-ID: <20210106023218.1.AA918961B69726C8@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Jan 6 02:37:21 2021 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 06 Jan 2021 02:37:21 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2349 Message-ID: <20210106023721.1.BC03BF903493BBCE@appveyor.com> An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Wed Jan 6 02:54:29 2021 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Tue, 5 Jan 2021 18:54:29 -0800 Subject: [Vm-dev] Multiple Keydown and up Message-ID: Hi, Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. https://youtu.be/N9q8DxYWAik It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight? Thank you! -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Jan 6 05:22:58 2021 From: tim at rowledge.org (tim Rowledge) Date: Tue, 5 Jan 2021 21:22:58 -0800 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: References: Message-ID: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > Hi, > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > https://youtu.be/N9q8DxYWAik > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? In experiments updating to a 5.3 image I notice that the keyboard listener I wroet way back when no longer seems to work as well. I do recall Marcel doing work in that general area and changing how events are dealt with; I'm guessing it will be related. Scratch expects to see a state for each key, rather than handle events - in *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not accurately track the key events will mess up some things. Or indeed, if I made any mistakes or failed to catch every possible case, which must be possible. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: KFP: Kindle Fire in Printer From nicolas.cellier.aka.nice at gmail.com Wed Jan 6 08:20:41 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Wed, 6 Jan 2021 09:20:41 +0100 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 3c8674: Fix slip in platforms/win32/plugins/SoundPlugin/s... In-Reply-To: References: Message-ID: Hi Eliot, no problem, I stepped on your feet with this quick fix for the sake of maintaining the builds green, I don't want to slow down your work. Le mar. 5 janv. 2021 à 22:07, Eliot Miranda a écrit : > > > Ugh, sorry Nicolas, I didn't mean to squash your commit. I meant to squash mine. I had fixed the same issue as you had with that macro but forgot to push. To day I got my merge wrong. So apologies if this seems like some passive aggressive bullshit. It's actually git incompetence on my part. > > On Tue, Jan 5, 2021 at 1:04 PM Eliot Miranda wrote: >> >> >> Branch: refs/heads/Cog >> Home: https://github.com/OpenSmalltalk/opensmalltalk-vm >> Commit: 3c86748664c35905f35a89d8e201b364520d4c7c >> https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3c86748664c35905f35a89d8e201b364520d4c7c >> Author: Eliot Miranda >> Date: 2020-12-30 (Wed, 30 Dec 2020) >> >> Changed paths: >> M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c >> >> Log Message: >> ----------- >> Fix slip in platforms/win32/plugins/SoundPlugin/sqWin32Sound.c >> >> >> Commit: d2d98d47ff11a6637f6f48c10e27159c96561612 >> https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d2d98d47ff11a6637f6f48c10e27159c96561612 >> Author: Eliot Miranda >> Date: 2021-01-05 (Tue, 05 Jan 2021) >> >> Changed paths: >> M build.win32x86/common/Makefile.msvc.tools >> M build.win64x64/common/Makefile.msvc.tools >> M nsspur64src/vm/cogit.h >> M nsspur64src/vm/cogitARMv8.c >> M nsspur64src/vm/cogitX64SysV.c >> M nsspur64src/vm/cogitX64WIN64.c >> M nsspursrc/vm/cogit.h >> M nsspursrc/vm/cogitARMv5.c >> M nsspursrc/vm/cogitIA32.c >> M nsspursrc/vm/cogitMIPSEL.c >> M platforms/Cross/plugins/BochsIA32Plugin/sqBochsIA32Plugin.cpp >> M platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp >> M platforms/Cross/plugins/DropPlugin/DropPlugin.h >> M platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c >> M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m >> M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m >> M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m >> M platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c >> M platforms/unix/vm-display-X11/sqUnixXdnd.c >> M platforms/unix/vm/sqUnixMain.c >> M platforms/win32/plugins/CameraPlugin/winCameraOps.cpp >> M platforms/win32/plugins/DropPlugin/sqWin32Drop.c >> M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c >> M platforms/win32/plugins/SqueakSSL/sqWin32SSL.c >> M platforms/win32/vm/sqWin32.h >> M platforms/win32/vm/sqWin32ExternalPrims.c >> M platforms/win32/vm/sqWin32Main.c >> M platforms/win32/vm/sqWin32Prefs.c >> M platforms/win32/vm/sqWin32Utils.c >> M spur64src/vm/cogit.h >> M spur64src/vm/cogitARMv8.c >> M spur64src/vm/cogitX64SysV.c >> M spur64src/vm/cogitX64WIN64.c >> M spurlowcode64src/vm/cogit.h >> M spurlowcode64src/vm/cogitARMv8.c >> M spurlowcode64src/vm/cogitX64SysV.c >> M spurlowcode64src/vm/cogitX64WIN64.c >> M spurlowcodesrc/vm/cogit.h >> M spurlowcodesrc/vm/cogitARMv5.c >> M spurlowcodesrc/vm/cogitIA32.c >> M spurlowcodesrc/vm/cogitMIPSEL.c >> M spursista64src/vm/cogit.h >> M spursista64src/vm/cogitARMv8.c >> M spursista64src/vm/cogitX64SysV.c >> M spursista64src/vm/cogitX64WIN64.c >> M spursistasrc/vm/cogit.h >> M spursistasrc/vm/cogitARMv5.c >> M spursistasrc/vm/cogitIA32.c >> M spursistasrc/vm/cogitMIPSEL.c >> M spursrc/vm/cogit.h >> M spursrc/vm/cogitARMv5.c >> M spursrc/vm/cogitIA32.c >> M spursrc/vm/cogitMIPSEL.c >> M src/plugins/DropPlugin/DropPlugin.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 >> M stacksrc/vm/gcc3x-interp.c >> M stacksrc/vm/interp.c >> >> Log Message: >> ----------- >> Merge branch 'Cog' of https://github.com/OpenSmalltalk/opensmalltalk-vm into Cog >> >> >> Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/facfd9012e9f...d2d98d47ff11 > > > > -- > _,,,^..^,,,_ > best, Eliot From JuanVuletich at zoho.com Wed Jan 6 19:43:46 2021 From: JuanVuletich at zoho.com (Juan Vuletich) Date: Wed, 06 Jan 2021 16:43:46 -0300 Subject: [Vm-dev] Online event: VectorGraphics and Morphic in Cuis Message-ID: <5FF612F2.9050401@zoho.com> Hi Folks. This Friday I’ll be showing Vector Graphics in Cuis-Smalltalk. See https://www.meetup.com/es/BA-Smalltalk/events/275419570 . I'll go through the examples in chapter seven of https://github.com/Cuis-Smalltalk/TheCuisBook , and explain the ideas and the programming style. If there is interest, we can also get into implementation strategies and https://www.researchgate.net/publication/267152327_Prefiltering_Antialiasing_for_General_Vector_Graphics . It will be an online event via Zoom. There will be time for q&a and discussion. You are all invited! -- Juan Vuletich www.cuis-smalltalk.org https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev https://github.com/jvuletich https://www.linkedin.com/in/juan-vuletich-75611b3 @JuanVuletich From lewis at mail.msen.com Wed Jan 6 21:27:45 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 6 Jan 2021 16:27:45 -0500 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> References: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> Message-ID: <20210106212745.GA51105@shell.msen.com> On Tue, Jan 05, 2021 at 09:22:58PM -0800, tim Rowledge wrote: > > > > > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > > > Hi, > > > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > > > https://youtu.be/N9q8DxYWAik > > > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ > > It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? > > In experiments updating to a 5.3 image I notice that the keyboard listener > I wroet way back when no longer seems to work as well. I do recall Marcel > doing work in that general area and changing how events are dealt with; > I'm guessing it will be related. > > Scratch expects to see a state for each key, rather than handle events - in > *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not > accurately track the key events will mess up some things. Or indeed, if I > made any mistakes or failed to catch every possible case, which must be > possible. > I'm sorry I cannot provide a reference, but I think that I recall some discussion of this in earlier years. It may be that this was caused by a limitation related to X11 key event delivery in the Unix VM. Possibly there is some discussion in the vm-dev archives. That's all I remember and it might be wrong. Dave From lewis at mail.msen.com Wed Jan 6 21:38:51 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Wed, 6 Jan 2021 16:38:51 -0500 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: <20210106212745.GA51105@shell.msen.com> References: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> <20210106212745.GA51105@shell.msen.com> Message-ID: <20210106213851.GA53518@shell.msen.com> On Wed, Jan 06, 2021 at 04:27:45PM -0500, David T. Lewis wrote: > > On Tue, Jan 05, 2021 at 09:22:58PM -0800, tim Rowledge wrote: > > > > > > > > > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > > > > > Hi, > > > > > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > > > > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > > > > > https://youtu.be/N9q8DxYWAik > > > > > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ > > > > It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? > > > > In experiments updating to a 5.3 image I notice that the keyboard listener > > I wroet way back when no longer seems to work as well. I do recall Marcel > > doing work in that general area and changing how events are dealt with; > > I'm guessing it will be related. > > > > Scratch expects to see a state for each key, rather than handle events - in > > *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not > > accurately track the key events will mess up some things. Or indeed, if I > > made any mistakes or failed to catch every possible case, which must be > > possible. > > > > I'm sorry I cannot provide a reference, but I think that I recall some > discussion of this in earlier years. It may be that this was caused by > a limitation related to X11 key event delivery in the Unix VM. Possibly > there is some discussion in the vm-dev archives. That's all I remember > and it might be wrong. > Ugh, so as soon as I hit I think of looking in the old Mantis issue tracker. Here is the issue that I was remembering: http://bugs.squeak.org/view.php?id=7597 So it was a Unix VM bug that apparently got fixed in Cog. I am not sure if this is same problem that we see today, but if so perhaps it is a regression. Note that the Mantis bug report includes HandMorph-handleEvent.st from Matthew Fulmer that might be helpful in debugging the problem today. Dave From noreply at github.com Wed Jan 6 23:16:26 2021 From: noreply at github.com (Nicolas Cellier) Date: Wed, 06 Jan 2021 15:16:26 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 836cba: upgrade to SDL 2.10.4 in cmake builds too Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 836cba12034fc762b88312723023c60866e10d74 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/836cba12034fc762b88312723023c60866e10d74 Author: Nicolas Cellier Date: 2021-01-06 (Wed, 06 Jan 2021) Changed paths: M cmake/SDL2.cmake Log Message: ----------- upgrade to SDL 2.10.4 in cmake builds too Commit: 07aad2fbc11587faf5f93d0594da15bab12fcf5e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/07aad2fbc11587faf5f93d0594da15bab12fcf5e Author: Nicolas Cellier Date: 2021-01-06 (Wed, 06 Jan 2021) Changed paths: M build.win32x86/third-party/Makefile.freetype2 M build.win64x64/third-party/Makefile.freetype2 M cmake/FreeType2.cmake M third-party/freetype2.spec R third-party/freetype291.patch Log Message: ----------- Ugrade freetype 2.9.1 -> 2.10.4 hence - remove the now useless patch - rebuild the win64 dll (same makefile as win32) rather than download from files.pharo.org Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/e38f6acf530b...07aad2fbc115 From no-reply at appveyor.com Thu Jan 7 02:06:24 2021 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 07 Jan 2021 02:06:24 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2350 Message-ID: <20210107020624.1.C620CD5F5C8DC7F0@appveyor.com> An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Thu Jan 7 08:20:40 2021 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 7 Jan 2021 09:20:40 +0100 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: <20210106213851.GA53518@shell.msen.com> References: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> <20210106212745.GA51105@shell.msen.com> <20210106213851.GA53518@shell.msen.com> Message-ID: Hi all! Here are some related issues to check: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42 https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/43 (closed) https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/363 https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/396 https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456 On Win10, it only bothers me that there is a keyDown for every keystroke. The rest seems fine. For example, [CMD]+[SHIFT]+[s] yields this: [1891 at 534 keyDown (18) 288897400] [1891 at 534 keyDown (16) 288897478] [1891 at 534 keyDown (83) 288897556] [1891 at 534 keystroke '' (83) 288897556] [1891 at 534 keyUp (16) 288897619] [1891 at 534 keyUp (18) 288897634] [1891 at 534 keyUp (83) 288897634] Looks good :-) Best, Marcel Am 06.01.2021 22:38:58 schrieb David T. Lewis : On Wed, Jan 06, 2021 at 04:27:45PM -0500, David T. Lewis wrote: > > On Tue, Jan 05, 2021 at 09:22:58PM -0800, tim Rowledge wrote: > > > > > > > > > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > > > > > Hi, > > > > > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > > > > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > > > > > https://youtu.be/N9q8DxYWAik > > > > > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ > > > > It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? > > > > In experiments updating to a 5.3 image I notice that the keyboard listener > > I wroet way back when no longer seems to work as well. I do recall Marcel > > doing work in that general area and changing how events are dealt with; > > I'm guessing it will be related. > > > > Scratch expects to see a state for each key, rather than handle events - in > > *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not > > accurately track the key events will mess up some things. Or indeed, if I > > made any mistakes or failed to catch every possible case, which must be > > possible. > > > > I'm sorry I cannot provide a reference, but I think that I recall some > discussion of this in earlier years. It may be that this was caused by > a limitation related to X11 key event delivery in the Unix VM. Possibly > there is some discussion in the vm-dev archives. That's all I remember > and it might be wrong. > Ugh, so as soon as I hit I think of looking in the old Mantis issue tracker. Here is the issue that I was remembering: http://bugs.squeak.org/view.php?id=7597 So it was a Unix VM bug that apparently got fixed in Cog. I am not sure if this is same problem that we see today, but if so perhaps it is a regression. Note that the Mantis bug report includes HandMorph-handleEvent.st from Matthew Fulmer that might be helpful in debugging the problem today. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Thu Jan 7 09:41:29 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Thu, 7 Jan 2021 10:41:29 +0100 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: References: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> <20210106212745.GA51105@shell.msen.com> <20210106213851.GA53518@shell.msen.com> Message-ID: Le jeu. 7 janv. 2021 à 09:20, Marcel Taeumel a écrit : > > > Hi all! > > Here are some related issues to check: > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42 > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/43 (closed) > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/363 > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/396 > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456 > > On Win10, it only bothers me that there is a keyDown for every keystroke. The rest seems fine. Hi Marcel, why does it bother you? To me they are not at the same level. Either you express interest in low level events (keydown/keyup), say for a space invader game, and in this case, most certainly ignore the synthetic/composite/interpreted keystroke. Or you express interest in higher level events (keystroke) like for textual input. So my POV is that they should co-exist, it's application business to select whichever is relevant. > > For example, [CMD]+[SHIFT]+[s] yields this: > > [1891 at 534 keyDown (18) 288897400] > [1891 at 534 keyDown (16) 288897478] > [1891 at 534 keyDown (83) 288897556] > [1891 at 534 keystroke '' (83) 288897556] > [1891 at 534 keyUp (16) 288897619] > [1891 at 534 keyUp (18) 288897634] > [1891 at 534 keyUp (83) 288897634] > > Looks good :-) > > Best, > Marcel > > Am 06.01.2021 22:38:58 schrieb David T. Lewis : > > > On Wed, Jan 06, 2021 at 04:27:45PM -0500, David T. Lewis wrote: > > > > On Tue, Jan 05, 2021 at 09:22:58PM -0800, tim Rowledge wrote: > > > > > > > > > > > > > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > > > > > > > Hi, > > > > > > > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > > > > > > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > > > > > > > https://youtu.be/N9q8DxYWAik > > > > > > > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ > > > > > > It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? > > > > > > In experiments updating to a 5.3 image I notice that the keyboard listener > > > I wroet way back when no longer seems to work as well. I do recall Marcel > > > doing work in that general area and changing how events are dealt with; > > > I'm guessing it will be related. > > > > > > Scratch expects to see a state for each key, rather than handle events - in > > > *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not > > > accurately track the key events will mess up some things. Or indeed, if I > > > made any mistakes or failed to catch every possible case, which must be > > > possible. > > > > > > > I'm sorry I cannot provide a reference, but I think that I recall some > > discussion of this in earlier years. It may be that this was caused by > > a limitation related to X11 key event delivery in the Unix VM. Possibly > > there is some discussion in the vm-dev archives. That's all I remember > > and it might be wrong. > > > > Ugh, so as soon as I hit I think of looking in the old Mantis > issue tracker. Here is the issue that I was remembering: > > http://bugs.squeak.org/view.php?id=7597 > > So it was a Unix VM bug that apparently got fixed in Cog. I am not sure > if this is same problem that we see today, but if so perhaps it is a > regression. > > Note that the Mantis bug report includes HandMorph-handleEvent.st from > Matthew Fulmer that might be helpful in debugging the problem today. > > Dave From marcel.taeumel at hpi.de Thu Jan 7 10:09:18 2021 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 7 Jan 2021 11:09:18 +0100 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: References: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> <20210106212745.GA51105@shell.msen.com> <20210106213851.GA53518@shell.msen.com> Message-ID: Hi Nicolas. > why does it bother you? > To me they are not at the same level. Exactly. The user pushes a key and gets a single keyDown. Repetition is (IMO) only defined in terms of keystrokes where characters matter. There is only a single mouseDown while the user keeps on holding the mouse button. Why the difference? =) Here are possible options: A) Only send a single keyDown even if the users holds the key B) Keep on sending mouseDown while the user holds the button I am asking for "more" consistency and a (maybe) simpler mental model. Anyway. It's good enough as it is now. At least for the Windows platform. Best, Marcel Am 07.01.2021 10:41:58 schrieb Nicolas Cellier : Le jeu. 7 janv. 2021 à 09:20, Marcel Taeumel a écrit : > > > Hi all! > > Here are some related issues to check: > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42 > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/43 (closed) > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/363 > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/396 > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456 > > On Win10, it only bothers me that there is a keyDown for every keystroke. The rest seems fine. Hi Marcel, why does it bother you? To me they are not at the same level. Either you express interest in low level events (keydown/keyup), say for a space invader game, and in this case, most certainly ignore the synthetic/composite/interpreted keystroke. Or you express interest in higher level events (keystroke) like for textual input. So my POV is that they should co-exist, it's application business to select whichever is relevant. > > For example, [CMD]+[SHIFT]+[s] yields this: > > [1891 at 534 keyDown (18) 288897400] > [1891 at 534 keyDown (16) 288897478] > [1891 at 534 keyDown (83) 288897556] > [1891 at 534 keystroke '' (83) 288897556] > [1891 at 534 keyUp (16) 288897619] > [1891 at 534 keyUp (18) 288897634] > [1891 at 534 keyUp (83) 288897634] > > Looks good :-) > > Best, > Marcel > > Am 06.01.2021 22:38:58 schrieb David T. Lewis : > > > On Wed, Jan 06, 2021 at 04:27:45PM -0500, David T. Lewis wrote: > > > > On Tue, Jan 05, 2021 at 09:22:58PM -0800, tim Rowledge wrote: > > > > > > > > > > > > > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > > > > > > > Hi, > > > > > > > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > > > > > > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > > > > > > > https://youtu.be/N9q8DxYWAik > > > > > > > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ > > > > > > It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? > > > > > > In experiments updating to a 5.3 image I notice that the keyboard listener > > > I wroet way back when no longer seems to work as well. I do recall Marcel > > > doing work in that general area and changing how events are dealt with; > > > I'm guessing it will be related. > > > > > > Scratch expects to see a state for each key, rather than handle events - in > > > *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not > > > accurately track the key events will mess up some things. Or indeed, if I > > > made any mistakes or failed to catch every possible case, which must be > > > possible. > > > > > > > I'm sorry I cannot provide a reference, but I think that I recall some > > discussion of this in earlier years. It may be that this was caused by > > a limitation related to X11 key event delivery in the Unix VM. Possibly > > there is some discussion in the vm-dev archives. That's all I remember > > and it might be wrong. > > > > Ugh, so as soon as I hit I think of looking in the old Mantis > issue tracker. Here is the issue that I was remembering: > > http://bugs.squeak.org/view.php?id=7597 > > So it was a Unix VM bug that apparently got fixed in Cog. I am not sure > if this is same problem that we see today, but if so perhaps it is a > regression. > > Note that the Mantis bug report includes HandMorph-handleEvent.st from > Matthew Fulmer that might be helpful in debugging the problem today. > > Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Thu Jan 7 11:51:41 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Thu, 7 Jan 2021 12:51:41 +0100 Subject: [Vm-dev] Multiple Keydown and up In-Reply-To: References: <9EC8326D-4FBF-4986-A16F-D13DA312F864@rowledge.org> <20210106212745.GA51105@shell.msen.com> <20210106213851.GA53518@shell.msen.com> Message-ID: Le jeu. 7 janv. 2021 à 11:09, Marcel Taeumel a écrit : > > > Hi Nicolas. > > > why does it bother you? > > To me they are not at the same level. > > Exactly. The user pushes a key and gets a single keyDown. Repetition is (IMO) only defined in terms of keystrokes where characters matter. There is only a single mouseDown while the user keeps on holding the mouse button. Why the difference? =) > > Here are possible options: > A) Only send a single keyDown even if the users holds the key > B) Keep on sending mouseDown while the user holds the button > > I am asking for "more" consistency and a (maybe) simpler mental model. > > Anyway. It's good enough as it is now. At least for the Windows platform. > > Best, > Marcel > Ah OK, so the example that you provided looks good as you said, it's only the case of repetitions that bothers you (issue #42). I agree, but we cannot do much about it, it's the OS (windows) which send multiple WM_KEYDOWN. Microsoft recommand handling the "control" key events with WM_KEYDOWN (control keys are for example a shortcut for a menu or things like that, as opposed to textual input which should better use WM_CHAR). Maybe they wanted a repetition feature on control keys too? Who knows... > Am 07.01.2021 10:41:58 schrieb Nicolas Cellier : > > > Le jeu. 7 janv. 2021 à 09:20, Marcel Taeumel a écrit : > > > > > > Hi all! > > > > Here are some related issues to check: > > > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42 > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/43 (closed) > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/363 > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/396 > > https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456 > > > > On Win10, it only bothers me that there is a keyDown for every keystroke. The rest seems fine. > > Hi Marcel, > why does it bother you? > To me they are not at the same level. > Either you express interest in low level events (keydown/keyup), say > for a space invader game, and in this case, most certainly ignore the > synthetic/composite/interpreted keystroke. > Or you express interest in higher level events (keystroke) like for > textual input. > So my POV is that they should co-exist, it's application business to > select whichever is relevant. > > > > > For example, [CMD]+[SHIFT]+[s] yields this: > > > > [1891 at 534 keyDown (18) 288897400] > > [1891 at 534 keyDown (16) 288897478] > > [1891 at 534 keyDown (83) 288897556] > > [1891 at 534 keystroke '' (83) 288897556] > > [1891 at 534 keyUp (16) 288897619] > > [1891 at 534 keyUp (18) 288897634] > > [1891 at 534 keyUp (83) 288897634] > > > > Looks good :-) > > > > Best, > > Marcel > > > > Am 06.01.2021 22:38:58 schrieb David T. Lewis : > > > > > > On Wed, Jan 06, 2021 at 04:27:45PM -0500, David T. Lewis wrote: > > > > > > On Tue, Jan 05, 2021 at 09:22:58PM -0800, tim Rowledge wrote: > > > > > > > > > > > > > > > > > On 2021-01-05, at 6:54 PM, Yoshiki Ohshima wrote: > > > > > > > > > > Hi, > > > > > > > > > > Another Raspberry Pi Scratch issue report but possibly affects Squeak on other platforms. > > > > > > > > > > A user reported that if you press down one key, and then another key, and then try to release both keys, the key up for the first key does not get reported. > > > > > > > > > > https://youtu.be/N9q8DxYWAik > > > > > > > > > > It could be the way Scratch handles them, but maybe it is an VM issue. Can somebody give me insight?\ > > > > > > > > It depends; is this the NuScratch as delivered in Raspbian? Or the package loaded into a post 5.1 image? > > > > > > > > In experiments updating to a 5.3 image I notice that the keyboard listener > > > > I wroet way back when no longer seems to work as well. I do recall Marcel > > > > doing work in that general area and changing how events are dealt with; > > > > I'm guessing it will be related. > > > > > > > > Scratch expects to see a state for each key, rather than handle events - in > > > > *some* places. Sigh. Anything that makes the KeyboardStateWatcher class not > > > > accurately track the key events will mess up some things. Or indeed, if I > > > > made any mistakes or failed to catch every possible case, which must be > > > > possible. > > > > > > > > > > I'm sorry I cannot provide a reference, but I think that I recall some > > > discussion of this in earlier years. It may be that this was caused by > > > a limitation related to X11 key event delivery in the Unix VM. Possibly > > > there is some discussion in the vm-dev archives. That's all I remember > > > and it might be wrong. > > > > > > > Ugh, so as soon as I hit I think of looking in the old Mantis > > issue tracker. Here is the issue that I was remembering: > > > > http://bugs.squeak.org/view.php?id=7597 > > > > So it was a Unix VM bug that apparently got fixed in Cog. I am not sure > > if this is same problem that we see today, but if so perhaps it is a > > regression. > > > > Note that the Mantis bug report includes HandMorph-handleEvent.st from > > Matthew Fulmer that might be helpful in debugging the problem today. > > > > Dave From commits at source.squeak.org Thu Jan 7 18:43:58 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 7 Jan 2021 18:43:58 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2926.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2926.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2926 Author: eem Time: 7 January 2021, 10:43:47.351813 am UUID: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf Ancestors: VMMaker.oscog-eem.2925 Include some more include files in the Cogits that are included by sq.h. Rename clone: to cloneObject: to avoid the clash with Unix pthread.h/sched.h's definition of clone, a variant of fork. =============== Diff against VMMaker.oscog-eem.2925 =============== Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" "N.B. We *do not* include sq.h; it pulls in conflicting definitions now that sqVirtualMachine.h declares cointerp's functions, and declares some of them inaccurately for histrical reasons. We pull in CoInterpreter's api via cointerp.h which is accurate." aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" + addHeaderFile:''; + addHeaderFile:''; + addHeaderFile:''; addHeaderFile:'"sqConfig.h"'; addHeaderFile:'"sqMemoryAccess.h"'; addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner declareC: '#if COGMTVM\usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t)\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! Item was changed: ----- Method: Cogit>>handleCompareAndSwapSimulationTrap: (in category 'simulation only') ----- handleCompareAndSwapSimulationTrap: aCompareAndSwapSimulationTrap + | variableValue | - | variableValue accessor | variableValue := (simulatedVariableGetters at: aCompareAndSwapSimulationTrap address ifAbsent: [self errorProcessingSimulationTrap: aCompareAndSwapSimulationTrap in: simulatedVariableGetters]) value asInteger. + processor setFlagsForCompareAndSwap: variableValue = aCompareAndSwapSimulationTrap expectedValue. variableValue = aCompareAndSwapSimulationTrap expectedValue ifTrue: [(simulatedVariableSetters at: aCompareAndSwapSimulationTrap address ifAbsent: [self errorProcessingSimulationTrap: aCompareAndSwapSimulationTrap in: simulatedVariableSetters]) value: aCompareAndSwapSimulationTrap storedValue]. - processor setFlagsForCompareAndSwap: variableValue = aCompareAndSwapSimulationTrap expectedValue. - accessor := aCompareAndSwapSimulationTrap registerAccessor. processor + perform: aCompareAndSwapSimulationTrap registerAccessor - perform: accessor with: (processor convertIntegerToInternal: variableValue). processor pc: aCompareAndSwapSimulationTrap nextpc. aCompareAndSwapSimulationTrap resume: processor! Item was changed: ----- Method: CroquetPlugin>>primitiveOrthoNormInverseMatrix (in category 'transforms') ----- primitiveOrthoNormInverseMatrix | srcOop dstOop src dst x y z rx ry rz | interpreterProxy methodArgumentCount = 0 ifFalse:[^interpreterProxy primitiveFail]. srcOop := interpreterProxy stackObjectValue: 0. interpreterProxy failed ifTrue:[^nil]. ((interpreterProxy isWords: srcOop) and:[(interpreterProxy slotSizeOf: srcOop) = 16]) ifFalse:[^interpreterProxy primitiveFail]. + dstOop := interpreterProxy cloneObject: srcOop. - dstOop := interpreterProxy clone: srcOop. "reload srcOop in case of GC" srcOop := interpreterProxy stackObjectValue: 0. src := interpreterProxy firstIndexableField: srcOop. dst := interpreterProxy firstIndexableField: dstOop. "Transpose upper 3x3 matrix" "dst at: 0 put: (src at: 0)." dst at: 1 put: (src at: 4). dst at: 2 put: (src at: 8). dst at: 4 put: (src at: 1). "dst at: 5 put: (src at: 5)." dst at: 6 put: (src at: 9). dst at: 8 put: (src at: 2). dst at: 9 put: (src at: 6). "dst at: 10 put: (src at: 10)." "Compute inverse translation vector" x := src at: 3. y := src at: 7. z := src at: 11. rx := (x * (dst at: 0)) + (y * (dst at: 1)) + (z * (dst at: 2)). ry := (x * (dst at: 4)) + (y * (dst at: 5)) + (z * (dst at: 6)). rz := (x * (dst at: 8)) + (y * (dst at: 9)) + (z * (dst at: 10)). dst at: 3 put: (self cCoerce: 0.0-rx to: #float). dst at: 7 put: (self cCoerce: 0.0-ry to: #float). dst at: 11 put: (self cCoerce: 0.0-rz to: #float). interpreterProxy pop: 1 thenPush: dstOop! Item was changed: ----- Method: CroquetPlugin>>primitiveTransformDirection (in category 'transforms') ----- primitiveTransformDirection | x y z rx ry rz matrix vertex v3Oop | interpreterProxy methodArgumentCount = 1 ifFalse:[^interpreterProxy primitiveFail]. v3Oop := interpreterProxy stackObjectValue: 0. interpreterProxy failed ifTrue:[^nil]. ((interpreterProxy isWords: v3Oop) and:[(interpreterProxy slotSizeOf: v3Oop) = 3]) ifFalse:[^interpreterProxy primitiveFail]. vertex := interpreterProxy firstIndexableField: v3Oop. matrix := self stackMatrix: 1. (matrix == nil) ifTrue:[^interpreterProxy primitiveFail]. x := vertex at: 0. y := vertex at: 1. z := vertex at: 2. rx := (x * (matrix at: 0)) + (y * (matrix at: 1)) + (z * (matrix at: 2)). ry := (x * (matrix at: 4)) + (y * (matrix at: 5)) + (z * (matrix at: 6)). rz := (x * (matrix at: 8)) + (y * (matrix at: 9)) + (z * (matrix at: 10)). + v3Oop := interpreterProxy cloneObject: v3Oop. - v3Oop := interpreterProxy clone: v3Oop. vertex := interpreterProxy firstIndexableField: v3Oop. vertex at: 0 put: (self cCoerce: rx to: 'float'). vertex at: 1 put: (self cCoerce: ry to:'float'). vertex at: 2 put: (self cCoerce: rz to: 'float'). interpreterProxy pop: 2. ^interpreterProxy push: v3Oop. ! Item was changed: ----- Method: CroquetPlugin>>primitiveTransformVector3 (in category 'transforms') ----- primitiveTransformVector3 | x y z rx ry rz rw matrix vertex v3Oop | interpreterProxy methodArgumentCount = 1 ifFalse:[^interpreterProxy primitiveFail]. v3Oop := interpreterProxy stackObjectValue: 0. interpreterProxy failed ifTrue:[^nil]. ((interpreterProxy isWords: v3Oop) and:[(interpreterProxy slotSizeOf: v3Oop) = 3]) ifFalse:[^interpreterProxy primitiveFail]. vertex := interpreterProxy firstIndexableField: v3Oop. matrix := self stackMatrix: 1. (matrix == nil) ifTrue:[^interpreterProxy primitiveFail]. x := vertex at: 0. y := vertex at: 1. z := vertex at: 2. rx := (x * (matrix at: 0)) + (y * (matrix at: 1)) + (z * (matrix at: 2)) + (matrix at: 3). ry := (x * (matrix at: 4)) + (y * (matrix at: 5)) + (z * (matrix at: 6)) + (matrix at: 7). rz := (x * (matrix at: 8)) + (y * (matrix at: 9)) + (z * (matrix at: 10)) + (matrix at: 11). rw := (x * (matrix at: 12)) + (y * (matrix at: 13)) + (z * (matrix at: 14)) + (matrix at: 15). + v3Oop := interpreterProxy cloneObject: v3Oop. - v3Oop := interpreterProxy clone: v3Oop. vertex := interpreterProxy firstIndexableField: v3Oop. rw = 1.0 ifTrue:[ vertex at: 0 put: (self cCoerce: rx to: 'float'). vertex at: 1 put: (self cCoerce: ry to:'float'). vertex at: 2 put: (self cCoerce: rz to: 'float'). ] ifFalse:[ rw = 0.0 ifTrue:[rw := 0.0] ifFalse:[rw := 1.0 / rw]. vertex at: 0 put: (self cCoerce: rx*rw to:'float'). vertex at: 1 put: (self cCoerce: ry*rw to:'float'). vertex at: 2 put: (self cCoerce: rz*rw to: 'float'). ]. interpreterProxy pop: 2. ^interpreterProxy push: v3Oop. ! Item was changed: ----- Method: CroquetPlugin>>primitiveTransposeMatrix (in category 'transforms') ----- primitiveTransposeMatrix | srcOop dstOop src dst | interpreterProxy methodArgumentCount = 0 ifFalse:[^interpreterProxy primitiveFail]. srcOop := interpreterProxy stackObjectValue: 0. interpreterProxy failed ifTrue:[^nil]. ((interpreterProxy isWords: srcOop) and:[(interpreterProxy slotSizeOf: srcOop) = 16]) ifFalse:[^interpreterProxy primitiveFail]. + dstOop := interpreterProxy cloneObject: srcOop. - dstOop := interpreterProxy clone: srcOop. "reload srcOop in case of GC" srcOop := interpreterProxy stackObjectValue: 0. src := interpreterProxy firstIndexableField: srcOop. dst := interpreterProxy firstIndexableField: dstOop. "dst at: 0 put: (src at: 0)." dst at: 1 put: (src at: 4). dst at: 2 put: (src at: 8). dst at: 3 put: (src at: 12). dst at: 4 put: (src at: 1). "dst at: 5 put: (src at: 5)." dst at: 6 put: (src at: 9). dst at: 7 put: (src at: 13). dst at: 8 put: (src at: 2). dst at: 9 put: (src at: 6). "dst at: 10 put: (src at: 10)." dst at: 11 put: (src at: 14). dst at: 12 put: (src at: 3). dst at: 13 put: (src at: 7). dst at: 14 put: (src at: 11). "dst at: 15 put: (src at: 15)." interpreterProxy pop: 1. ^interpreterProxy push: dstOop. ! Item was changed: ----- Method: Interpreter>>primitiveClone (in category 'object access primitives') ----- primitiveClone "Return a shallow copy of the receiver." | newCopy | + newCopy := self cloneObject: self stackTop. - newCopy := self clone: self stackTop. newCopy = 0 ifTrue: "not enough memory most likely" [^self primitiveFail]. self pop: argumentCount + 1 thenPush: newCopy! Item was changed: ----- Method: InterpreterPrimitives>>primitiveClone (in category 'object access primitives') ----- primitiveClone "Return a shallow copy of the receiver." | rcvr newCopy | rcvr := self stackTop. (objectMemory isImmediate: rcvr) ifTrue: [newCopy := rcvr] ifFalse: [(argumentCount = 0 or: [(objectMemory isForwarded: rcvr) not]) + ifTrue: [newCopy := objectMemory cloneObject: rcvr] - ifTrue: [newCopy := objectMemory clone: rcvr] ifFalse: [newCopy := 0]. newCopy = 0 ifTrue: "not enough memory most likely" [^self primitiveFail]]. self pop: argumentCount + 1 thenPush: newCopy! Item was removed: - ----- Method: InterpreterProxy>>clone: (in category 'instance creation') ----- - clone: oop - ^oop shallowCopy! Item was added: + ----- Method: InterpreterProxy>>cloneObject: (in category 'instance creation') ----- + cloneObject: oop + ^oop shallowCopy! Item was removed: - ----- Method: NewObjectMemory>>clone: (in category 'allocation') ----- - clone: obj - "Return a shallow copy of the given object. May cause GC. - Assume: Oop is a real object, not a small integer. - Override to assert it's not a married context and maybe fix cloned methods." - | extraHdrBytes bytes newChunk remappedOop fromIndex toIndex lastFrom newOop header hash | - - - - self assert: ((self isContext: obj) not - or: [(coInterpreter isMarriedOrWidowedContext: obj) not]). - - self assert: (self isNonIntegerObject: obj). - extraHdrBytes := self extraHeaderBytes: obj. - bytes := self sizeBitsOf: obj. - bytes := bytes + extraHdrBytes. - - "allocate space for the copy, remapping obj in case of a GC" - self pushRemappableOop: obj. - "check it is safe to allocate this much memory. Return 0 if not" - (self sufficientSpaceToAllocate: 2500 + bytes) ifFalse:[^0]. - newChunk := self allocateChunk: bytes. - remappedOop := self popRemappableOop. - - "copy old to new including all header words" - toIndex := newChunk - self wordSize. "loop below uses pre-increment" - fromIndex := (remappedOop - extraHdrBytes) - self wordSize. - lastFrom := fromIndex + bytes. - [fromIndex < lastFrom] whileTrue: - [self longAt: (toIndex := toIndex + self wordSize) - put: (self longAt: (fromIndex := fromIndex + self wordSize))]. - newOop := newChunk + extraHdrBytes. "convert from chunk to oop" - - "fix base header: compute new hash and clear Mark and Root bits" - hash := self newObjectHash. - header := (self longAt: newOop) bitAnd: 16r1FFFF. - "use old ccIndex, format, size, and header-type fields" - header := header bitOr: ((hash << HashBitsOffset) bitAnd: HashBits). - self longAt: newOop put: header. - (self isCompiledMethodHeader: header) ifTrue: - [coInterpreter maybeFixClonedCompiledMethod: newOop]. - ^newOop - ! Item was added: + ----- Method: NewObjectMemory>>cloneObject: (in category 'allocation') ----- + cloneObject: obj + "Return a shallow copy of the given object. May cause GC. + Assume: Oop is a real object, not a small integer. + Override to assert it's not a married context and maybe fix cloned methods." + | extraHdrBytes bytes newChunk remappedOop fromIndex toIndex lastFrom newOop header hash | + + + + self assert: ((self isContext: obj) not + or: [(coInterpreter isMarriedOrWidowedContext: obj) not]). + + self assert: (self isNonIntegerObject: obj). + extraHdrBytes := self extraHeaderBytes: obj. + bytes := self sizeBitsOf: obj. + bytes := bytes + extraHdrBytes. + + "allocate space for the copy, remapping obj in case of a GC" + self pushRemappableOop: obj. + "check it is safe to allocate this much memory. Return 0 if not" + (self sufficientSpaceToAllocate: 2500 + bytes) ifFalse:[^0]. + newChunk := self allocateChunk: bytes. + remappedOop := self popRemappableOop. + + "copy old to new including all header words" + toIndex := newChunk - self wordSize. "loop below uses pre-increment" + fromIndex := (remappedOop - extraHdrBytes) - self wordSize. + lastFrom := fromIndex + bytes. + [fromIndex < lastFrom] whileTrue: + [self longAt: (toIndex := toIndex + self wordSize) + put: (self longAt: (fromIndex := fromIndex + self wordSize))]. + newOop := newChunk + extraHdrBytes. "convert from chunk to oop" + + "fix base header: compute new hash and clear Mark and Root bits" + hash := self newObjectHash. + header := (self longAt: newOop) bitAnd: 16r1FFFF. + "use old ccIndex, format, size, and header-type fields" + header := header bitOr: ((hash << HashBitsOffset) bitAnd: HashBits). + self longAt: newOop put: header. + (self isCompiledMethodHeader: header) ifTrue: + [coInterpreter maybeFixClonedCompiledMethod: newOop]. + ^newOop + ! Item was removed: - ----- Method: ObjectMemory>>clone: (in category 'allocation') ----- - clone: obj - "Return a shallow copy of the given object. May cause GC" - "Assume: Oop is a real object, not a small integer." - - | extraHdrBytes bytes newChunk remappedOop fromIndex toIndex lastFrom newOop header hash | - - - - self assert: (self isNonIntegerObject: obj). - extraHdrBytes := self extraHeaderBytes: obj. - bytes := self sizeBitsOf: obj. - bytes := bytes + extraHdrBytes. - - "allocate space for the copy, remapping obj in case of a GC" - self pushRemappableOop: obj. - "check it is safe to allocate this much memory. Return 0 if not" - (self sufficientSpaceToAllocate: 2500 + bytes) ifFalse:[^0]. - newChunk := self allocateChunk: bytes. - remappedOop := self popRemappableOop. - - "copy old to new including all header words" - toIndex := newChunk - self wordSize. "loop below uses pre-increment" - fromIndex := (remappedOop - extraHdrBytes) - self wordSize. - lastFrom := fromIndex + bytes. - [fromIndex < lastFrom] whileTrue: - [self longAt: (toIndex := toIndex + self wordSize) put: (self longAt: (fromIndex := fromIndex + self wordSize))]. - newOop := newChunk + extraHdrBytes. "convert from chunk to oop" - - "fix base header: compute new hash and clear Mark and Root bits" - hash := self newObjectHash. - header := (self longAt: newOop) bitAnd: 16r1FFFF. - "use old ccIndex, format, size, and header-type fields" - header := header bitOr: ((hash << HashBitsOffset) bitAnd: HashBits). - self longAt: newOop put: header. - ^newOop - ! Item was added: + ----- Method: ObjectMemory>>cloneObject: (in category 'allocation') ----- + cloneObject: obj + "Return a shallow copy of the given object. May cause GC" + "Assume: Oop is a real object, not a small integer." + + | extraHdrBytes bytes newChunk remappedOop fromIndex toIndex lastFrom newOop header hash | + + + + self assert: (self isNonIntegerObject: obj). + extraHdrBytes := self extraHeaderBytes: obj. + bytes := self sizeBitsOf: obj. + bytes := bytes + extraHdrBytes. + + "allocate space for the copy, remapping obj in case of a GC" + self pushRemappableOop: obj. + "check it is safe to allocate this much memory. Return 0 if not" + (self sufficientSpaceToAllocate: 2500 + bytes) ifFalse:[^0]. + newChunk := self allocateChunk: bytes. + remappedOop := self popRemappableOop. + + "copy old to new including all header words" + toIndex := newChunk - self wordSize. "loop below uses pre-increment" + fromIndex := (remappedOop - extraHdrBytes) - self wordSize. + lastFrom := fromIndex + bytes. + [fromIndex < lastFrom] whileTrue: + [self longAt: (toIndex := toIndex + self wordSize) put: (self longAt: (fromIndex := fromIndex + self wordSize))]. + newOop := newChunk + extraHdrBytes. "convert from chunk to oop" + + "fix base header: compute new hash and clear Mark and Root bits" + hash := self newObjectHash. + header := (self longAt: newOop) bitAnd: 16r1FFFF. + "use old ccIndex, format, size, and header-type fields" + header := header bitOr: ((hash << HashBitsOffset) bitAnd: HashBits). + self longAt: newOop put: header. + ^newOop + ! Item was removed: - ----- Method: SpurMemoryManager>>clone: (in category 'allocation') ----- - clone: objOop - | numSlots fmt newObj | - numSlots := self numSlotsOf: objOop. - fmt := self formatOf: objOop. - numSlots > self maxSlotsForNewSpaceAlloc - ifTrue: - [newObj := self allocateSlotsInOldSpace: numSlots - format: fmt - classIndex: (self classIndexOf: objOop)] - ifFalse: - [newObj := self allocateSlots: numSlots - format: fmt - classIndex: (self classIndexOf: objOop)]. - newObj ifNil: - [^0]. - (self isPointersFormat: fmt) - ifTrue: - [| hasYoung | - hasYoung := false. - 0 to: numSlots - 1 do: - [:i| | oop | - oop := self fetchPointer: i ofObject: objOop. - (self isNonImmediate: oop) ifTrue: - [(self isForwarded: oop) ifTrue: - [oop := self followForwarded: oop]. - ((self isNonImmediate: oop) - and: [self isYoungObject: oop]) ifTrue: - [hasYoung := true]]. - self storePointerUnchecked: i - ofObject: newObj - withValue: oop]. - (hasYoung - and: [(self isYoungObject: newObj) not]) ifTrue: - [scavenger remember: newObj]] - ifFalse: - [0 to: numSlots - 1 do: - [:i| - self storePointerUnchecked: i - ofObject: newObj - withValue: (self fetchPointer: i ofObject: objOop)]. - fmt >= self firstCompiledMethodFormat ifTrue: - [coInterpreter maybeFixClonedCompiledMethod: newObj. - ((self isOldObject: newObj) - and: [(self isYoungObject: objOop) or: [self isRemembered: objOop]]) ifTrue: - [scavenger remember: newObj]]]. - ^newObj! Item was added: + ----- Method: SpurMemoryManager>>cloneObject: (in category 'allocation') ----- + cloneObject: objOop + | numSlots fmt newObj | + numSlots := self numSlotsOf: objOop. + fmt := self formatOf: objOop. + numSlots > self maxSlotsForNewSpaceAlloc + ifTrue: + [newObj := self allocateSlotsInOldSpace: numSlots + format: fmt + classIndex: (self classIndexOf: objOop)] + ifFalse: + [newObj := self allocateSlots: numSlots + format: fmt + classIndex: (self classIndexOf: objOop)]. + newObj ifNil: + [^0]. + (self isPointersFormat: fmt) + ifTrue: + [| hasYoung | + hasYoung := false. + 0 to: numSlots - 1 do: + [:i| | oop | + oop := self fetchPointer: i ofObject: objOop. + (self isNonImmediate: oop) ifTrue: + [(self isForwarded: oop) ifTrue: + [oop := self followForwarded: oop]. + ((self isNonImmediate: oop) + and: [self isYoungObject: oop]) ifTrue: + [hasYoung := true]]. + self storePointerUnchecked: i + ofObject: newObj + withValue: oop]. + (hasYoung + and: [(self isYoungObject: newObj) not]) ifTrue: + [scavenger remember: newObj]] + ifFalse: + [0 to: numSlots - 1 do: + [:i| + self storePointerUnchecked: i + ofObject: newObj + withValue: (self fetchPointer: i ofObject: objOop)]. + fmt >= self firstCompiledMethodFormat ifTrue: + [coInterpreter maybeFixClonedCompiledMethod: newObj. + ((self isOldObject: newObj) + and: [(self isYoungObject: objOop) or: [self isRemembered: objOop]]) ifTrue: + [scavenger remember: newObj]]]. + ^newObj! Item was changed: ----- Method: SpurMemoryManager>>outOfPlaceBecome:and:copyHashFlag: (in category 'become implementation') ----- outOfPlaceBecome: obj1 and: obj2 copyHashFlag: copyHashFlag "in an effort to fix a compiler bug with two-way become post r3427" "Allocate two new objects, n1 & n2. Copy the contents appropriately. Convert obj1 and obj2 into forwarding objects pointing to n2 and n1 respectively" | clone1 clone2 | clone1 := (self isContextNonImm: obj1) ifTrue: [coInterpreter cloneContext: obj1] + ifFalse: [self cloneObject: obj1]. - ifFalse: [self clone: obj1]. clone2 := (self isContextNonImm: obj2) ifTrue: [coInterpreter cloneContext: obj2] + ifFalse: [self cloneObject: obj2]. - ifFalse: [self clone: obj2]. (self isObjImmutable: obj1) ifTrue: [self setIsImmutableOf: clone1 to: true]. (self isObjImmutable: obj2) ifTrue: [self setIsImmutableOf: clone2 to: true]. copyHashFlag ifTrue: [self setHashBitsOf: clone1 to: (self rawHashBitsOf: obj1). self setHashBitsOf: clone2 to: (self rawHashBitsOf: obj2)] ifFalse: [self setHashBitsOf: clone1 to: (self rawHashBitsOf: obj2). self setHashBitsOf: clone2 to: (self rawHashBitsOf: obj1)]. self forward: obj1 to: clone2; forward: obj2 to: clone1. ((self isYoungObject: obj1) ~= (self isYoungObject: clone2) or: [(self isYoungObject: obj2) ~= (self isYoungObject: clone1)]) ifTrue: [becomeEffectsFlags := becomeEffectsFlags bitOr: OldBecameNewFlag]! Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveClone (in category 'object access primitives') ----- primitiveClone "Return a shallow copy of the receiver. Special-case non-single contexts (because of context-to-stack mapping). Can't fail for contexts cuz of image context instantiation code (sigh)." | rcvr newCopy | rcvr := self stackTop. (objectMemory isImmediate: rcvr) ifTrue: [newCopy := rcvr] ifFalse: [(objectMemory isContextNonImm: rcvr) ifTrue: [newCopy := self cloneContext: rcvr] ifFalse: [(argumentCount = 0 or: [(objectMemory isForwarded: rcvr) not]) + ifTrue: [newCopy := objectMemory cloneObject: rcvr] - ifTrue: [newCopy := objectMemory clone: rcvr] ifFalse: [newCopy := 0]]. newCopy = 0 ifTrue: [^self primitiveFailFor: PrimErrNoMemory]]. self pop: argumentCount + 1 thenPush: newCopy! From noreply at github.com Thu Jan 7 18:59:51 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 10:59:51 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 704a4d: CogVM source as per VMMaker.oscog-eem.2926 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 704a4df16cc732fcd4fa10eef52c70bce631fe94 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/704a4df16cc732fcd4fa10eef52c70bce631fe94 Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M build.macos64ARMv8/common/entitlements.plist M build.macos64x64/common/entitlements.plist 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 nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.c M platforms/Cross/vm/sq.h M platforms/Cross/vm/sqMemoryAccess.h M platforms/Cross/vm/sqVirtualMachine.c M platforms/Cross/vm/sqVirtualMachine.h M platforms/minheadless/unix/sqPlatformSpecific-Unix.h M platforms/unix/vm/sqPlatformSpecific.h M platforms/unix/vm/sqUnixVMProfile.c 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/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/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/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/plugins/CroquetPlugin/CroquetPlugin.c M src/plugins/Squeak3D/Squeak3D.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 M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2926 Include some more include files in the Cogits that are included by sq.h. Rename clone: to cloneObject: to avoid the clash with Unix pthread.h/sched.h's definition of clone, a variant of fork. Move declarations of the memory initialization functions from sq.h to sqMemoryAccess.h so that the cogits can see them now they don't include sq.h. From no-reply at appveyor.com Thu Jan 7 19:04:30 2021 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 07 Jan 2021 19:04:30 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2351 Message-ID: <20210107190430.1.C86DE22FD7252BC1@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Thu Jan 7 22:01:14 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 7 Jan 2021 22:01:14 0000 Subject: [Vm-dev] VM Maker: Cog-eem.432.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.432.mcz ==================== Summary ==================== Name: Cog-eem.432 Author: eem Time: 7 January 2021, 2:01:12.601696 pm UUID: 4e880215-47ef-4bce-9d52-afa37179c2ec Ancestors: Cog-eem.431 MTVM: Extend CompareAndSwapSimulationTrap with the failedComparisonRegisterAccessor to to CMPXCHG correctly on x86/x86_64. Print the direction flag on x86/x86_64. Apply the clone: => cloneObject: refactoring. =============== Diff against Cog-eem.431 =============== Item was changed: ----- Method: BochsIA32Alien>>printFields:inRegisterState:on: (in category 'printing') ----- printFields: fields inRegisterState: registerStateVector on: aStream | rsvs | aStream ensureCr. rsvs := registerStateVector readStream. fields withIndexDo: [:sym :index| | val | sym = #cr ifTrue: [aStream cr] ifFalse: [(val := rsvs next) isNil ifTrue: [^self]. (sym beginsWith: 'xmm') ifTrue: [aStream nextPutAll: sym; nextPut: $:; space. val printOn: aStream base: 16 length: 16 padded: true. aStream space; nextPut: $(. "At the image level Float is apparently in big-endian format" ((Float basicNew: 2) at: 2 put: (val bitAnd: 16rFFFFFFFF); at: 1 put: (val bitShift: -32); yourself) printOn: aStream. aStream nextPut: $)] ifFalse: [aStream nextPutAll: sym; nextPut: $:; space. val printOn: aStream base: 16 length: 8 padded: true. #eflags == sym ifTrue: [aStream space. + 'C-P-A-ZS--DO' withIndexDo: - 'C-P-A-ZS---O' withIndexDo: [:flag :bitIndex| flag ~= $- ifTrue: [aStream nextPut: flag; nextPutAll: 'F='; print: (val bitAnd: 1 << (bitIndex - 1)) >> (bitIndex - 1); space]]] ifFalse: [val > 16 ifTrue: [aStream space; nextPut: $(. val printOn: aStream base: 10 length: 1 padded: false. aStream nextPut: $)]]]. (fields at: index + 1) ~~ #cr ifTrue: [aStream tab]]]! Item was changed: ----- Method: BochsX64Alien>>handleGroup6through10FailureAt:in:rex: (in category 'error handling') ----- handleGroup6through10FailureAt: pc "" in: memoryArray "" rex: rexByteOrNil "" "Convert an execution primitive failure for a group 5 instruction into the relevant ProcessorSimulationTrap signal." | rexByte modrmByte baseReg srcReg | (((rexByte := memoryArray byteAt: pc + 2) bitAnd: 16rF8) = self rexPrefix and: [(memoryArray byteAt: pc + 3) = 16r0F and: [(memoryArray byteAt: pc + 4) = 16rB1]]) ifTrue: [modrmByte := memoryArray byteAt: pc + 5. modrmByte >> 6 = 0 ifTrue: "ModRegInd" [srcReg := (modrmByte >> 3 bitAnd: 7) + ((rexByte bitAnd: 4) bitShift: 1). baseReg := (modrmByte bitAnd: 7) + ((rexByte bitAnd: 1) bitShift: 3). ^(CompareAndSwapSimulationTrap pc: pc nextpc: pc + 5 address: (self perform: (self registerStateGetters at: baseReg + 1)) type: #write accessor: (self registerStateSetters at: srcReg + 1)) + failedComparisonRegisterAccessor: #rax:; expectedValue: self rax; storedValue: (self perform: (self registerStateGetters at: srcReg + 1)); signal]]! Item was changed: ----- Method: BochsX64Alien>>printFields:inRegisterState:on: (in category 'printing') ----- printFields: fields inRegisterState: registerStateVector on: aStream | rsvs | aStream ensureCr. rsvs := registerStateVector readStream. fields withIndexDo: [:sym :index| | val | sym = #cr ifTrue: [aStream cr] ifFalse: [(val := rsvs next) isNil ifTrue: [^self]. (sym beginsWith: 'xmm') ifTrue: [aStream nextPutAll: sym; nextPut: $:; space. val printOn: aStream base: 16 length: 16 padded: true. aStream space; nextPut: $(. "At the image level Float is apparently in big-endian format" ((Float basicNew: 2) at: 2 put: (val bitAnd: 16rFFFFFFFF); at: 1 put: (val bitShift: -32); yourself) printOn: aStream. aStream nextPut: $)] ifFalse: [aStream nextPutAll: sym; nextPut: $:; space. val printOn: aStream base: 16 length: 8 padded: true. #rflags == sym ifTrue: [aStream space. + 'C-P-A-ZS--DO' withIndexDo: - 'C-P-A-ZS---O' withIndexDo: [:flag :bitIndex| flag ~= $- ifTrue: [aStream nextPut: flag; nextPutAll: 'F='; print: (val bitAnd: 1 << (bitIndex - 1)) >> (bitIndex - 1); space]]] ifFalse: [val > 16 ifTrue: [aStream space; nextPut: $(. val printOn: aStream base: 10 length: 1 padded: false. aStream nextPut: $)]]]. (fields at: index + 1) ~~ #cr ifTrue: [aStream tab]]]! Item was changed: ----- Method: BochsX64Alien>>printRegisterStateExceptPC:on: (in category 'printing') ----- printRegisterStateExceptPC: registerStateVector on: aStream self printFields: ((registerStateVector size < 34 or: [(19 to: 34) allSatisfy: [:i| (registerStateVector at: i) isZero]]) ifTrue: [#( rax rbx rcx rdx cr rsp rbp rsi rdi cr r8 r9 r10 r11 cr + r12 r13 r14 r15 cr + rflags cr)] - r12 r13 r14 r15 cr)] ifFalse: [#( rax rbx rcx rdx cr rsp rbp rsi rdi cr r8 r9 r10 r11 cr r12 r13 r14 r15 cr + rflags cr xmm0low xmm1low cr xmm2low xmm3low cr xmm4low xmm5low cr xmm6low xmm7low cr )]) inRegisterState: registerStateVector on: aStream! Item was changed: ProcessorSimulationTrap subclass: #CompareAndSwapSimulationTrap + instanceVariableNames: 'expectedValue storedValue failedComparisonRegisterAccessor' - instanceVariableNames: 'expectedValue storedValue' classVariableNames: '' poolDictionaries: '' category: 'Cog-Processors'! Item was added: + ----- Method: CompareAndSwapSimulationTrap>>failedComparisonRegisterAccessor (in category 'accessing') ----- + failedComparisonRegisterAccessor + "Some compare-and-swaps (ARM) always set a given register with the value compared against. + Others (x86/x86-64) set a different register if the comparison fails. On these processors + failedComparisonRegisterAccessor can be supplied to specify that register." + ^failedComparisonRegisterAccessor ifNil: [registerAccessor]! Item was added: + ----- Method: CompareAndSwapSimulationTrap>>failedComparisonRegisterAccessor: (in category 'accessing') ----- + failedComparisonRegisterAccessor: aRegisterSetter + "Some compare-and-swaps (ARM) always set a given register with the value compared against. + Others (x86/x86-64) set a different register if the comparison fails. On these processors + failedComparisonRegisterAccessor can be supplied to specify that register." + failedComparisonRegisterAccessor := aRegisterSetter! Item was added: + ----- Method: CompareAndSwapSimulationTrap>>printAnyExtrasOn: (in category 'printing') ----- + printAnyExtrasOn: aStream + failedComparisonRegisterAccessor ifNotNil: + [aStream nextPutAll: ' failAccessor: '; print: failedComparisonRegisterAccessor]. + aStream + nextPutAll: ' expectedValue: '; print: expectedValue; + nextPutAll: ' storedValue: '; print: storedValue; cr! Item was added: + ----- Method: ProcessorSimulationTrap>>printAnyExtrasOn: (in category 'printing') ----- + printAnyExtrasOn: aStream! Item was changed: ----- Method: ProcessorSimulationTrap>>printOn: (in category 'printing') ----- printOn: aStream super printOn: aStream. aStream nextPutAll: ' (pc: '; print: pc; nextPut: $/. pc printOn: aStream base: 16. aStream nextPutAll: ' nextpc: '; print: nextpc; nextPut: $/. nextpc printOn: aStream base: 16. aStream nextPutAll: ' address: '; print: address; nextPut: $/. address printOn: aStream base: 16. aStream nextPutAll: ' type: '; print: type. + aStream nextPutAll: ' accessor: '; print: registerAccessor. + self printAnyExtrasOn: aStream. + aStream nextPut: $)! - aStream nextPutAll: ' accessor: '; print: registerAccessor; nextPut: $)! Item was removed: - ----- Method: Spur32BitPreen>>clone: (in category 'bootstrap image') ----- - clone: oldObj - | newObj hash | - newObj := newHeap - allocateSlots: (oldHeap numSlotsOf: oldObj) - format: (oldHeap formatOf: oldObj) - classIndex: (oldHeap classIndexOf: oldObj). - (hash := oldHeap rawHashBitsOf: oldObj) ~= 0 ifTrue: - [newHeap setHashBitsOf: newObj to: hash]. - (oldHeap isImmutable: oldObj) ifTrue: - [newHeap setIsImmutableOf: newObj to: true]. - (oldHeap isPinned: oldObj) ifTrue: - [newHeap setIsPinnedOf: newObj to: true]. - self deny: (oldHeap isRemembered: oldObj). - self deny: (oldHeap isMarked: oldObj). - self deny: (oldHeap isGrey: oldObj). - reverseMap at: newObj put: oldObj. - ^map at: oldObj put: newObj! Item was added: + ----- Method: Spur32BitPreen>>cloneObject: (in category 'bootstrap image') ----- + cloneObject: oldObj + | newObj hash | + newObj := newHeap + allocateSlots: (oldHeap numSlotsOf: oldObj) + format: (oldHeap formatOf: oldObj) + classIndex: (oldHeap classIndexOf: oldObj). + (hash := oldHeap rawHashBitsOf: oldObj) ~= 0 ifTrue: + [newHeap setHashBitsOf: newObj to: hash]. + (oldHeap isImmutable: oldObj) ifTrue: + [newHeap setIsImmutableOf: newObj to: true]. + (oldHeap isPinned: oldObj) ifTrue: + [newHeap setIsPinnedOf: newObj to: true]. + self deny: (oldHeap isRemembered: oldObj). + self deny: (oldHeap isMarked: oldObj). + self deny: (oldHeap isGrey: oldObj). + reverseMap at: newObj put: oldObj. + ^map at: oldObj put: newObj! Item was changed: ----- Method: Spur32BitPreen>>cloneObjects (in category 'bootstrap image') ----- cloneObjects "Clone all normal objects. Of hidden objects only clone the freeLists object and the classTableRoot and class table pages. In particular, dont clone objStacks. The refs to the objStacks are nilled out in fillInHeap." | i freeListsObject | i := 0. freeListsObject := oldHeap freeListsObject. oldHeap allOldSpaceObjectsDo: [:obj32| (i := i + 1) >= 100000 ifTrue: [Transcript nextPut: $:; flush. i := 0]. obj32 = freeListsObject ifTrue: [self cloneFreeLists: obj32] ifFalse: + [(self shouldcloneObject: obj32) ifTrue: + [self cloneObject: obj32]]]! - [(self shouldClone: obj32) ifTrue: - [self clone: obj32]]]! Item was removed: - ----- Method: Spur32to64BitImageConverter>>clone: (in category 'bootstrap image') ----- - clone: sourceObj - | targetObj format numSlots numBytes hash | - format := sourceHeap formatOf: sourceObj. - numSlots := sourceHeap numSlotsOf: sourceObj. - format > sourceHeap lastPointerFormat ifTrue: - [format < sourceHeap firstByteFormat - ifTrue: - [format = sourceHeap firstLongFormat - ifTrue: - [numSlots := sourceHeap numSlotsOf: sourceObj. - numSlots odd ifTrue: - [format := format + 1]. - numSlots := numSlots + 1 // 2] - ifFalse: [self error: 'bad format']] - ifFalse: - [numBytes := sourceHeap numBytesOf: sourceObj. - format < sourceHeap firstCompiledMethodFormat - ifTrue: - [format := targetHeap byteFormatForNumBytes: numBytes. - numSlots := numSlots + 1 // 2] - ifFalse: - [numSlots := sourceHeap numPointerSlotsOf: sourceObj. - numBytes := numBytes - (numSlots * sourceHeap bytesPerOop). - format := (targetHeap byteFormatForNumBytes: numBytes) + sourceHeap firstCompiledMethodFormat - sourceHeap firstByteFormat. - numSlots := numSlots + (targetHeap numSlotsForBytes: numBytes)]]]. - targetObj := targetHeap - allocateSlots: numSlots - format: format - classIndex: (sourceHeap classIndexOf: sourceObj). - (hash := sourceHeap rawHashBitsOf: sourceObj) ~= 0 ifTrue: - [targetHeap setHashBitsOf: targetObj to: hash]. - (sourceHeap isImmutable: sourceObj) ifTrue: - [targetHeap setIsImmutableOf: targetObj to: true]. - (sourceHeap isPinned: sourceObj) ifTrue: - [targetHeap setIsPinnedOf: targetObj to: true]. - self deny: (sourceHeap isRemembered: sourceObj). - self deny: (sourceHeap isMarked: sourceObj). - self deny: (sourceHeap isGrey: sourceObj). - reverseMap at: targetObj put: sourceObj. - ^map at: sourceObj put: targetObj! Item was added: + ----- Method: Spur32to64BitImageConverter>>cloneObject: (in category 'bootstrap image') ----- + cloneObject: sourceObj + | targetObj format numSlots numBytes hash | + format := sourceHeap formatOf: sourceObj. + numSlots := sourceHeap numSlotsOf: sourceObj. + format > sourceHeap lastPointerFormat ifTrue: + [format < sourceHeap firstByteFormat + ifTrue: + [format = sourceHeap firstLongFormat + ifTrue: + [numSlots := sourceHeap numSlotsOf: sourceObj. + numSlots odd ifTrue: + [format := format + 1]. + numSlots := numSlots + 1 // 2] + ifFalse: [self error: 'bad format']] + ifFalse: + [numBytes := sourceHeap numBytesOf: sourceObj. + format < sourceHeap firstCompiledMethodFormat + ifTrue: + [format := targetHeap byteFormatForNumBytes: numBytes. + numSlots := numSlots + 1 // 2] + ifFalse: + [numSlots := sourceHeap numPointerSlotsOf: sourceObj. + numBytes := numBytes - (numSlots * sourceHeap bytesPerOop). + format := (targetHeap byteFormatForNumBytes: numBytes) + sourceHeap firstCompiledMethodFormat - sourceHeap firstByteFormat. + numSlots := numSlots + (targetHeap numSlotsForBytes: numBytes)]]]. + targetObj := targetHeap + allocateSlots: numSlots + format: format + classIndex: (sourceHeap classIndexOf: sourceObj). + (hash := sourceHeap rawHashBitsOf: sourceObj) ~= 0 ifTrue: + [targetHeap setHashBitsOf: targetObj to: hash]. + (sourceHeap isImmutable: sourceObj) ifTrue: + [targetHeap setIsImmutableOf: targetObj to: true]. + (sourceHeap isPinned: sourceObj) ifTrue: + [targetHeap setIsPinnedOf: targetObj to: true]. + self deny: (sourceHeap isRemembered: sourceObj). + self deny: (sourceHeap isMarked: sourceObj). + self deny: (sourceHeap isGrey: sourceObj). + reverseMap at: targetObj put: sourceObj. + ^map at: sourceObj put: targetObj! Item was removed: - ----- Method: Spur64to32BitImageConverter>>clone: (in category 'bootstrap image') ----- - clone: sourceObj - | targetObj format numSlots numBytes hash | - format := sourceHeap formatOf: sourceObj. - numSlots := sourceHeap numSlotsOf: sourceObj. - format > sourceHeap lastPointerFormat ifTrue: - [format < sourceHeap firstByteFormat - ifTrue: - [format = sourceHeap sixtyFourBitIndexableFormat - ifTrue: - [numSlots := (sourceHeap numSlotsOf: sourceObj) * 2] - ifFalse: - [(format between: sourceHeap firstLongFormat and: sourceHeap firstLongFormat + 1) - ifTrue: - [numSlots := (sourceHeap numSlotsOf: sourceObj) * 2 - (format bitAnd: 1). - format := format bitClear: 1] - ifFalse: [self error: 'bad format']]] - ifFalse: - [numBytes := sourceHeap numBytesOf: sourceObj. - format < sourceHeap firstCompiledMethodFormat - ifTrue: - [numCompiledCode := numCompiledCode + 1. - numSlots := numBytes + 3 // 4. - format := targetHeap byteFormatForNumBytes: numBytes] - ifFalse: - [numSlots := sourceHeap numPointerSlotsOf: sourceObj. - numBytes := numBytes - (numSlots * sourceHeap bytesPerOop). - format := (targetHeap byteFormatForNumBytes: numBytes) + sourceHeap firstCompiledMethodFormat - sourceHeap firstByteFormat. - numSlots := numSlots + (targetHeap numSlotsForBytes: numBytes)]]]. - targetObj := targetHeap - allocateSlots: numSlots - format: format - classIndex: (sourceHeap classIndexOf: sourceObj). - (hash := sourceHeap rawHashBitsOf: sourceObj) ~= 0 ifTrue: - [targetHeap setHashBitsOf: targetObj to: hash]. - (sourceHeap isImmutable: sourceObj) ifTrue: - [numReadOnly := numReadOnly + 1. - targetHeap setIsImmutableOf: targetObj to: true]. - (sourceHeap isPinned: sourceObj) ifTrue: - [targetHeap setIsPinnedOf: targetObj to: true]. - self deny: (sourceHeap isRemembered: sourceObj). - self deny: (sourceHeap isMarked: sourceObj). - self deny: (sourceHeap isGrey: sourceObj). - reverseMap at: targetObj put: sourceObj. - ^map at: sourceObj put: targetObj! Item was added: + ----- Method: Spur64to32BitImageConverter>>cloneObject: (in category 'bootstrap image') ----- + cloneObject: sourceObj + | targetObj format numSlots numBytes hash | + format := sourceHeap formatOf: sourceObj. + numSlots := sourceHeap numSlotsOf: sourceObj. + format > sourceHeap lastPointerFormat ifTrue: + [format < sourceHeap firstByteFormat + ifTrue: + [format = sourceHeap sixtyFourBitIndexableFormat + ifTrue: + [numSlots := (sourceHeap numSlotsOf: sourceObj) * 2] + ifFalse: + [(format between: sourceHeap firstLongFormat and: sourceHeap firstLongFormat + 1) + ifTrue: + [numSlots := (sourceHeap numSlotsOf: sourceObj) * 2 - (format bitAnd: 1). + format := format bitClear: 1] + ifFalse: [self error: 'bad format']]] + ifFalse: + [numBytes := sourceHeap numBytesOf: sourceObj. + format < sourceHeap firstCompiledMethodFormat + ifTrue: + [numCompiledCode := numCompiledCode + 1. + numSlots := numBytes + 3 // 4. + format := targetHeap byteFormatForNumBytes: numBytes] + ifFalse: + [numSlots := sourceHeap numPointerSlotsOf: sourceObj. + numBytes := numBytes - (numSlots * sourceHeap bytesPerOop). + format := (targetHeap byteFormatForNumBytes: numBytes) + sourceHeap firstCompiledMethodFormat - sourceHeap firstByteFormat. + numSlots := numSlots + (targetHeap numSlotsForBytes: numBytes)]]]. + targetObj := targetHeap + allocateSlots: numSlots + format: format + classIndex: (sourceHeap classIndexOf: sourceObj). + (hash := sourceHeap rawHashBitsOf: sourceObj) ~= 0 ifTrue: + [targetHeap setHashBitsOf: targetObj to: hash]. + (sourceHeap isImmutable: sourceObj) ifTrue: + [numReadOnly := numReadOnly + 1. + targetHeap setIsImmutableOf: targetObj to: true]. + (sourceHeap isPinned: sourceObj) ifTrue: + [targetHeap setIsPinnedOf: targetObj to: true]. + self deny: (sourceHeap isRemembered: sourceObj). + self deny: (sourceHeap isMarked: sourceObj). + self deny: (sourceHeap isGrey: sourceObj). + reverseMap at: targetObj put: sourceObj. + ^map at: sourceObj put: targetObj! Item was removed: - ----- Method: SpurMtoNBitImageConverter>>clone: (in category 'bootstrap image') ----- - clone: sourceObj - self subclassResponsibility! Item was added: + ----- Method: SpurMtoNBitImageConverter>>cloneObject: (in category 'bootstrap image') ----- + cloneObject: sourceObj + self subclassResponsibility! Item was changed: ----- Method: SpurMtoNBitImageConverter>>cloneObjects (in category 'bootstrap image') ----- cloneObjects "Clone all normal objects. Of hidden objects only clone the freeLists object and the classTableRoot and class table pages. In particular, dont clone objStacks. The refs to the objStacks are nilled out in fillInHeap." | i freeListsObject | i := 0. freeListsObject := sourceHeap freeListsObject. sourceHeap allOldSpaceObjectsDo: [:sourceObj| (i := i + 1) >= 100000 ifTrue: [Transcript nextPut: $:; flush. i := 0]. sourceObj = freeListsObject ifTrue: [self cloneFreeLists: sourceObj] ifFalse: + [(self shouldcloneObject: sourceObj) ifTrue: + [self cloneObject: sourceObj]]]! - [(self shouldClone: sourceObj) ifTrue: - [self clone: sourceObj]]]! From commits at source.squeak.org Thu Jan 7 22:05:51 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 7 Jan 2021 22:05:51 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2927.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2927.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2927 Author: eem Time: 7 January 2021, 2:05:43.745942 pm UUID: 91ada8ee-d8ae-4034-ba1d-3da323ba1a3d Ancestors: VMMaker.oscog-eem.2926 x86/x86_64 Cog MTVM: Add the code to handle the lock already having the right value to x86/x86_64 generateLowLevelTryLock:. Extend handleCompareAndSwapSimulationTrap: to simulate x86/x86_64 cmpxchg (add failedComparisonRegisterAccessor to the mix). Always use a REX prefix for SETE. Categorize all processor specific opcode generators under concretize processor-specific Still the x86_64 low-level lock dfoesn't simulate correctly. I suspect that setting the flags word doesn't actually set the flags in the plugin. =============== Diff against VMMaker.oscog-eem.2926 =============== Item was changed: ----- Method: CogX64Compiler>>computeMaximumSize (in category 'generate machine code') ----- (excessive size, no diff calculated) Item was changed: + ----- Method: CogX64Compiler>>concretizeBSR (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeBSR (in category 'generate machine code - concretize') ----- concretizeBSR "Bit Scan Reverse First operand is input register (mask) Second operand is output register (dest)" "BSR" | dest maskReg | maskReg := operands at: 0. dest := operands at: 1. machineCode at: 0 put: (self rexw: true r: dest x: 0 b: maskReg); at: 1 put: 16r0F; at: 2 put: 16rBD; at: 3 put: (self mod: ModReg RM: maskReg RO: dest). ^4! Item was changed: + ----- Method: CogX64Compiler>>concretizeCDQ (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeCDQ (in category 'generate machine code - concretize') ----- concretizeCDQ "Will get inlined into concretizeAt: switch." machineCode at: 0 put: 16r48; at: 1 put: 16r99. ^2! Item was changed: + ----- Method: CogX64Compiler>>concretizeCLD (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeCLD (in category 'generate machine code - concretize') ----- concretizeCLD machineCode at: 0 put: 16rFC. ^1! Item was changed: + ----- Method: CogX64Compiler>>concretizeCPUID (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeCPUID (in category 'generate machine code - concretize') ----- concretizeCPUID machineCode at: 0 put: 16r0F; at: 1 put: 16rA2. ^2! Item was changed: + ----- Method: CogX64Compiler>>concretizeIDIVR (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeIDIVR (in category 'generate machine code - concretize') ----- concretizeIDIVR "Will get inlined into concretizeAt: switch." | regDivisor | regDivisor := operands at: 0. machineCode at: 0 put: (self rexR: 0 x: 0 b: regDivisor); at: 1 put: 16rF7; at: 2 put: (self mod: ModReg RM: regDivisor RO: 7). ^3! Item was changed: + ----- Method: CogX64Compiler>>concretizeLOCK (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeLOCK (in category 'pro') ----- concretizeLOCK machineCode at: 0 put: 16rF0. ^1! Item was changed: + ----- Method: CogX64Compiler>>concretizeMOVSB (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeMOVSB (in category 'generate machine code - concretize') ----- concretizeMOVSB machineCode at: 0 put: 16rA4. ^1! Item was changed: + ----- Method: CogX64Compiler>>concretizeMOVSQ (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeMOVSQ (in category 'generate machine code - concretize') ----- concretizeMOVSQ machineCode at: 0 put: (self rexw: true r: 0 x: 0 b: 0); at: 1 put: 16rA5. ^2! Item was changed: + ----- Method: CogX64Compiler>>concretizeMoveRAwNoVBR (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeMoveRAwNoVBR (in category 'generate machine code - concretize') ----- concretizeMoveRAwNoVBR "A version of concretizeMoveRAw tat does not use VarBaseReg." | addressOperand reg offset | reg := operands at: 0. addressOperand := operands at: 1. (self isAnInstruction: (cogit cCoerceSimple: addressOperand to: #'AbstractInstruction *')) ifTrue: [addressOperand := (cogit cCoerceSimple: addressOperand to: #'AbstractInstruction *') address]. "If storing RAX, store directly, otherwise, because of instruction encoding limitations, the register _must_ be stored through RAX. If reg = RBP or RSP simply store directly, otherwise swap RAX with the register before and after the store through RAX. We avoid sweapping before hand with RBP and RSP because setting RSP to whatever the contents of RAX is can cause disastrous results if an interrupt is delivered immediately after that point. See mail threads beginning with http://lists.squeakfoundation.org/pipermail/vm-dev/2019-September/031428.html http://lists.squeakfoundation.org/pipermail/vm-dev/2019-October/031499.html" (reg = RAX or: [reg = RBP or: [reg = RSP]]) ifTrue: [offset := 0] ifFalse: [(reg = RBP or: [reg = RSP]) ifTrue: [machineCode at: 0 put: (self rexR: reg x: 0 b: RAX); at: 1 put: 16r89; at: 2 put: (self mod: ModReg RM: RAX RO: reg). offset := 3] ifFalse: [machineCode at: 0 put: (self rexR: RAX x: 0 b: reg); at: 1 put: 16r90 + (reg \\ 8). offset := 2]]. machineCode at: 0 + offset put: 16r48; at: 1 + offset put: 16rA3; at: 2 + offset put: (addressOperand bitAnd: 16rFF); at: 3 + offset put: (addressOperand >> 8 bitAnd: 16rFF); at: 4 + offset put: (addressOperand >> 16 bitAnd: 16rFF); at: 5 + offset put: (addressOperand >> 24 bitAnd: 16rFF); at: 6 + offset put: (addressOperand >> 32 bitAnd: 16rFF); at: 7 + offset put: (addressOperand >> 40 bitAnd: 16rFF); at: 8 + offset put: (addressOperand >> 48 bitAnd: 16rFF); at: 9 + offset put: (addressOperand >> 56 bitAnd: 16rFF). reg = RAX ifTrue: [^10]. (reg = RBP or: [reg = RSP]) ifTrue: [^13]. "Now effect the assignment via xchg, which restores RAX" machineCode at: 12 put: (machineCode at: 0); at: 13 put: (machineCode at: 1). ^14! Item was changed: + ----- Method: CogX64Compiler>>concretizeREP (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeREP (in category 'generate machine code - concretize') ----- concretizeREP machineCode at: 0 put: 16rF3. ^1! Item was changed: + ----- Method: CogX64Compiler>>concretizeSet: (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeSet: (in category 'proc') ----- concretizeSet: conditionCode + | reg | + reg := operands at: 0. - | reg offset | - offset := (reg := operands at: 0) >= R8 - ifTrue: [machineCode at: 0 put: 16r40. - 1] - ifFalse: [0]. machineCode + at: 0 put: (reg >= R8 ifTrue: [16r44] ifFalse: [16r40]); + at: 1 put: 16r0F; + at: 2 put: 16r90 + conditionCode; + at: 3 put: (self mod: ModReg RM: (reg bitAnd: 7) RO: 0). - at: 0 + offset put: 16r0F; - at: 1 + offset put: 16r90 + conditionCode; - at: 2 + offset put: (self mod: ModReg RM: (reg bitAnd: 7) RO: 0). "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! - ^3 + offset! Item was changed: + ----- Method: CogX64Compiler>>concretizeXCHGRR (in category 'generate machine code - concretize processor-specific') ----- - ----- Method: CogX64Compiler>>concretizeXCHGRR (in category 'generate machine code - concretize') ----- concretizeXCHGRR | r1 r2 | r1 := operands at: 0. r2 := operands at: 1. r2 = RAX ifTrue: [r2 := r1. r1 := RAX]. r1 = RAX ifTrue: [machineCode at: 0 put: (self rexR: 0 x: 0 b: r2); at: 1 put: 16r90 + (r2 \\ 8). ^2]. machineCode at: 0 put: (self rexR: r1 x: 0 b: r2); at: 1 put: 16r87; at: 2 put: (self mod: ModReg RM: r2 RO: r1). ^3! Item was changed: ----- Method: CogX64Compiler>>generateLowLevelTryLock: (in category 'multi-threading') ----- generateLowLevelTryLock: vmOwnerLockAddress "Generate a function that attempts to lock the vmOwnerLock and answers if it succeeded." + | vmOwnerLockAddressReg jumpEqual | - | vmOwnerLockAddressReg | vmOwnerLockAddress = 0 ifTrue: [cogit MoveCq: 1 R: ABIResultReg; RetN: 0. ^self]. "RAX holds the value of lock if unlocked (zero), receives the existing value of the lock; RAX is implicit in CMPXCHG" vmOwnerLockAddressReg := CArg1Reg. cogit MoveCq: 0 R: RAX; MoveCq: vmOwnerLockAddress R: vmOwnerLockAddressReg; gen: LOCK; + gen: CMPXCHGRMr operand: CArg0Reg operand: vmOwnerLockAddressReg. + jumpEqual := cogit JumpZero: 0. + cogit CmpR: CArg0Reg R: RAX. "If not equal to zero is it already equal to the desired value?" + jumpEqual jmpTarget: (cogit gen: SETE operand: ABIResultReg). + cogit RetN: 0! - gen: CMPXCHGRMr operand: CArg0Reg operand: vmOwnerLockAddressReg; - gen: SETE operand: ABIResultReg; - RetN: 0! Item was changed: ----- Method: CogX64Compiler>>numLowLevelLockOpcodes (in category 'multi-threading') ----- numLowLevelLockOpcodes "ceTryLockVMOwner: xorq %rax, %rax movq &vmOwnerLock, %rsi lock cmpxchgq %rdi, (%rsi) N.B. lock cmpxchgq are two separate opcodes + jz equal + cmpq %rdi, %rax + equal: setz %alt ret" + ^8! - ^6! Item was changed: ----- Method: Cogit>>handleCompareAndSwapSimulationTrap: (in category 'simulation only') ----- handleCompareAndSwapSimulationTrap: aCompareAndSwapSimulationTrap | variableValue | variableValue := (simulatedVariableGetters at: aCompareAndSwapSimulationTrap address ifAbsent: [self errorProcessingSimulationTrap: aCompareAndSwapSimulationTrap in: simulatedVariableGetters]) value asInteger. + variableValue = aCompareAndSwapSimulationTrap expectedValue + ifTrue: + [(simulatedVariableSetters + at: aCompareAndSwapSimulationTrap address + ifAbsent: [self errorProcessingSimulationTrap: aCompareAndSwapSimulationTrap + in: simulatedVariableSetters]) value: aCompareAndSwapSimulationTrap storedValue. + processor + setFlagsForCompareAndSwap: true; + perform: aCompareAndSwapSimulationTrap registerAccessor + with: (processor convertIntegerToInternal: variableValue)] + ifFalse: + [processor + setFlagsForCompareAndSwap: false; + perform: aCompareAndSwapSimulationTrap failedComparisonRegisterAccessor + with: (processor convertIntegerToInternal: variableValue)]. - processor setFlagsForCompareAndSwap: variableValue = aCompareAndSwapSimulationTrap expectedValue. - variableValue = aCompareAndSwapSimulationTrap expectedValue ifTrue: - [(simulatedVariableSetters - at: aCompareAndSwapSimulationTrap address - ifAbsent: [self errorProcessingSimulationTrap: aCompareAndSwapSimulationTrap - in: simulatedVariableSetters]) value: aCompareAndSwapSimulationTrap storedValue]. - processor - perform: aCompareAndSwapSimulationTrap registerAccessor - with: (processor convertIntegerToInternal: variableValue). processor pc: aCompareAndSwapSimulationTrap nextpc. aCompareAndSwapSimulationTrap resume: processor! From commits at source.squeak.org Thu Jan 7 23:45:36 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 7 Jan 2021 23:45:36 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2928.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2928.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2928 Author: eem Time: 7 January 2021, 3:45:26.107896 pm UUID: f6b0bdca-f526-4f21-8c07-fc9a7b4cc3f2 Ancestors: VMMaker.oscog-eem.2927 Newspeak Cogit: Reimplement warnMultiple:selectors: given printf support for #stderr as a parameter and %.*s variable string widths. =============== Diff against VMMaker.oscog-eem.2927 =============== Item was changed: ----- Method: Cogit>>warnMultiple:selectors: (in category 'debug printing') ----- warnMultiple: cogMethod selectors: aSelectorOop + 'Warning, attempt to use method with selector %.*s and selector %.*s\n' + f: #stderr + printf: {self cCoerceSimple: (objectMemory numBytesOf: cogMethod selector) to: #int. + self cCoerceSimple: (objectMemory firstIndexableField: cogMethod selector) to: #'char *'. + self cCoerceSimple: (objectMemory numBytesOf: aSelectorOop) to: #int. + self cCoerceSimple: (objectMemory firstIndexableField: aSelectorOop) to: #'char *' }! - self cCode: - [self fp: #stderr - r: 'Warning, attempt to use method with selector %.*s and selector %.*s\n' - i: (self cCoerceSimple: (objectMemory numBytesOf: cogMethod selector) to: #int) - n: (self cCoerceSimple: (objectMemory firstIndexableField: cogMethod selector) to: #'char *') - t: (self cCoerceSimple: (objectMemory numBytesOf: aSelectorOop) to: #int) - f: (self cCoerceSimple: (objectMemory firstIndexableField: aSelectorOop) to: #'char *')] - inSmalltalk: - [self warn: 'Warning, attempt to use method with selector ', - (coInterpreter stringOf: cogMethod selector), - ' and selector ', - (coInterpreter stringOf: aSelectorOop)]! Item was changed: ----- Method: PrintfFormatString>>transformForVMMaker (in category '*VMMaker-C code generation') ----- transformForVMMaker [outputStream nextPutAll: string next. format atEnd] whileFalse: + [| nextDescriptorOrNil | + [nextDescriptorOrNil := format next transformForVMMaker. + nextDescriptorOrNil isNil] whileTrue. "skip PrintfNumberHolderDescriptors" + outputStream nextPutAll: nextDescriptorOrNil]. - [outputStream nextPutAll: format next transformForVMMaker]. "any remainder is string, if so append to outputStream" string atEnd ifFalse: [outputStream nextPutAll: string next]. ^outputStream contents! Item was added: + ----- Method: PrintfNumberHolderDescriptor>>transformForVMMaker (in category '*VMMaker-C code generation') ----- + transformForVMMaker + ^nil! From noreply at github.com Fri Jan 8 00:30:24 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 16:30:24 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] ae12df: Fix compilation on win32 given recet changes to wh... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: ae12dfc3ca7b09def36109e494e2275f444a09ce https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ae12dfc3ca7b09def36109e494e2275f444a09ce Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M platforms/Cross/vm/sq.h M platforms/Cross/vm/sqVirtualMachine.h M platforms/Plan9/vm/sqPlan9io.c M platforms/RiscOS/vm/sqRPCMain.c M platforms/iOS/vm/Common/Classes/sqMacV2Time.c M platforms/minheadless/generic/sqPlatformSpecific-Generic.c M platforms/minheadless/unix/sqUnixHeartbeat.c M platforms/minheadless/windows/sqWin32Heartbeat.c M platforms/minheadless/windows/sqWin32Time.c M platforms/unix/misc/threadValidate/sqUnixHeartbeat.c M platforms/unix/vm/sqUnixHeartbeat.c M platforms/unix/vm/sqUnixITimerHeartbeat.c M platforms/unix/vm/sqUnixITimerTickerHeartbeat.c M platforms/unix/vm/sqUnixMain.c M platforms/win32/vm/sqWin32Heartbeat.c M platforms/win32/vm/sqWin32Time.c Log Message: ----------- Fix compilation on win32 given recet changes to what sq.h and sqVirtualMachine.h define. Make the type of io[Micro]MSecs usqInt because a) these are unsigned clocks and b) usqInt is the word size and so generates the simplest client code. From no-reply at appveyor.com Fri Jan 8 00:35:10 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jan 2021 00:35:10 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2352 Message-ID: <20210108003510.1.C9EC3D4163D690A6@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Jan 8 00:58:33 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 8 Jan 2021 00:58:33 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2929.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2929.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2929 Author: eem Time: 7 January 2021, 4:58:23.879547 pm UUID: c5db190c-4c95-4719-819e-6010319abfe3 Ancestors: VMMaker.oscog-eem.2928 Bow to LLP64 and type ioMicroMSecs as unigned int. =============== Diff against VMMaker.oscog-eem.2928 =============== Item was changed: ----- Method: InterpreterProxy>>ioMicroMSecs (in category 'other') ----- ioMicroMSecs + ^Time millisecondClockValue! From noreply at github.com Fri Jan 8 01:05:49 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 17:05:49 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 4097d3: CogVM source as per VMMaker.oscog-eem.2929 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 4097d3ca731631b6c22516d9207ae090704240a2 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4097d3ca731631b6c22516d9207ae090704240a2 Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M platforms/Cross/vm/sq.h M platforms/Cross/vm/sqVirtualMachine.h M platforms/Mac OS/vm/Developer/sqMacMinimal.c M platforms/Mac OS/vm/sqMacTime.c M platforms/Plan9/vm/sqPlan9io.c M platforms/RiscOS/vm/sqRPCMain.c M platforms/minheadless/common/sqaio.h M platforms/unix/vm/sqUnixHeartbeat.c M platforms/unix/vm/sqUnixITimerHeartbeat.c M platforms/unix/vm/sqUnixITimerTickerHeartbeat.c M platforms/unix/vm/sqUnixMain.c M platforms/unix/vm/sqaio.h M platforms/win32/vm/sqWin32Heartbeat.c M platforms/win32/vm/sqWin32Time.c M src/plugins/B2DPlugin/B2DPlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2929 Bow to LLP64 and type ioMicroMSecs as unigned int. From no-reply at appveyor.com Fri Jan 8 01:18:09 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jan 2021 01:18:09 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2353 Message-ID: <20210108011809.1.037FBD39EC33EE86@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Fri Jan 8 04:50:59 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 20:50:59 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 0c72d2: Fixes fr compilation on 64-bit win32 cygwin/mingw. Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 0c72d2bd11c64a3c1dc0428090baa01afd2cf607 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/0c72d2bd11c64a3c1dc0428090baa01afd2cf607 Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M platforms/Cross/plugins/Squeak3D/b3dMain.c M platforms/Cross/vm/sq.h M platforms/Cross/vm/sqVirtualMachine.h M platforms/win32/plugins/JoystickTabletPlugin/sqWin32Joystick.c M platforms/win32/vm/sqPlatformSpecific.h Log Message: ----------- Fixes fr compilation on 64-bit win32 cygwin/mingw. From no-reply at appveyor.com Fri Jan 8 05:10:31 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jan 2021 05:10:31 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2354 Message-ID: <20210108051031.1.966D1672ABB02B78@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Fri Jan 8 05:17:25 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 21:17:25 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 419dae: CogVM source as per VMMaker.oscog-eem.2925 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 419dae1ad026c7eba84c011bd31c9e2dd8407774 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/419dae1ad026c7eba84c011bd31c9e2dd8407774 Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c M src/plugins/SqueakFFIPrims/ARM64FFIPlugin.c M src/plugins/SqueakFFIPrims/IA32FFIPlugin.c M src/plugins/SqueakFFIPrims/X64SysVFFIPlugin.c M src/plugins/SqueakFFIPrims/X64Win64FFIPlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2925 The FFI plugins need to be regenerated for ioLoadSymbol:OfLength:FromModule: From no-reply at appveyor.com Fri Jan 8 05:53:38 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jan 2021 05:53:38 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2355 Message-ID: <20210108055338.1.02B26C828818991A@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Jan 8 06:59:28 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 8 Jan 2021 06:59:28 0000 Subject: [Vm-dev] VM Maker: Cog-eem.433.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.433.mcz ==================== Summary ==================== Name: Cog-eem.433 Author: eem Time: 7 January 2021, 10:59:26.348948 pm UUID: 8f14ae4e-2c3f-4b02-9aea-bfb0346c0854 Ancestors: Cog-eem.432 Time to bring the ARMv8 work back into Cog/VMMaker under full MIT. =============== Diff against Cog-eem.432 =============== Item was added: + CogProcessorAlien variableByteSubclass: #GdbARMv8Alien + instanceVariableNames: '' + classVariableNames: 'ID_AA64DFR0_EL1 ID_AA64DFR1_EL1 ID_AA64ISAR0_EL1 ID_AA64ISAR1_EL1 ID_AA64MMFR0_EL1 ID_AA64MMFR1_EL1 ID_AA64PFR0_EL1 ID_AA64PFR1_EL1 Level0FailureTable' + poolDictionaries: 'ARMv8A64Opcodes' + category: 'Cog-Processors'! + + !GdbARMv8Alien commentStamp: 'eem 11/19/2019 15:39' prior: 0! + I am a wrapper around the struct sim aarch64 CPU instance and emulator routines and I give access to disassembling using libopcodes.! Item was added: + ----- Method: GdbARMv8Alien class>>dataSize (in category 'instance creation') ----- + dataSize + ^2280! Item was added: + ----- Method: GdbARMv8Alien class>>implementationClass (in category 'instance creation') ----- + implementationClass + ^Smalltalk wordSize = 8 ifTrue: [GdbARMv8Alien64] ifFalse: [self]! Item was added: + ----- Method: GdbARMv8Alien class>>initialize (in category 'class initialization') ----- + initialize + "Initialize the execution failure dispatch table. This is organized around op0 in C4.1 of the Arm ARM. + Each tuple is a type and a failure routine, or nil of not needed to be handled as an execution failure." + "self initialize" + Level0FailureTable := #( + "0" nil nil nil nil + "4" (LDST handleFailingLoadStore:at:in:) + "5" nil + "6" (LDST handleFailingLoadStore:at:in:) + "7" nil nil nil + "a" (BR handleFailingBranch:at:in:) + "b" (BR handleFailingBranch:at:in:) + "c" (LDST handleFailingLoadStore:at:in:) + "d" nil + "e" (LDST handleFailingLoadStore:at:in:) + nil). + + "At least Raspberry Pi 4 running Manjaro allows access to EL1 level system registers... + These values are derived from the program in + https://android.googlesource.com/kernel/common/+/refs/tags/ASB-2019-03-05_4.14-p-release/Documentation/arm64/cpu-feature-registers.txt + run on a raspberry Pi 4 Model B" + + ID_AA64ISAR0_EL1 := 16r00010000. + ID_AA64ISAR1_EL1 := 16r00000000. + ID_AA64MMFR0_EL1 := 16rFF000000. + ID_AA64MMFR1_EL1 := 16r00000000. + ID_AA64PFR0_EL1 := 16r00000011. + ID_AA64PFR1_EL1 := 16r00000000. + ID_AA64DFR0_EL1 := 16r00000006. + ID_AA64DFR1_EL1 := 16r00000000 + ! Item was added: + ----- Method: GdbARMv8Alien class>>primitiveNewCPU (in category 'primitives') ----- + primitiveNewCPU + "Answer the address of a new struct sim_spu instance (see processors/ARM/gdb-8.3.1/sim/aarch64/sim_main.h)." + + ^self primitiveFailed! Item was added: + ----- Method: GdbARMv8Alien>>abiMarshalArg0:arg1:in: (in category 'accessing-abstract') ----- + abiMarshalArg0: arg0 arg1: arg1 in: memory + "Marshal two integral arguments according to the ABI." + self r0: arg0. + self r1: arg1! Item was added: + ----- Method: GdbARMv8Alien>>abiMarshalArg0:in: (in category 'accessing-abstract') ----- + abiMarshalArg0: arg0 in: memory + "Marshal one integral argument according to the ABI. + Currently used in the COGMTVM to tryLockVMOwner:" + self r0: arg0! Item was added: + ----- Method: GdbARMv8Alien>>abstractInstructionCompilerClass (in category 'Cog API') ----- + abstractInstructionCompilerClass + ^CogARMv8Compiler! Item was added: + ----- Method: GdbARMv8Alien>>b0 (in category 'accessing') ----- + b0 + ^self unsignedByteAt: 1! Item was added: + ----- Method: GdbARMv8Alien>>b0: (in category 'accessing') ----- + b0: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 1 put: 0. + ^self unsignedByteAt: 1 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b1 (in category 'accessing') ----- + b1 + ^self unsignedByteAt: 9! Item was added: + ----- Method: GdbARMv8Alien>>b10 (in category 'accessing') ----- + b10 + ^self unsignedByteAt: 81! Item was added: + ----- Method: GdbARMv8Alien>>b10: (in category 'accessing') ----- + b10: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 81 put: 0. + ^self unsignedByteAt: 81 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b11 (in category 'accessing') ----- + b11 + ^self unsignedByteAt: 89! Item was added: + ----- Method: GdbARMv8Alien>>b11: (in category 'accessing') ----- + b11: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 89 put: 0. + ^self unsignedByteAt: 89 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b12 (in category 'accessing') ----- + b12 + ^self unsignedByteAt: 97! Item was added: + ----- Method: GdbARMv8Alien>>b12: (in category 'accessing') ----- + b12: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 97 put: 0. + ^self unsignedByteAt: 97 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b13 (in category 'accessing') ----- + b13 + ^self unsignedByteAt: 105! Item was added: + ----- Method: GdbARMv8Alien>>b13: (in category 'accessing') ----- + b13: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 105 put: 0. + ^self unsignedByteAt: 105 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b14 (in category 'accessing') ----- + b14 + ^self unsignedByteAt: 113! Item was added: + ----- Method: GdbARMv8Alien>>b14: (in category 'accessing') ----- + b14: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 113 put: 0. + ^self unsignedByteAt: 113 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b15 (in category 'accessing') ----- + b15 + ^self unsignedByteAt: 121! Item was added: + ----- Method: GdbARMv8Alien>>b15: (in category 'accessing') ----- + b15: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 121 put: 0. + ^self unsignedByteAt: 121 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b16 (in category 'accessing') ----- + b16 + ^self unsignedByteAt: 129! Item was added: + ----- Method: GdbARMv8Alien>>b16: (in category 'accessing') ----- + b16: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 129 put: 0. + ^self unsignedByteAt: 129 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b17 (in category 'accessing') ----- + b17 + ^self unsignedByteAt: 137! Item was added: + ----- Method: GdbARMv8Alien>>b17: (in category 'accessing') ----- + b17: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 137 put: 0. + ^self unsignedByteAt: 137 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b18 (in category 'accessing') ----- + b18 + ^self unsignedByteAt: 145! Item was added: + ----- Method: GdbARMv8Alien>>b18: (in category 'accessing') ----- + b18: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 145 put: 0. + ^self unsignedByteAt: 145 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b19 (in category 'accessing') ----- + b19 + ^self unsignedByteAt: 153! Item was added: + ----- Method: GdbARMv8Alien>>b19: (in category 'accessing') ----- + b19: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 153 put: 0. + ^self unsignedByteAt: 153 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b1: (in category 'accessing') ----- + b1: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 9 put: 0. + ^self unsignedByteAt: 9 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b2 (in category 'accessing') ----- + b2 + ^self unsignedByteAt: 17! Item was added: + ----- Method: GdbARMv8Alien>>b20 (in category 'accessing') ----- + b20 + ^self unsignedByteAt: 161! Item was added: + ----- Method: GdbARMv8Alien>>b20: (in category 'accessing') ----- + b20: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 161 put: 0. + ^self unsignedByteAt: 161 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b21 (in category 'accessing') ----- + b21 + ^self unsignedByteAt: 169! Item was added: + ----- Method: GdbARMv8Alien>>b21: (in category 'accessing') ----- + b21: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 169 put: 0. + ^self unsignedByteAt: 169 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b22 (in category 'accessing') ----- + b22 + ^self unsignedByteAt: 177! Item was added: + ----- Method: GdbARMv8Alien>>b22: (in category 'accessing') ----- + b22: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 177 put: 0. + ^self unsignedByteAt: 177 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b23 (in category 'accessing') ----- + b23 + ^self unsignedByteAt: 185! Item was added: + ----- Method: GdbARMv8Alien>>b23: (in category 'accessing') ----- + b23: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 185 put: 0. + ^self unsignedByteAt: 185 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b24 (in category 'accessing') ----- + b24 + ^self unsignedByteAt: 193! Item was added: + ----- Method: GdbARMv8Alien>>b24: (in category 'accessing') ----- + b24: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 193 put: 0. + ^self unsignedByteAt: 193 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b25 (in category 'accessing') ----- + b25 + ^self unsignedByteAt: 201! Item was added: + ----- Method: GdbARMv8Alien>>b25: (in category 'accessing') ----- + b25: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 201 put: 0. + ^self unsignedByteAt: 201 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b26 (in category 'accessing') ----- + b26 + ^self unsignedByteAt: 209! Item was added: + ----- Method: GdbARMv8Alien>>b26: (in category 'accessing') ----- + b26: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 209 put: 0. + ^self unsignedByteAt: 209 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b27 (in category 'accessing') ----- + b27 + ^self unsignedByteAt: 217! Item was added: + ----- Method: GdbARMv8Alien>>b27: (in category 'accessing') ----- + b27: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 217 put: 0. + ^self unsignedByteAt: 217 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b28 (in category 'accessing') ----- + b28 + ^self unsignedByteAt: 225! Item was added: + ----- Method: GdbARMv8Alien>>b28: (in category 'accessing') ----- + b28: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 225 put: 0. + ^self unsignedByteAt: 225 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b2: (in category 'accessing') ----- + b2: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 17 put: 0. + ^self unsignedByteAt: 17 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b3 (in category 'accessing') ----- + b3 + ^self unsignedByteAt: 25! Item was added: + ----- Method: GdbARMv8Alien>>b3: (in category 'accessing') ----- + b3: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 25 put: 0. + ^self unsignedByteAt: 25 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b4 (in category 'accessing') ----- + b4 + ^self unsignedByteAt: 33! Item was added: + ----- Method: GdbARMv8Alien>>b4: (in category 'accessing') ----- + b4: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 33 put: 0. + ^self unsignedByteAt: 33 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b5 (in category 'accessing') ----- + b5 + ^self unsignedByteAt: 41! Item was added: + ----- Method: GdbARMv8Alien>>b5: (in category 'accessing') ----- + b5: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 41 put: 0. + ^self unsignedByteAt: 41 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b6 (in category 'accessing') ----- + b6 + ^self unsignedByteAt: 49! Item was added: + ----- Method: GdbARMv8Alien>>b6: (in category 'accessing') ----- + b6: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 49 put: 0. + ^self unsignedByteAt: 49 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b7 (in category 'accessing') ----- + b7 + ^self unsignedByteAt: 57! Item was added: + ----- Method: GdbARMv8Alien>>b7: (in category 'accessing') ----- + b7: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 57 put: 0. + ^self unsignedByteAt: 57 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b8 (in category 'accessing') ----- + b8 + ^self unsignedByteAt: 65! Item was added: + ----- Method: GdbARMv8Alien>>b8: (in category 'accessing') ----- + b8: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 65 put: 0. + ^self unsignedByteAt: 65 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>b9 (in category 'accessing') ----- + b9 + ^self unsignedByteAt: 73! Item was added: + ----- Method: GdbARMv8Alien>>b9: (in category 'accessing') ----- + b9: anUnsignedByte + "zero extend..." + self unsignedLongLongAt: 73 put: 0. + ^self unsignedByteAt: 73 put: anUnsignedByte! Item was added: + ----- Method: GdbARMv8Alien>>cResultRegister (in category 'accessing-abstract') ----- + cResultRegister + ^self r0! Item was added: + ----- Method: GdbARMv8Alien>>cResultRegister: (in category 'accessing-abstract') ----- + cResultRegister: aValue + self r0: aValue! Item was added: + ----- Method: GdbARMv8Alien>>clrexOpcode (in category 'opcodes') ----- + clrexOpcode + ^2r11010101000000110011111101011111! Item was added: + ----- Method: GdbARMv8Alien>>controlRegisterGetters (in category 'accessing-abstract') ----- + controlRegisterGetters + ^#(pc rawCPSR fpCPSR fpCPCR nextpc)! Item was added: + ----- Method: GdbARMv8Alien>>convertIntegerToInternal: (in category 'tests support') ----- + convertIntegerToInternal: anInteger + "Conversion for 64-bit processors." + ^anInteger signedIntToLong64! Item was added: + ----- Method: GdbARMv8Alien>>d0 (in category 'accessing') ----- + d0 + ^self unsignedLongLongAt: 265! Item was added: + ----- Method: GdbARMv8Alien>>d0: (in category 'accessing') ----- + d0: anUnsignedInteger + ^self unsignedLongLongAt: 265 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d1 (in category 'accessing') ----- + d1 + ^self unsignedLongLongAt: 281! Item was added: + ----- Method: GdbARMv8Alien>>d10 (in category 'accessing') ----- + d10 + ^self unsignedLongLongAt: 425! Item was added: + ----- Method: GdbARMv8Alien>>d10: (in category 'accessing') ----- + d10: anUnsignedInteger + ^self unsignedLongLongAt: 425 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d11 (in category 'accessing') ----- + d11 + ^self unsignedLongLongAt: 441! Item was added: + ----- Method: GdbARMv8Alien>>d11: (in category 'accessing') ----- + d11: anUnsignedInteger + ^self unsignedLongLongAt: 441 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d12 (in category 'accessing') ----- + d12 + ^self unsignedLongLongAt: 457! Item was added: + ----- Method: GdbARMv8Alien>>d12: (in category 'accessing') ----- + d12: anUnsignedInteger + ^self unsignedLongLongAt: 457 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d13 (in category 'accessing') ----- + d13 + ^self unsignedLongLongAt: 473! Item was added: + ----- Method: GdbARMv8Alien>>d13: (in category 'accessing') ----- + d13: anUnsignedInteger + ^self unsignedLongLongAt: 473 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d14 (in category 'accessing') ----- + d14 + ^self unsignedLongLongAt: 489! Item was added: + ----- Method: GdbARMv8Alien>>d14: (in category 'accessing') ----- + d14: anUnsignedInteger + ^self unsignedLongLongAt: 489 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d15 (in category 'accessing') ----- + d15 + ^self unsignedLongLongAt: 505! Item was added: + ----- Method: GdbARMv8Alien>>d15: (in category 'accessing') ----- + d15: anUnsignedInteger + ^self unsignedLongLongAt: 505 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d16 (in category 'accessing') ----- + d16 + ^self unsignedLongLongAt: 521! Item was added: + ----- Method: GdbARMv8Alien>>d16: (in category 'accessing') ----- + d16: anUnsignedInteger + ^self unsignedLongLongAt: 521 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d17 (in category 'accessing') ----- + d17 + ^self unsignedLongLongAt: 537! Item was added: + ----- Method: GdbARMv8Alien>>d17: (in category 'accessing') ----- + d17: anUnsignedInteger + ^self unsignedLongLongAt: 537 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d18 (in category 'accessing') ----- + d18 + ^self unsignedLongLongAt: 553! Item was added: + ----- Method: GdbARMv8Alien>>d18: (in category 'accessing') ----- + d18: anUnsignedInteger + ^self unsignedLongLongAt: 553 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d19 (in category 'accessing') ----- + d19 + ^self unsignedLongLongAt: 569! Item was added: + ----- Method: GdbARMv8Alien>>d19: (in category 'accessing') ----- + d19: anUnsignedInteger + ^self unsignedLongLongAt: 569 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d1: (in category 'accessing') ----- + d1: anUnsignedInteger + ^self unsignedLongLongAt: 281 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d2 (in category 'accessing') ----- + d2 + ^self unsignedLongLongAt: 297! Item was added: + ----- Method: GdbARMv8Alien>>d20 (in category 'accessing') ----- + d20 + ^self unsignedLongLongAt: 585! Item was added: + ----- Method: GdbARMv8Alien>>d20: (in category 'accessing') ----- + d20: anUnsignedInteger + ^self unsignedLongLongAt: 585 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d21 (in category 'accessing') ----- + d21 + ^self unsignedLongLongAt: 601! Item was added: + ----- Method: GdbARMv8Alien>>d21: (in category 'accessing') ----- + d21: anUnsignedInteger + ^self unsignedLongLongAt: 601 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d22 (in category 'accessing') ----- + d22 + ^self unsignedLongLongAt: 617! Item was added: + ----- Method: GdbARMv8Alien>>d22: (in category 'accessing') ----- + d22: anUnsignedInteger + ^self unsignedLongLongAt: 617 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d23 (in category 'accessing') ----- + d23 + ^self unsignedLongLongAt: 633! Item was added: + ----- Method: GdbARMv8Alien>>d23: (in category 'accessing') ----- + d23: anUnsignedInteger + ^self unsignedLongLongAt: 633 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d24 (in category 'accessing') ----- + d24 + ^self unsignedLongLongAt: 649! Item was added: + ----- Method: GdbARMv8Alien>>d24: (in category 'accessing') ----- + d24: anUnsignedInteger + ^self unsignedLongLongAt: 649 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d25 (in category 'accessing') ----- + d25 + ^self unsignedLongLongAt: 665! Item was added: + ----- Method: GdbARMv8Alien>>d25: (in category 'accessing') ----- + d25: anUnsignedInteger + ^self unsignedLongLongAt: 665 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d26 (in category 'accessing') ----- + d26 + ^self unsignedLongLongAt: 681! Item was added: + ----- Method: GdbARMv8Alien>>d26: (in category 'accessing') ----- + d26: anUnsignedInteger + ^self unsignedLongLongAt: 681 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d27 (in category 'accessing') ----- + d27 + ^self unsignedLongLongAt: 697! Item was added: + ----- Method: GdbARMv8Alien>>d27: (in category 'accessing') ----- + d27: anUnsignedInteger + ^self unsignedLongLongAt: 697 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d28 (in category 'accessing') ----- + d28 + ^self unsignedLongLongAt: 713! Item was added: + ----- Method: GdbARMv8Alien>>d28: (in category 'accessing') ----- + d28: anUnsignedInteger + ^self unsignedLongLongAt: 713 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d29 (in category 'accessing') ----- + d29 + ^self unsignedLongLongAt: 729! Item was added: + ----- Method: GdbARMv8Alien>>d29: (in category 'accessing') ----- + d29: anUnsignedInteger + ^self unsignedLongLongAt: 729 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d2: (in category 'accessing') ----- + d2: anUnsignedInteger + ^self unsignedLongLongAt: 297 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d3 (in category 'accessing') ----- + d3 + ^self unsignedLongLongAt: 313! Item was added: + ----- Method: GdbARMv8Alien>>d30 (in category 'accessing') ----- + d30 + ^self unsignedLongLongAt: 745! Item was added: + ----- Method: GdbARMv8Alien>>d30: (in category 'accessing') ----- + d30: anUnsignedInteger + ^self unsignedLongLongAt: 745 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d31 (in category 'accessing') ----- + d31 + ^self unsignedLongLongAt: 761! Item was added: + ----- Method: GdbARMv8Alien>>d31: (in category 'accessing') ----- + d31: anUnsignedInteger + ^self unsignedLongLongAt: 761 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d3: (in category 'accessing') ----- + d3: anUnsignedInteger + ^self unsignedLongLongAt: 313 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d4 (in category 'accessing') ----- + d4 + ^self unsignedLongLongAt: 329! Item was added: + ----- Method: GdbARMv8Alien>>d4: (in category 'accessing') ----- + d4: anUnsignedInteger + ^self unsignedLongLongAt: 329 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d5 (in category 'accessing') ----- + d5 + ^self unsignedLongLongAt: 345! Item was added: + ----- Method: GdbARMv8Alien>>d5: (in category 'accessing') ----- + d5: anUnsignedInteger + ^self unsignedLongLongAt: 345 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d6 (in category 'accessing') ----- + d6 + ^self unsignedLongLongAt: 361! Item was added: + ----- Method: GdbARMv8Alien>>d6: (in category 'accessing') ----- + d6: anUnsignedInteger + ^self unsignedLongLongAt: 361 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d7 (in category 'accessing') ----- + d7 + ^self unsignedLongLongAt: 377! Item was added: + ----- Method: GdbARMv8Alien>>d7: (in category 'accessing') ----- + d7: anUnsignedInteger + ^self unsignedLongLongAt: 377 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d8 (in category 'accessing') ----- + d8 + ^self unsignedLongLongAt: 393! Item was added: + ----- Method: GdbARMv8Alien>>d8: (in category 'accessing') ----- + d8: anUnsignedInteger + ^self unsignedLongLongAt: 393 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>d9 (in category 'accessing') ----- + d9 + ^self unsignedLongLongAt: 409! Item was added: + ----- Method: GdbARMv8Alien>>d9: (in category 'accessing') ----- + d9: anUnsignedInteger + ^self unsignedLongLongAt: 409 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>decorateDisassembly:for:fromAddress: (in category 'disassembly') ----- + decorateDisassembly: anInstructionString for: aSymbolManager fromAddress: address + ^self decorateDisassembly: anInstructionString for: aSymbolManager fromAddress: address labels: nil! Item was added: + ----- Method: GdbARMv8Alien>>decorateDisassembly:for:fromAddress:labels: (in category 'disassembly') ----- + decorateDisassembly: anInstructionString for: aSymbolManager fromAddress: address labels: labelDictionaryOrNil + "Decode what we can of the instruction and decorate it with useful stuff" + | word operand memory theInstructionString mnemonic offsetIdx nonZeroIdx size secondOperand | + word := (memory:= aSymbolManager objectMemory) long32At: address. + "See #twoWordLiteral in the (ARMv8A64Opcodes instructionIsAnyLoadStore: word) arm below. + If a previous pc-relative load has been decorated it will be added to labelDictionaryOrNil, + with valuer #twoWordLiteral, so just try and decode the value." + labelDictionaryOrNil ifNotNil: + [(mnemonic := labelDictionaryOrNil at: address ifAbsent: nil) == #twoWordLiteral ifTrue: + [^(anInstructionString copyReplaceAll: '; undefined' with: '') + , ((address noMask: 7) "Is this the first word of the literal?" + ifTrue: [(aSymbolManager lookupAddress: (memory longAt: address)) ifNotNil: [:label| ' = ', label] ifNil: ['']] + ifFalse: [''])]. + mnemonic = #oneWordLiteral ifTrue: + [^(anInstructionString copyReplaceAll: '; undefined' with: ''), + ((aSymbolManager lookup32BitWordConstant: word) ifNotNil: [:label| ' => ', label] ifNil: [''])]]. + mnemonic := (anInstructionString first isLetter + ifTrue: [anInstructionString copyUpTo: Character tab] + ifFalse: [anInstructionString + copyFrom: (anInstructionString indexOf: $:) + 2 + to: (anInstructionString indexOf: Character tab ifAbsent: [anInstructionString size + 1]) - 1]) + copyUpTo: Character space. + + "Trim long sequences of zeros in address operands" + theInstructionString := + (offsetIdx := (anInstructionString indexOfSubCollection: '0x' startingAt: 12)) > 0 + ifTrue: + [nonZeroIdx := offsetIdx + 2. + size := anInstructionString size. + [nonZeroIdx <= size and: [(anInstructionString at: nonZeroIdx) == $0]] whileTrue: [nonZeroIdx := nonZeroIdx + 1]. + nonZeroIdx < size + ifTrue: [anInstructionString copyReplaceFrom: offsetIdx + 2 to: nonZeroIdx - 1 with: ''] + ifFalse: [anInstructionString]] + ifFalse: [anInstructionString]. + + mnemonic ~= '.inst' ifTrue: "All bets are off for arbitrary literals" + [((mnemonic beginsWith: 'ld') or: [(mnemonic beginsWith: 'st') or: [mnemonic beginsWith: 'cas']]) + ifTrue: [self assert: (ARMv8A64Opcodes instructionIsAnyLoadStore: word)] + ifFalse: [self deny: (ARMv8A64Opcodes instructionIsAnyLoadStore: word)]. + ((mnemonic beginsWith: 'br') or: [(mnemonic beginsWith: 'bl') or: [(mnemonic beginsWith: 'b.') + or: [mnemonic = 'b' or: [mnemonic = 'ret']]]]) + ifTrue: [self assert: (ARMv8A64Opcodes instructionIsAnyB: word)] + ifFalse: [self deny: (ARMv8A64Opcodes instructionIsAnyB: word)]. + "add register names..." + offsetIdx := theInstructionString size + 2. + [(offsetIdx := theInstructionString lastIndexOf: $x startingAt: offsetIdx - 2) > 1] whileTrue: + [| regNum regName stream | + ((theInstructionString at: offsetIdx - 1) isAlphaNumeric not + and: [(theInstructionString at: offsetIdx + 1) isDigit + and: [stream := ReadStream on: theInstructionString from: offsetIdx + 1 to: offsetIdx + 2. + (regName := aSymbolManager lookupRegisterNumber: (regNum := Integer readFrom:stream)) notNil]]) + ifTrue: + [((theInstructionString at: offsetIdx - 1) == $[ + and: [stream position + 4 < theInstructionString size + and: [(theInstructionString at: stream position + 3) == $#]]) ifTrue: "excludes e.g. ldr x29, [x16], #8'" + [| offsetStream | + offsetStream := ReadStream on: theInstructionString from: stream position + 4 to: theInstructionString size. + (regNum = FPReg and: [PrintTempNames]) ifTrue: + [(aSymbolManager lookupFrameOffset: (Integer readFrom: offsetStream)) ifNotNil: + [:varName| + theInstructionString := theInstructionString + copyReplaceFrom: offsetStream position + 1 + to: offsetStream position + with: ':', varName]]. + regNum = ReceiverResultReg ifTrue: + [(aSymbolManager lookupInstVarOffset: (Integer readFrom: offsetStream)) ifNotNil: + [:varName| + theInstructionString := theInstructionString + copyReplaceFrom: offsetStream position + 1 + to: offsetStream position + with: ':', varName]]]. + theInstructionString := theInstructionString + copyReplaceFrom: stream position + 1 + to: stream position + with: '/', regName]]]. + + (ARMv8A64Opcodes instructionIsAnyB: word) + ifTrue: + [(ARMv8A64Opcodes instructionIsBImm26: word) ifTrue: + [operand := ARMv8A64Opcodes extractOffsetFromBImm26: word]. + (ARMv8A64Opcodes instructionIsBImm19: word) ifTrue: + [operand := ARMv8A64Opcodes extractOffsetFromBImm19: word]. + operand ifNotNil: + [operand := (operand bitShift: 2) + address bitAnd: aSymbolManager addressSpaceMask]. + "We can't extract the offset from a BX/BLX instructions register, unless we're at the current pc, + because otherwise its current value has nothing to do with the value when this instruction is executed." + (self pc = address + and: [ARMv8A64Opcodes instructionIsAnyBX: word]) ifTrue: + [operand := (self perform: (self registerStateGetters at: (word >> 5 bitAnd: 31) + 1))]] + ifFalse: + [(ARMv8A64Opcodes instructionIsAnyLoadStore: word) + ifTrue: + [| baseR twoWords addr lit signExtend | + "first see if this is a load via the varBase register" + operand := (baseR := (word >> 5 bitAnd: 31)) = CogARMv8Compiler VarBaseReg ifTrue: + [aSymbolManager varBaseAddress + (ARMv8A64Opcodes extractOffsetFromLoadStore: word)]. + (operand ~~ nil and: [mnemonic = 'ldp' or: [mnemonic = 'stp']]) ifTrue: + [secondOperand := operand + 8]. + "See if this is a pc-relative literal load" + (ARMv8A64Opcodes instructionIsPCRelativeLoad: word) ifTrue: + [twoWords := word >> 30 anyMask: 1. + addr := aSymbolManager backEnd pcRelativeAddressAt: address. + lit := twoWords + ifTrue: [self assert: (addr noMask: 7). + labelDictionaryOrNil ifNotNil: + [labelDictionaryOrNil at: addr put: #twoWordLiteral; at: addr + 4 put: #twoWordLiteral]. + memory longAt: addr] + ifFalse: + ["If the next instruction is a linked send then mark the literal and it'll get mapped to a class index" + labelDictionaryOrNil ifNotNil: + [| nextInst | + nextInst := memory long32At: address + 4. + (ARMv8A64Opcodes instructionIsBImm26: nextInst) ifTrue: + [operand := ARMv8A64Opcodes extractOffsetFromBImm26: word. + operand := (operand bitShift: 2) + address bitAnd: aSymbolManager addressSpaceMask. + operand := aSymbolManager lookupAddress: operand. + (operand isNil "Closed PICs" + or: [operand includes: $@]) "likely linked send" ifTrue: + [labelDictionaryOrNil at: addr put: #oneWordLiteral]]]. + lit := memory long32At: addr. + (signExtend := word >> 31 anyMask: 1) + ifTrue: [lit - (lit >> 31 << 32)] + ifFalse: [lit]]. + ^(aSymbolManager lookupAddress: lit) + ifNotNil: [:label| theInstructionString, ' = ', label] + ifNil: [theInstructionString, ' = ', (lit hex allButFirst: 3)]]] + ifFalse: + [operand := word]]. + + "is there an interesting address for the operand, for this instruction?" + operand ifNotNil: + [labelDictionaryOrNil ifNotNil: + [(labelDictionaryOrNil at: operand ifAbsent: nil) ifNotNil: + [:string| ^theInstructionString, ' = ', string]]. + (aSymbolManager lookupAddress: operand) ifNotNil: + [:string| ^theInstructionString, ' = ', string, (secondOperand ifNil: [''] ifNotNil: [',', (aSymbolManager lookupAddress: secondOperand)])]]. + + ^theInstructionString! Item was added: + ----- Method: GdbARMv8Alien>>floatingPointRegisterStateGetters (in category 'accessing-abstract') ----- + floatingPointRegisterStateGetters + ^#(d0 d1 d2 d3 d4 d5 d6 d7 + d8 d9 d10 d11 d12 d13 d14 d15 + d16 d17 d18 d19 d20 d21 d22 d23 + d24 d25 d26 d27 d28 d29 d30 d31)! Item was added: + ----- Method: GdbARMv8Alien>>fp (in category 'accessing') ----- + fp + ^self unsignedLongLongAt: 233! Item was added: + ----- Method: GdbARMv8Alien>>fp: (in category 'accessing') ----- + fp: anUnsignedInteger + ^self unsignedLongLongAt: 233 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>fpCPCR (in category 'accessing') ----- + fpCPCR + ^self unsignedLongLongAt: 793! Item was added: + ----- Method: GdbARMv8Alien>>fpCPCR: (in category 'accessing') ----- + fpCPCR: anUnsignedInteger + ^self unsignedLongLongAt: 793 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>fpCPSR (in category 'accessing') ----- + fpCPSR + ^self unsignedLongLongAt: 789! Item was added: + ----- Method: GdbARMv8Alien>>fpCPSR: (in category 'accessing') ----- + fpCPSR: anUnsignedInteger + ^self unsignedLongLongAt: 789 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>h0 (in category 'accessing') ----- + h0 + ^self unsignedShortAt: 1! Item was added: + ----- Method: GdbARMv8Alien>>h0: (in category 'accessing') ----- + h0: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 1 put: 0. + ^self unsignedShortAt: 1 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h1 (in category 'accessing') ----- + h1 + ^self unsignedShortAt: 9! Item was added: + ----- Method: GdbARMv8Alien>>h10 (in category 'accessing') ----- + h10 + ^self unsignedShortAt: 81! Item was added: + ----- Method: GdbARMv8Alien>>h10: (in category 'accessing') ----- + h10: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 81 put: 0. + ^self unsignedShortAt: 81 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h11 (in category 'accessing') ----- + h11 + ^self unsignedShortAt: 89! Item was added: + ----- Method: GdbARMv8Alien>>h11: (in category 'accessing') ----- + h11: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 89 put: 0. + ^self unsignedShortAt: 89 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h12 (in category 'accessing') ----- + h12 + ^self unsignedShortAt: 97! Item was added: + ----- Method: GdbARMv8Alien>>h12: (in category 'accessing') ----- + h12: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 97 put: 0. + ^self unsignedShortAt: 97 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h13 (in category 'accessing') ----- + h13 + ^self unsignedShortAt: 105! Item was added: + ----- Method: GdbARMv8Alien>>h13: (in category 'accessing') ----- + h13: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 105 put: 0. + ^self unsignedShortAt: 105 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h14 (in category 'accessing') ----- + h14 + ^self unsignedShortAt: 113! Item was added: + ----- Method: GdbARMv8Alien>>h14: (in category 'accessing') ----- + h14: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 113 put: 0. + ^self unsignedShortAt: 113 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h15 (in category 'accessing') ----- + h15 + ^self unsignedShortAt: 121! Item was added: + ----- Method: GdbARMv8Alien>>h15: (in category 'accessing') ----- + h15: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 121 put: 0. + ^self unsignedShortAt: 121 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h16 (in category 'accessing') ----- + h16 + ^self unsignedShortAt: 129! Item was added: + ----- Method: GdbARMv8Alien>>h16: (in category 'accessing') ----- + h16: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 129 put: 0. + ^self unsignedShortAt: 129 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h17 (in category 'accessing') ----- + h17 + ^self unsignedShortAt: 137! Item was added: + ----- Method: GdbARMv8Alien>>h17: (in category 'accessing') ----- + h17: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 137 put: 0. + ^self unsignedShortAt: 137 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h18 (in category 'accessing') ----- + h18 + ^self unsignedShortAt: 145! Item was added: + ----- Method: GdbARMv8Alien>>h18: (in category 'accessing') ----- + h18: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 145 put: 0. + ^self unsignedShortAt: 145 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h19 (in category 'accessing') ----- + h19 + ^self unsignedShortAt: 153! Item was added: + ----- Method: GdbARMv8Alien>>h19: (in category 'accessing') ----- + h19: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 153 put: 0. + ^self unsignedShortAt: 153 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h1: (in category 'accessing') ----- + h1: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 9 put: 0. + ^self unsignedShortAt: 9 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h2 (in category 'accessing') ----- + h2 + ^self unsignedShortAt: 17! Item was added: + ----- Method: GdbARMv8Alien>>h20 (in category 'accessing') ----- + h20 + ^self unsignedShortAt: 161! Item was added: + ----- Method: GdbARMv8Alien>>h20: (in category 'accessing') ----- + h20: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 161 put: 0. + ^self unsignedShortAt: 161 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h21 (in category 'accessing') ----- + h21 + ^self unsignedShortAt: 169! Item was added: + ----- Method: GdbARMv8Alien>>h21: (in category 'accessing') ----- + h21: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 169 put: 0. + ^self unsignedShortAt: 169 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h22 (in category 'accessing') ----- + h22 + ^self unsignedShortAt: 177! Item was added: + ----- Method: GdbARMv8Alien>>h22: (in category 'accessing') ----- + h22: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 177 put: 0. + ^self unsignedShortAt: 177 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h23 (in category 'accessing') ----- + h23 + ^self unsignedShortAt: 185! Item was added: + ----- Method: GdbARMv8Alien>>h23: (in category 'accessing') ----- + h23: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 185 put: 0. + ^self unsignedShortAt: 185 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h24 (in category 'accessing') ----- + h24 + ^self unsignedShortAt: 193! Item was added: + ----- Method: GdbARMv8Alien>>h24: (in category 'accessing') ----- + h24: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 193 put: 0. + ^self unsignedShortAt: 193 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h25 (in category 'accessing') ----- + h25 + ^self unsignedShortAt: 201! Item was added: + ----- Method: GdbARMv8Alien>>h25: (in category 'accessing') ----- + h25: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 201 put: 0. + ^self unsignedShortAt: 201 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h26 (in category 'accessing') ----- + h26 + ^self unsignedShortAt: 209! Item was added: + ----- Method: GdbARMv8Alien>>h26: (in category 'accessing') ----- + h26: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 209 put: 0. + ^self unsignedShortAt: 209 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h27 (in category 'accessing') ----- + h27 + ^self unsignedShortAt: 217! Item was added: + ----- Method: GdbARMv8Alien>>h27: (in category 'accessing') ----- + h27: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 217 put: 0. + ^self unsignedShortAt: 217 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h28 (in category 'accessing') ----- + h28 + ^self unsignedShortAt: 225! Item was added: + ----- Method: GdbARMv8Alien>>h28: (in category 'accessing') ----- + h28: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 225 put: 0. + ^self unsignedShortAt: 225 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h2: (in category 'accessing') ----- + h2: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 17 put: 0. + ^self unsignedShortAt: 17 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h3 (in category 'accessing') ----- + h3 + ^self unsignedShortAt: 25! Item was added: + ----- Method: GdbARMv8Alien>>h3: (in category 'accessing') ----- + h3: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 25 put: 0. + ^self unsignedShortAt: 25 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h4 (in category 'accessing') ----- + h4 + ^self unsignedShortAt: 33! Item was added: + ----- Method: GdbARMv8Alien>>h4: (in category 'accessing') ----- + h4: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 33 put: 0. + ^self unsignedShortAt: 33 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h5 (in category 'accessing') ----- + h5 + ^self unsignedShortAt: 41! Item was added: + ----- Method: GdbARMv8Alien>>h5: (in category 'accessing') ----- + h5: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 41 put: 0. + ^self unsignedShortAt: 41 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h6 (in category 'accessing') ----- + h6 + ^self unsignedShortAt: 49! Item was added: + ----- Method: GdbARMv8Alien>>h6: (in category 'accessing') ----- + h6: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 49 put: 0. + ^self unsignedShortAt: 49 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h7 (in category 'accessing') ----- + h7 + ^self unsignedShortAt: 57! Item was added: + ----- Method: GdbARMv8Alien>>h7: (in category 'accessing') ----- + h7: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 57 put: 0. + ^self unsignedShortAt: 57 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h8 (in category 'accessing') ----- + h8 + ^self unsignedShortAt: 65! Item was added: + ----- Method: GdbARMv8Alien>>h8: (in category 'accessing') ----- + h8: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 65 put: 0. + ^self unsignedShortAt: 65 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>h9 (in category 'accessing') ----- + h9 + ^self unsignedShortAt: 73! Item was added: + ----- Method: GdbARMv8Alien>>h9: (in category 'accessing') ----- + h9: anUnsignedShort + "zero extend..." + self unsignedLongLongAt: 73 put: 0. + ^self unsignedShortAt: 73 put: anUnsignedShort! Item was added: + ----- Method: GdbARMv8Alien>>hackFixNextPCOfJumpFor:using: (in category 'execution') ----- + hackFixNextPCOfJumpFor: aProcessorSimulationTrap using: objectMemory + "This is a hack fix before we revise the simulators. When a jump call is made, the + next pc is effectively the return address in the link reg, not the instruction following + the jump. So reset it here. All this is because currently the simulators don't execute + a control transfer to a fake address, as would a real processor. Once the processor + simulators correctly emulate such control transfers, we can ditch this hack." + + aProcessorSimulationTrap nextpc: self lr! Item was added: + ----- Method: GdbARMv8Alien>>handleExecutionPrimitiveFailureIn:minimumAddress:code: (in category 'error handling') ----- + handleExecutionPrimitiveFailureIn: memoryArray "" minimumAddress: minimumAddress "" code: errorCode "" + "Handle an execution primitive failure. Convert out-of-range call and absolute + memory read into register instructions into ProcessorSimulationTrap signals." + "self disassembleInstructionAt: self pc In: memoryArray" + | instr pc op | + pc := self pc. + instr := self instr. + (pc between: minimumAddress and: memoryArray byteSize - 1) ifTrue: + [self assert: instr = (memoryArray unsignedLongAt: pc + 1 bigEndian: false)]. + op := instr >> 25 bitAnd: 16rF. + (Level0FailureTable at: op + 1) ifNotNil: + [:tuple| + ^self perform: (tuple at: 2) with: instr with: pc with: memoryArray]. + ^self reportPrimitiveFailure! Item was added: + ----- Method: GdbARMv8Alien>>handleFailingBranch:at:in: (in category 'error handling') ----- + handleFailingBranch: instruction at: pc in: memoryArray "" + "see C4.1.3 Branches, Exception Generating and System instructions in Arm ARM. + Table C4-4 op1 plus the two top bit of op1" + | opcOp2Op3Op4 op1CRnCRmOp2 | + "self disassembleInstructionAt: self pc In: memoryArray" + (instruction bitShift: -25) = 2r1101011 ifTrue: "Unconditional branch (register) on page C4-262" + [opcOp2Op3Op4 := instruction bitAnd: 2r1111111111111110000011111. + opcOp2Op3Op4 = 2r10111110000000000000000 ifTrue: "RET" + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: self lr + type: #return) + signal]. + opcOp2Op3Op4 = 2r1111110000000000000000 ifTrue: "BLR" + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: (self perform: (self registerStateGetters at: ((instruction >> 5) bitAnd: 31) + 1)) + type: #call) + signal]. + opcOp2Op3Op4 = 2r0111110000000000000000 ifTrue: "BR" + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: (self perform: (self registerStateGetters at: ((instruction >> 5) bitAnd: 31) + 1)) + type: #jump) + signal]]. + instruction = self clrexOpcode ifTrue: + [self pc: pc + 4. + ^self]. + (instruction bitShift: -19) = 2r1101010100111 ifTrue: "MRS Op0=3" + [op1CRnCRmOp2 := instruction bitAnd: 2r1111111111111100000. + "At least Raspberry Pi 4 running Manjaro allows access to ID_AA64ISAR0_EL1" + op1CRnCRmOp2 = 2r11000000000 ifTrue: + [self perform: (self registerStateSetters at: (instruction bitAnd: 31) + 1) with: ID_AA64ISAR0_EL1. + self pc: pc + 4. + ^self]]. + self reportPrimitiveFailure! Item was added: + ----- Method: GdbARMv8Alien>>handleFailingLoadStore:at:in: (in category 'error handling') ----- + handleFailingLoadStore: instruction at: pc in: memoryArray "" + "C4.1.4 Loads and Stores C4-266 + This section describes the encoding of the Loads and Stores group. The encodings in this section are decoded from A64 instruction set encoding on page C4-252. + + Table C4-5 Encoding table for the Loads and Stores group + + op0 31:28 1 op1 26 0 op2 24:23 x op3 21:16 x op4 11:10 + + op0 op2 op3 op4 + xx11 0x 0xxxxx 00 Load/store register (unscaled immediate) on page C4-283 + xx11 0x 0xxxxx 01 Load/store register (immediate post-indexed) on page C4-284 + xx11 0x 0xxxxx 10 Load/store register (unprivileged) on page C4-286 + xx11 0x 0xxxxx 11 Load/store register (immediate pre-indexed) on page C4-286 + xx11 0x 1xxxxx 00 Atomic memory operations on page C4-288 + xx11 0x 1xxxxx 10 Load/store register (register offset) on page C4-295 + xx11 0x 1xxxxx x1 Load/store register (pac) on page C4-297 + xx11 1x 1xxxxx - Load/store register (unsigned immediate) on page C4-297" + + | op0op2 size op4 rm rn rt opc v offsetFromImm addr shift | + "self disassembleInstructionAt: self pc In: memoryArray" + size := instruction bitShift: -30. + opc := (instruction bitShift: -22) bitAnd: 3. + op4 := (instruction bitShift: -10) bitAnd: 3. + rn := (instruction bitShift: -5) bitAnd: 31. + rt := instruction bitAnd: 31. + (rn = 31 and: [self sp anyMask: 15]) ifTrue: + [self reportStackAlignmentVolation]. + "op0 = xx11 op2 = 0x" + (op0op2 := (instruction bitShift: -23) bitAnd: 2r1100010) = 2r1100000 ifFalse: + [offsetFromImm := ARMv8A64Opcodes extractOffsetFromLoadStore: instruction. + (v := instruction >> 26 bitAnd: 1) = 0 ifFalse: [self halt]. + addr := (self perform: (self registerStateGetters at: rn + 1)) + offsetFromImm. + op0op2 = 2r1100010 ifTrue: "Load/store register (unsigned immediate) on page C4-297" + [^(opc = 0 + ifTrue: + [ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #write + accessor: ((self registerStateGettersForSizes: size) at: rt + 1)] + ifFalse: + [ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #read + accessor: ((self registerStateSettersForSizes: size) at: rt + 1)]) + signal]. + op0op2 = 2r1000010 ifTrue: "Load/store register pair (signed immediate) on page C4-282" + [| rt2 | + rt2 := (instruction bitShift: -10) bitAnd: 31. + ^opc = 0 + ifTrue: + [(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #write + accessor: ((self registerStateGettersForSizes: size + 1) at: rt + 1)) + signal. + (ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + 8 + type: #write + accessor: ((self registerStateGettersForSizes: size + 1) at: rt2 + 1)) + signal] + ifFalse: + [(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #read + accessor: ((self registerStateSettersForSizes: size + 1) at: rt + 1)) + signal. + (ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + 8 + type: #read + accessor: ((self registerStateSettersForSizes: size + 1) at: rt2 + 1)) + signal]]. + op0op2 = 0 ifTrue: "LDAXR/STRXR register on page C4-279" + [| result rs | + self assert: size = 3. + opc = 1 ifTrue: + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #read + accessor: (self registerStateSetters at: rt + 1)) signal]. + result := (ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #write + accessor: (self registerStateGetters at: rt + 1)) signal. + rs := instruction >> 16 bitAnd: 31. + "For now assume the write succeeded..." + self perform: ((self registerStateSettersForSizes: 2) at: rs + 1) + with: 0. + ^result]. + self halt: 'undecoded failing load/store']. + + ((instruction bitShift: -21) noMask: 1) ifTrue: "op3 = 0xxxxx" + [offsetFromImm := ((instruction bitShift: -12) bitAnd: 16r1FF) bitShift: size. + opc = 0 ifTrue:"C4-286 opc = 0 => store" + [self assert: size = 3. + ^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: (self perform: (self registerStateGetters at: rn + 1)) + offsetFromImm + type: #write + accessor: (self registerStateGetters at: rt + 1)) + signal]. + opc = 1 ifTrue: + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: (self perform: (self registerStateGetters at: rn + 1)) + offsetFromImm + type: #read + accessor: ((self registerStateSettersForSizes: size) at: rt + 1)) + signal]. + self halt: 'op3 = 0xxxxx opc > 1']. + + "op0 op2 op3 op4 + xx11 0x 1xxxxx 10 Load/store register (register offset) on page C4-295 (296/297)" + + v := instruction >> 26 bitAnd: 1. + rm := instruction >> 16 bitAnd: 31. + shift := instruction anyMask: 1 << 12. + (size = 3 and: [v = 0]) ifTrue: + [addr := (self perform: (self registerStateGetters at: rn + 1)) + + (shift + ifTrue: [(self perform: (self registerStateGetters at: rm + 1)) << size] + ifFalse: [self perform: (self registerStateGetters at: rm + 1)]). + opc = 0 ifTrue: "STR (register) - 64-bit variant on page C6-1242" + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #write + accessor: (self registerStateGetters at: rt + 1)) + signal]. + opc = 1 ifTrue: "LDR (register) - 64-bit variant on page C6-981" + [^(ProcessorSimulationTrap + pc: pc + nextpc: pc + 4 + address: addr + type: #read + accessor: (self registerStateSetters at: rt + 1)) + signal]. + (opc = 3 and: [instruction >> 10 allMask: 63]) ifTrue: "CASAL C4-278/C6-829" + [^(CompareAndSwapSimulationTrap + pc: pc + nextpc: pc + 4 + address: (self perform: (self registerStateGetters at: rn + 1)) + type: #write + accessor: (self registerStateSetters at: rm + 1)) + expectedValue: (self perform: (self registerStateGetters at: rm + 1)); + storedValue: (self perform: (self registerStateGetters at: rt + 1)); + signal]. + self halt: 'op3 = 1xxxxx opc > 1']. + self halt: 'op3 = 1xxxxx size ~= 3'! Item was added: + ----- Method: GdbARMv8Alien>>initializeStackFor: (in category 'processor setup') ----- + initializeStackFor: aCogit + "Different cpus need different stack alignment etc, so handle the details here. + See e.g. https://github.com/ARM-software/software-standards/blob/master/abi/aapcs64/aapcs64.rst#the-stack" + aCogit setStackAlignment: 16 expectedSPOffset: 0 expectedFPOffset: 0. + PostBuildStackDelta := 0! Item was added: + ----- Method: GdbARMv8Alien>>instr (in category 'accessing') ----- + instr + ^self unsignedLongAt: 809! Item was added: + ----- Method: GdbARMv8Alien>>integerRegisterState (in category 'accessing-abstract') ----- + integerRegisterState + "Answer a DoubleWordArray of the integer registers, the pc and the flags. + This primitive is unnecessary; it exists only to speed up single-stepping. + If the primitive fails fall back and yield an Array of the same." + + ^{ self r0. self r1. self r2. self r3. self r4. self r5. self r6. self r7. + self r8. self r9. self r10. self r11. self r12. self r13. self r14. self r15. + self r16. self r17. self r18. self r19. self r20. self r21. self r22. self r23. + self r24. self r25. self r26. self r27. self r28. self fp. self lr. self sp. + self pc. self rawCPSR }! Item was added: + ----- Method: GdbARMv8Alien>>leafRetpcIn: (in category 'accessing-abstract') ----- + leafRetpcIn: aMemory + "Answer the retpc assuming that the processor is in a simulated call established + by simulateLeafCallOf:nextpc:memory:" + ^self lr! Item was added: + ----- Method: GdbARMv8Alien>>lr (in category 'accessing') ----- + lr + ^self unsignedLongLongAt: 241! Item was added: + ----- Method: GdbARMv8Alien>>lr: (in category 'accessing') ----- + lr: anUnsignedInteger + ^self unsignedLongLongAt: 241 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>nextpc (in category 'accessing') ----- + nextpc + ^self unsignedLongLongAt: 797! Item was added: + ----- Method: GdbARMv8Alien>>nextpc: (in category 'accessing') ----- + nextpc: anUnsignedInteger + ^self unsignedLongLongAt: 797 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>nopOpcode (in category 'opcodes') ----- + nopOpcode + ^NOP! Item was added: + ----- Method: GdbARMv8Alien>>pc (in category 'accessing') ----- + pc + ^self unsignedLongLongAt: 777! Item was added: + ----- Method: GdbARMv8Alien>>pc: (in category 'accessing') ----- + pc: anUnsignedInteger + ^self unsignedLongLongAt: 777 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>popWordIn: (in category 'execution') ----- + popWordIn: aMemory + | sp word | + word := aMemory long64At: (sp := self sp) + 1. + self sp: sp + 8. + ^word! Item was added: + ----- Method: GdbARMv8Alien>>postCallArgumentsNumArgs:in: (in category 'execution') ----- + postCallArgumentsNumArgs: numArgs "" in: memory "" + "Answer an argument vector of the requested size after a vanilla ABI call. For ARMv8 enough of the Procedure Calling Specification + can be found in http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf. + On ARM this typically means accessing r0 through r7 and fetching additional arguments from the stack. + Since we never have arities beyond 4 ish only implement access from register arguments." + | args getters | + args := Array new: numArgs. + getters := self registerStateGetters. + (1 to: numArgs) do: [:i | args at: i put: (self perform: (getters at: i))]. + ^args! Item was added: + ----- Method: GdbARMv8Alien>>primitiveDisassembleAt:inMemory: (in category 'primitives') ----- + primitiveDisassembleAt: address inMemory: memoryArray "" + "Answer an Array of the size and the disassembled code string for the instruction at the current instruction pointer in memory." + + ^self primitiveFailed! Item was added: + ----- Method: GdbARMv8Alien>>primitiveErrorAndLog (in category 'primitives') ----- + primitiveErrorAndLog + "Answer an array of the current error code and log contents" + + ^self primitiveFailed! Item was added: + ----- Method: GdbARMv8Alien>>primitiveFlushICacheFrom:To: (in category 'primitives') ----- + primitiveFlushICacheFrom: startAddress "" To: endAddress "" + "Flush the icache in the requested range" + + ^self primitiveFailed! Item was added: + ----- Method: GdbARMv8Alien>>primitiveResetCPU (in category 'primitives') ----- + primitiveResetCPU + "Reset the receiver to registers all zero, and protected 32-bit mode." + + ^self reportPrimitiveFailure! Item was added: + ----- Method: GdbARMv8Alien>>primitiveRunInMemory:minimumAddress:readOnlyBelow: (in category 'primitives') ----- + primitiveRunInMemory: memoryArray "" minimumAddress: minimumAddress "" readOnlyBelow: minimumWritableAddress "" + "Run the receiver using the argument as the store. Origin the argument at 0. i.e. the first byte of the + memoryArray is address 0. Make addresses below minimumAddress illegal. Convert out-of-range + calls, jumps and memory read/writes into ProcessorSimulationTrap signals. + Note that minWriteMaxExecAddress is both the minimum writeable address AND the maximum executable address" + + ^ec isPrimitiveError + ifTrue: + [self handleExecutionPrimitiveFailureIn: memoryArray + minimumAddress: minimumAddress + code: ec errorCode] + ifFalse: + [ec == #'inappropriate operation' + ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray + minimumAddress: minimumAddress] + ifFalse: [self reportPrimitiveFailure]]! Item was added: + ----- Method: GdbARMv8Alien>>primitiveSingleStepInMemory:minimumAddress:readOnlyBelow: (in category 'primitives') ----- + primitiveSingleStepInMemory: memoryArray "" minimumAddress: minimumAddress "" readOnlyBelow: minimumWritableAddress "" + "Single-step the receiver using the argument as the store. Origin the argument at 0. i.e. the first byte of the + memoryArray is address 0. Make addresses below minimumAddress illegal. Convert out-of-range + calls, jumps and memory read/writes into ProcessorSimulationTrap signals." + + ^ec isPrimitiveError + ifTrue: + [self handleExecutionPrimitiveFailureIn: memoryArray + minimumAddress: minimumAddress + code: ec errorCode] + ifFalse: + [ec == #'inappropriate operation' + ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray + minimumAddress: minimumAddress] + ifFalse: [self reportPrimitiveFailure]]! Item was added: + ----- Method: GdbARMv8Alien>>printFields:inRegisterState:on: (in category 'printing') ----- + printFields: fields inRegisterState: registerStateVector on: aStream + | rsvs | + aStream ensureCr. + rsvs := registerStateVector readStream. + fields withIndexDo: + [:sym :index| | val | + sym = #cr + ifTrue: [aStream cr] + ifFalse: + [(val := rsvs next) isNil ifTrue: [^self]. + aStream nextPutAll: sym; nextPut: $:; space. + val printOn: aStream base: 16 length: 16 padded: true. + #eflags == sym + ifTrue: + [aStream space. + "'FIVCZN'"'--VCZN' withIndexDo: + [:flag :bitIndex| + flag ~= $- ifTrue: + [aStream nextPut: flag; nextPutAll: 'F='; print: (val bitAnd: 1 << (bitIndex - 1)) >> (bitIndex - 1); space]]] + ifFalse: + [val > 16 ifTrue: + [aStream space; nextPut: $(. + val printOn: aStream base: 10 length: 1 padded: false. + aStream nextPut: $)]]. + (fields at: index + 1) ~~ #cr ifTrue: + [aStream tab]]]! Item was added: + ----- Method: GdbARMv8Alien>>printRegisterState:on: (in category 'printing') ----- + printRegisterState: registerStateVector on: aStream + (registerStateVector size >= 64 + ifTrue: + [#( (r0 r1 r2 r3 cr) + (r4 r5 r6 r7 cr) + (r8 r9 r10 r11 cr) + (r12 r13 r14 r15 cr) + (r16 r17 r18 r19 cr) + (r20 r21 r22 r23 cr) + (r24 r25 r26 r27 cr) + (r28 fp lr sp cr) + (d0 d1 d2 d3 cr) + (d4 d5 d6 d7 cr) + (d8 d9 d10 d11 cr) + (d12 d13 d14 d15 cr) + (d16 d17 d18 d19 cr) + (d20 d21 d22 d23 cr) + (d24 d25 d26 d27 cr) + (d28 d29 d30 d31 cr))] + ifFalse: + [#( (r0 r1 r2 r3 cr) + (r4 r5 r6 r7 cr) + (r8 r9 r10 r11 cr) + (r12 r13 r14 r15 cr) + (r16 r17 r18 r19 cr) + (r20 r21 r22 r23 cr) + (r24 r25 r26 r27 cr) + (r28 fp lr sp cr))]) doWithIndex: + [:subset :index| + (subset anySatisfy: [:getter| getter ~~ #cr and: [(self perform: getter) ~= 0]]) ifTrue: + [self printFields: subset + inRegisterState: (registerStateVector copyFrom: index * 4 - 3 to: index * 4) + on: aStream]]. + registerStateVector size = 34 "i.e. imtegerRegisterState" + ifTrue: + [self printFields: #(pc rawCPSR cr) + inRegisterState: (registerStateVector last: 2) + on: aStream] + ifFalse: + [self printFields: #(pc CPSR FPSR FPCR nextpc cr) + inRegisterState: (registerStateVector last: 5) + on: aStream]! Item was added: + ----- Method: GdbARMv8Alien>>printRegisterStateExceptPC:on: (in category 'printing') ----- + printRegisterStateExceptPC: registerStateVector on: aStream + self printFields: #( r0 r1 r2 r3 cr + r4 r5 r6 r7 cr + r8 r9 r10 r11 cr + r12 r13 r14 r15 cr + r16 r17 r18 r19 cr + r20 r21 r22 r23 cr + r24 r25 r26 r27 cr + r28 fp lr sp cr) + inRegisterState: registerStateVector + on: aStream! Item was added: + ----- Method: GdbARMv8Alien>>pushPair:and:in: (in category 'execution') ----- + pushPair: aValue and: bValue in: aMemory + | sp | + sp := self sp. + self assert: (sp noMask: 15). + aMemory + unsignedLong64At: sp - 8 + 1 put: aValue; + unsignedLong64At: sp - 16 + 1 put: bValue. + ^self sp: sp - 16! Item was added: + ----- Method: GdbARMv8Alien>>pushWord:in: (in category 'execution') ----- + pushWord: aValue in: aMemory + self assert: (self sp noMask: 15). + aMemory unsignedLong64At: (self sp: self sp - 8) + 1 put: aValue! Item was added: + ----- Method: GdbARMv8Alien>>r0 (in category 'accessing') ----- + r0 + ^self unsignedLongLongAt: 1! Item was added: + ----- Method: GdbARMv8Alien>>r0: (in category 'accessing') ----- + r0: anUnsignedInteger + ^self unsignedLongLongAt: 1 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r1 (in category 'accessing') ----- + r1 + ^self unsignedLongLongAt: 9! Item was added: + ----- Method: GdbARMv8Alien>>r10 (in category 'accessing') ----- + r10 + ^self unsignedLongLongAt: 81! Item was added: + ----- Method: GdbARMv8Alien>>r10: (in category 'accessing') ----- + r10: anUnsignedInteger + ^self unsignedLongLongAt: 81 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r11 (in category 'accessing') ----- + r11 + ^self unsignedLongLongAt: 89! Item was added: + ----- Method: GdbARMv8Alien>>r11: (in category 'accessing') ----- + r11: anUnsignedInteger + ^self unsignedLongLongAt: 89 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r12 (in category 'accessing') ----- + r12 + ^self unsignedLongLongAt: 97! Item was added: + ----- Method: GdbARMv8Alien>>r12: (in category 'accessing') ----- + r12: anUnsignedInteger + ^self unsignedLongLongAt: 97 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r13 (in category 'accessing') ----- + r13 + ^self unsignedLongLongAt: 105! Item was added: + ----- Method: GdbARMv8Alien>>r13: (in category 'accessing') ----- + r13: anUnsignedInteger + ^self unsignedLongLongAt: 105 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r14 (in category 'accessing') ----- + r14 + ^self unsignedLongLongAt: 113! Item was added: + ----- Method: GdbARMv8Alien>>r14: (in category 'accessing') ----- + r14: anUnsignedInteger + ^self unsignedLongLongAt: 113 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r15 (in category 'accessing') ----- + r15 + ^self unsignedLongLongAt: 121! Item was added: + ----- Method: GdbARMv8Alien>>r15: (in category 'accessing') ----- + r15: anUnsignedInteger + ^self unsignedLongLongAt: 121 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r16 (in category 'accessing') ----- + r16 + ^self unsignedLongLongAt: 129! Item was added: + ----- Method: GdbARMv8Alien>>r16: (in category 'accessing') ----- + r16: anUnsignedInteger + ^self unsignedLongLongAt: 129 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r17 (in category 'accessing') ----- + r17 + ^self unsignedLongLongAt: 137! Item was added: + ----- Method: GdbARMv8Alien>>r17: (in category 'accessing') ----- + r17: anUnsignedInteger + ^self unsignedLongLongAt: 137 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r18 (in category 'accessing') ----- + r18 + ^self unsignedLongLongAt: 145! Item was added: + ----- Method: GdbARMv8Alien>>r18: (in category 'accessing') ----- + r18: anUnsignedInteger + ^self unsignedLongLongAt: 145 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r19 (in category 'accessing') ----- + r19 + ^self unsignedLongLongAt: 153! Item was added: + ----- Method: GdbARMv8Alien>>r19: (in category 'accessing') ----- + r19: anUnsignedInteger + ^self unsignedLongLongAt: 153 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r1: (in category 'accessing') ----- + r1: anUnsignedInteger + ^self unsignedLongLongAt: 9 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r2 (in category 'accessing') ----- + r2 + ^self unsignedLongLongAt: 17! Item was added: + ----- Method: GdbARMv8Alien>>r20 (in category 'accessing') ----- + r20 + ^self unsignedLongLongAt: 161! Item was added: + ----- Method: GdbARMv8Alien>>r20: (in category 'accessing') ----- + r20: anUnsignedInteger + ^self unsignedLongLongAt: 161 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r21 (in category 'accessing') ----- + r21 + ^self unsignedLongLongAt: 169! Item was added: + ----- Method: GdbARMv8Alien>>r21: (in category 'accessing') ----- + r21: anUnsignedInteger + ^self unsignedLongLongAt: 169 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r22 (in category 'accessing') ----- + r22 + ^self unsignedLongLongAt: 177! Item was added: + ----- Method: GdbARMv8Alien>>r22: (in category 'accessing') ----- + r22: anUnsignedInteger + ^self unsignedLongLongAt: 177 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r23 (in category 'accessing') ----- + r23 + ^self unsignedLongLongAt: 185! Item was added: + ----- Method: GdbARMv8Alien>>r23: (in category 'accessing') ----- + r23: anUnsignedInteger + ^self unsignedLongLongAt: 185 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r24 (in category 'accessing') ----- + r24 + ^self unsignedLongLongAt: 193! Item was added: + ----- Method: GdbARMv8Alien>>r24: (in category 'accessing') ----- + r24: anUnsignedInteger + ^self unsignedLongLongAt: 193 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r25 (in category 'accessing') ----- + r25 + ^self unsignedLongLongAt: 201! Item was added: + ----- Method: GdbARMv8Alien>>r25: (in category 'accessing') ----- + r25: anUnsignedInteger + ^self unsignedLongLongAt: 201 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r26 (in category 'accessing') ----- + r26 + ^self unsignedLongLongAt: 209! Item was added: + ----- Method: GdbARMv8Alien>>r26: (in category 'accessing') ----- + r26: anUnsignedInteger + ^self unsignedLongLongAt: 209 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r27 (in category 'accessing') ----- + r27 + ^self unsignedLongLongAt: 217! Item was added: + ----- Method: GdbARMv8Alien>>r27: (in category 'accessing') ----- + r27: anUnsignedInteger + ^self unsignedLongLongAt: 217 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r28 (in category 'accessing') ----- + r28 + ^self unsignedLongLongAt: 225! Item was added: + ----- Method: GdbARMv8Alien>>r28: (in category 'accessing') ----- + r28: anUnsignedInteger + ^self unsignedLongLongAt: 225 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r2: (in category 'accessing') ----- + r2: anUnsignedInteger + ^self unsignedLongLongAt: 17 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r3 (in category 'accessing') ----- + r3 + ^self unsignedLongLongAt: 25! Item was added: + ----- Method: GdbARMv8Alien>>r3: (in category 'accessing') ----- + r3: anUnsignedInteger + ^self unsignedLongLongAt: 25 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r4 (in category 'accessing') ----- + r4 + ^self unsignedLongLongAt: 33! Item was added: + ----- Method: GdbARMv8Alien>>r4: (in category 'accessing') ----- + r4: anUnsignedInteger + ^self unsignedLongLongAt: 33 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r5 (in category 'accessing') ----- + r5 + ^self unsignedLongLongAt: 41! Item was added: + ----- Method: GdbARMv8Alien>>r5: (in category 'accessing') ----- + r5: anUnsignedInteger + ^self unsignedLongLongAt: 41 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r6 (in category 'accessing') ----- + r6 + ^self unsignedLongLongAt: 49! Item was added: + ----- Method: GdbARMv8Alien>>r6: (in category 'accessing') ----- + r6: anUnsignedInteger + ^self unsignedLongLongAt: 49 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r7 (in category 'accessing') ----- + r7 + ^self unsignedLongLongAt: 57! Item was added: + ----- Method: GdbARMv8Alien>>r7: (in category 'accessing') ----- + r7: anUnsignedInteger + ^self unsignedLongLongAt: 57 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r8 (in category 'accessing') ----- + r8 + ^self unsignedLongLongAt: 65! Item was added: + ----- Method: GdbARMv8Alien>>r8: (in category 'accessing') ----- + r8: anUnsignedInteger + ^self unsignedLongLongAt: 65 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>r9 (in category 'accessing') ----- + r9 + ^self unsignedLongLongAt: 73! Item was added: + ----- Method: GdbARMv8Alien>>r9: (in category 'accessing') ----- + r9: anUnsignedInteger + ^self unsignedLongLongAt: 73 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>rawCPSR (in category 'accessing') ----- + rawCPSR + ^self unsignedLongLongAt: 785! Item was added: + ----- Method: GdbARMv8Alien>>rawCPSR: (in category 'accessing') ----- + rawCPSR: anUnsignedInteger + ^self unsignedLongLongAt: 785 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>rawPrimitiveRunInMemory:offsetBy:minimumAddress:readOnlyBelow: (in category 'primitives-simulation') ----- + rawPrimitiveRunInMemory: memoryArray offsetBy: offset minimumAddress: minimumAddress readOnlyBelow: minimumWritableAddress + "A version of primitiveRunInMemory:offsetBy:minimumAddress:readOnlyBelow: for simulation" + + ^ec! Item was added: + ----- Method: GdbARMv8Alien>>rawPrimitiveSingleStepInMemory:offsetBy:minimumAddress:readOnlyBelow: (in category 'primitives-simulation') ----- + rawPrimitiveSingleStepInMemory: memoryArray offsetBy: offset minimumAddress: minimumAddress readOnlyBelow: minimumWritableAddress + "A version of primitiveSingleStepInMemory:offsetBy:minimumAddress:readOnlyBelow: for simulation" + + ^ec! Item was added: + ----- Method: GdbARMv8Alien>>registerState (in category 'accessing-abstract') ----- + registerState + ^{ self r0. self r1. self r2. self r3. self r4. self r5. self r6. self r7. + self r8. self r9. self r10. self r11. self r12. self r13. self r14. self r15. + self r16. self r17. self r18. self r19. self r20. self r21. self r22. self r23. + self r24. self r25. self r26. self r27. self r28. self fp. self lr. self sp. + self d0. self d1. self d2. self d3. self d4. self d5. self d6. self d7. + self d8. self d9. self d10. self d11. self d12. self d13. self d14. self d15. + self d16. self d17. self d18. self d19. self d20. self d21. self d22. self d23. + self d24. self d25. self d26. self d27. self d28. self d29. self d30. self d31. + self pc. self rawCPSR. self fpCPSR. self fpCPCR. self nextpc }! Item was added: + ----- Method: GdbARMv8Alien>>registerStateGetters (in category 'accessing-abstract') ----- + registerStateGetters + ^#(r0 r1 r2 r3 r4 r5 r6 r7 + r8 r9 r10 r11 r12 r13 r14 r15 + r16 r17 r18 r19 r20 r21 r22 r23 + r24 r25 r26 r27 r28 fp lr sp + d0 d1 d2 d3 d4 d5 d6 d7 + d8 d9 d10 d11 d12 d13 d14 d15 + d16 d17 d18 d19 d20 d21 d22 d23 + d24 d25 d26 d27 d28 d29 d30 d31 + pc rawCPSR fpCPSR fpCPCR nextpc)! Item was added: + ----- Method: GdbARMv8Alien>>registerStateGettersForSizes: (in category 'accessing-abstract') ----- + registerStateGettersForSizes: sizeField + "Answer the array of regular register getters for sizeFieldPlusOne, so + if sizeField is 0, and the getters are byte register getters + if sizeField is 1, and the getters are halfword register getters + if sizeField is 2, and the getters are word register getters + if sizeField is 3, and the getters are the doubleword register getters, the normal getters" + ^#((b0 b1 b2 b3 b4 b5 b6 b7 + b8 b9 b10 b11 b12 b13 b14 b15 + b16 b17 b18 b19 b20 b21 b22 b23 + b24 b25 b26 b27 b28 b29) + (h0 h1 h2 h3 h4 h5 h6 h7 + h8 h9 h10 h11 h12 h13 h14 h15 + h16 h17 h18 h19 h20 h21 h22 h23 + h24 h25 h26 h27 h28 h29) + (w0 w1 w2 w3 w4 w5 w6 w7 + w8 w9 w10 w11 w12 w13 w14 w15 + w16 w17 w18 w19 w20 w21 w22 w23 + w24 w25 w26 w27 w28 w29) + (r0 r1 r2 r3 r4 r5 r6 r7 + r8 r9 r10 r11 r12 r13 r14 r15 + r16 r17 r18 r19 r20 r21 r22 r23 + r24 r25 r26 r27 r28 fp lr sp)) at: sizeField + 1! Item was added: + ----- Method: GdbARMv8Alien>>registerStatePCIndex (in category 'accessing-abstract') ----- + registerStatePCIndex + "Answer the index of the PC register in the Array answered by integerRegisterState" + ^33! Item was added: + ----- Method: GdbARMv8Alien>>registerStateSetters (in category 'accessing-abstract') ----- + registerStateSetters + ^#(r0: r1: r2: r3: r4: r5: r6: r7: + r8: r9: r10: r11: r12: r13: r14: r15: + r16: r17: r18: r19: r20: r21: r22: r23: + r24: r25: r26: r27: r28: fp: lr: sp: + d0: d1: d2: d3: d4: d5: d6: d7: + d8: d9: d10: d11: d12: d13: d14: d15: + d16: d17: d18: d19: d20: d21: d22: d23: + d24: d25: d26: d27: d28: d29: d30: d31: + pc: rawCPSR: fpCPSR: fpCPCR: nextpc:)! Item was added: + ----- Method: GdbARMv8Alien>>registerStateSettersForSizes: (in category 'accessing-abstract') ----- + registerStateSettersForSizes: sizeField + "Answer the array of regular register setters for sizeFieldPlusOne, so + if sizeField is 0, and the setters are byte register setters + if sizeField is 1, and the setters are halfword register setters + if sizeField is 2, and the setters are word register setters + if sizeField is 3, and the setters are the doubleword register setters, the normal setters" + ^#((b0: b1: b2: b3: b4: b5: b6: b7: + b8: b9: b10: b11: b12: b13: b14: b15: + b16: b17: b18: b19: b20: b21: b22: b23: + b24: b25: b26: b27: b28: b29) + (h0: h1: h2: h3: h4: h5: h6: h7: + h8: h9: h10: h11: h12: h13: h14: h15: + h16: h17: h18: h19: h20: h21: h22: h23: + h24: h25: h26: h27: h28: h29) + (w0: w1: w2: w3: w4: w5: w6: w7: + w8: w9: w10: w11: w12: w13: w14: w15: + w16: w17: w18: w19: w20: w21: w22: w23: + w24: w25: w26: w27: w28: w29) + (r0: r1: r2: r3: r4: r5: r6: r7: + r8: r9: r10: r11: r12: r13: r14: r15: + r16: r17: r18: r19: r20: r21: r22: r23: + r24: r25: r26: r27: r28: fp: lr: sp:)) at: sizeField + 1! Item was added: + ----- Method: GdbARMv8Alien>>reset (in category 'processor setup') ----- + reset + self primitiveResetCPU! Item was added: + ----- Method: GdbARMv8Alien>>retpcIn: (in category 'accessing-abstract') ----- + retpcIn: aMemory + "The return address is on the stack, having been pushed by either + simulateCallOf:nextpc:memory: or simulateJumpCallOf:memory:" + ^aMemory long64At: self fp + 9! Item was added: + ----- Method: GdbARMv8Alien>>setFlagsForCompareAndSwap: (in category 'execution') ----- + setFlagsForCompareAndSwap: aBoolean + "ARMv8 does not set flags as part of CASAL et al. That requires a separate compare. So simply ignore."! Item was added: + ----- Method: GdbARMv8Alien>>setFramePointer:stackPointer: (in category 'accessing-abstract') ----- + setFramePointer: framePointer stackPointer: stackPointer + "Initialize the processor's frame and stack pointers" + self fp: framePointer. + self sp: stackPointer! Item was added: + ----- Method: GdbARMv8Alien>>setIntegerRegisterState: (in category 'accessing-abstract') ----- + setIntegerRegisterState: newState + "Set the state reasonably efficiently, for the benefit of the MultiProcessor." + + self r0: (newState at: 1). self r1: (newState at: 2). self r2: (newState at: 3). self r3: (newState at: 4). + self r4: (newState at: 5). self r5: (newState at: 6). self r6: (newState at: 7). self r7: (newState at: 8). + self r8: (newState at: 9). self r9: (newState at: 10). self r10: (newState at: 11). self r11: (newState at: 12). + self r12: (newState at: 13). self r13: (newState at: 14). self r14: (newState at: 15). self r15: (newState at: 16). + self r16: (newState at: 17). self r17: (newState at: 18). self r18: (newState at: 19). self r19: (newState at: 20). + self r20: (newState at: 21). self r21: (newState at: 22). self r22: (newState at: 23). self r23: (newState at: 24). + self r24: (newState at: 25). self r25: (newState at: 26). self r26: (newState at: 27). self r27: (newState at: 28). + self r28: (newState at: 29). self fp: (newState at: 30). self lr: (newState at: 31). self sp: (newState at: 32). + self pc: (newState at: 33). + self rawCPSR: (newState at: 34)! Item was added: + ----- Method: GdbARMv8Alien>>simulateCallOf:nextpc:memory: (in category 'execution') ----- + simulateCallOf: address nextpc: nextpc memory: aMemory + "Simulate a frame-building call of address. Build a frame since + this is used for calls into the run-time which are unlikely to be leaf-calls" + + self fp: (self pushPair: self lr and: self fp in: aMemory). + self pc: address! Item was added: + ----- Method: GdbARMv8Alien>>simulateJumpCallOf:memory: (in category 'execution') ----- + simulateJumpCallOf: address memory: aMemory + "Simulate a frame-building jump call of address. Build a frame since + this is used for calls into the run-time which are unlikely to be leaf-calls" + + self fp: (self pushPair: self lr and: self fp in: aMemory). + self pc: address! Item was added: + ----- Method: GdbARMv8Alien>>simulateLeafCallOf:nextpc:memory: (in category 'execution') ----- + simulateLeafCallOf: address nextpc: nextpc memory: aMemory + self lr: nextpc. + self pc: address! Item was added: + ----- Method: GdbARMv8Alien>>simulateLeafReturnIn: (in category 'execution') ----- + simulateLeafReturnIn: aMemory + self pc: self lr! Item was added: + ----- Method: GdbARMv8Alien>>simulateReturnIn: (in category 'execution') ----- + simulateReturnIn: aMemory + PostBuildStackDelta ~= 0 ifTrue: + [self sp: self sp + PostBuildStackDelta]. + self fp: (self popWordIn: aMemory). + self pc: (self popWordIn: aMemory)! Item was added: + ----- Method: GdbARMv8Alien>>smashCallerSavedRegistersWithValuesFrom:by: (in category 'accessing-abstract') ----- + smashCallerSavedRegistersWithValuesFrom: base by: step + | setters | + setters := self registerStateSetters. + 1 to: 18 do: + [:index| + self perform: (setters at: index) with: index - 1 * step + base]! Item was added: + ----- Method: GdbARMv8Alien>>smashRegisterAccessors (in category 'accessing-abstract') ----- + smashRegisterAccessors + "See Table 3-1 Register Usage in AArch64 SMC32, HVC32, SMC64, and HVC64 calls + in http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf" + ^#(r0: r1: r2: r3: r4: r5: r6: r7: r8: r9: r10: r11: r12: r13: r14: r15: r16: r17:)! Item was added: + ----- Method: GdbARMv8Alien>>sp (in category 'accessing') ----- + sp + ^self unsignedLongLongAt: 249! Item was added: + ----- Method: GdbARMv8Alien>>sp: (in category 'accessing') ----- + sp: anUnsignedInteger + ^self unsignedLongLongAt: 249 put: anUnsignedInteger! Item was added: + ----- Method: GdbARMv8Alien>>w0 (in category 'accessing') ----- + w0 + ^self unsignedLongAt: 1! Item was added: + ----- Method: GdbARMv8Alien>>w0: (in category 'accessing') ----- + w0: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 1 put: 0. + ^self unsignedLongAt: 1 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w1 (in category 'accessing') ----- + w1 + ^self unsignedLongAt: 9! Item was added: + ----- Method: GdbARMv8Alien>>w10 (in category 'accessing') ----- + w10 + ^self unsignedLongAt: 81! Item was added: + ----- Method: GdbARMv8Alien>>w10: (in category 'accessing') ----- + w10: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 81 put: 0. + ^self unsignedLongAt: 81 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w11 (in category 'accessing') ----- + w11 + ^self unsignedLongAt: 89! Item was added: + ----- Method: GdbARMv8Alien>>w11: (in category 'accessing') ----- + w11: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 89 put: 0. + ^self unsignedLongAt: 89 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w12 (in category 'accessing') ----- + w12 + ^self unsignedLongAt: 97! Item was added: + ----- Method: GdbARMv8Alien>>w12: (in category 'accessing') ----- + w12: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 97 put: 0. + ^self unsignedLongAt: 97 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w13 (in category 'accessing') ----- + w13 + ^self unsignedLongAt: 105! Item was added: + ----- Method: GdbARMv8Alien>>w13: (in category 'accessing') ----- + w13: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 105 put: 0. + ^self unsignedLongAt: 105 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w14 (in category 'accessing') ----- + w14 + ^self unsignedLongAt: 113! Item was added: + ----- Method: GdbARMv8Alien>>w14: (in category 'accessing') ----- + w14: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 113 put: 0. + ^self unsignedLongAt: 113 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w15 (in category 'accessing') ----- + w15 + ^self unsignedLongAt: 121! Item was added: + ----- Method: GdbARMv8Alien>>w15: (in category 'accessing') ----- + w15: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 121 put: 0. + ^self unsignedLongAt: 121 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w16 (in category 'accessing') ----- + w16 + ^self unsignedLongAt: 129! Item was added: + ----- Method: GdbARMv8Alien>>w16: (in category 'accessing') ----- + w16: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 129 put: 0. + ^self unsignedLongAt: 129 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w17 (in category 'accessing') ----- + w17 + ^self unsignedLongAt: 137! Item was added: + ----- Method: GdbARMv8Alien>>w17: (in category 'accessing') ----- + w17: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 137 put: 0. + ^self unsignedLongAt: 137 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w18 (in category 'accessing') ----- + w18 + ^self unsignedLongAt: 145! Item was added: + ----- Method: GdbARMv8Alien>>w18: (in category 'accessing') ----- + w18: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 145 put: 0. + ^self unsignedLongAt: 145 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w19 (in category 'accessing') ----- + w19 + ^self unsignedLongAt: 153! Item was added: + ----- Method: GdbARMv8Alien>>w19: (in category 'accessing') ----- + w19: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 153 put: 0. + ^self unsignedLongAt: 153 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w1: (in category 'accessing') ----- + w1: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 9 put: 0. + ^self unsignedLongAt: 9 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w2 (in category 'accessing') ----- + w2 + ^self unsignedLongAt: 17! Item was added: + ----- Method: GdbARMv8Alien>>w20 (in category 'accessing') ----- + w20 + ^self unsignedLongAt: 161! Item was added: + ----- Method: GdbARMv8Alien>>w20: (in category 'accessing') ----- + w20: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 161 put: 0. + ^self unsignedLongAt: 161 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w21 (in category 'accessing') ----- + w21 + ^self unsignedLongAt: 169! Item was added: + ----- Method: GdbARMv8Alien>>w21: (in category 'accessing') ----- + w21: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 169 put: 0. + ^self unsignedLongAt: 169 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w22 (in category 'accessing') ----- + w22 + ^self unsignedLongAt: 177! Item was added: + ----- Method: GdbARMv8Alien>>w22: (in category 'accessing') ----- + w22: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 177 put: 0. + ^self unsignedLongAt: 177 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w23 (in category 'accessing') ----- + w23 + ^self unsignedLongAt: 185! Item was added: + ----- Method: GdbARMv8Alien>>w23: (in category 'accessing') ----- + w23: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 185 put: 0. + ^self unsignedLongAt: 185 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w24 (in category 'accessing') ----- + w24 + ^self unsignedLongAt: 193! Item was added: + ----- Method: GdbARMv8Alien>>w24: (in category 'accessing') ----- + w24: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 193 put: 0. + ^self unsignedLongAt: 193 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w25 (in category 'accessing') ----- + w25 + ^self unsignedLongAt: 201! Item was added: + ----- Method: GdbARMv8Alien>>w25: (in category 'accessing') ----- + w25: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 201 put: 0. + ^self unsignedLongAt: 201 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w26 (in category 'accessing') ----- + w26 + ^self unsignedLongAt: 209! Item was added: + ----- Method: GdbARMv8Alien>>w26: (in category 'accessing') ----- + w26: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 209 put: 0. + ^self unsignedLongAt: 209 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w27 (in category 'accessing') ----- + w27 + ^self unsignedLongAt: 217! Item was added: + ----- Method: GdbARMv8Alien>>w27: (in category 'accessing') ----- + w27: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 217 put: 0. + ^self unsignedLongAt: 217 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w28 (in category 'accessing') ----- + w28 + ^self unsignedLongAt: 225! Item was added: + ----- Method: GdbARMv8Alien>>w28: (in category 'accessing') ----- + w28: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 225 put: 0. + ^self unsignedLongAt: 225 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w2: (in category 'accessing') ----- + w2: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 17 put: 0. + ^self unsignedLongAt: 17 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w3 (in category 'accessing') ----- + w3 + ^self unsignedLongAt: 25! Item was added: + ----- Method: GdbARMv8Alien>>w3: (in category 'accessing') ----- + w3: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 25 put: 0. + ^self unsignedLongAt: 25 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w4 (in category 'accessing') ----- + w4 + ^self unsignedLongAt: 33! Item was added: + ----- Method: GdbARMv8Alien>>w4: (in category 'accessing') ----- + w4: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 33 put: 0. + ^self unsignedLongAt: 33 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w5 (in category 'accessing') ----- + w5 + ^self unsignedLongAt: 41! Item was added: + ----- Method: GdbARMv8Alien>>w5: (in category 'accessing') ----- + w5: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 41 put: 0. + ^self unsignedLongAt: 41 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w6 (in category 'accessing') ----- + w6 + ^self unsignedLongAt: 49! Item was added: + ----- Method: GdbARMv8Alien>>w6: (in category 'accessing') ----- + w6: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 49 put: 0. + ^self unsignedLongAt: 49 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w7 (in category 'accessing') ----- + w7 + ^self unsignedLongAt: 57! Item was added: + ----- Method: GdbARMv8Alien>>w7: (in category 'accessing') ----- + w7: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 57 put: 0. + ^self unsignedLongAt: 57 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w8 (in category 'accessing') ----- + w8 + ^self unsignedLongAt: 65! Item was added: + ----- Method: GdbARMv8Alien>>w8: (in category 'accessing') ----- + w8: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 65 put: 0. + ^self unsignedLongAt: 65 put: anUnsignedLong! Item was added: + ----- Method: GdbARMv8Alien>>w9 (in category 'accessing') ----- + w9 + ^self unsignedLongAt: 73! Item was added: + ----- Method: GdbARMv8Alien>>w9: (in category 'accessing') ----- + w9: anUnsignedLong + "zero extend..." + self unsignedLongLongAt: 73 put: 0. + ^self unsignedLongAt: 73 put: anUnsignedLong! Item was added: + GdbARMv8Alien variableByteSubclass: #GdbARMv8Alien64 + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'Cog-Processors'! + + !GdbARMv8Alien64 commentStamp: 'eem 11/19/2019 15:39' prior: 0! + I am a wrapper around the struct sim aarch64 CPU instance and emulator routines when compiled for 64-bits. I give access to disassembling using libopcodes.! Item was added: + ----- Method: GdbARMv8Alien64 class>>dataSize (in category 'instance creation') ----- + dataSize + ^2280! Item was added: + ----- Method: GdbARMv8Alien64>>nextpc (in category 'accessing') ----- + nextpc + ^self unsignedLongLongAt: 801! Item was added: + ----- Method: GdbARMv8Alien64>>nextpc: (in category 'accessing') ----- + nextpc: anUnsignedInteger + ^self unsignedLongLongAt: 801 put: anUnsignedInteger! From commits at source.squeak.org Fri Jan 8 07:03:00 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 8 Jan 2021 07:03:00 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2930.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2930.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2930 Author: eem Time: 7 January 2021, 11:02:49.506067 pm UUID: 3755defc-b655-43b4-bb4e-467bae846680 Ancestors: VMMaker.oscog-eem.2929 Time to bring the ARMv8 work back into Cog/VMMaker under full MIT. =============== Diff against VMMaker.oscog-eem.2929 =============== Item was added: + CogAbstractInstruction subclass: #CogARMv8Compiler + instanceVariableNames: '' + classVariableNames: 'AL ArithmeticAdd ArithmeticAddS ArithmeticSub ArithmeticSubS CASAL CArg0Reg CArg1Reg CArg2Reg CArg3Reg CArg4Reg CArg5Reg CArg6Reg CBNZ CBZ CC CCMPNE CLREX CS CSET D0 D1 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D2 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D3 D30 D31 D4 D5 D6 D7 D8 D9 DC DC_CISW DC_CIVAC DC_CSW DC_CVAC DC_CVAU DC_ISW DC_IVAC DC_ZVA DMB DSB DSB_ALL DSB_ALLSY DSB_ISH DSB_NSH DSB_OSH DSB_READS DSB_SY DSB_WRITES DivRRR EQ FP GE GT HI IC IC_IALLU IC_IALLUIS IC_IVAU ISB LDAXR LE LR LS LT LogicalAnd LogicalAndS LogicalOr LogicalXor MI MRS_CTR_EL0 MRS_ID_AA64ISAR0_EL1 MSubRRR MoveAwRR MoveRRAw MulOverflowRRR MulRRR NE NativePopRR NativePushRR PL R0 R1 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R2 R20 R21 R22 R23 R24 R25 R26 R27 R28 R29 R3 R30 R31 R4 R5 R6 R7 R8 R9 SMULHRRR SP STLR STLXR SXTB SXTH SXTW SXTX UXTB UXTH UXTW UXTX VC VS XZR' + poolDictionaries: 'ARMv8A64Opcodes' + category: 'VMMaker-JIT'! + CogARMv8Compiler class + instanceVariableNames: 'ctrEl0 idISAR0'! + + !CogARMv8Compiler commentStamp: 'eem 1/7/2021 23:01' prior: 0! + I generate ARMv8 machine code instructions from CogAbstractInstructions with CogRTLOpcodes. + Here in "Arm ARM" refers to + Arm� Architecture Reference Manual + Armv8, for Armv8-A architecture profile + https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile + + Some things to know about ARMv8 instructions: + Whether 31 in a register field implies the zero register or the SP register(s) depends on the specific instruction. + + C3.2.1 Load/Store register + If a Load instruction specifies writeback and the register being loaded is also the base register, + then behavior is CONSTRAINED UNPREDICTABLE and one of the following behaviors must occur: + - The instruction is treated as UNDEFINED. + - The instruction is treated as a NOP. + - The instruction performs the load using the specified addressing mode and the base register + becomes UNKNOWN. In addition, if an exception occurs during the execution of such an + instruction, the base address might be corrupted so that the instruction cannot be repeated. + If a Store instruction performs a writeback and the register that is stored is also the base register, + then behavior is CONSTRAINED UNPREDICTABLE and one of the following behaviors must occur: + - The instruction is treated as UNDEFINED. + - The instruction is treated as a NOP. + - The instruction performs the store to the designated register using the specified addressing + mode, but the value stored is UNKNOWN.! + CogARMv8Compiler class + instanceVariableNames: 'ctrEl0 idISAR0'! Item was added: + ----- Method: CogARMv8Compiler class>>ISA (in category 'translation') ----- + ISA + "Answer the name of the ISA the receiver implements." + ^#ARMv8! Item was added: + ----- Method: CogARMv8Compiler class>>VarBaseReg (in category 'accessing') ----- + VarBaseReg + "Answer the number of the reg we use to hold the base address of CoInterpreter variables" + ^VarBaseReg! Item was added: + ----- Method: CogARMv8Compiler class>>ctrEl0 (in category 'accessing') ----- + ctrEl0 + ^ctrEl0! Item was added: + ----- Method: CogARMv8Compiler class>>declareCVarsIn: (in category 'translation') ----- + declareCVarsIn: aCCodeGenerator + aCCodeGenerator + declareVar: 'ctrEl0' type: #usqIntptr_t; + declareVar: 'idISAR0' type: #usqIntptr_t! Item was added: + ----- Method: CogARMv8Compiler class>>idISAR0 (in category 'accessing') ----- + idISAR0 + ^idISAR0! Item was added: + ----- Method: CogARMv8Compiler class>>identifyingPredefinedMacros (in category 'translation') ----- + identifyingPredefinedMacros + ^#('__arm64__' '__aarch64__' '__ARM_ARCH_ISA_A64' '__ARM_ARCH >= 8' 'ARM64' 'ARMv8') "The last two are probably bogus..."! Item was added: + ----- Method: CogARMv8Compiler class>>initialize (in category 'class initialization') ----- + initialize + "Initialize various ARM64 instruction-related constants." + "self initialize" + + "main registers; a minor complication in reading the doc. + ARM refer to the 64bit registers as X0...30 and use R0...30 to refer to the 32bit lower halves. + They also use a whole suite of names for the floating point/SIMD registers. See ARMARM DDI0487 B1.2.1 etc for the gory details. + Note that R30 (yes, yes, X30) is used as the link register and as such is not really a general purpose register. + Also note that 31 in a general register field means R31, and that in most of these instructions R31 is the zero + register named XZR in ARM doc. but in the rest of these instructions R31 the effective SP register. + XZR is a pseudo-register that always reads as 0 and writes to /dev/null. + And note that unlike the ARM32, there is no general purpose register for the PC; a big difference. + See ARMARM DDI0487 C1.2.5. wrt to both the lack of a PC register and the XZR/SP distinction." + + "and initialize most sets of variables that run from 0 to N - 1..." + #( "General registers, 0 to 31. We stick with R0...30 to refer to the 64 bit general regs and D0...31 (note the extra reg here!!) for the FP/SIMD regs" + (R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R20 R21 R22 R23 R24 R25 R26 R27 R28 R29 R30 R31) + "Floating-point registers, 0 to 31" + (D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31) + "C argument registers, 0 to 6" + (CArg0Reg CArg1Reg CArg2Reg CArg3Reg CArg4Reg CArg5Reg CArg6Reg) + "Condition Codes 0 to 16. Note that cc=16rF is mapped back to AL in AARCH64. Generally it shouldn't be used." + (EQ NE CS CC MI PL VS VC HI LS GE LT GT LE AL) + "Logical Op Codes" + (LogicalAnd LogicalOr LogicalXor LogicalAndS) + "Arithmetic Opcodes" + "ADD (shifted register) on page C6-763 10001011 + ADDS (shifted register) on page C6-771 10101011 + CMN (shifted register) on page C6-854 10101011 Rd=XZR + SUB (shifted register) on page C6-1313 11001011 + SUBS (shifted register) on page C6-1323 11101011 + CMP (shifted register) on page C6-860 11101011 Rd=XZR + NEG (shifted register) on page C6-1114 11001011 Rn=XZR + NEGS on page C6-1116 11101011 Rn=XZR" + (ArithmeticAdd ArithmeticAddS ArithmeticSub ArithmeticSubS) + "Extension Methods " + (UXTB UXTH UXTW UXTX "a.k.a. LSL" SXTB SXTH SXTW SXTX)) do: + [:classVarNames| + classVarNames doWithIndex: + [:k :v| + CogARMv8Compiler classPool at: k put: v - 1]]. + + SP := XZR := R31. + LR := R30. + FP := R29. + + "DC variant selectors; see concretizeDataCacheControl" + DC_CISW := 13. + DC_CIVAC := 14. + DC_CSW := 15. + DC_CVAC := 16. + DC_CVAU := 19. + DC_ISW := 26. + DC_IVAC := 27. + DC_ZVA := 28. + + "IC variant selectors; see concretizeInstructionCacheControl" + IC_IALLU := 0. + IC_IALLUIS := 1. + IC_IVAU := 2. + + "DSB domains and types C6.2.81 DSB C6-891" + DSB_OSH := 0. "Domain_OuterSharable" + DSB_NSH := 1. "Domain_NonSharable" + DSB_ISH := 2. "Domain_InnerSharable" + DSB_SY := 3. "Domain_FullSystem" + + DSB_ALLSY := 0. "Types_All; domain = Domain_FullSystem" + DSB_READS := 1. "Types_Reads" + DSB_WRITES := 2. "Types_Writes" + DSB_ALL := 3. "Types_All; domain ~= Domain_FullSystem" + + "Specific instructions" + self + initializeSpecificOpcodes: #(MulRRR MulOverflowRRR SMULHRRR DivRRR MSubRRR "N.B. ARMv8 has MSUBRRRR but we only support three operands" + MoveAwRR MoveRRAw NativePushRR NativePopRR "these map to ldp/stp" + "Cache control and memory barrier" + "B2.3.7 Memory barriers B2-124" + DC IC DMB DSB ISB MRS_CTR_EL0 MRS_ID_AA64ISAR0_EL1 + CASAL CBNZ CBZ CCMPNE CSET CLREX LDAXR STLXR STLR) + in: thisContext method! Item was added: + ----- Method: CogARMv8Compiler class>>initializeAbstractRegisters (in category 'class initialization') ----- + initializeAbstractRegisters + "Assign the abstract registers with the identities/indices of the relevant concrete registers." + + "See Table 3-1 Register Usage in AArch64 SMC32, HVC32, SMC64, and HVC64 calls in + SMC CALLING CONVENTION + System Software on ARM� Platforms Document number: ARM DEN 0028B + http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf" + + TempReg := R0. + ClassReg := R4. + ReceiverResultReg := R5. + SendNumArgsReg := R6. + Arg0Reg := R7. + Arg1Reg := R8. + RISCTempReg := R9. + SPReg := R16."we cannot easily use the native SP for SPReg because of the typical + 16-byte alignment restriction, enforced if the SA0 bit is set in SCTLR_EL1." + "X18/R18 is the Platform register; leave it be" + Extra0Reg := R19. "R18 through R28 are callee saved" + Extra1Reg := R20. + Extra2Reg := R21. + Extra3Reg := R22. + Extra4Reg := R23. + Extra5Reg := R24. + Extra6Reg := R25. + Extra7Reg := R26. + Extra8Reg := R27. + VarBaseReg := R28. + FPReg := FP. "a.k.a. R29" + LinkReg := LR. "a.k.a. R30" + NativeSPReg := SP. "a.k.a. R31; we cannot easily use the native SP for SPReg because of the typical + 16-byte alignment restriction, enforced if the SA0 bit is set in SCTLR_EL1." + + ABICalleeSavedRegisterMask := (self registerMaskFor: 19 and: 20 and: 21 and: 22 and: 23) + + (self registerMaskFor: 24 and: 25 and: 26 and: 27 and: 28). + ABICallerSavedRegisterMask := ((self registerMaskFor: 0 and: 1 and: 2 and: 3 and: 4 and: 5 and: 6 and: 7 and: 8 and: 9) + + (self registerMaskFor: 10 and: 11 and: 12 and: 13 and: 14 and: 15 and: 16 and: 17)). + CallerSavedRegisterMask := ABICallerSavedRegisterMask + bitAnd: (self registerMaskFor: ClassReg and: ReceiverResultReg and: SendNumArgsReg and: Arg0Reg and: Arg1Reg). + + NumRegisters := 32. + + DPFPReg0 := D0. + DPFPReg1 := D1. + DPFPReg2 := D2. + DPFPReg3 := D3. + DPFPReg4 := D4. + DPFPReg5 := D5. + DPFPReg6 := D6. + DPFPReg7 := D7. + DPFPReg8 := D8. + DPFPReg9 := D9. + DPFPReg10 := D10. + DPFPReg11 := D11. + DPFPReg12 := D12. + DPFPReg13 := D13. + DPFPReg14 := D14. + DPFPReg15 := D15. + + NumFloatRegisters := 32! Item was added: + ----- Method: CogARMv8Compiler class>>literalsManagerClass (in category 'accessing class hierarchy') ----- + literalsManagerClass + ^OutOfLineLiteralsManagerFor64Bits! Item was added: + ----- Method: CogARMv8Compiler class>>machineCodeDeclaration (in category 'translation') ----- + machineCodeDeclaration + "Answer the declaration for the machineCode array. + ARM instructions are 32-bits in length." + ^{#'unsigned int'. '[', self basicNew machineCodeWords printString, ']'}! Item was added: + ----- Method: CogARMv8Compiler class>>numTrampolines (in category 'trampoline support') ----- + numTrampolines + ^2 "ceFlushICache, and optionally ceFlushDCache"! Item was added: + ----- Method: CogARMv8Compiler class>>preambleCCode (in category 'translation') ----- + preambleCCode + ^'#if __APPLE__ && __MACH__ /* Mac OS X */\#include \#endif' withCRs! Item was added: + ----- Method: CogARMv8Compiler class>>printFormatForOpcodeName: (in category 'debug printing') ----- + printFormatForOpcodeName: opcodeName + "Answer a sequence of $r, $f or nil for the operands in the opcode, used for printing, where + r => integer register, f => floating point register, and nil => numeric or address operand. + Subclasses can override to provide a format string for their own private opcodes." + ^opcodeName caseOf: { + [#CASAL] -> ['rrr']. + [#CCMPNE] -> ['rrc']. + [#CSET] -> [#($r nil)]. + [#LDAXR] -> ['rr']. + [#STLXR] -> ['rr']. + [#STLR] -> ['rr'] } + otherwise: [#()]! Item was added: + ----- Method: CogARMv8Compiler class>>specificOpcodes (in category 'class initialization') ----- + specificOpcodes + "Answer the processor-specific opcodes for this class. + They're all in an Array literal in the initialize method." + ^(self class >> #initialize) literals detect: [:l| l isArray and: [l includes: #MulRR]]! Item was added: + ----- Method: CogARMv8Compiler class>>wordSize (in category 'translation') ----- + wordSize + "This is a 64-bit ISA" + ^8! Item was added: + ----- Method: CogARMv8Compiler>>addrn:rd:imm:shiftBy12: (in category 'generate machine code - support') ----- + addrn: rn rd: rd imm: offset shiftBy12: shiftBy12 + "C6.2.4 ADD (immediate) p761" + self assert: (offset between: 0 and: 1 << 12 - 1). + ^2r10010001000000000000000000000000 + + (shiftBy12 ifTrue: [1 << 22] ifFalse: [0]) + (offset << 10) + (rn << 5) + rd! Item was added: + ----- Method: CogARMv8Compiler>>assertCoherentCodeAt:delta: (in category 'debugging') ----- + assertCoherentCodeAt: codeAddress delta: theCodeToDataDelta + + | codeInstruction dataInstruction | + codeInstruction := self instructionAt: codeAddress. + dataInstruction := self instructionAt: codeAddress + theCodeToDataDelta. + self assert: codeInstruction = dataInstruction! Item was added: + ----- Method: CogARMv8Compiler>>bl: (in category 'generate machine code - support') ----- + bl: callDistance + "C6.2.33 BL C6-812" + + self assert: (callDistance noMask: 3). + ^2r100101 << 26 + (callDistance >>> 2 bitAnd: 1 << 26 - 1)! Item was added: + ----- Method: CogARMv8Compiler>>brlink:reg: (in category 'generate machine code - support') ----- + brlink: link reg: reg + ^2r1101011000011111 << 16 + + (link ifTrue: [1 << 21] ifFalse: [0]) + + (reg << 5)! Item was added: + ----- Method: CogARMv8Compiler>>byteReadsZeroExtend (in category 'testing') ----- + byteReadsZeroExtend + "Answer if a byte read, via MoveAbR, MoveMbrR, or MoveXbrRR zero-extends + into the full register, or merely affects the least significant 8 bits of the + the register. By default the code generator assumes that byte reads + to not zero extend. Note that byte reads /must not/ sign extend." + ^true! Item was added: + ----- Method: CogARMv8Compiler>>callInstructionByteSize (in category 'accessing') ----- + callInstructionByteSize + "ARM calls and jumps span +/- 32 mb, more than enough for intra-zone calls and jumps." + ^4! Item was added: + ----- Method: CogARMv8Compiler>>callTargetFromReturnAddress: (in category 'inline cacheing') ----- + callTargetFromReturnAddress: mcpc + | instr | + instr := self instructionAt: mcpc - 4. + "C6.2.26 B C6-799 + C6.2.33 BL C6-812" + self assert: (instr >> 26 = 2r100101 or: [instr >> 26 = 2r101]). + ^(self + cCode: [(instr bitAnd: 1 << 26 - 1) << 38] + inSmalltalk: [(instr bitAnd: 1 << 26 - 1) << 38 bitAnd: 1 << 64 - 1]) + signedIntFromLong64 >>> 36 + (mcpc - 4)! Item was added: + ----- Method: CogARMv8Compiler>>canDivQuoRem (in category 'testing') ----- + canDivQuoRem + ^true! Item was added: + ----- Method: CogARMv8Compiler>>canMulRR (in category 'testing') ----- + canMulRR + ^true! Item was added: + ----- Method: CogARMv8Compiler>>canMulRRDetectOverflow (in category 'testing') ----- + canMulRRDetectOverflow + "ARMv8's intrinsic integer multiply doesn't set the overflow flag, so we + need to generate additional code to implement overflow checking." + + ^false! Item was added: + ----- Method: CogARMv8Compiler>>canSignExtend (in category 'testing') ----- + canSignExtend + "ARMv8 has native SignExtend8RR, SignExtend16RR, & SignExtend32RR." + + ^true! Item was added: + ----- Method: CogARMv8Compiler>>canZeroExtend (in category 'testing') ----- + canZeroExtend + "x64 has native ZeroExtend8RR, ZeroExtend16RR, & ZeroExtend32RR." + + ^true! Item was added: + ----- Method: CogARMv8Compiler>>cmpC32RTempByteSize (in category 'accessing') ----- + cmpC32RTempByteSize + ^8! Item was added: + ----- Method: CogARMv8Compiler>>codeGranularity (in category 'accessing') ----- + codeGranularity + "Answer the size in bytes of a unit of machine code." + + ^4! Item was added: + ----- Method: CogARMv8Compiler>>computeJumpTargetOffset (in category 'generate machine code - support') ----- + computeJumpTargetOffset + + | jumpTarget | + + jumpTarget := self jumpTargetAddress. + ^jumpTarget signedIntFromLong64 - address signedIntFromLong64! Item was added: + ----- Method: CogARMv8Compiler>>computeLowBit: (in category 'generate machine code - support') ----- + computeLowBit: nArg + " Answer the index of the low order one bit. + 2r00101000 lowBit (Answers: 4) + 2r-00101000 lowBit (Answers: 4) + This is an implementation of SmallInteger>>lowBit" + + | n result | + nArg = 0 ifTrue: [^0]. + n := nArg. + result := 1. + [n noMask: 16rFF] + whileTrue: + [result := result + 8. + n := n bitShift: -8]. + (n noMask: 16rF) ifTrue: + [result := result + 4. + n := n bitShift: -4]. + (n noMask: 16r3) ifTrue: + [result := result + 2. + n := n bitShift: -2]. + ^(n anyMask: 1) + ifTrue: [result] + ifFalse: [result + 1] + + "| me | + me := self basicNew. + (0 to: 65535) reject: [:i| i lowBit = (me lowBit: i)]"! Item was added: + ----- Method: CogARMv8Compiler>>computeMaximumSize (in category 'generate machine code') ----- + computeMaximumSize + "Because we don't use Thumb, each ARMv8 instruction has 4 bytes. Several + abstract opcodes need more than one instruction. Instructions that refer to + constants and/or literals depend on literals being stored out-of-line or encoded + in immediate instruction fields (i.e. we only support OutOfLineLiteralsManager. + + N.B. The ^N forms are to get around the old bytecode compiler's long branch + limits which are exceeded when each case jumps around the otherwise." + + opcode + caseOf: { + "Noops & Pseudo Ops" + [Label] -> [^0]. + [Literal] -> [^self literalSize]. + [AlignmentNops] -> [^(operands at: 0) - 4]. + "Control" + [CallFull] -> [^8]. + [JumpFull] -> [^8]. + [JumpLongZero] -> [^8]. + [JumpLongNonZero] -> [^8]. + [JumpMulOverflow] -> [^8]. + [JumpNoMulOverflow] -> [^8]. + [JumpFPOrdered] -> [^8]. + [JumpFPUnordered] -> [^8]. + [RetN] -> [^(operands at: 0) = 0 ifTrue: [4] ifFalse: [8]]. + [NativeRetN] -> [^(operands at: 0) = 0 ifTrue: [4] ifFalse: [8]]. + + "Arithmetic" + [AddCqR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|4] ifFalse: [8]]. + [AddCqRR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|4] ifFalse: [8]]. + [CmpCqR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|4] ifFalse: [8]]. + [SubCqR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|4] ifFalse: [8]]. + [LoadEffectiveAddressMwrR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|4] ifFalse: [8]]. + [AndCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|4] ifFalse:[8]]. + [AndCqRR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|4] ifFalse:[8]]. + [OrCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|4] ifFalse:[8]]. + [OrCqRR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|4] ifFalse:[8]]. + [TstCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|4] ifFalse:[8]]. + [XorCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|4] ifFalse:[8]]. + [AddCwR] -> [^8]. + [AndCwR] -> [^8]. + [CmpCwR] -> [^8]. + [CmpC32R] -> [^8]. + [OrCwR] -> [^8]. + [SubCwR] -> [^8]. + [XorCwR] -> [^8]. + [SubRR] -> [^(operands at: 0) = SP ifTrue: [8] ifFalse: [4]]. + [SubRRR] -> [^(operands at: 0) = SP ifTrue: [8] ifFalse: [4]]. + + "ARMv8 Specific Arithmetic" + [MulOverflowRRR] -> [^12]. + "Data Movement" + [MoveAwR] -> [^((self isAddressRelativeToVarBase: (operands at: 0)) + or: [cogit addressIsInCurrentCompilation: (operands at: 0)]) + ifTrue: [(operands at: 1) ~= SP ifTrue: [4] ifFalse: [8]] + ifFalse: [(operands at: 1) ~= SP ifTrue: [8] ifFalse: [12]]]. + [MoveRAw] -> [^((self isAddressRelativeToVarBase: (operands at: 1)) + or: [cogit addressIsInCurrentCompilation: (operands at: 1)]) + ifTrue: [(operands at: 0) ~= SP ifTrue: [4] ifFalse: [8]] + ifFalse: [(operands at: 0) ~= SP ifTrue: [8] ifFalse: [12]]]. + [MoveAwRR] -> [self assert: (self isAddressRelativeToVarBase: (operands at: 0)). + ^((operands at: 1) = SP or: [(operands at: 2) = SP]) + ifTrue: [8] ifFalse: [4]]. + [MoveRRAw] -> [self assert: (self isAddressRelativeToVarBase: (operands at: 2)). + ^((operands at: 0) = SP or: [(operands at: 1) = SP]) + ifTrue: [8] ifFalse: [4]]. + [MoveAbR] -> [^(self isAddressRelativeToVarBase: (operands at: 0)) + ifTrue: [4] + ifFalse: [8]]. + [MoveRAb] -> [^(self isAddressRelativeToVarBase: (operands at: 1)) + ifTrue: [4] + ifFalse: [8]]. + [MoveMwrR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveRMwr] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveM32rR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveRM32r] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveM16rR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveRM16r] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveMbrR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveRMbr] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|4] ifFalse:[8]]. + [MoveM64rRd] -> [^(self isUnsigned12BitMultipleOf8: (operands at: 0)) ifTrue: [4] ifFalse: [8]]. + [MoveRdM64r] -> [^(self isUnsigned12BitMultipleOf8: (operands at: 1)) ifTrue: [4] ifFalse: [8]]. + [PushCw] -> [^8]. + [PushCq] -> [^8]. + } + otherwise: [^4]. + ^0 "to keep C compiler quiet" + ! Item was added: + ----- Method: CogARMv8Compiler>>concretizeAddCqRDest: (in category 'generate machine code - concretize') ----- + concretizeAddCqRDest: destReg + "Will get inlined into concretizeAt: switch." + + | constant srcReg offset | + + constant := (operands at: 0) signedIntFromLong64. + srcReg := operands at: 1. + + self isPossiblyShiftableImm12: constant + ifTrue: + [:shift| + "C6.2.4 ADD (immediate) C6-761 + C6.2.8 ADDS (immediate) C6-769" + machineCode + at: 0 + put: (srcReg = SP + ifTrue: [2r100100010 "ADD"] + ifFalse: [2r101100010 "ADDS"]) << 23 + + (shift ifTrue: [constant >> 2 + (1 << 22)] ifFalse: [constant << 10]) + + (srcReg << 5) + + destReg. + ^4] + ifFalse: []. + self isPossiblyShiftableImm12: constant negated + ifTrue: + [:shift| + "C6.2.308 SUB (immediate) C6-1311 + C6.2.314 SUBS (immediate) C6-1321" + machineCode + at: 0 + put: (srcReg = SP + ifTrue: [2r110100010 "SUB"] + ifFalse: [2r111100010 "SUBS"]) << 23 + + (shift ifTrue: [constant negated >> 2 + (1 << 22)] ifFalse: [constant negated << 10]) + + (srcReg << 5) + +destReg. + ^4] + ifFalse: []. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + "cogit processor disassembleInstructionAt: 4 In: machineCode object" + offset := self emitMoveCw: constant intoR: RISCTempReg at: 0. + "C6.2.7 ADDS (extended register) C6-766" + machineCode + at: offset // 4 + put: 2r10101011001 << 21 + + (RISCTempReg << 16) + + (SXTX << 13) + + (srcReg << 5) + + destReg. + ^offset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeAlignmentNops (in category 'generate machine code - concretize') ----- + concretizeAlignmentNops + + "See outputMachineCodeAt:" + self assert: machineCodeSize \\ 4 = 0. + machineCode at: 0 put: NOP. + ^machineCodeSize! Item was added: + ----- Method: CogARMv8Compiler>>concretizeArithmeticShiftRightCqR (in category 'generate machine code - concretize') ----- + concretizeArithmeticShiftRightCqR + + "C6.2.17 ASR (immediate) C6-785 100100110 (1) + C6.2.177 LSL (immediate) C6-1075 110100110 (1) + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + | reg constant | + constant := operands at: 0. + reg := operands at: 1. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1001001101 << 22 + + (constant << 16) + + (63 << 10) + + (reg << 5) + + reg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeArithmeticShiftRightCqRR (in category 'generate machine code - concretize') ----- + concretizeArithmeticShiftRightCqRR + + "C6.2.17 ASR (immediate) C6-785 100100110 (1) + C6.2.177 LSL (immediate) C6-1075 110100110 (1) + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + | constant srcReg destReg | + constant := operands at: 0. + srcReg := operands at: 1. + destReg := operands at: 2. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1001001101 << 22 + + (constant << 16) + + (63 << 10) + + (srcReg << 5) + + destReg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCASAL (in category 'generate machine code - concretize processor-specific') ----- + concretizeCASAL + "Will get inlined into concretizeAt: switch." + + | constantReg "Xs" valueReg "Xt" baseReg "Xn" | + constantReg := operands at: 0. + valueReg := operands at: 1. + baseReg := operands at: 2. + machineCode + at: 0 + put: 2r11001000111 << 21 + + (constantReg << 16) + + (63 << 10) + + (baseReg << 5) + + valueReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCB (in category 'generate machine code - concretize processor-specific') ----- + concretizeCB + "C6.2.44/45 CBNZ/CBZ C6-831..." + + | offset reg | + offset := self computeJumpTargetOffset. + self assert: (offset ~= 0 and: [self isInImmediateBranchRange: offset]). + reg := operands at: 1. + machineCode + at: 0 + put: 2r101101 << 26 + + (opcode = CBNZ ifTrue: [1 << 24] ifFalse: [0]) + + ((offset bitAnd: 1 << 21 - 1) << 3) + + reg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCCMPNE (in category 'generate machine code - concretize processor-specific') ----- + concretizeCCMPNE + "C6.2.49 CCMP (register) C6-839" + + | rM rN flags | + rM := operands at: 0. + rN := operands at: 1. + flags := operands at: 2. + machineCode + at: 0 + put: 2r11111010010 << 21 + + (rM << 16) + + (NE << 12) + + (rN << 5) + + flags. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCLREX (in category 'generate machine code - concretize processor-specific') ----- + concretizeCLREX + "C6.2.54 CLREX C6-847" + + machineCode + at: 0 + put: 2r11010101000000110011111101011111. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCSET (in category 'generate machine code - concretize processor-specific') ----- + concretizeCSET + "Will get inlined into concretizeAt: switch." + + | reg condition | + reg := operands at: 0. + condition := operands at: 1. + machineCode + at: 0 + put: 2r1001101010011111 << 16 + + ((condition bitXor: 1) "strange, but true" << 12) + + (2r111111 << 5) + + reg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCacheControlOp1:CRm:Op2: (in category 'generate machine code - concretize processor-specific') ----- + concretizeCacheControlOp1: op1 CRm: crm Op2: op2 + + machineCode + at: 0 + put: 2r1101010100001 << 19 + + (op1 << 16) + + (2r0111 << 12) "CRn" + + (crm << 8) + + (op2 << 5) + + (operands at: 0). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4 + + "Scripture (see DminLine & IminLine below): + + D13.2.33 CTR_EL0, Cache Type Register D13-2912 + + Provides information about the architecture of the caches. + + AArch64 System register CTR_EL0[31:0] is architecturally mapped to AArch32 System register CTR[31:0]. + + CTR_EL0 is a 64-bit register. + + DIC, bit [29] + Instruction cache invalidation requirements for instruction to data coherence. The meaning of this bit is: + 0b0 Instruction cache invalidation to the Point of Unification is required for instruction to data coherence. + 0b1 Instruction cache cleaning to the Point of Unification is not required for instruction to data coherence. + + IDC, bit [28] + Data cache clean requirements for instruction to data coherence. The meaning of this bit is: + 0b0 Data cache clean to the Point of Unification is required for instruction to data coherence, + unless CLIDR.LoC == 0b000 or (CLIDR.LoUIS == 0b000 && CLIDR.LoUU == 0b000). + 0b1 Data cache clean to the Point of Unification is not required for instruction to data coherence. + + CWG, bits [27:24] + Cache writeback granule. Log2 of the number of words of the maximum size of memory that can be overwritten as a result of the eviction of a cache entry that has had a memory location in it modified. + A value of 0b0000 indicates that this register does not provide Cache writeback granule information and either: + - The architectural maximum of 512 words (2KB) must be assumed. + - The Cache writeback granule can be determined from maximum cache line size encoded in the Cache Size ID Registers. + Values greater than 0b1001 are reserved. + Arm recommends that an implementation that does not support cache write-back implements this field as 0b0001. This applies, for example, to an implementation that supports only write-through caches. + + ERG, bits [23:20] + Exclusives reservation granule. Log2 of the number of words of the maximum size of the reservation granule that has been implemented for the Load-Exclusive and Store-Exclusive instructions. + The use of the value 0b0000 is deprecated. + The value 0b0001 and values greater than 0b1001 are reserved. + + DminLine, bits [19:16] + Log2 of the number of words in the smallest cache line of all the data caches and unified caches that are controlled by the PE. + + L1Ip, bits [15:14] + Level 1 instruction cache policy. Indicates the indexing and tagging policy for the L1 instruction cache. Possible values of this field are: + 0b00 VMID aware Physical Index, Physical tag (VPIPT) + 0b01 ASID-tagged Virtual Index, Virtual Tag (AIVIVT) + 0b10 Virtual Index, Physical Tag (VIPT) + 0b11 Physical Index, Physical Tag (PIPT) + The value 0b01 is reserved in Armv8. + The value 0b00 is permitted only in an implementation that includes ARMv8.2-VPIPT, otherwise the value is reserved. + + Bits [13:4] Reserved, RES0. + + IminLine, bits [3:0] + Log2 of the number of words in the smallest cache line of all the instruction caches that are controlled by the PE."! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCall (in category 'generate machine code - concretize') ----- + concretizeCall + + | offset | + offset := ((operands at: 0) - address) signedIntFromLong64. + self assert: (offset noMask: 3). + self assert: (self isInImmediateBranchAndLinkRange: offset). + "C6.2.33 BL C6-812" + machineCode at: 0 put: (self bl: offset). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCallJumpFull: (in category 'generate machine code - concretize') ----- + concretizeCallJumpFull: link + "Sizing/generating calls. + Jump targets can be to absolute addresses or other abstract instructions. + Generating initial trampolines instructions may have no maxSize and be to absolute addresses. + Otherwise instructions must have a machineCodeSize which must be kept to." + + | jumpTarget instrOffset| + + jumpTarget := self longJumpTargetAddress. + instrOffset := self emitMoveCw: jumpTarget asUnsignedInteger intoR: RISCTempReg at: 0. + machineCode + at: instrOffset // 4 + put: (self brlink: link reg: RISCTempReg). + self assert: instrOffset = self literalLoadInstructionBytes. + ^instrOffset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeClzRR (in category 'generate machine code - concretize') ----- + concretizeClzRR + "C6.2.56 CLZ C6-849" + + | maskReg dest | + maskReg := operands at: 0. + dest := operands at: 1. + machineCode + at: 0 + put: 2r11011010110000000001 << 12 + + (maskReg << 5) + + dest. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCmpC32R (in category 'generate machine code - concretize') ----- + concretizeCmpC32R + + | constant rn | + constant := operands at: 0. + rn := operands at: 1. + + self assert: (cogit addressIsInCurrentCompilation: dependent address). + self assert: dependent address \\ 4 = 0. + self assert: (dependent address - address) abs < (1<<18). + "C6.2.131 LDR (literal) C6-979" + machineCode + at: 0 + put: 2r00011 << 27 + + (dependent address - address << 3 "5 - 2") + + RISCTempReg. + + "C6.2.60 CMP (extended register) C6-856" + machineCode + at: 1 + put: 2r01101011001 << 21 "N.B. sf == 0!!!!" + + (RISCTempReg << 16) + + (UXTX << 13) + + (rn << 5) + + XZR. + ^8! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCmpCqR (in category 'generate machine code - concretize') ----- + concretizeCmpCqR + "Will get inlined into concretizeAt: switch." + + | constant rn offset | + + constant := (operands at: 0) signedIntFromLong64. + rn := operands at: 1. + + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + self isPossiblyShiftableImm12: constant + ifTrue: + [:shift| + "C6.2.61 CMP (immediate) C6-858 + C6.2.314 SUBS (immediate) C6-1321" + machineCode + at: 0 + put: 2r111100010 << 23 + + (shift ifTrue: [constant >> 2 + (1 << 22)] ifFalse: [constant << 10]) + + (rn << 5) + + XZR. + ^4] + ifFalse: []. + self isPossiblyShiftableImm12: constant negated + ifTrue: + [:shift| + "C6.2.58 CMN (immediate) C6-852 + C6.2.8 ADDS (immediate) C6-769" + machineCode + at: 0 + put: 2r101100010 << 23 + + (shift ifTrue: [constant negated >> 2 + (1 << 22)] ifFalse: [constant negated << 10]) + + (rn << 5) + + XZR. + ^4] + ifFalse: []. + offset := self emitMoveCw: constant intoR: RISCTempReg at: 0. + "C6.2.60 CMP (extended register) C6-856" + machineCode + at: offset // 4 + put: 2r11101011001 << 21 + + (RISCTempReg << 16) + + (UXTX << 13) + + (rn << 5) + + XZR. + ^offset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCmpRdRd (in category 'generate machine code - concretize') ----- + concretizeCmpRdRd + "C7.2.59 FCMP C7-1506" + + machineCode + at: 0 + put: 2r11110011 << 21 + + ((operands at: 0) << 16) + + (1 << 13) + + ((operands at: 1) << 5). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeConditionalJump: (in category 'generate machine code - concretize') ----- + concretizeConditionalJump: conditionCode + "Will get inlined into concretizeAt: switch." + "Sizing/generating jumps. + Jump targets can be to absolute addresses or other abstract instructions. + Generating initial trampolines instructions may have no maxSize and be to absolute addresses. + Otherwise instructions must have a machineCodeSize which must be kept to." + + | offset | + offset := self computeJumpTargetOffset. + self assert: (offset ~= 0 and: [self isInImmediateBranchRange: offset]). + machineCode at: 0 put: (self cond: conditionCode offset: offset). "B offset" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeConditionalLongJump: (in category 'generate machine code - concretize') ----- + concretizeConditionalLongJump: conditionCode + "Generate a short conditional branch around a long unconditional jump. + C6.2.25 B.cond C6-798 + C6.2.26 B C6-799 + Note that C6.2.44 CBNZ and C6.2.45 CBZ aren't useful for Closed PIC jumps. + They compare against zero and have only a +/-1Mb range." + + | offset | + self assert: (conditionCode = EQ or: [conditionCode = NE]). + offset := (operands at: 0) - (address + 4). + self assert: (offset noMask: 3). + self assert: (offset >>> 2 between: -1 << 26 and: 1 << 26 - 1). + machineCode + at: 0 + put: 2r101010 << 25 + + (2 << 5 "skip next instruction") + + (conditionCode = EQ ifTrue: [NE] ifFalse: [EQ]); + at: 1 + put: 2r101 << 26 + (offset >>> 2 bitAnd: 1 << 26 - 1). + ^8! Item was added: + ----- Method: CogARMv8Compiler>>concretizeConvertRRd (in category 'generate machine code - concretize') ----- + concretizeConvertRRd + "Table C3-67 Floating-point and integer or fixed-point conversion instructions C3-229 + SCVTF (scalar, integer) on page C7-1894" + + machineCode + at: 0 + put: 2r1001111001100010 << 16 + + ((operands at: 0) << 5) + + (operands at: 1). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeConvertRdR (in category 'generate machine code - concretize') ----- + concretizeConvertRdR + "Table C3-67 Floating-point and integer or fixed-point conversion instructions C3-229 + FCVTZS (scalar, integer) on page C7-1568" + + machineCode + at: 0 + put: 2r1001111001111 << 19 + + ((operands at: 0) << 5) + + (operands at: 1). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCwRArithmetic:Rd: (in category 'generate machine code - concretize') ----- + concretizeCwRArithmetic: arithOp Rd: destRegOrXZR + | instrBytes | + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + "cogit processor disassembleInstructionAt: 4 In: machineCode object" + instrBytes := self emitMoveCw: (operands at: 0) intoR: RISCTempReg at: 0. + "ADD (extended register) on page C6-758 + ADDS (extended register) on page C6-766 + SUB (extended register) on page C6-1308 + SUBS (extended register) on page C6-1318" + machineCode + at: instrBytes // 4 + put: 2r10001011001 << 21 + + (arithOp << 29) + + (RISCTempReg <<16) + + (UXTX << 13) + + ((operands at: 1) << 5) + + destRegOrXZR. + ^instrBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeCwRLogical: (in category 'generate machine code - concretize') ----- + concretizeCwRLogical: op + | destReg constant offset | + constant := operands at: 0. + destReg := operands at: 1. + offset := self emitMoveCw: constant intoR: RISCTempReg at: 0. + "AND (shifted register) - 64-bit variant on page C6-777 + BIC (shifted register) - 64-bit variant on page C6-808 + ORR (shifted register) - 64-bit variant on page C6-1127 + ORN (shifted register) - 64-bit variant on page C6-1123 + EOR (shifted register) - 64-bit variant on page C6-898 + EON (shifted register) - 64-bit variant on page C6-894 + ANDS (shifted register) - 64-bit variant on page C6-781 + BICS (shifted register) - 64-bit variant on page C6-810" + machineCode + at: offset // 4 + put: 2r1000101 << 25 + + (op << 29) + + (RISCTempReg << 16) + + (destReg << 5) + + destReg. + ^offset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeDataCacheControl (in category 'generate machine code - concretize processor-specific') ----- + concretizeDataCacheControl + "Issue a DC CIVAC, CVAC or CVAU + C5.3.14 DC CIVAC, Data or unified Cache line Clean and Invalidate by VA to PoC C5-486 + Clean and Invalidate data cache by address to Point of Coherency. + C5.3.16 DC CVAC, Data or unified Cache line Clean by VA to PoC C5-490 + Clean data cache by address to Point of Coherency. + C5.3.19 DC CVAU, Clean data cache by address to Point of Unification C5-496 + Clean data cache by address to Point of Unification." + + "(operands at: 0) is the target register, accessed within concretizeCacheControlOp1:CRm:Op2:" + | cacheOpcode | + cacheOpcode := (operands at: 1) caseOf: { + [DC_CIVAC] -> [2r1110]. + [DC_CVAC] -> [2r1010]. + [DC_CVAU] -> [2r1011] }. + ^self concretizeCacheControlOp1: 2r011 CRm: cacheOpcode Op2: 2r001 + + "Scripture: + C5.3.1 DC CGDSW, Data, Allocation Tag or unified Cache line Clean of Data and Allocation Tags by Set/Way C5-460 + C5.3.2 DC CGDVAC, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoC C5-462 + C5.3.3 DC CGDVADP, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoDP C5-464 + C5.3.4 DC CGDVAP, Data, Allocation Tag or unified Cache line Clean of Data and Allocation Tags by VA to PoP C5-466 + C5.3.5 DC CGSW, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by Set/Way C5-468 + C5.3.6 DC CGVAC, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoC C5-470 + C5.3.7 DC CGVADP, Data, Allocation Tag or unified Cache line Clean of Data and Allocation Tags by VA to PoDP C5-472 + C5.3.8 DC CGVAP, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoP C5-474 + C5.3.9 DC CIGDSW, Data, Allocation Tag or unified Cache line Clean and Invalidate of Data and Allocation Tags by Set/Way C5-476 + C5.3.10 DC CIGDVAC, Data, Allocation Tag or unified Cache line Clean and Invalidate of Data and Allocation Tags by VA to PoC C5-478 + C5.3.11 DC CIGSW, Data, Allocation Tag or unified Cache line Clean and Invalidate of Allocation Tags by Set/Way C5-480 + C5.3.12 DC CIGVAC, Data, Allocation Tag or unified Cache line Clean and Invalidate of Allocation Tags by VA to PoC C5-482 + C5.3.13 DC CISW, Data or unified Cache line Clean and Invalidate by Set/Way C5-484 + C5.3.14 DC CIVAC, Data or unified Cache line Clean and Invalidate by VA to PoC C5-486 + C5.3.15 DC CSW, Data or unified Cache line Clean by Set/Way C5-488 + C5.3.16 DC CVAC, Data or unified Cache line Clean by VA to PoC C5-490 + C5.3.17 DC CVADP, Data or unified Cache line Clean by VA to PoDP C5-492 + C5.3.18 DC CVAP, Data or unified Cache line Clean by VA to PoP C5-494 + C5.3.19 DC CVAU, Data or unified Cache line Clean by VA to PoU C5-496 + C5.3.20 DC GVA, Data Cache set Allocation Tag by VA C5-498 + C5.3.21 DC GZVA, Data Cache set Allocation Tags and Zero by VA C5-500 + C5.3.22 DC IGDSW, Data, Allocation Tag or unified Cache line Invalidate of Data and Allocation Tags by Set/Way C5-502 + C5.3.23 DC IGDVAC, Data, Allocation Tag or unified Cache line Invalidate of Allocation Tags by VA to PoC C5-504 + C5.3.24 DC IGSW, Data, Allocation Tag or unified Cache line Invalidate of Allocation Tags by Set/Way C5-506 + C5.3.25 DC IGVAC, Data, Allocation Tag or unified Cache line Invalidate of Allocation Tags by VA to PoC C5-508 + C5.3.26 DC ISW, Data or unified Cache line Invalidate by Set/Way C5-510 + C5.3.27 DC IVAC, Data or unified Cache line Invalidate by VA to PoC C5-512 + C5.3.28 DC ZVA, Data Cache Zero by VA C5-514 + + C6.2.75 DC C6-883 + 1101010100 0 01 op1:3 [0111,CRn:4=7] CRm:4 op2:3 Rt:5 + + DC , equivalent to SYS #. C7, , #, = SysOp(op1,0111,CRm,op2) == Sys_DC + : + C5.3.27 IVAC when op1 = 000, CRm = 0110, op2 = 001 Invalidate data cache by address to Point of Coherency. + C5.3.26 ISW when op1 = 000, CRm = 0110, op2 = 010 Invalidate data cache by set/way. + C5.3.15 CSW when op1 = 000, CRm = 1010, op2 = 010 Clean data cache by set/way. + C5.3.13 CISW when op1 = 000, CRm = 1110, op2 = 010 Clean and Invalidate data cache by set/way. + C5.3.28 ZVA when op1 = 011, CRm = 0100, op2 = 001 Zero data cache by address. Zeroes a naturally aligned block + of N bytes, where the size of N is identified in DCZID_EL0. + C5.3.16 CVAC when op1 = 011, CRm = 1010, op2 = 001 Clean data cache by address to Point of Coherency. + C5.3.19 CVAU when op1 = 011, CRm = 1011, op2 = 001 Clean data cache by address to Point of Unification. + C5.3.14 CIVAC when op1 = 011, CRm = 1110, op2 = 001 Clean and Invalidate data cache by address to Point of Coherency."! Item was added: + ----- Method: CogARMv8Compiler>>concretizeDataSynchronizationBarrier (in category 'generate machine code - concretize processor-specific') ----- + concretizeDataSynchronizationBarrier + "C6.2.81 DSB C6-891" + + | CRm | + CRm := (operands at: 0) << 2 + (operands at: 1). + machineCode + at: 0 + put: 2r11010101000000110011000010011111 + + (CRm << 8). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeDivRRR (in category 'generate machine code - concretize processor-specific') ----- + concretizeDivRRR + "C6.2.234 SDIV C6-1174" + + "Rd := Rn / Rm" + "reg3 := reg1 / reg2" + | reg1 reg2 reg3 | + reg1 := operands at: 0. + reg2 := operands at: 1. + reg3 := operands at: 2. + machineCode + at: 0 + put: 2r10011010110 << 21 + + (reg2 << 16) + + (2r000011 << 10) + + (reg1 << 5) + + reg3. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeFill32 (in category 'generate machine code - concretize') ----- + concretizeFill32 + "fill with operand 0 according to the processor's endianness" + + machineCode at: 0 put: (operands at: 0). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeInstructionCacheControl (in category 'generate machine code - concretize processor-specific') ----- + concretizeInstructionCacheControl + "Issue an IC IVAU Invalidate instruction cache by address to Point of Unification. + C5.3.31 IC IVAU, Instruction Cache line Invalidate by VA to PoU C5-518" + "(operands at: 0) is the target register, accessed within concretizeCacheControlOp1:CRm:Op2:" + "Ho hum, table C5-1 page C5-367 states that IC_IALLU & IC_IALLUIS are available from EL1 or higher, + so they are off limits to us." + + ^true + ifTrue: [self concretizeCacheControlOp1: 2r011 CRm: 2r0101 Op2: 2r001 "IC_IVAU"] + ifFalse: + [(operands at: 1) caseOf: { + [IC_IALLU] -> [self concretizeCacheControlOp1: 2r000 CRm: 2r0101 Op2: 2r000]. + [IC_IALLUIS] -> [self concretizeCacheControlOp1: 2r000 CRm: 2r0001 Op2: 2r000]. + [IC_IVAU] -> [self concretizeCacheControlOp1: 2r011 CRm: 2r0101 Op2: 2r001] }] + + "Scripture: + C5.3.29 IC IALLU, Instruction Cache Invalidate All to PoU C5-516 + C5.3.30 IC IALLUIS, Instruction Cache Invalidate All to PoU, Inner Shareable C5-517 + C5.3.31 IC IVAU, Instruction Cache line Invalidate by VA to PoU C5-518 + + C6.2.94 IC C6-910 + 1101010100 0 01 op1:3 [0111,CRn:4=7] CRm:4 op2:3 Rt:5 + + IC , equivalent to SYS #. C7, , #{, } = SysOp(op1,0111,CRm,op2) == Sys_IC + + C5.3.30 IALLUIS when op1 = 000, CRm = 0001, op2 = 000 Invalidate all instruction caches in Inner Shareable domain to Point of Unification. + C5.3.29 IALLU when op1 = 000, CRm = 0101, op2 = 000 Invalidate all instruction caches to Point of Unification. + C5.3.31 IVAU when op1 = 011, CRm = 0101, op2 = 001 Invalidate instruction cache by address to Point of Unification."! Item was added: + ----- Method: CogARMv8Compiler>>concretizeInstructionSynchronizationBarrier (in category 'generate machine code - concretize processor-specific') ----- + concretizeInstructionSynchronizationBarrier + "C6.2.96 ISB C6-912" + + | CRm | + CRm := 2r1111. + machineCode + at: 0 + put: 2r11010101000000110011000011011111 + + (CRm << 8). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeJumpLong (in category 'generate machine code - concretize') ----- + concretizeJumpLong + "C6.2.26 B C6-799" + + | offset | + offset := (operands at: 0) - address. + self assert: (offset noMask: 3). + self assert: (offset >>> 2 between: -1 << 26 and: 1 << 26 - 1). + machineCode + at: 0 + put: 2r101 << 26 + (offset >>> 2 bitAnd: 1 << 26 - 1). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeJumpR (in category 'generate machine code - concretize') ----- + concretizeJumpR + "C6.2.36 BR C6-816" + + machineCode + at: 0 + put: 2r1101011 << 25 + + (XZR << 16) + + ((operands at: 0) << 5). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLDAXR (in category 'generate machine code - concretize') ----- + concretizeLDAXR + "C6.2.113 LDAXR C6-944" + + | targetReg addressReg | + targetReg := operands at: 0. + addressReg := operands at: 1. + machineCode + at: 0 + put: 2r1100100001011111111111 << 10 + + (addressReg << 5) + + targetReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLiteral (in category 'generate machine code - concretize') ----- + concretizeLiteral + "Generate an out-of-line literal. Copy the value and any annotation from the stand-in in the literals manager." + | literalAsInstruction literal | + + literalAsInstruction := cogit cCoerceSimple: (operands at: 0) to: #'AbstractInstruction *'. + literal := (self isAnInstruction: literalAsInstruction) + ifTrue: [literalAsInstruction address] + ifFalse: [self cCode: [literalAsInstruction asUnsignedInteger] + inSmalltalk: [literalAsInstruction]]. + self assert: (dependent notNil and: [dependent opcode = Literal]). + dependent annotation ifNotNil: + [self assert: annotation isNil. + annotation := dependent annotation]. + dependent address ifNotNil: [self assert: dependent address = address]. + dependent address: address. + machineCode at: 0 put: (literal bitAnd: 16rFFFFFFFF). + self literalSize = 4 ifTrue: + [^4]. + machineCode at: 1 put: (literal >> 32). + ^8! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLoadEffectiveAddressMwrR (in category 'generate machine code - concretize') ----- + concretizeLoadEffectiveAddressMwrR + | baseReg offset destReg instrBytes | + + offset := operands at: 0. + baseReg := operands at: 1. + destReg := operands at: 2. + self isPossiblyShiftableImm12: offset + ifTrue: + [:shift| + "C6.2.4 ADD (immediate) C6-761" + machineCode + at: 0 + put: 2r100100010 << 23 + + (shift ifTrue: [offset >> 2] ifFalse: [offset << 10]) + + (baseReg << 5) + + destReg. + ^4] + ifFalse: []. + self isPossiblyShiftableImm12: offset negated + ifTrue: + [:shift| + "C6.2.308 SUB (immediate) C6-1311" + machineCode + at: 0 + put: 2r100100010 << 23 + + (shift ifTrue: [offset negated >> 2] ifFalse: [offset negated << 10]) + + (baseReg << 5) + + destReg. + ^4] + ifFalse: []. + instrBytes := self emitMoveCw: offset intoR: RISCTempReg at: 0. + "C6.2.3 ADD (extended register) C6-758" + machineCode + at: instrBytes // 4 + put: 2r10001011001 << 21 + + (destReg << 16) + + (UXTX << 13) + + (RISCTempReg << 5) + + destReg. + ^instrBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLogicalOp:CqRDest: (in category 'generate machine code - concretize') ----- + concretizeLogicalOp: op CqRDest: destReg + "AND (immediate) - 64-bit variant on page C6-775 + ORR (immediate) - 64-bit variant on page C6-1125 + EOR (immediate) - 64-bit variant on page C6-896 + ANDS (immediate) - 64-bit variant on page C6-779 + C6.2.329 TST (immediate) C6-1346" + + | srcReg constant | + constant := operands at: 0. + srcReg := operands at: 1. + ^self isImmNImmSImmREncodableBitmask: constant + ifTrue: + [:n :imms :immr| + machineCode + at: 0 + put: 2r1001001 << 25 + + (op << 29) + + (n << 22) + + (immr << 16) + + (imms << 10) + + (srcReg << 5) + + destReg. + 4] + ifFalse: + [| offset | + offset := self emitMoveCw: constant intoR: RISCTempReg at: 0. + "OPC N + 00 0 AND (shifted register) - 64-bit variant on page C6-777 + 00 1 BIC (shifted register) - 64-bit variant on page C6-808 + 01 0 ORR (shifted register) - 64-bit variant on page C6-1127 + 01 1 ORN (shifted register) - 64-bit variant on page C6-1123 + 10 0 EOR (shifted register) - 64-bit variant on page C6-898 + 10 1 EON (shifted register) - 64-bit variant on page C6-894 + 11 0 ANDS (shifted register) - 64-bit variant on page C6-781 + 11 0 BICS (shifted register) - 64-bit variant on page C6-810" + machineCode + at: offset // 4 + put: 2r1000101 << 25 + + (op << 29) + + (RISCTempReg << 16) + + (srcReg << 5) + + destReg. + offset + 4] + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + "cogit processor disassembleInstructionAt: 4 In: machineCode object" + "cogit processor disassembleInstructionAt: 8 In: machineCode object"! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLogicalShiftLeftCqR (in category 'generate machine code - concretize') ----- + concretizeLogicalShiftLeftCqR + + "C6.2.17 ASR (immediate) C6-785 100100110 (1) + C6.2.177 LSL (immediate) C6-1075 110100110 (1) + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + | reg constant | + constant := operands at: 0. + reg := operands at: 1. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1101001101 << 22 + + (64 - constant << 16) + + (63 - constant << 10) + + (reg << 5) + + reg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLogicalShiftLeftCqRR (in category 'generate machine code - concretize') ----- + concretizeLogicalShiftLeftCqRR + + "C6.2.17 ASR (immediate) C6-785 100100110 (1) + C6.2.177 LSL (immediate) C6-1075 110100110 (1) + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + | constant srcReg destReg | + constant := operands at: 0. + srcReg := operands at: 1. + destReg := operands at: 2. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1101001101 << 22 + + (64 - constant << 16) + + (63 - constant << 10) + + (srcReg << 5) + + destReg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLogicalShiftRightCqR (in category 'generate machine code - concretize') ----- + concretizeLogicalShiftRightCqR + + "C6.2.17 ASR (immediate) C6-785 100100110 (1) + C6.2.177 LSL (immediate) C6-1075 110100110 (1) + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + | reg constant | + constant := operands at: 0. + reg := operands at: 1. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1101001101 << 22 + + (constant << 16) + + (63 << 10) + + (reg << 5) + + reg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeLogicalShiftRightCqRR (in category 'generate machine code - concretize') ----- + concretizeLogicalShiftRightCqRR + + "C6.2.17 ASR (immediate) C6-785 100100110 (1) + C6.2.177 LSL (immediate) C6-1075 110100110 (1) + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + | constant srcReg destReg | + constant := operands at: 0. + srcReg := operands at: 1. + destReg := operands at: 2. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1101001101 << 22 + + (constant << 16) + + (63 << 10) + + (srcReg << 5) + + destReg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMRSOp1:CRn:CRm:Op2: (in category 'generate machine code - concretize processor-specific') ----- + concretizeMRSOp1: op1 CRn: crn CRm: crm Op2: op2 + "C6.2.192 MRS C6-1104 + Move System Register allows the PE to read an AArch64 System register into a general-purpose register." + + machineCode + at: 0 + put: 2r1101010100111 << 19 + + (op1 << 16) + + (crn << 12) + + (crm << 8) + + (op2 << 5) + + (operands at: 0). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMRS_CTR_EL0 (in category 'generate machine code - concretize processor-specific') ----- + concretizeMRS_CTR_EL0 + "C6.2.192 MRS C6-1104 + Move System Register allows the PE to read an AArch64 System register into a general-purpose register. + D12.3 op0==0b11, Moves to and from non-debug System registers, Special-purpose registers D12-2808 + Register Accessed op0 op1 CRn CRm op2 + ... + CTR_EL0 3 3 0 0 1" + + ^self concretizeMRSOp1: 3 CRn: 0 CRm: 0 Op2: 1! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMRS_ID_AA64ISAR0_EL1 (in category 'generate machine code - concretize processor-specific') ----- + concretizeMRS_ID_AA64ISAR0_EL1 + "C6.2.192 MRS C6-1104 + Move System Register allows the PE to read an AArch64 System register into a general-purpose register. + D12.3 op0==0b11, Moves to and from non-debug System registers, Special-purpose registers D12-2808 + Register Accessed op0 op1 CRn CRm op2 + ... + CTR_EL0 3 3 0 0 1 + ID_AA64ISAR0_EL1 3 0 0 5 1" + + ^self concretizeMRSOp1: 0 CRn: 0 CRm: 6 Op2: 0! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMSubRRR (in category 'generate machine code - concretize processor-specific') ----- + concretizeMSubRRR + "C6.2.195 MSUB C6-1109 + Xd := Xa - (Xn * Xm)" + + "rD := rA - (rN * rM)" + | rN rA rM rD | + rM := (operands at: 0) >> 5. + rN := (operands at: 0) bitAnd: 31. + rA := operands at: 1. + rD := operands at: 2. + machineCode + at: 0 + put: 2r10011011 << 24 + + (rM << 16) "Xm" + + (1 << 15) + + (rA << 10) "Xa" + + (rN << 5) "Xn" + + rD. "Xd" + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMathRdRd: (in category 'generate machine code - concretize') ----- + concretizeMathRdRd: floatArithOp + "C7.2.43 FADD (scalar) C7-1426" + "C7.2.91 FDIV (scalar) C7-1582" + "C7.2.129 FMUL (scalar) C7-1664" + "C7.2.167 FSUB (scalar) C7-1747" + + | srcReg destReg | + srcReg := operands at: 0. + destReg := operands at: 1. + machineCode + at: 0 + put: 2r11110011 << 21 + + (srcReg << 16) + + (floatArithOp << 10) + + (destReg << 5) + + destReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveAbR (in category 'generate machine code - concretize') ----- + concretizeMoveAbR + "Will get inlined into concretizeAt: switch." + + | srcAddr destReg instrOffset | + srcAddr := operands at: 0. + destReg := operands at: 1. + self deny: SP = destReg. + "ldr srcReg, [VarBaseReg, #offset] except that this is illegal for SP/X31" + (self isAddressRelativeToVarBase: srcAddr) ifTrue: + [srcAddr < cogit varBaseAddress ifTrue: + [self shouldBeImplemented. + ^4]. + ^self emitLd: 0 rn: VarBaseReg rt: destReg imm: srcAddr - cogit varBaseAddress shiftBy12: false at: 0]. + instrOffset := self emitMoveCw: srcAddr intoR: RISCTempReg at: 0. + ^self emitLd: 0 rn: RISCTempReg rt: destReg imm: 0 shiftBy12: false at: instrOffset! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveAwR (in category 'generate machine code - concretize') ----- + concretizeMoveAwR + "Will get inlined into concretizeAt: switch." + + | srcAddr destReg instrOffset | + srcAddr := operands at: 0. + destReg := operands at: 1. + "ldr srcReg, [VarBaseReg, #offset] except that this is illegal for SP/X31" + (self isAddressRelativeToVarBase: srcAddr) ifTrue: + [srcAddr < cogit varBaseAddress ifTrue: + [self shouldBeImplemented. + ^4]. + destReg ~= SP ifTrue: + [^self emitLd: 3 rn: VarBaseReg rt: destReg imm: srcAddr - cogit varBaseAddress shiftBy12: false at: 0]. + instrOffset := self emitLd: 3 rn: VarBaseReg rt: RISCTempReg imm: srcAddr - cogit varBaseAddress shiftBy12: false at: 0. + machineCode + at: instrOffset / 4 + put: (self movern: RISCTempReg rd: destReg). + ^instrOffset + 4]. + instrOffset := self emitMoveCw: srcAddr intoR: RISCTempReg at: 0. + SP ~= destReg ifTrue: + [^self emitLd: 3 rn: RISCTempReg rt: destReg imm: 0 shiftBy12: false at: instrOffset]. + instrOffset := self emitLd: 3 rn: RISCTempReg rt: RISCTempReg imm: 0 shiftBy12: false at: instrOffset. + machineCode + at: instrOffset // 4 + put: (self movern: RISCTempReg rd: destReg). + ^instrOffset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveAwRR (in category 'generate machine code - concretize processor-specific') ----- + concretizeMoveAwRR + "C6.2.128 LDP C6-970" + | pairAddress reg1 reg2 | + + pairAddress := operands at: 0. + reg1 := operands at: 1. + reg2 := operands at: 2. + self assert: reg1 ~= reg2. + self assert: (reg1 ~= RISCTempReg and: [reg2 ~= RISCTempReg]). + self assert: (self isAddressRelativeToVarBase: pairAddress). + self assert: pairAddress - cogit varBaseAddress / 8 < (1 << 6). + reg1 = SP ifTrue: [reg1 := RISCTempReg]. + reg2 = SP ifTrue: [reg2 := RISCTempReg]. + machineCode + at: 0 + put: 2r1010100101 << 22 + + (pairAddress - cogit varBaseAddress / 8 << 15) + + (reg2 << 10) + + (VarBaseReg << 5) + + reg1. + (reg1 ~= RISCTempReg and: [reg2 ~= RISCTempReg]) ifTrue: + [^4]. + machineCode + at: 1 + put: (self movern: RISCTempReg rd: SP). + ^8 + + "cogit processor + disassembleInstructionAt: 0 In: machineCode object; + disassembleInstructionAt: 4 In: machineCode object"! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveC32R (in category 'generate machine code - concretize') ----- + concretizeMoveC32R + + | constant rn | + constant := operands at: 0. + rn := operands at: 1. + + self assert: (cogit addressIsInCurrentCompilation: dependent address). + self assert: dependent address \\ 4 = 0. + self assert: (dependent address - address) < (1 << 20). + "C6.2.131 LDR (literal) C6-979 + C6.2.143 LDRSW (literal) C6-1008" + machineCode + at: 0 + put: 2r10011 << 27 + + ((dependent address - address bitAnd: 1 << 21 - 1) << 3 "5 - 2") + + rn. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveCqR (in category 'generate machine code - concretize') ----- + concretizeMoveCqR + "C3.3.4 Move (immediate) C3-215 + + The Move (immediate) instructions are aliases for a single MOVZ, MOVN, or ORR (immediate with zero register), + instruction to load an immediate value into the destination register. An assembler must permit a signed or + unsigned immediate, as long as its binary representation can be generated using one of these instructions, + and an assembler error results if the immediate cannot be generated in this way. On disassembly, it is + unspecified whether the immediate is output as a signed or an unsigned value. + + C6.2.191 MOVZ C6-1102 Move wide with zero moves an optionally-shifted 16-bit immediate value to a register. + C6.2.190 MOVN C6-1100 Move wide with NOT moves the inverse of an optionally-shifted 16-bit immediate value to a register. + C6.2.204 ORR (immediate) C6-1125 + Bitwise OR (immediate) performs a bitwise (inclusive) OR of a register value and an immediate + register value, and writes the result to the destination register." + + | constant destReg | + constant := operands at: 0. + destReg := operands at: 1. + destReg ~= SP ifTrue: + [| lowBit lowBitMod16 mask | + lowBit := constant > 0 + ifTrue: [self cCode: [self computeLowBit: constant] inSmalltalk: [constant lowBit - 1]] + ifFalse: [0]. + lowBitMod16 := lowBit // 16 * 16. + mask := 1 << 16 - 1 << lowBitMod16. + (constant bitAnd: mask) = constant ifTrue: + ["Use MOVZ" + machineCode + at: 0 + put: 2r110100101 << 23 + + (lowBitMod16 // 16 << 21) + + (constant >> lowBitMod16 << 5) + + destReg. + ^4]. + lowBit := constant signedIntFromLong64 < -1 + ifTrue: [self cCode: [self computeLowBit: constant bitInvert64] inSmalltalk: [constant bitInvert64 lowBit - 1]] + ifFalse: [0]. + (constant bitOr: mask) signedIntFromLong64 = -1 ifTrue: + ["Use MOVN" + self assert: (constant bitInvert64 >> lowBitMod16) = ((constant bitInvert64 >> lowBitMod16) bitAnd: mask). + machineCode + at: 0 + put: 2r100100101 << 23 + + (lowBitMod16 // 16 << 21) + + (constant bitInvert64 >> lowBitMod16 << 5) + + destReg. + ^4]]. + ^self isImmNImmSImmREncodableBitmask: constant + ifTrue: + [:n :imms :immr| "Use ORR" + machineCode + at: 0 + put: 2r1011001001 << 22 + + (immr << 16) + + (imms << 10) + + (XZR << 5) + + destReg. + 4] + ifFalse: [self emitMoveCw: constant intoR: destReg at: 0]! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveCwR (in category 'generate machine code - concretize') ----- + concretizeMoveCwR + + ^self emitMoveCw: (operands at: 0) intoR: (operands at: 1) at: 0! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveM64rRd (in category 'generate machine code - concretize') ----- + concretizeMoveM64rRd + "Load/Store Vector on page C3-206. + C7.2.184 LDR (immediate, SIMD&FP) C7-1800" + + | rd offset baseReg | + offset := operands at: 0. + baseReg := operands at: 1. + rd := operands at: 2. + self assert: (offset noMask: 7). + machineCode + at: 0 + put: 2r1111110101 << 22 + + (offset << 7 "10 - 3") + + (baseReg << 5) + + rd. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveMSrR: (in category 'generate machine code - concretize') ----- + concretizeMoveMSrR: unitSizeLog2MinusOne + "Mwr/M32r/M16r/Mbr - memory unit whose address is a constant M away from an address in a register" + ^self emitLd: unitSizeLog2MinusOne + rn: (operands at: 1) + rt: (operands at: 2) signedIntFromLong64 + imm: (operands at: 0) + shiftBy12: false + at: 0 + "cogit processor disassembleInstructionAt: 0 In: machineCode object"! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRAb (in category 'generate machine code - concretize') ----- + concretizeMoveRAb + "Will get inlined into concretizeAt: switch." + + | srcReg destAddr instrOffset | + srcReg := operands at: 0. + destAddr := operands at: 1. + self deny: SP = srcReg. + (self isAddressRelativeToVarBase: destAddr) ifTrue: + [destAddr < cogit varBaseAddress ifTrue: + [self shouldBeImplemented. + ^4]. + machineCode + at: 0 + put: (self st: 0 rn: VarBaseReg rt: srcReg imm: destAddr - cogit varBaseAddress shiftBy12: false). + ^4]. + instrOffset := self emitMoveCw: destAddr intoR: RISCTempReg at: 0. + machineCode + at: instrOffset // 4 + put: (self st: 0 rn: RISCTempReg rt: srcReg imm: 0 shiftBy12: false). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^instrOffset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRAw (in category 'generate machine code - concretize') ----- + concretizeMoveRAw + "Will get inlined into concretizeAt: switch." + + | srcReg destAddr instrOffset | + srcReg := operands at: 0. + destAddr := operands at: 1. + "str srcReg, [VarBaseReg, #offset] except that this is illegal for srcReg = SP/X31" + (self isAddressRelativeToVarBase: destAddr) ifTrue: + [destAddr < cogit varBaseAddress ifTrue: + [self shouldBeImplemented. + ^4]. + srcReg ~= SP ifTrue: + [machineCode + at: 0 + put: (self st: 3 rn: VarBaseReg rt: srcReg imm: destAddr - cogit varBaseAddress shiftBy12: false). + ^4]. + machineCode + at: 0 + put: (self movern: srcReg rd: RISCTempReg); + at: 1 + put: (self st: 3 rn: VarBaseReg rt: RISCTempReg imm: destAddr - cogit varBaseAddress shiftBy12: false). + ^8]. + instrOffset := self emitMoveCw: destAddr intoR: RISCTempReg at: 0. + SP ~= srcReg ifTrue: + [machineCode + at: instrOffset // 4 + put: (self st: 3 rn: RISCTempReg rt: srcReg imm: 0 shiftBy12: false). + ^instrOffset + 4]. + machineCode + at: instrOffset // 4 + put: (self movern: srcReg rd: CArg1Reg); + at: instrOffset // 4 + put: (self st: 3 rn: RISCTempReg rt: CArg1Reg imm: 0 shiftBy12: false). + ^instrOffset + 8 + ! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRMSr: (in category 'generate machine code - concretize') ----- + concretizeMoveRMSr: unitSizeLog2MinusOne + "Mwr/M32r/M16r/Mbr - memory unit whose address is a constant M away from an address in a register" + machineCode + at: 0 + put: (self st: unitSizeLog2MinusOne + rn: (operands at: 2) + rt: (operands at: 0) + imm: (operands at: 1) signedIntFromLong64 + shiftBy12: false). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRR (in category 'generate machine code - concretize') ----- + concretizeMoveRR + "Will get inlined into concretizeAt: switch." + + | srcReg destReg | + srcReg := operands at: 0. + destReg := operands at: 1. + "C6.2.184 MOV (to/from SP) p1089 + C6.2.188 MOV (register) p1096" + machineCode + at: 0 + put: ((srcReg = SP or: [destReg = SP]) + ifTrue: [2r10010001 << 24 + + (srcReg << 5) + + destReg] + ifFalse: [2r10101010 << 24 + + (srcReg << 16) + + (XZR << 5) + + destReg]). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRRAw (in category 'generate machine code - concretize processor-specific') ----- + concretizeMoveRRAw + "C6.2.272 STP C6-1236" + + | pairAddress reg1 reg2 offset | + reg1 := operands at: 0. + reg2 := operands at: 1. + pairAddress := operands at: 2. + self assert: reg1 ~= reg2. + self assert: (reg1 ~= RISCTempReg and: [reg2 ~= RISCTempReg]). + self assert: (self isAddressRelativeToVarBase: pairAddress). + self assert: pairAddress - cogit varBaseAddress / 8 < (1 << 6). + reg1 = SP ifTrue: [reg1 := RISCTempReg]. + reg2 = SP ifTrue: [reg2 := RISCTempReg]. + (reg1 = RISCTempReg or: [reg2 = RISCTempReg]) + ifTrue: + [machineCode + at: 0 + put: (self movern: SP rd: RISCTempReg). + offset := 1] + ifFalse: + [offset := 0]. + machineCode + at: offset + put: 2r1010100100 << 22 + + (pairAddress - cogit varBaseAddress / 8 << 15) + + (reg2 << 10) + + (VarBaseReg << 5) + + reg1. + "cogit processor + disassembleInstructionAt: 0 In: machineCode object; + disassembleInstructionAt: 4 In: machineCode object" + ^offset + 1 * 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRRd (in category 'generate machine code - concretize') ----- + concretizeMoveRRd + + "C7.2.124 FMOV (general) C7-1651" + machineCode + at: 0 + put: 2r1001111001100111 << 16 + + ((operands at: 0) << 5) + + (operands at: 1). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRXSrR: (in category 'generate machine code - concretize') ----- + concretizeMoveRXSrR: unitSizeLog2MinusOne + "Xwr/X32r/X16r/Xbr - memory unit whose address is r * unit size away from an address in a register" + "C6.2.274 STR (register) C6-1242" + | src index base | + src := operands at: 0. + index := operands at: 1. + base := operands at: 2. + self deny: (SP = src or: [SP = index]). + machineCode + at: 0 + put: unitSizeLog2MinusOne << 30 + + (2r111000001 << 21) + + (index << 16) + + (UXTX << 13) + + (3 << 11) + + (base << 5) + + src. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRXbrR (in category 'generate machine code - concretize') ----- + concretizeMoveRXbrR + + "Xbr - byte in mwemory whose address is r away from an address in a register" + "C6.2.274 STR (register) C6-1242" + | src index base | + src := operands at: 0. + index := operands at: 1. + base := operands at: 2. + self deny: (SP = src or: [SP = index]). + machineCode + at: 0 + put: 2r00111000001 << 21 + + (index << 16) + + (UXTX << 13) + + (3 << 11) + + (base << 5) + + src. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRdM64r (in category 'generate machine code - concretize') ----- + concretizeMoveRdM64r + "Load/Store Vector on page C3-206. + C7.2.323 STR (immediate, SIMD&FP) C7-2114" + + | rd offset baseReg | + rd := operands at: 0. + offset := operands at: 1. + baseReg := operands at: 2. + self assert: (offset noMask: 7). + machineCode + at: 0 + put: 2r11111101 << 24 + + (offset << 7 "10 - 3") + + (baseReg << 5) + + rd. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveRdR (in category 'generate machine code - concretize') ----- + concretizeMoveRdR + + "C7.2.124 FMOV (general) C7-1651" + machineCode + at: 0 + put: 2r1001111001100110 << 16 + + ((operands at: 0) << 5) + + (operands at: 1). + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMoveXSrRR: (in category 'generate machine code - concretize') ----- + concretizeMoveXSrRR: unitSizeLog2MinusOne + "Xwr/X32r/X16r/Xbr - memory unit whose address is r * unit size away from an address in a register" + "C6.2.132 LDR (register) C6-981" + | index base dest | + index := operands at: 0. + base := operands at: 1. + dest := operands at: 2. + self deny: SP = dest. + machineCode + at: 0 + put: unitSizeLog2MinusOne << 30 + + (2r111000011 << 21) + + (index << 16) + + (UXTX << 13) + + (3 << 11) + + (base << 5) + + dest. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMulOverflowJump (in category 'generate machine code - concretize processor-specific') ----- + concretizeMulOverflowJump + "Will get inlined into concretizeAt: switch." + "Sizing/generating jumps. + Jump targets can be to absolute addresses or other abstract instructions. + Generating initial trampolines instructions may have no maxSize and be to absolute addresses. + Otherwise instructions must have a machineCodeSize which must be kept to." + + | offset | + offset := self computeJumpTargetOffset - 4. "-4 because the jump is from the second word..." + self assert: (offset ~= 0 and: [self isInImmediateBranchRange: offset]). + "See concretizeMulOverflowRRR + RISCTempReg := RISCTempReg + CArg1Reg/sign. + JumpZero/NonZero" + machineCode + at: 0 + put: 2r10001011 << 24 + + (ArithmeticAddS << 29) + + (CArg1Reg << 16) + + (RISCTempReg << 5) + + RISCTempReg; + at: 1 + put: (self + cond: (opcode = JumpMulOverflow ifTrue: [NE] ifFalse: [EQ]) + offset: offset). "B offset" + ^8! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMulOverflowRRR (in category 'generate machine code - concretize processor-specific') ----- + concretizeMulOverflowRRR + "ARMv8 has no multiply overflow detection. Instead it is synthesized from the two halves of + a 64x64=>128 bit multiply. The upper 64-bits are tested. The sequence is + low64 := MUL a,b + high64 := SMULH a,b + signBit := low64 >> 63 + high64 := high64 + signBit + If high64 is zero after this sequence then the multiply has not overflowed, since + high64 is an extension of signBit if no overflow (either 0 or -1) and -1 + 1 = 0. + However, since we restrict ourselves to three concrete ARMv8 instructions per abstract instruction + we move the last operation of the sequence to concretizeMulOverflowJump + + C6.2.196 MUL C6-1111 + C6.2.242 SMULH C6-1184 + C6.2.180 LSR (immediate) C6-1081 110100110 (1)" + + + | reg1 reg2 reg3 | + reg1 := operands at: 0. + reg2 := operands at: 1. + reg3 := operands at: 2. + "reg3 := reg1 * reg2" + machineCode + at: 0 + put: 2r10011011 << 24 + + (reg1 << 16) + + (XZR << 10) + + (reg2 << 5) + + reg3. + "RISCTempReg := high(reg1 * reg2)" + machineCode + at: 1 + put: 2r1001101101 << 22 + + (reg1 << 16) + + (XZR << 10) + + (reg2 << 5) + + RISCTempReg. + "CArg1Reg := sign(reg3)" + machineCode + at: 2 + put: 2r1101001101 << 22 + + (63 << 16) "constant to shift by" + + (63 << 10) + + (reg3 << 5) + + CArg1Reg. "cuz CArg0Reg == TempReg" + "RISCTempReg := RISCTempReg + CArg1Reg/sign + is in concretizeMulOverflowJump" + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + "cogit processor disassembleInstructionAt: 4 In: machineCode object" + "cogit processor disassembleInstructionAt: 8 In: machineCode object" + ^12! Item was added: + ----- Method: CogARMv8Compiler>>concretizeMulRRR (in category 'generate machine code - concretize') ----- + concretizeMulRRR + "C6.2.196 MUL C6-1111" + + "reg3 := reg1 * reg2" + | reg1 reg2 reg3 | + reg1 := operands at: 0. + reg2 := operands at: 1. + reg3 := operands at: 2. + machineCode + at: 0 + put: 2r10011011 << 24 + + (reg1 << 16) + + (XZR << 10) + + (reg2 << 5) + + reg3. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeNativePopRR (in category 'generate machine code - concretize processor-specific') ----- + concretizeNativePopRR + "C6.2.128 LDP C6-970" + + | reg1 reg2 | + reg1 := operands at: 0. + reg2 := operands at: 1. + "Post-index" + machineCode + at: 0 + put: 2r10101000110000010 << 15 + + (reg2 << 10) + + (SP << 5) + + reg1. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeNativePushRR (in category 'generate machine code - concretize processor-specific') ----- + concretizeNativePushRR + "C6.2.272 STP C6-1236" + + | reg1 reg2 | + reg1 := operands at: 0. + reg2 := operands at: 1. + "Pre-index" + machineCode + at: 0 + put: 2r10101001101111110 << 15 + + (reg2 << 10) + + (SP << 5) + + reg1. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeNativeRetN (in category 'generate machine code - concretize processor-specific') ----- + concretizeNativeRetN + "Will get inlined into concretizeAt: switch." + + + | offset | + offset := operands at: 0. + "C6.2.218 RET p1147" + offset = 0 ifTrue: + [machineCode + at: 0 + put: 2r1101011001 << 22 + + (XZR << 16) + + (LR << 5). + ^4]. + + "C6.2.4 ADD (immediate) p761" + machineCode + at: 0 put: (self addrn: NativeSPReg rd: NativeSPReg imm: offset shiftBy12: false); + at: 1 put: 2r1101011001 << 22 + + (XZR << 16) + + (LR << 5). + ^8! Item was added: + ----- Method: CogARMv8Compiler>>concretizeNegateR (in category 'generate machine code - concretize') ----- + concretizeNegateR + + "C6.2.309 SUB (shifted register) 1313 + C6.2.313 SUBS (extended register) C6-1318" + | reg | + reg := operands at: 0. + self deny: SP = reg. + machineCode + at: 0 + put: 2r11001011 << 24 + + (reg << 16) + + (XZR << 5) + + reg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeNop (in category 'generate machine code - concretize') ----- + concretizeNop + + machineCode at: 0 put: NOP. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizePopR (in category 'generate machine code - concretize') ----- + concretizePopR + + "C6.2.130 LDR (immediate) C6-976 + Post-index" + | reg | + reg := operands at: 0. + self deny: SP = reg. + machineCode + at: 0 + put: 2r1111100001 << 22 + + (8 << 12) + + (2r01 << 10) + + (SPReg << 5) + + reg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizePrefetchAw (in category 'generate machine code - concretize') ----- + concretizePrefetchAw + "Will get inlined into concretizeAt: switch." + + | srcAddr | + srcAddr := operands at: 0. + (self isAddressRelativeToVarBase: srcAddr) ifTrue: + [srcAddr < cogit varBaseAddress ifTrue: + [self shouldBeImplemented. + ^4]. + machineCode + at: 0 + put: (self prn: VarBaseReg imm: srcAddr - cogit varBaseAddress shiftBy12: false). + ^4]. + self halt. + ^0! Item was added: + ----- Method: CogARMv8Compiler>>concretizePushCq (in category 'generate machine code - concretize') ----- + concretizePushCq + "ARMv8 has no push costant insructions (no store immediate pre-index). + Instead load the constant into RISCTempReg and push that." + + | instrBytes | + operands at: 1 put: RISCTempReg. + instrBytes := self concretizeMoveCqR. + "C6.2.273 STR (immediate) Pre-index C6-1239" + machineCode + at: instrBytes // 4 + put: 2r11111 << 27 + + ((-8 bitAnd: 1 << 9 - 1) << 12) + + (2r11 << 10) + + (SPReg << 5) + + RISCTempReg. + ^instrBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizePushCw (in category 'generate machine code - concretize') ----- + concretizePushCw + + | instrBytes | + instrBytes := self emitMoveCw: (operands at: 0) intoR: RISCTempReg at: 0. + "C6.2.273 STR (immediate) Pre-index C6-1239" + machineCode + at: instrBytes // 4 + put: 2r11111 << 27 + + ((-8 bitAnd: 1 << 9 - 1) << 12) + + (2r11 << 10) + + (SPReg << 5) + + RISCTempReg. + ^instrBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizePushR (in category 'generate machine code - concretize') ----- + concretizePushR + + "C6.2.273 STR (immediate) C6-1239 + Pre-index" + | reg | + reg := operands at: 0. + self deny: SP = reg. + machineCode + at: 0 + put: 2r11111 << 27 + + ((-8 bitAnd: 1 << 9 - 1) << 12) + + (2r11 << 10) + + (SPReg << 5) + + reg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeRRArithmetic:Rd: (in category 'generate machine code - concretize') ----- + concretizeRRArithmetic: arithOp Rd: rd + "rd := regA op regB " + | regA regB | + regB := operands at: 0. + regA := operands at: 1. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + "cogit processor disassembleInstructionAt: 4 In: machineCode object" + SP = regB ifTrue: "Arithmetic with the sp; we must use the extended register forms, and negate + on subtract because we can't have Rm as SP, Rm = 31 is interoreted as XZR." + ["ADD (extended register) on page C6-758 + ADDS (extended register) on page C6-766 + SUB (extended register) on page C6-1308 + SUBS (extended register) on page C6-1318" + machineCode + at: 0 + put: 2r10001011001 << 21 + + (arithOp << 29) + + (regA << 16) + + (UXTX << 13) + + (regB << 5) + + rd. + (arithOp = ArithmeticSub or: [arithOp = ArithmeticSubS]) ifFalse: + [^4]. + machineCode + at: 1 + put: 2r10001011 << 24 + + (arithOp << 29) + + (rd << 16) + + (XZR << 5) + + rd. + ^8]. + SP = regA ifTrue: "Arithmetic with the sp; we must use the extended register forms." + ["ADD (extended register) on page C6-758 + ADDS (extended register) on page C6-766 + SUB (extended register) on page C6-1308 + SUBS (extended register) on page C6-1318 + CMN (extended register) on page C6-850 + CMP (extended register) on page C6-856" + machineCode + at: 0 + put: 2r10001011001 << 21 + + (arithOp << 29) + + (regB << 16) + + (UXTX << 13) + + (regA << 5) + + rd. + rd ~= XZR ifTrue: [self halt]. + ^4]. + self assert: (regA ~= SP and: [regB ~= SP]). + "ADD (shifted register) on page C6-763 + ADDS (shifted register) on page C6-771 + CMN (shifted register) on page C6-854 + CMP (shifted register) on page C6-860 + SUB (shifted register) on page C6-1313 + SUBS (shifted register) on page C6-1323" + machineCode + at: 0 + put: 2r10001011 << 24 + + (arithOp << 29) + + (regB << 16) + + (regA << 5) + + rd. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeRRLogical: (in category 'generate machine code - concretize') ----- + concretizeRRLogical: logicalOp + "AND (shifted register) - 64-bit variant on page C6-777 + BIC (shifted register) - 64-bit variant on page C6-808 + ORR (shifted register) - 64-bit variant on page C6-1127 + ORN (shifted register) - 64-bit variant on page C6-1123 + EOR (shifted register) - 64-bit variant on page C6-898 + EON (shifted register) - 64-bit variant on page C6-894 + ANDS (shifted register) - 64-bit variant on page C6-781 + BICS (shifted register) - 64-bit variant on page C6-810" + | destReg srcReg | + srcReg := operands at: 0. + destReg := operands at: 1. + machineCode + at: 0 + put: 2r1000101 << 25 + + (logicalOp << 29) + + (srcReg << 16) + + (destReg << 5) + + destReg. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeRetN (in category 'generate machine code - concretize') ----- + concretizeRetN + "Will get inlined into concretizeAt: switch." + + + | offset | + offset := operands at: 0. + "C6.2.218 RET p1147" + offset = 0 ifTrue: + [machineCode + at: 0 + put: 2r1101011001 << 22 + + (XZR << 16) + + (LR << 5). + ^4]. + + "C6.2.4 ADD (immediate) p761" + machineCode + at: 0 put: (self addrn: SPReg rd: SPReg imm: offset shiftBy12: false); + at: 1 put: 2r1101011001 << 22 + + (XZR << 16) + + (LR << 5). + ^8! Item was added: + ----- Method: CogARMv8Compiler>>concretizeRotateCqR (in category 'generate machine code - concretize') ----- + concretizeRotateCqR + "C6.2.225 ROR (immediate) C6-1157" + + | constant reg | + constant := operands at: 0. + reg := operands at: 1. + self assert: (constant between: 1 and: 63). + machineCode + at: 0 + put: 2r1001001111 << 22 + + (reg << 16) + + ((RotateRightCqR = opcode ifTrue: [constant] ifFalse: [64 - constant]) << 10) + "+ (1 << 10)" + + (reg << 5) + + reg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeSTLR (in category 'generate machine code - concretize processor-specific') ----- + concretizeSTLR + | valueReg "Xt" baseReg "Xn" | + valueReg := operands at: 0. + baseReg := operands at: 1. + machineCode + at: 0 + put: 2r1100100010011111111111 << 10 + + (baseReg << 5) + + valueReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object '00000000: stlr x0, [x1]'" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeSTLXR (in category 'generate machine code - concretize') ----- + concretizeSTLXR + "C6.2.268 STLXR C6-1228" + + | valueReg addressReg statusReg | + valueReg := operands at: 0. + addressReg := operands at: 1. + statusReg := operands at: 2. + machineCode + at: 0 + put: 2r11001 << 27 + + (statusReg << 16) + + (63 << 10) + + (addressReg << 5) + + valueReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeShiftRR: (in category 'generate machine code - concretize') ----- + concretizeShiftRR: shiftOp + "C6.2.18 ASRV C6-787 (a.k.a C6.2.16 ASR (register) + C6.2.178 LSLV C6-1077 (a.k.a C6.2.176 LSL (register) + C6.2.181 LSRV C6-1083 (a.k.a C6.2.179 LSR (register)" + + | shiftedReg shiftCountReg | + shiftCountReg := operands at: 0. + shiftedReg := operands at: 1. + machineCode + at: 0 + put: 2r10011010110 << 21 + + (shiftCountReg << 16) + + (shiftOp << 10) + + (shiftedReg << 5) + + shiftedReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeSignExtendRR: (in category 'generate machine code - concretize') ----- + concretizeSignExtendRR: width + "C6.2.320 SXTB C6-1332 + C6.2.321 SXTH C6-1334 + C6.2.322 SXTW C6-1336" + | rn rd | + rn := operands at: 0. + rd := operands at: 1. + machineCode + at: 0 + put: 2r1001001101 << 22 + + (width - 1 << 10) + + (rn << 5) + + rd. + ^4 + + "cogit processor disassembleInstructionAt: 0 In: machineCode object"! Item was added: + ----- Method: CogARMv8Compiler>>concretizeSqrtRd (in category 'generate machine code - concretize') ----- + concretizeSqrtRd + "C7.2.165 FSQRT (scalar) C7-1743" + + | reg | + reg := operands at: 0. + machineCode + at: 0 + put: 2r111100110000111 << 14 + + (reg << 5) + + reg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeStop (in category 'generate machine code - concretize') ----- + concretizeStop + + machineCode at: 0 put: self stop. + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeSubCqR (in category 'generate machine code - concretize') ----- + concretizeSubCqR + "Will get inlined into concretizeAt: switch." + + | constant reg offset | + + constant := (operands at: 0) signedIntFromLong64. + reg := operands at: 1. + + self isPossiblyShiftableImm12: constant + ifTrue: + [:shift| + "C6.2.308 SUB (immediate) C6-1311 + C6.2.314 SUBS (immediate) C6-1321" + machineCode + at: 0 + put: (reg = SP + ifTrue: [2r110100010] + ifFalse: [2r111100010]) << 23 + + (shift ifTrue: [constant >> 2 + (1 << 22)] ifFalse: [constant << 10]) + + (reg << 5) + + reg. + ^4] + ifFalse: []. + self isPossiblyShiftableImm12: constant negated + ifTrue: + [:shift| + "C6.2.4 ADDS (immediate) C6-761 + C6.2.8 ADDS (immediate) C6-769" + machineCode + at: 0 + put: (reg = SP + ifTrue: [2r100100010] + ifFalse: [2r101100010]) << 23 + + (shift ifTrue: [constant negated >> 2 + (1 << 22)] ifFalse: [constant negated << 10]) + + (reg << 5) + + reg. + ^4] + ifFalse: []. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + "cogit processor disassembleInstructionAt: 4 In: machineCode object" + offset := self emitMoveCw: constant intoR: RISCTempReg at: 0. + self deny: SP = reg. + "C6.2.313 SUBS (extended register) C6-1318" + machineCode + at: offset // 4 + put: 2r10001011 << 24 + + (ArithmeticSubS << 29) + + (RISCTempReg << 16) + + (reg << 5) + + reg. + ^offset + 4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeXorRdRd (in category 'generate machine code - concretize') ----- + concretizeXorRdRd + "C7.2.34 EOR (vector) C7-1440" + + | srcReg destReg | + srcReg := operands at: 0. + destReg := operands at: 1. + machineCode + at: 0 + put: 2r101110001 << 21 + + (srcReg << 16) + + (2r111 << 10) + + (destReg << 5) + + destReg. + "cogit processor disassembleInstructionAt: 0 In: machineCode object" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>concretizeZeroExtendRR: (in category 'generate machine code - concretize') ----- + concretizeZeroExtendRR: width + "C6.2.333 UBFX C6-1353 + C6.2.341 UXTB C6-1364 + C6.2.342 UXTH C6-1366" + | rn rd | + rn := operands at: 0. + rd := operands at: 1. + machineCode + at: 0 + put: 2r1101001101 << 22 + + (width - 1 << 10) + + (rn << 5) + + rd. + ^4 + + "cogit processor disassembleInstructionAt: 0 In: machineCode object"! Item was added: + ----- Method: CogARMv8Compiler>>cond:offset: (in category 'generate machine code - support') ----- + cond: cond offset: offset + "Conditional branch (immediate) C4-257" + + self assert: (offset bitAnd: 3) = 0. + ^2r010101 << 26 + + ((offset bitAnd: 1 << 21 - 1) << 3) "(offset / 4 bitAnd: 1 << 19 - 1) << 5" + + cond! Item was added: + ----- Method: CogARMv8Compiler>>countLeadingOnes: (in category 'generate machine code - support') ----- + countLeadingOnes: anInteger + | count theInteger | + anInteger >= 0 ifTrue: [^0]. + theInteger := anInteger. + count := 0. + 5 to: 0 by: -1 do: + [:logBase2Shift| | shift | + shift := 1 << logBase2Shift. + theInteger >>> shift = -1 + ifTrue: [count := count + shift] + ifFalse: [theInteger := theInteger >>> shift]]. + ^theInteger = -1 + ifTrue: [count + 1] + ifFalse: [count] + + + "self basicNew countLeadingOnes: -16 + ((-16 bitAnd: 1 << 64 - 1) binary copyUpTo: $0) occurrencesOf: $1 + + self basicNew countLeadingOnes: -1 + ((-1 bitAnd: 1 << 64 - 1) binary copyUpTo: $0) occurrencesOf: $1 + + (-1 to: -64 by: -1) + select: [:n| (self basicNew countLeadingOnes: n) ~= (((n bitAnd: 1 << 64 - 1) binary copyUpTo: $0) occurrencesOf: $1)] + thenCollect: [:n| {self basicNew countLeadingOnes: n. (n bitAnd: 1 << 64 - 1) binary}]"! Item was added: + ----- Method: CogARMv8Compiler>>countTrailingOnes: (in category 'generate machine code - support') ----- + countTrailingOnes: anInteger + | bits count | + bits := anInteger. + count := 0. + [bits allMask: 16rFFFF] whileTrue: + [bits := bits bitShift: -16. + count := count + 16]. + [bits allMask: 16rFF] whileTrue: + [bits := bits bitShift: -8. + count := count + 8]. + (bits allMask: 16rF) ifTrue: + [bits := bits bitShift: -4. + count := count + 4]. + (bits allMask: 16r3) ifTrue: + [bits := bits bitShift: -2. + count := count + 2]. + ^(bits allMask: 1) ifTrue: [count + 1] ifFalse: [count] + + "(-16 to: 16) collect: [:i| {i. self basicNew countTrailingOnes: (i bitAnd: 1 << 64 - 1)}]"! Item was added: + ----- Method: CogARMv8Compiler>>countTrailingZeros: (in category 'generate machine code - support') ----- + countTrailingZeros: anInteger + "a.k.a. anInteger lowBit - 1" + | n result | + self assert: anInteger ~= 0. + n := anInteger. + result := 0. + [n noMask: 16rFF] + whileTrue: + [result := result + 8. + n := n bitShift: -8]. + (n noMask: 16rF) ifTrue: + [result := result + 4. + n := n bitShift: -4]. + (n noMask: 16r3) ifTrue: + [result := result + 2. + n := n bitShift: -2]. + ^(n anyMask: 1) + ifTrue: [result] + ifFalse: [result + 1] + + "| me | + me := self basicNew. + (1 to: 65535) reject: [:i| i lowBit - 1 = (me countTrailingZeros: i)]"! Item was added: + ----- Method: CogARMv8Compiler>>ctrEl0 (in category 'feature detection') ----- + ctrEl0 + + "For want of somewhere to put the variable..." + ^self class ctrEl0! Item was added: + ----- Method: CogARMv8Compiler>>decode64Imms:immr: (in category 'generate machine code - support') ----- + decode64Imms: imms immr: immr + "See aarch64/instrs/integer/bitmasks/DecodeBitMasks J1-7389. + This is a 64-bit version computing the imm mask (wmask) only." + + | mask | + + self assert: ((imms between: 0 and: 63) and: [immr between: 0 and: 63]). + "For logical immediates an all-ones value of S is reserved since it would generate a useless all-ones result (many times)" + imms = 63 ifTrue: + [^self cCode: [0] inSmalltalk: [#undefined]]. + + mask := 1 << (imms + 1) - 1. + ^immr = 0 + ifTrue: [mask] + ifFalse: [(mask << (64 - immr) bitAnd: 1 << 64 - 1) + (mask >> immr)]! Item was added: + ----- Method: CogARMv8Compiler>>detectFeatures (in category 'feature detection') ----- + detectFeatures + "Do throw-away compilations to read CTR_EL0 & ID_AA64ISAR0_EL1 and initialize ctrEl0 & idISAR0" + | startAddress getFeatureReg | + + startAddress := cogit methodZoneBase. + cogit allocateOpcodes: 3 bytecodes: 0. + getFeatureReg := cogit cCoerceSimple: startAddress to: #'usqIntptr_t (*)(void)'. + "Return the value of CTR_EL0; that's the control register that defines the vital statistics of the processor's caches." + cogit + gen: MRS_CTR_EL0 operand: ABIResultReg; + RetN: 0. + cogit outputInstructionsForGeneratedRuntimeAt: startAddress. + cogit resetMethodZoneBase: startAddress. + self setCtrEl0: (self cCode: 'getFeatureReg()' inSmalltalk: [cogit simulateLeafCallOf: startAddress]). + cogit zeroOpcodeIndexForNewOpcodes. + cogit + gen: MRS_ID_AA64ISAR0_EL1 operand: ABIResultReg; + RetN: 0. + cogit outputInstructionsForGeneratedRuntimeAt: startAddress. + cogit resetMethodZoneBase: startAddress. + self setIdISAR0: (self cCode: 'getFeatureReg()' inSmalltalk: [cogit simulateLeafCallOf: startAddress])! Item was added: + ----- Method: CogARMv8Compiler>>dispatchConcretize (in category 'generate machine code') ----- + dispatchConcretize + "Attempt to generate concrete machine code for the instruction at address. + This is the inner dispatch of concretizeAt: actualAddress which exists only + to get around the branch size limits in the SqueakV3 (blue book derived) + bytecode set." + + opcode caseOf: { + "Noops & Pseudo Ops" + [Label] -> [^self concretizeLabel]. + [Literal] -> [^self concretizeLiteral]. + [AlignmentNops] -> [^self concretizeAlignmentNops]. + [Fill32] -> [^self concretizeFill32]. + [Nop] -> [^self concretizeNop]. + "Control" + [Call] -> [^self concretizeCall]. "call code within code space" + [CallFull] -> [^self concretizeCallJumpFull: true]. "call code anywhere in address space" + [JumpR] -> [^self concretizeJumpR]. + [JumpFull] -> [^self concretizeCallJumpFull: false]."jump within address space" + [JumpLong] -> [^self concretizeJumpLong]."jump within code space" + [JumpLongZero] -> [^self concretizeConditionalLongJump: EQ]. + [JumpLongNonZero] -> [^self concretizeConditionalLongJump: NE]. + [Jump] -> [^self concretizeConditionalJump: AL]. "jump within a method, etc" + [JumpZero] -> [^self concretizeConditionalJump: EQ]. + [JumpNonZero] -> [^self concretizeConditionalJump: NE]. + [JumpNegative] -> [^self concretizeConditionalJump: MI]. + [JumpNonNegative] -> [^self concretizeConditionalJump: PL]. + [JumpOverflow] -> [^self concretizeConditionalJump: VS]. + [JumpNoOverflow] -> [^self concretizeConditionalJump: VC]. + [JumpMulOverflow] -> [^self concretizeMulOverflowJump]. + [JumpNoMulOverflow] -> [^self concretizeMulOverflowJump]. + [JumpCarry] -> [^self concretizeConditionalJump: CS]. + [JumpNoCarry] -> [^self concretizeConditionalJump: CC]. + [JumpLess] -> [^self concretizeConditionalJump: LT]. + [JumpGreaterOrEqual] -> [^self concretizeConditionalJump: GE]. + [JumpGreater] -> [^self concretizeConditionalJump: GT]. + [JumpLessOrEqual] -> [^self concretizeConditionalJump: LE]. + [JumpBelow] -> [^self concretizeConditionalJump: CC]. "unsigned lower" + [JumpAboveOrEqual] -> [^self concretizeConditionalJump: CS]. "unsigned greater or equal" + [JumpAbove] -> [^self concretizeConditionalJump: HI]. + [JumpBelowOrEqual] -> [^self concretizeConditionalJump: LS]. + [JumpFPEqual] -> [^self concretizeConditionalJump: EQ]. + [JumpFPNotEqual] -> [^self concretizeConditionalJump: NE]. + [JumpFPLess] -> [^self concretizeConditionalJump: LT]. + [JumpFPGreaterOrEqual] -> [^self concretizeConditionalJump: GE]. + [JumpFPGreater] -> [^self concretizeConditionalJump: GT]. + [JumpFPLessOrEqual] -> [^self concretizeConditionalJump: LE]. + [JumpFPOrdered] -> [^self concretizeConditionalJump: VC]. + [JumpFPUnordered] -> [^self concretizeConditionalJump: VS]. + [RetN] -> [^self concretizeRetN]. + [NativeRetN] -> [^self concretizeNativeRetN]. + [Stop] -> [^self concretizeStop]. + "Arithmetic" + [AddCqR] -> [^self concretizeAddCqRDest: (operands at: 1)]. + [AddCqRR] -> [^self concretizeAddCqRDest: (operands at: 2)]. + [AndCqR] -> [^self concretizeLogicalOp: LogicalAndS CqRDest: (operands at: 1)]. + [AndCqRR] -> [^self concretizeLogicalOp: LogicalAndS CqRDest: (operands at: 2)]. + [OrCqR] -> [^self concretizeLogicalOp: LogicalOr CqRDest: (operands at: 1)]. + [OrCqRR] -> [^self concretizeLogicalOp: LogicalOr CqRDest: (operands at: 2)]. + [CmpCqR] -> [^self concretizeCmpCqR]. + [SubCqR] -> [^self concretizeSubCqR]. + [TstCqR] -> [^self concretizeLogicalOp: LogicalAndS CqRDest: XZR]. + [XorCqR] -> [^self concretizeLogicalOp: LogicalXor CqRDest: (operands at: 1)]. + [AddCwR] -> [^self concretizeCwRArithmetic: ArithmeticAddS Rd: (operands at: 1)]. + [AndCwR] -> [^self concretizeCwRLogical: LogicalAndS]. + [CmpCwR] -> [^self concretizeCwRArithmetic: ArithmeticSubS Rd: XZR]. + [CmpC32R] -> [^self concretizeCmpC32R]. + [OrCwR] -> [^self concretizeCwRLogical: LogicalOr]. + [SubCwR] -> [^self concretizeCwRArithmetic: ArithmeticSubS Rd: (operands at: 1)]. + [XorCwR] -> [^self concretizeCwRLogical: LogicalXor]. + [AddRR] -> [^self concretizeRRArithmetic: ArithmeticAddS Rd: (operands at: 1)]. + [AndRR] -> [^self concretizeRRLogical: LogicalAndS]. + [CmpRR] -> [^self concretizeRRArithmetic: ArithmeticSubS Rd: XZR]. + [OrRR] -> [^self concretizeRRLogical: LogicalOr]. + [SubRR] -> [^self concretizeRRArithmetic: ArithmeticSubS Rd: (operands at: 1)]. + [XorRR] -> [^self concretizeRRLogical: LogicalXor]. + [AddRRR] -> [^self concretizeRRArithmetic: ArithmeticAddS Rd: (operands at: 2)]. + [SubRRR] -> [^self concretizeRRArithmetic: ArithmeticSubS Rd: (operands at: 2)]. + [AddRdRd] -> [^self concretizeMathRdRd: 2r1010]. + [CmpRdRd] -> [^self concretizeCmpRdRd]. + [DivRdRd] -> [^self concretizeMathRdRd: 2r0110]. + [MulRdRd] -> [^self concretizeMathRdRd: 2r0010]. + [SubRdRd] -> [^self concretizeMathRdRd: 2r1110]. + [XorRdRd] -> [^self concretizeXorRdRd]. + [SqrtRd] -> [^self concretizeSqrtRd]. + [NegateR] -> [^self concretizeNegateR]. + [LoadEffectiveAddressMwrR] -> [^self concretizeLoadEffectiveAddressMwrR]. + [ArithmeticShiftRightCqR] -> [^self concretizeArithmeticShiftRightCqR]. + [ArithmeticShiftRightCqRR] -> [^self concretizeArithmeticShiftRightCqRR]. + [LogicalShiftRightCqR] -> [^self concretizeLogicalShiftRightCqR]. + [LogicalShiftRightCqRR] -> [^self concretizeLogicalShiftRightCqRR]. + [LogicalShiftLeftCqR] -> [^self concretizeLogicalShiftLeftCqR]. + [LogicalShiftLeftCqRR] -> [^self concretizeLogicalShiftLeftCqRR]. + [ArithmeticShiftRightRR] -> [^self concretizeShiftRR: 2r001010]. + [LogicalShiftLeftRR] -> [^self concretizeShiftRR: 2r001000]. + [LogicalShiftRightRR] -> [^self concretizeShiftRR: 2r001001]. + [RotateRightCqR] -> [^self concretizeRotateCqR]. + [RotateLeftCqR] -> [^self concretizeRotateCqR]. + [ClzRR] -> [^self concretizeClzRR]. + "ARM Specific Arithmetic" + [MulRRR] -> [^self concretizeMulRRR]. + [MulOverflowRRR] -> [^self concretizeMulOverflowRRR]. + [DivRRR] -> [^self concretizeDivRRR]. + [MSubRRR] -> [^self concretizeMSubRRR]. + "ARM Specific Cache Control" + [DC] -> [^self concretizeDataCacheControl]. + [DSB] -> [^self concretizeDataSynchronizationBarrier]. + [IC] -> [^self concretizeInstructionCacheControl]. + [ISB] -> [^self concretizeInstructionSynchronizationBarrier]. + [MRS_CTR_EL0] -> [^self concretizeMRS_CTR_EL0]. + [MRS_ID_AA64ISAR0_EL1] -> [^self concretizeMRS_ID_AA64ISAR0_EL1]. + "Data Movement" + [MoveCqR] -> [^self concretizeMoveCqR]. + [MoveCwR] -> [^self concretizeMoveCwR]. + [MoveC32R] -> [^self concretizeMoveC32R]. + [MoveRR] -> [^self concretizeMoveRR]. + [MoveRRd] -> [^self concretizeMoveRRd]. + [MoveRdR] -> [^self concretizeMoveRdR]. + [MoveAwR] -> [^self concretizeMoveAwR]. + [MoveRAw] -> [^self concretizeMoveRAw]. + [MoveAwRR] -> [^self concretizeMoveAwRR]. + [MoveRRAw] -> [^self concretizeMoveRRAw]. + [MoveAbR] -> [^self concretizeMoveAbR]. + [MoveRAb] -> [^self concretizeMoveRAb]. + [MoveMwrR] -> [^self concretizeMoveMSrR: 3]. + [MoveM32rR] -> [^self concretizeMoveMSrR: 2]. + [MoveM16rR] -> [^self concretizeMoveMSrR: 1]. + [MoveMbrR] -> [^self concretizeMoveMSrR: 0]. + [MoveRMwr] -> [^self concretizeMoveRMSr: 3]. + [MoveRM32r] -> [^self concretizeMoveRMSr: 2]. + [MoveRM16r] -> [^self concretizeMoveRMSr: 1]. + [MoveRMbr] -> [^self concretizeMoveRMSr: 0]. + [MoveXwrRR] -> [^self concretizeMoveXSrRR: 3]. + [MoveX32rRR] -> [^self concretizeMoveXSrRR: 2]. + [MoveX16rRR] -> [^self concretizeMoveXSrRR: 1]. + [MoveXbrRR] -> [^self concretizeMoveXSrRR: 0]. + [MoveRXwrR] -> [^self concretizeMoveRXSrR: 3]. + [MoveRX32rR] -> [^self concretizeMoveRXSrR: 2]. + [MoveRX16rR] -> [^self concretizeMoveRXSrR: 1]. + [MoveRXbrR] -> [^self concretizeMoveRXSrR: 0]. + [MoveM64rRd] -> [^self concretizeMoveM64rRd]. + [MoveRdM64r] -> [^self concretizeMoveRdM64r]. + [PopR] -> [^self concretizePopR]. + [PushR] -> [^self concretizePushR]. + [NativePopRR] -> [^self concretizeNativePopRR]. + [NativePushRR] -> [^self concretizeNativePushRR]. + [PushCq] -> [^self concretizePushCq]. + [PushCw] -> [^self concretizePushCw]. + [PrefetchAw] -> [^self concretizePrefetchAw]. + "Conversion" + [ConvertRRd] -> [^self concretizeConvertRRd]. + [ConvertRdR] -> [^self concretizeConvertRdR]. + "[ConvertRRs] -> [^self concretizeConvertRRs]. + [ConvertRsR] -> [^self concretizeConvertRsR]. + [ConvertRsRd] -> [^self concretizeConvertRsRd]. + [ConvertRdRs] -> [^self concretizeConvertRdRs]." + + [SignExtend8RR] -> [^self concretizeSignExtendRR: 8]. + [SignExtend16RR] -> [^self concretizeSignExtendRR: 16]. + [SignExtend32RR] -> [^self concretizeSignExtendRR: 32]. + + [ZeroExtend8RR] -> [^self concretizeZeroExtendRR: 8]. + [ZeroExtend16RR] -> [^self concretizeZeroExtendRR: 16]. + [ZeroExtend32RR] -> [^self concretizeZeroExtendRR: 32]. + + "Multi-processing" + [LDAXR] -> [^self concretizeLDAXR]. + [STLXR] -> [^self concretizeSTLXR]. + [CLREX] -> [^self concretizeCLREX]. + [STLR] -> [^self concretizeSTLR]. + [CASAL] -> [^self concretizeCASAL]. + [CCMPNE] -> [^self concretizeCCMPNE]. + [CSET] -> [^self concretizeCSET]. + [CBNZ] -> [^self concretizeCB]. + [CBZ] -> [^self concretizeCB]. }. + + ^0 "keep Slang happy"! Item was added: + ----- Method: CogARMv8Compiler>>emitLd:rn:rt:imm:shiftBy12:at: (in category 'generate machine code - support') ----- + emitLd: unitSizeLog2MinusOne rn: baseReg rt: targetReg imm: offset shiftBy12: shiftBy12 at: instrOffset + "C6.2.130 LDR (immediate) C6-976 + C6.2.132 LDR (register) C6-981 + C6.2.136 LDRH (immediate) C6-990 + C6.2.166 LDUR C6-1058 + C6.2.134 LDRB (immediate) C6-985 + C6.2.135 LDRB (register) C6-988" + + "cogit processor disassembleInstructionAt: instrOffset In: machineCode object" + | unitSize instrBytes | + unitSize := 1 << unitSizeLog2MinusOne. + "Unsigned offset, C6-977" + (offset \\ unitSize = 0 + and: [offset / unitSize between: 0 and: 1 << 12 - 1]) ifTrue: + [machineCode + at: instrOffset / 4 + put: unitSizeLog2MinusOne << 30 + + (2r11100101 << 22) + + (offset << (10 - unitSizeLog2MinusOne)) + + (baseReg << 5) + + targetReg. + ^instrOffset + 4]. + (offset between: -256 and: 255) ifTrue: "Unscaled signed 9-bit offset, C6-1058" + [machineCode + at: instrOffset / 4 + put: unitSizeLog2MinusOne << 30 + + (2r11100001 << 22) + + ((offset bitAnd: 511) << 12) + + (baseReg << 5) + + targetReg. + ^instrOffset + 4]. + "C6.2.132 LDR (register) C6-981" + instrBytes := self emitMoveCw: offset intoR: RISCTempReg at: instrOffset. + machineCode + at: instrBytes // 4 + put: unitSizeLog2MinusOne << 30 + + (2r111000011 << 21) + + (RISCTempReg << 16) + + (UXTX << 13) + + (1 << 11) + + (baseReg << 5) + + targetReg. + ^instrBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>emitLdfprn:rt:imm:shiftBy12:at: (in category 'generate machine code - support') ----- + emitLdfprn: baseReg rt: targetDPReg imm: offset shiftBy12: shiftBy12 at: instrOffset + "C7.2.184 LDR (immediate, SIMD&FP) C7-1800 + C7.2.186 LDR (register, SIMD&FP) C7-1806" + + "cogit processor disassembleInstructionAt: instrOffset In: machineCode object" + | instrBytes | + "Unsigned offset, C7-1801" + (offset \\ 8 = 0 + and: [offset / 8 between: 0 and: 1 << 12 - 1]) ifTrue: + [machineCode + at: instrOffset / 4 + put: 2r1111110101 << 22 + + (offset << 7 "10 - 3") + + (baseReg << 5) + + targetDPReg. + ^instrOffset + 4]. + "No unscaled signed 9-bit offset because there is only post-index and pre-index, see C7-1800" + "C6.2.132 LDR (register) C6-981" + instrBytes := self emitMoveCw: offset intoR: RISCTempReg at: instrOffset. + "C7.2.186 LDR (register, SIMD&FP) C7-1806" + machineCode + at: instrBytes // 4 + put: 2r11111100011 << 21 + + (RISCTempReg << 16) + + (UXTX << 13) + + (1 << 11) + + (baseReg << 5) + + targetDPReg. + ^instrBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>emitMoveCw:intoR:at: (in category 'generate machine code - support') ----- + emitMoveCw: constantArg intoR: destReg at: offsetBytes + "Emit a load of constant into destReg. Answer the number of bytes of machine code + generated. Literals are stored out-of-line; emit a LDR (literal) with the relevant offset." + + | constant | + + + self deny: destReg = SP. + "cogit processor disassembleInstructionAt: offsetBytes // 4 In: machineCode object" + constant := (self isAnInstruction: (cogit cCoerceSimple: constantArg to: #'AbstractInstruction *')) + ifTrue: [(cogit cCoerceSimple: constantArg to: #'AbstractInstruction *') address] + ifFalse: [constantArg]. + ((opcode = MoveCwR or: [opcode = PushCw]) + and: [self inCurrentCompilation: constant]) ifTrue: + [| aligned unaligned pcRelativeOffset | + "C6.2.10 ADR C6-773" + unaligned := constant bitAnd: 3. + aligned := constant - unaligned. + pcRelativeOffset := aligned - address asInteger >>> 2. + self assert: (pcRelativeOffset between: -1 << 18 and: 1 << 18 - 1). + machineCode + at: offsetBytes // 4 + put: unaligned << 29 + + (1 << 28) + + ((pcRelativeOffset bitAnd: 1 << 19 - 1) << 5) + + destReg. + ^offsetBytes + 4]. + self assert: (cogit addressIsInCurrentCompilation: dependent address). + self assert: dependent address \\ 4 = 0. + self assert: (dependent address - (address + offsetBytes)) abs < (1 << 20). + "C6.2.131 LDR (literal) C6-979" + machineCode + at: offsetBytes // 4 + put: 2r01011 << 27 + + ((dependent address - (address + offsetBytes) bitAnd: 1 << 21 - 1) << 3 "5 - 2") + + destReg. + ^offsetBytes + 4! Item was added: + ----- Method: CogARMv8Compiler>>flushDCacheFrom:to: (in category 'inline cacheing') ----- + flushDCacheFrom: startAddress "" to: endAddress "" + "If there is a dual mapped code zone (the normal zone but marked with read/execute, and a + read/write zone codeToDataDelta bytes away) then flush the data cache for the corresponding + range in the read/write zone and invalidate the data cache for the read/execute zone." + + ^cogit simulateCeFlushDCacheFrom: startAddress to: endAddress! Item was added: + ----- Method: CogARMv8Compiler>>flushICacheFrom:to: (in category 'inline cacheing') ----- + flushICacheFrom: startAddress "" to: endAddress "" + "Flush the instruction cache from (startAddress to endAddress]. + If there is a dual mapped code zone (the normal zone but marked with read/execute, and a + read/write zone codeToDataDelta bytes away) then also flush the data cache for the corresp- + onding range in the read/write zone and invalidate the data cache for the read/execute zone." + + ^cogit simulateCeFlushICacheFrom: startAddress to: endAddress! Item was added: + ----- Method: CogARMv8Compiler>>fullCallsAreRelative (in category 'abi') ----- + fullCallsAreRelative + "Answer if CallFull and/or JumpFull are relative and hence need relocating on method + compation. If so, they are annotated with IsRelativeCall in methods and relocated in + relocateIfCallOrMethodReference:mcpc:delta:" + ^false! Item was added: + ----- Method: CogARMv8Compiler>>genAlignCStackSavingRegisters:numArgs:wordAlignment: (in category 'abi') ----- + genAlignCStackSavingRegisters: regMask numArgs: numArgs wordAlignment: alignment + + "Override to do nothing. On the ARMv8 the SP has to be aligned correctly, + as enforced by the processor on any and all accesses to the SP." + ^0! Item was added: + ----- Method: CogARMv8Compiler>>genDivR:R:Quo:Rem: (in category 'abstract instructions') ----- + genDivR: regDivisor R: regDividend Quo: regQuotient Rem: regRemainder + "Divide regDividend by regDivisor storing the quotient in regQuotient and remainder in regRemainder. + MSUB Multiply-subtract MSUB C6-1109 + SDIV Signed divide SDIV C6-1174" + | instr safeRegQuotient | + "For the MSUB to work we must preserve regDivisor and regDividend for the MSUB; + i.e. the DivRRR must not overwrite either regDivisor or regDividend." + safeRegQuotient := (regQuotient = regDividend or: [regQuotient = regDivisor]) + ifTrue: [RISCTempReg] + ifFalse: [regQuotient]. + instr := cogit gen: DivRRR operand: regDividend operand: regDivisor operand: safeRegQuotient. + "MSUB , , , , Xd := Xa - (Xn * Xm)" + "MSUB regRemainder, regQuotient, regDivisor, regQuotient" + cogit gen: MSubRRR operand: safeRegQuotient << 5 + regDivisor operand: regDividend operand: regRemainder. + safeRegQuotient ~= regQuotient ifTrue: + [cogit gen: MoveRR operand: safeRegQuotient operand: regQuotient]. + ^instr + + "{ 4 \\ 3. 4 // 3. 4 quo: 3. 4 rem: 3 } #(1 1 1 1) + { 4 \\ -3. 4 // -3. 4 quo: -3. 4 rem: -3 } #(-2 -2 -1 1) + { -4 \\ 3. -4 // 3. -4 quo: 3. -4 rem: 3 } #(2 -2 -1 -1) + { -4 \\ -3. -4 // -3. -4 quo: -3. -4 rem: -3 } #(-1 1 1 -1)"! Item was added: + ----- Method: CogARMv8Compiler>>genLoadCStackPointers (in category 'smalltalk calling convention') ----- + genLoadCStackPointers + "Load the frame and stack pointer registers with those of the C stack, + effecting a switch to the C stack. Used when machine code calls into + the CoInterpreter run-time (e.g. to invoke interpreter primitives). + Override to try and use MoveAwRR/ldp" + cogit cStackPointerAddress + 8 = cogit cFramePointerAddress ifTrue: + [cogit + gen: MoveAwRR + operand: cogit cStackPointerAddress + operand: NativeSPReg + operand: FPReg. + ^0]. + + ^super genLoadCStackPointers! Item was added: + ----- Method: CogARMv8Compiler>>genLoadStackPointers (in category 'smalltalk calling convention') ----- + genLoadStackPointers + "Switch back to the Smalltalk stack. Assign SPReg first + because typically it is used immediately afterwards. + Override to try and use MoveAwRR/ldp" + cogit stackPointerAddress + 8 = cogit framePointerAddress ifTrue: + [cogit + gen: MoveAwRR + operand: cogit stackPointerAddress + operand: SPReg + operand: FPReg. + ^0]. + cogit framePointerAddress + 8 = cogit stackPointerAddress ifTrue: + [cogit + gen: MoveAwRR + operand: cogit framePointerAddress + operand: FPReg + operand: SPReg. + ^0]. + + ^super genLoadStackPointers! Item was added: + ----- Method: CogARMv8Compiler>>genMarshallNArgs:arg:arg:arg:arg: (in category 'abi') ----- + genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3 + "Generate the code to pass up to four arguments in a C run-time call. Hack: each argument is + either a negative number, which encodes a constant, or a non-negative number, that of a register. + + Run-time calls have no more than four arguments, so chosen so that on ARM, where in its C ABI the + first four integer arguments are passed in registers, all arguments can be passed in registers. We + defer to the back end to generate this code not so much that the back end knows whether it uses + the stack or registers to pass arguments (it does, but...). In fact we defer for an extremely evil reason. + Doing so allows the x64 (where up to 6 args are passed) to assign the register arguments in an order + that allows some of the argument registers to be used for specific abstract registers, specifically + ReceiverResultReg and ClassReg. This is evil, evil, evil, but also it's really nice to keep using the old + register assignments the original author has grown accustomed to." + + numArgs = 0 ifTrue: [^self]. + "Avoid arg regs being overwritten before they are read." + numArgs > 1 ifTrue: + [((cogit isTrampolineArgConstant: regOrConst1) not + and: [regOrConst1 = CArg0Reg]) ifTrue: + [cogit MoveR: regOrConst1 R: Extra0Reg. + ^self genMarshallNArgs: numArgs arg: regOrConst0 arg: Extra0Reg arg: regOrConst2 arg: regOrConst3]. + numArgs > 2 ifTrue: + [((cogit isTrampolineArgConstant: regOrConst2) not + and: [regOrConst2 = CArg0Reg or: [regOrConst2 = CArg1Reg]]) ifTrue: + [cogit MoveR: regOrConst2 R: Extra1Reg. + ^self genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: Extra1Reg arg: regOrConst3]. + numArgs > 3 ifTrue: + [((cogit isTrampolineArgConstant: regOrConst3) not + and: [regOrConst3 = CArg0Reg or: [regOrConst3 = CArg1Reg or: [regOrConst3 = CArg2Reg]]]) ifTrue: + [cogit MoveR: regOrConst3 R: Extra2Reg. + ^self genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: Extra2Reg]]]]. + (cogit isTrampolineArgConstant: regOrConst0) + ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst0) R: CArg0Reg] + ifFalse: [cogit MoveR: regOrConst0 R: CArg0Reg]. + numArgs = 1 ifTrue: [^self]. + (cogit isTrampolineArgConstant: regOrConst1) + ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst1) R: CArg1Reg] + ifFalse: [cogit MoveR: regOrConst1 R: CArg1Reg]. + numArgs = 2 ifTrue: [^self]. + (cogit isTrampolineArgConstant: regOrConst2) + ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst2) R: CArg2Reg] + ifFalse: [cogit MoveR: regOrConst2 R: CArg2Reg]. + numArgs = 3 ifTrue: [^self]. + (cogit isTrampolineArgConstant: regOrConst3) + ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst3) R: CArg3Reg] + ifFalse: [cogit MoveR: regOrConst3 R: CArg3Reg]! Item was added: + ----- Method: CogARMv8Compiler>>genMulOverflowR:R: (in category 'abstract instructions') ----- + genMulOverflowR: regSource R: regDest + ^cogit gen: MulOverflowRRR operand: regSource operand: regDest operand: regDest! Item was added: + ----- Method: CogARMv8Compiler>>genMulR:R: (in category 'abstract instructions') ----- + genMulR: regSource R: regDest + ^cogit gen: MulRRR operand: regSource operand: regDest operand: regDest! Item was added: + ----- Method: CogARMv8Compiler>>genPushRegisterArgsForAbortMissNumArgs: (in category 'smalltalk calling convention') ----- + genPushRegisterArgsForAbortMissNumArgs: numArgs + "Ensure that the register args are pushed before the outer and + inner retpcs at an entry miss for arity <= self numRegArgs. The + outer retpc is that of a call at a send site. The inner is the call + from a method or PIC abort/miss to the trampoline." + + "Putting the receiver and args above the return address means the + CoInterpreter has a single machine-code frame format which saves + us a lot of work." + + "Iff there are register args convert + sp -> outerRetpc (send site retpc) + linkReg = innerRetpc (PIC abort/miss retpc) + to + base -> receiver + (arg0) + (arg1) + sp -> outerRetpc (send site retpc) + sp -> linkReg/innerRetpc (PIC abort/miss retpc)" + numArgs <= cogit numRegArgs ifTrue: + [self assert: cogit numRegArgs <= 2. + cogit MoveMw: 0 r: SPReg R: TempReg. "Save return address" + cogit MoveR: ReceiverResultReg Mw: 0 r: SPReg. + numArgs > 0 ifTrue: + [cogit PushR: Arg0Reg. + numArgs > 1 ifTrue: + [cogit PushR: Arg1Reg]]. + cogit PushR: TempReg]. "push back return address" + cogit PushR: LinkReg! Item was added: + ----- Method: CogARMv8Compiler>>genPushRegisterArgsForNumArgs:scratchReg: (in category 'smalltalk calling convention') ----- + genPushRegisterArgsForNumArgs: numArgs scratchReg: ignored + "Ensure that the register args are pushed before the retpc for arity <= self numRegArgs." + "This is easy on a RISC like ARM because the return address is in the link register. Putting + the receiver and args above the return address means the CoInterpreter has a single + machine-code frame format which saves us a lot of work + NOTA BENE: we do NOT push the return address here, which means it must be dealt with later." + numArgs <= cogit numRegArgs ifTrue: + [self assert: cogit numRegArgs <= 2. + cogit PushR: ReceiverResultReg. + numArgs > 0 ifTrue: + [cogit PushR: Arg0Reg. + numArgs > 1 ifTrue: + [cogit PushR: Arg1Reg]]]! Item was added: + ----- Method: CogARMv8Compiler>>genRemoveNArgsFromStack: (in category 'abi') ----- + genRemoveNArgsFromStack: n + "This is a no-op on ARM64 since the ABI passes up to 6 args in registers and trampolines currently observe that limit, using only 4." + + self assert: n <= 6. + ^0! Item was added: + ----- Method: CogARMv8Compiler>>genRestoreRegs: (in category 'abi') ----- + genRestoreRegs: regMask + "Restore the registers in regMask as saved by genSaveRegs:. + See http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf + N.B. Alignment is handled by genAlignCStackSavingRegisters:numArgs:wordAlignment:." + | nRegs pair | + regMask = 0 ifTrue: [^0]. + self deny: (cogit register: RISCTempReg isInMask: regMask). + nRegs := 0. + R1 to: R17 do: + [:reg| + (regMask anyMask: (cogit registerMaskFor: reg)) ifTrue: + [nRegs := nRegs + 1]]. + pair := nRegs even ifTrue: [NoReg] ifFalse: [RISCTempReg]. + R1 to: R17 do: + [:reg| + (regMask anyMask: (cogit registerMaskFor: reg)) ifTrue: + [pair = NoReg + ifTrue: [pair := reg] + ifFalse: + [cogit gen: NativePopRR operand: reg operand: pair. + pair := NoReg]]]. + self assert: pair = NoReg. + ^0! Item was added: + ----- Method: CogARMv8Compiler>>genSaveRegs: (in category 'abi') ----- + genSaveRegs: regMask + "Save the registers in regMask for a call into the C run-time from a trampoline. + See http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf + N.B. Alignment is handled by genAlignCStackSavingRegisters:numArgs:wordAlignment:." + | pair | + regMask = 0 ifTrue: [^0]. + self deny: (cogit register: RISCTempReg isInMask: regMask). + pair := NoReg. + R17 to: R0 by: -1 do: + [:reg| + (regMask anyMask: (cogit registerMaskFor: reg)) ifTrue: + [pair = NoReg + ifTrue: [pair := reg] + ifFalse: + [cogit gen: NativePushRR operand: pair operand: reg. + pair := NoReg]]]. + pair ~= NoReg ifTrue: + [cogit gen: NativePushRR operand: pair operand: RISCTempReg]. + ^0! Item was added: + ----- Method: CogARMv8Compiler>>genSaveStackPointers (in category 'smalltalk calling convention') ----- + genSaveStackPointers + "Save the frame and stack pointer registers to the framePointer + and stackPointer variables. Used to save the machine code frame + for use by the run-time when calling into the CoInterpreter run-time. + Override to try and use MoveRRAw/stp" + cogit stackPointerAddress + 8 = cogit framePointerAddress ifTrue: + [cogit + gen: MoveRRAw + operand: SPReg + operand: FPReg + operand: cogit stackPointerAddress. + ^0]. + + ^super genSaveStackPointers! Item was added: + ----- Method: CogARMv8Compiler>>genSubstituteReturnAddress: (in category 'abstract instructions') ----- + genSubstituteReturnAddress: retpc + + ^cogit MoveCw: retpc R: LR! Item was added: + ----- Method: CogARMv8Compiler>>genSubstituteReturnAddressR: (in category 'abstract instructions') ----- + genSubstituteReturnAddressR: retpcReg + + ^cogit MoveR: retpcReg R: LR! Item was added: + ----- Method: CogARMv8Compiler>>generalPurposeRegisterMap (in category 'disassembly') ----- + generalPurposeRegisterMap + + "Answer a Dictionary from register getter to register index." + ^Dictionary newFromPairs: + { #r0. R0. + #r1. R1. + #r2. R2. + #r3. R3. + #r4. R4. + #r5. R5. + #r6. R6. + #r7. R7. + #r8. R8. + #r9. R9. + #r10. R10. + #r11. R11. + #r12. R12. + #r13. R13. + #r14. R14. + #r15. R15. + #r16. R16. + #r17. R17. + #r18. R18. + #r19. R19. + #r20. R20. + #r21. R21. + #r22. R22. + #r23. R23. + #r24. R24. + #r25. R25. + #r26. R26. + #r27. R27. + #r28. R28 }! Item was added: + ----- Method: CogARMv8Compiler>>generateDCacheFlush (in category 'inline cacheing') ----- + generateDCacheFlush + "Use the DC instruction to implement ceFlushDCache(void *start, void *end); see flushDCacheFrom:to:. + If there is a dual mapped zone then clean data via DC_CVAU as address + codeToDataDelta, + then invalidate data at address via CIVAC." + + "D4.4.7 About cache maintenance in AArch64 state D4-2478 + + Terminology for Clean, Invalidate, and Clean and Invalidate instructions D4-2479 + ... + - For instructions operating by VA, the following conceptual points are defined: D4-2480 + Point of Unification (PoU) + The PoU for a PE is the point by which the instruction and data caches and the translation table walks of that + PE are guaranteed to see the same copy of a memory location. In many cases, the Point of Unification is the + point in a uniprocessor memory system by which the instruction and data caches and the translation table + walks have merged. + + The PoU for an Inner Shareable shareability domain is the point by which the instruction and data caches + and the translation table walks of all the PEs in that Inner Shareable shareability domain are guaranteed to + see the same copy of a memory location. Defining this point permits self-modifying software to ensure future + instruction fetches are associated with the modified version of the software by using the standard correctness + policy of: + 1. Clean data cache entry by address. + 2. Invalidate instruction cache entry by address. + + Example code for cache maintenance instructions D4-2490 - D4-2491" + | ctrEL0 dataCacheMinLineLength mask loop | + self assert: cogit getCodeToDataDelta ~= 0. + ctrEL0 := self ctrEl0. + "See concretizeCacheControlOp1:CRm:Op2: & + http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.100403_0200_00_en/lau1443435580346.html + DminLine & IminLine are Log2 words; 16 words miniumum" + (dataCacheMinLineLength := ctrEL0 >> 16 bitAnd: 15) = 0 ifTrue: + [dataCacheMinLineLength := 4]. + dataCacheMinLineLength := 4 << dataCacheMinLineLength. + "Mask is large enough to encompass the method zone and has the correct minimum alignment." + mask := 1 << (cogit coInterpreter highBit: cogit methodZone zoneEnd) - dataCacheMinLineLength. + + "Since this is used from C code we must use only caller-saved registers. + C arg registers 2 & 3 are such a convenient pair of caller-saved registers." + cogit AndCq: mask R: CArg0Reg R: CArg2Reg. "CArg2Reg = aligned pointer to start of each data cache line" + cogit AddCq: cogit getCodeToDataDelta R: CArg2Reg R: CArg3Reg. + loop := cogit Label. + "see concretizeDataCacheControl" + cogit gen: DC operand: CArg3Reg operand: DC_CVAU. "clean (flush) address + codeToDataDelta" + cogit gen: DC operand: CArg2Reg operand: DC_CIVAC. "invalidate address" + cogit + AddCq: dataCacheMinLineLength R: CArg2Reg; + AddCq: dataCacheMinLineLength R: CArg3Reg; + CmpR: CArg1Reg R: CArg2Reg; + JumpBelowOrEqual: loop. + cogit RetN: 0! Item was added: + ----- Method: CogARMv8Compiler>>generateICacheFlush (in category 'inline cacheing') ----- + generateICacheFlush + "Use DC VAUC, DSB, IC IVAU, and ISB instructions to implement ceFlushICache(void *start, void *end); see flushICacheFrom:to:. + One might think that if there is a dual zone then data at address + codeToDataDelta must be cleaned, + but this isn't the case. All we need to do is clean data at address via DC VAUC and instructions via IC IVAU." + + "B2.2.5 Concurrent modification and execution of instructions B2-112 + + ...to avoid UNPREDICTABLE or CONSTRAINED UNPREDICTABLE behavior, instruction modifications must be explicitly synchronized before they are executed. The required synchronization is as follows: + + 1. No PE must be executing an instruction when another PE is modifying that instruction. + + 2. To ensure that the modified instructions are observable, a PE that is writing the instructions must issue the following sequence of instructions and operations: + + ; Coherency example for data and instruction accesses within the same Inner Shareable domain. + ; enter this code with containing a new 32-bit instruction, to be held in Cacheable space at a location pointed to by Xn. + + STR Wt, [Xn] + DC CVAU, Xn ; Clean data cache by VA to point of unification (PoU) + DSB ISH ; Ensure visibility of the data cleaned from cache + IC IVAU, Xn ; Invalidate instruction cache by VA to PoU + DSB ISH + + Note + - The DC CVAU operation is not required if the area of memory is either Non-cacheable or Write-Through Cacheable. + - If the contents of physical memory differ between the mappings, changing the mapping of VAs to PAs can cause + the instructions to be concurrently modified by one PE and executed by another PE. If the modifications affect + instructions other than those listed as being acceptable for modification, synchronization must be used to avoid + UNPREDICTABLE or CONSTRAINED UNPREDICTABLE behavior. + + 3. In a multiprocessor system, the IC IVAU is broadcast to all PEs within the Inner Shareable domain of the PE running this sequence. + However, when the modified instructions are observable, each PE that is executing the modified instructions must issue the following + instruction to ensure execution of the modified instructions: + + ISB ; Synchronize fetched instruction stream" + + "D4.4.7 About cache maintenance in AArch64 state D4-2478 + + Terminology for Clean, Invalidate, and Clean and Invalidate instructions D4-2479 + ... + - For instructions operating by VA, the following conceptual points are defined: D4-2480 + Point of Unification (PoU) + The PoU for a PE is the point by which the instruction and data caches and the translation table walks of that + PE are guaranteed to see the same copy of a memory location. In many cases, the Point of Unification is the + point in a uniprocessor memory system by which the instruction and data caches and the translation table + walks have merged. + + The PoU for an Inner Shareable shareability domain is the point by which the instruction and data caches + and the translation table walks of all the PEs in that Inner Shareable shareability domain are guaranteed to + see the same copy of a memory location. Defining this point permits self-modifying software to ensure future + instruction fetches are associated with the modified version of the software by using the standard correctness + policy of: + 1. Clean data cache entry by address. + 2. Invalidate instruction cache entry by address. + + Example code for cache maintenance instructions D4-2490 - D4-2491" + | ctrEL0 dataCacheMinLineLength instrCacheMinLineLength mask loop | + ctrEL0 := self ctrEl0. + "See concretizeCacheControlOp1:CRm:Op2: & + http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.100403_0200_00_en/lau1443435580346.html" + (ctrEL0 noMask: 1 << 28) ifTrue: "CTR_EL0.IDC disabled; must clean data cache to point of unification." + ["Since this is used from C code we must use only caller-saved registers. + C arg registers 2 & 3 are as such a convenient pair of caller-saved registers." + dataCacheMinLineLength := 4 << (ctrEL0 >> 16 bitAnd: 15). + "Mask is large enough to encompass the method zone and has the correct minimum alignment." + mask := 1 << (cogit coInterpreter highBit: cogit methodZone zoneEnd) - dataCacheMinLineLength. + cogit AndCq: mask R: CArg0Reg R: CArg2Reg. "CArg2Reg = aligned pointer to start of each data cache line" + + loop := cogit Label. + "see concretizeDataCacheControl" + cogit + gen: DC operand: CArg2Reg operand: DC_CVAU; "clean (flush) address" + AddCq: dataCacheMinLineLength R: CArg2Reg; + CmpR: CArg1Reg R: CArg2Reg; + JumpBelowOrEqual: loop]. + + cogit gen: DSB operand: DSB_ISH operand: DSB_ALL. "Ensure visibility of the data cleaned from cache" + + (ctrEL0 noMask: 1 << 29) ifTrue: "CTR_EL0.DIC disabled; must clean instruction cache to point of unification." + [instrCacheMinLineLength := 4 << (ctrEL0 bitAnd: 15). + "Mask is large enough to encompass the method zone and has the correct minimum alignment." + mask := 1 << (cogit coInterpreter highBit: cogit methodZone zoneEnd) - instrCacheMinLineLength. + cogit AndCq: mask R: CArg0Reg R: CArg2Reg. "CArg2Reg = aligned pointer to start of each data cache line" + + loop := cogit Label. + "see concretizeDataCacheControl" + cogit + gen: IC operand: CArg2Reg operand: IC_IVAU; "clean (flush) address" + AddCq: instrCacheMinLineLength R: CArg2Reg; + CmpR: CArg1Reg R: CArg2Reg; + JumpBelowOrEqual: loop. + + cogit gen: DSB operand: DSB_ISH operand: DSB_ALL]. + + cogit + gen: ISB; + RetN: 0! Item was added: + ----- Method: CogARMv8Compiler>>generateLowLevelTryLock: (in category 'multi-threading') ----- + generateLowLevelTryLock: vmOwnerLockAddress + "Generate a function that attempts to lock the vmOwnerLock to the argument and answers if it succeeded." + + | lockValueReg vmOwnerLockAddressReg br statusReg ldaxr | + vmOwnerLockAddress = 0 ifTrue: + [cogit + MoveCq: 1 R: ABIResultReg; + RetN: 0. + ^self]. + + "spiffy 8.1 version using CASAL..." + lockValueReg := CArg1Reg. "Holds the value of lock if unlocked (zero), receives the existing value of the lock" + vmOwnerLockAddressReg := CArg2Reg. + self hasAtomicInstructions ifTrue: + [cogit + MoveCq: 0 R: lockValueReg; + MoveCq: vmOwnerLockAddress R: vmOwnerLockAddressReg; + gen: CASAL operand: lockValueReg operand: CArg0Reg operand: vmOwnerLockAddressReg; + CmpCq: 0 R: lockValueReg; + gen: CCMPNE operand: ABIResultReg operand: lockValueReg operand: 0 "nzcv all false"; "i.e. if NE to 0, then is it already set to the argument?" + gen: CSET operand: ABIResultReg operand: EQ; + RetN: 0. + ^self]. + + "frumpy 8.0 version using LDAXR/STLXR" + cogit MoveCq: vmOwnerLockAddress R: vmOwnerLockAddressReg. + cogit MoveCq: 0 R: (statusReg := CArg3Reg). "STLXR sets a word status register; clearing the top bits means it's a non-issue" + ldaxr := cogit gen: LDAXR operand: lockValueReg operand: vmOwnerLockAddressReg. + br := cogit gen: CBNZ operand: 0 operand: lockValueReg. + cogit gen: STLXR operand: CArg0Reg operand: vmOwnerLockAddressReg operand: statusReg. + cogit gen: CBNZ operand: ldaxr asUnsignedInteger operand: statusReg. + "Since CArg0Reg is never zero, merely returning answers true" + cogit RetN: 0. + br jmpTarget: (cogit gen: CLREX). + cogit CmpR: ABIResultReg R: lockValueReg. + cogit gen: CSET operand: ABIResultReg operand: EQ. "i.e. if NE to 0, then is it already set to the argument?" + cogit RetN: 0. + ^self! Item was added: + ----- Method: CogARMv8Compiler>>getDefaultCogCodeSize (in category 'accessing') ----- + getDefaultCogCodeSize + "Answer the default number of bytes to allocate for native code at startup. + The actual value can be set via vmParameterAt: and/or a preference in the ini file." + + ^1024 * 1664! Item was added: + ----- Method: CogARMv8Compiler>>hasAtomicInstructions (in category 'feature detection') ----- + hasAtomicInstructions + "D13.2.53 ID_AA64ISAR0_EL1, AArch64 Instruction Set Attribute Register 0 D13-3096 + + The ID_AA64ISAR0_EL1 characteristics are: + Purpose + Provides information about the instructions implemented in AArch64 state. + ... + Atomic, bits [23:20] + From ARMv8.1: + Atomic instructions implemented in AArch64 state. Defined values are: + 0b0000 No Atomic instructions implemented. + 0b0010 LDADD, LDCLR, LDEOR, LDSET, LDSMAX, LDSMIN, LDUMAX, LDUMIN, CAS, CASP, and SWP instructions implemented. + All other values are reserved. + ARMv8.1-LSE implements the functionality identified by the value 0b0010. + From Armv8.1, the only permitted value is 0b0010. + Otherwise: + Reserved, RES0." + + ^((self idISAR0 >> 20) bitAnd: 2r1111) = 2r10! Item was added: + ----- Method: CogARMv8Compiler>>hasDoublePrecisionFloatingPointSupport (in category 'testing') ----- + hasDoublePrecisionFloatingPointSupport + ^true! Item was added: + ----- Method: CogARMv8Compiler>>hasLZCNTInstructions (in category 'testing') ----- + hasLZCNTInstructions + ^true! Item was added: + ----- Method: CogARMv8Compiler>>hasLinkRegister (in category 'testing') ----- + hasLinkRegister + ^true "lr"! Item was added: + ----- Method: CogARMv8Compiler>>hasThreeAddressArithmetic (in category 'testing') ----- + hasThreeAddressArithmetic + "Answer if the receiver supports three-address arithmetic instructions (currently only AndCqRR)" + ^true! Item was added: + ----- Method: CogARMv8Compiler>>hasVarBaseRegister (in category 'testing') ----- + hasVarBaseRegister + "Answer if the processor has a dedicated callee-saved register to point to + the base of commonly-accessed variables. On ARMv8 we use R27 for this." + ^true! Item was added: + ----- Method: CogARMv8Compiler>>idISAR0 (in category 'feature detection') ----- + idISAR0 + + "For want of somewhere to put the variable..." + ^self class idISAR0! Item was added: + ----- Method: CogARMv8Compiler>>initialFlushICacheFrom:to: (in category 'inline cacheing') ----- + initialFlushICacheFrom: startAddress "" to: endAddress "" + "This must be implemented only if a back end defines any of the following as non-zero: + numCheckFeaturesOpcodes + numDCacheFlushOpcodes + numICacheFlushOpcodes + If I or D cache flushing code is jitted (which it will be if num[ID]CacheFlushOpcodes is non-zero) then + the ICache must be flushed before the code is used, and that's what this function does." + + self cCode: + [self cppIf: #__APPLE__ & #__MACH__ ifTrue: + [cogit sys_dcache_flush: (self cCoerce: startAddress to: #'void *') _: endAddress - startAddress + 1; + sys_icache_invalidate: (self cCoerce: startAddress to: #'void *') _: endAddress - startAddress + 1] + cppIf: #__GNUC__ ifTrue: + [cogit __clear_cache: (self cCoerce: startAddress to: #'char *') _: (self cCoerce: endAddress to: #'char *')] + ifFalse: [cogit error: 'cache flushing method unknown for this platform']] + inSmalltalk: + [cogit processor flushICacheFrom: startAddress to: endAddress]! Item was added: + ----- Method: CogARMv8Compiler>>inlineCacheTagAt: (in category 'inline cacheing') ----- + inlineCacheTagAt: callSiteReturnAddress + + ^self instructionAt: (self pcRelativeAddressAt: (callSiteReturnAddress - 8) asUnsignedInteger)! Item was added: + ----- Method: CogARMv8Compiler>>inlineCacheValueForSelector:in: (in category 'inline cacheing') ----- + inlineCacheValueForSelector: selector in: aCogMethod + "Answer the value to put in an inline-cache that is being loaded with the selector. + Usually this is simply the selector, but in 64-bits the cache is only 32-bits wide and so the + cache is loaded with the index of the selector. Override to use the 64-bit implementation." + + ^cogit indexForSelector: selector in: aCogMethod! Item was added: + ----- Method: CogARMv8Compiler>>instructionAddressBefore: (in category 'inline cacheing') ----- + instructionAddressBefore: mcpc + "Answer the instruction address immediately preceding mcpc." + + ^mcpc - 4! Item was added: + ----- Method: CogARMv8Compiler>>instructionAt: (in category 'accessing') ----- + instructionAt: pc + + + ^objectMemory long32At: pc! Item was added: + ----- Method: CogARMv8Compiler>>instructionBeforeAddress: (in category 'inline cacheing') ----- + instructionBeforeAddress: followingAddress + "Answer the instruction immediately preceding followingAddress." + + ^self instructionAt: (self instructionAddressBefore: followingAddress)! Item was added: + ----- Method: CogARMv8Compiler>>instructionIsADR: (in category 'testing') ----- + instructionIsADR: word + "C6.2.10 ADR C6-773" + ^(word >> 24 bitAnd: 2r10011111) = 2r00010000! Item was added: + ----- Method: CogARMv8Compiler>>instructionIsBL: (in category 'generate machine code - support') ----- + instructionIsBL: word + + + ^word >> 26 = 2r100101! Item was added: + ----- Method: CogARMv8Compiler>>instructionIsBLR: (in category 'generate machine code - support') ----- + instructionIsBLR: word + + + ^(word bitOr: 31 << 5) = 2r11010110001111110000001111100000! Item was added: + ----- Method: CogARMv8Compiler>>instructionIsImm26BorBL: (in category 'generate machine code - support') ----- + instructionIsImm26BorBL: word + "C6.2.26 B C6-799 + C6.2.33 BL C6-812" + + + "BL is 2r100101, B is 2r000101" + ^(word >> 26 bitAnd: 2r11111) = 2r000101! Item was added: + ----- Method: CogARMv8Compiler>>instructionIsLoadStore: (in category 'inline cacheing') ----- + instructionIsLoadStore: instr + "C4.1 A64 instruction set encoding on page C4-252" + ^(instr >> 25 bitAnd: 2r101) = 2r100! Item was added: + ----- Method: CogARMv8Compiler>>instructionIsPCRelativeLoad: (in category 'inline cacheing') ----- + instructionIsPCRelativeLoad: instr + "C6.2.131 LDR (literal) C6-979 + C6.2.143 LDRSW (literal) C6-1008" + ^(instr >> 24 bitAnd: 2r00111111) = 2r00011000! Item was added: + ----- Method: CogARMv8Compiler>>instructionSizeAt: (in category 'disassembly') ----- + instructionSizeAt: pc + "Answer the instruction size at pc.Simple on ARM ;-)" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>inverseForArithOp: (in category 'generate machine code - support') ----- + inverseForArithOp: arithOp + "Several of the opcodes are inverses. Answer the inverse for an opcode if it has one. + See Table A3-2 in sec A3.4 Data-processing instructions of the AARM." + ^arithOp caseOf: { + [ArithmeticAdd] -> [ArithmeticSub]. + [ArithmeticAddS] -> [ArithmeticSubS]. + [ArithmeticSub] -> [ArithmeticAdd]. + [ArithmeticSubS] -> [ArithmeticAddS] }! Item was added: + ----- Method: CogARMv8Compiler>>is6BitSignedImmediate:ifTrue:ifFalse: (in category 'generate machine code - support') ----- + is6BitSignedImmediate: constant ifTrue: binaryBlock ifFalse: nullaryBlock + + (constant between: -1 << 5 and: 1 << 5) + ifTrue: + [^binaryBlock + value: constant abs + value: constant < 0] + ifFalse: [^nullaryBlock value]! Item was added: + ----- Method: CogARMv8Compiler>>isAddressRelativeToVarBase: (in category 'testing') ----- + isAddressRelativeToVarBase: varAddress + + + "Support for addressing variables off the dedicated VarBaseReg" + ^varAddress notNil + and: [varAddress + between: cogit varBaseAddress - (1 << 8) + and: cogit varBaseAddress + (1 << 12) - 1]! Item was added: + ----- Method: CogARMv8Compiler>>isBigEndian (in category 'testing') ----- + isBigEndian + ^false! Item was added: + ----- Method: CogARMv8Compiler>>isCallPrecedingReturnPC: (in category 'testing') ----- + isCallPrecedingReturnPC: mcpc + "Assuming mcpc is a send return pc answer if the instruction before it is a call (not a CallFull)." + "There are two types of calls: BL & BLR; BLR is used for CallFull" + ^self instructionIsBL: (self instructionBeforeAddress: mcpc)! Item was added: + ----- Method: CogARMv8Compiler>>isImmNImmSImmREncodableBitmask:ifTrue:ifFalse: (in category 'generate machine code - support') ----- + isImmNImmSImmREncodableBitmask: constant ifTrue: trinaryBlock "[:n :imms :immr|...]" ifFalse: nullaryBlock + "See DecodeBitMasks J1-7389. + See https://dinfuehr.github.io/blog/encoding-of-immediate-values-on-aarch64/ + This method is adapted from The LLVM Compiler Infrastructure, AArch64AddressingModes.h processLogicalImmediate" + + | imm size mask numLeadingOnes numTrailingOnes immr n nImms rotateCount | + + + (constant between: -1 and: 0) ifTrue: + [^nullaryBlock value]. + imm := self cCode: [constant] inSmalltalk: [constant signedIntToLong64]. + + "First, determine the element size." + size := 32. + [mask := 1 << size - 1. + (imm bitAnd: mask) ~= (imm >> size) + ifTrue: [size := size * 2. false] + ifFalse: [size > 2]] + whileTrue: [size := size / 2]. + + "Second, determine the rotation to make the element be: 0^m 1^n." + mask := 1 << 64 - 1 >> (64 - size). + imm := imm bitAnd: mask. + + (self isShiftedMask: imm) + ifTrue: + [rotateCount := self countTrailingZeros: imm. + numTrailingOnes := self countTrailingOnes: imm >> rotateCount] + ifFalse: + [imm := imm bitOr: mask bitInvert64. + (self isShiftedMask: imm) ifFalse: + [^nullaryBlock value]. + numLeadingOnes := self countLeadingOnes: imm. + rotateCount := 64 - numLeadingOnes. + numTrailingOnes := numLeadingOnes + (self countTrailingOnes: imm) - (64 - size)]. + + "Encode in Immr the number of RORs it would take to get *from* 0^m 1^n + to our target value, where I is the number of RORs to go the opposite direction." + + self assert: size > rotateCount. "rotateCount should be smaller than element size" + immr := size - rotateCount bitAnd: size - 1. + + "If size has a 1 in the n'th bit, create a value that has zeroes in bits [0, n] and ones above that." + nImms := (size - 1) bitInvert64 << 1. + + "Or the CTO value into the low bits, which must be below the Nth bit mentioned above." + nImms := nImms bitOr: numTrailingOnes - 1. + + "Extract the seventh bit and toggle it to create the N field." + n := ((nImms >> 6) bitAnd: 1) bitXor: 1. + + nImms := nImms bitAnd: 16r3F. + + self assert: (self decode64Imms: nImms immr: immr) = constant signedIntToLong64. + + ^trinaryBlock + value: n + value: nImms + value: immr + ! Item was added: + ----- Method: CogARMv8Compiler>>isInImmediateBranchAndLinkRange: (in category 'testing') ----- + isInImmediateBranchAndLinkRange: offset + "ARM64 calls span +/- 128 mb. + C6.2.33 BL C6-812" + + self assert: (offset noMask: 3). + ^offset signedIntFromLong64 >>> 27 between: -16r1 and: 0! Item was added: + ----- Method: CogARMv8Compiler>>isInImmediateBranchRange: (in category 'testing') ----- + isInImmediateBranchRange: offset + "ARM64 calls and jumps span +/- 1 mb." + + self assert: (offset noMask: 3). + ^offset signedIntFromLong64 >>> 18 between: -16r1 and: 0! Item was added: + ----- Method: CogARMv8Compiler>>isInImmediateJumpRange: (in category 'generate machine code - support') ----- + isInImmediateJumpRange: operand + "ARMv8 calls and jumps span +/- 128 mb, more than enough for intra-zone calls and jumps." + + self assert: (operand noMask: 3). + ^operand signedIntFromLong between: -1 << 27 and: 1 << 27 - 1! Item was added: + ----- Method: CogARMv8Compiler>>isJump (in category 'testing') ----- + isJump + ^super isJump or: [opcode between: CBNZ and: CBZ]! Item was added: + ----- Method: CogARMv8Compiler>>isJumpAt: (in category 'testing') ----- + isJumpAt: pc + | op0_101_op1MSB | + "C4.1 A64 instruction set encoding on page C4-252 + C4.1.3 Branches, Exception Generating and System instructions" + "cogit processor disassembleInstructionAt: pc In: objectMemory memory" + op0_101_op1MSB := (self instructionAt: pc) bitShift: -25. + ^op0_101_op1MSB = 2r0101010 "Conditional branch immediate" + or: [op0_101_op1MSB = 2r1101011 "Unconditional branch (register)" + or: [(op0_101_op1MSB bitAnd: 2r1111110) = 2r1001010 "Unconditional Branch (immediate) BL" + or: [(op0_101_op1MSB bitAnd: 2r1111110) = 2r0001010]]] "Unconditional branch (immediate) & Compare/Test and branch (immediate)"! Item was added: + ----- Method: CogARMv8Compiler>>isPCDependent (in category 'testing') ----- + isPCDependent + "Answer if the receiver is a pc-dependent instruction. With out-of-line literals any instruction + that refers to a literal depends on the address of the literal, so add them in addition to the jumps." + ^self isJump + or: [opcode = AlignmentNops + or: [opcode ~= Literal and: [dependent notNil and: [dependent opcode = Literal]]]]! Item was added: + ----- Method: CogARMv8Compiler>>isPossiblyShiftableImm12:ifTrue:ifFalse: (in category 'generate machine code - support') ----- + isPossiblyShiftableImm12: immediate ifTrue: unaryBlock ifFalse: nullaryBlock + + (immediate between: 0 and: 1 << 12 - 1) ifTrue: + [^unaryBlock value: false]. + ((immediate noMask: 1 << 12 - 1) + and: [immediate >>> 12 between: 0 and: 1 << 12 - 1]) ifTrue: + [^unaryBlock value: true]. + ^nullaryBlock value! Item was added: + ----- Method: CogARMv8Compiler>>isPossiblyShiftableImm12orImm9:ifTrue:ifFalse: (in category 'generate machine code - support') ----- + isPossiblyShiftableImm12orImm9: immediate ifTrue: unaryBlock ifFalse: nullaryBlock + + ((immediate between: -256 and: 255) + or: [immediate between: 0 and: 1 << 12 - 1]) ifTrue: + [^unaryBlock value: false]. + ((immediate noMask: 1 << 12 - 1) + and: [immediate >>> 12 between: 0 and: 1 << 12 - 1]) ifTrue: + [^unaryBlock value: true]. + ^nullaryBlock value! Item was added: + ----- Method: CogARMv8Compiler>>isPossiblyShiftableNegatableImm12:ifTrue:ifFalse: (in category 'generate machine code - support') ----- + isPossiblyShiftableNegatableImm12: immediate ifTrue: unaryBlock ifFalse: nullaryBlock + + (immediate between: -1 << 12 and: 1 << 12 - 1) ifTrue: + [^unaryBlock value: false]. + ((immediate noMask: 1 << 12 - 1) + and: [immediate >>> 12 between: -1 << 12 and: 1 << 12 - 1]) ifTrue: + [^unaryBlock value: true]. + ^nullaryBlock value! Item was added: + ----- Method: CogARMv8Compiler>>isSharable (in category 'generate machine code') ----- + isSharable + "Hack: To know if a literal should be unique (not shared) mark the LSB of the second operand." + + self assert: opcode = Literal. + ^(operands at: 1) anyMask: 1! Item was added: + ----- Method: CogARMv8Compiler>>isShiftedMask: (in category 'generate machine code - support') ----- + isShiftedMask: anInteger + | bits | + ^anInteger ~= 0 + and: [bits := anInteger - 1 bitOr: anInteger. + (bits bitAnd: bits + 1) = 0]! Item was added: + ----- Method: CogARMv8Compiler>>isUnsigned12BitMultipleOf8: (in category 'generate machine code - support') ----- + isUnsigned12BitMultipleOf8: anInteger + ^anInteger \\ 8 = 0 + and: [anInteger / 8 between: 0 and: 1 << 12 - 1]! Item was added: + ----- Method: CogARMv8Compiler>>jumpLongByteSize (in category 'accessing') ----- + jumpLongByteSize + " Branch/Call ranges. Jump[Cond] can be generated as short as possible. Call/Jump[Cond]Long must be generated + in the same number of bytes irrespective of displacement since their targets may be updated, but they need only + span 16Mb, the maximum size of the code zone. This allows e.g. ARM to use single-word call and jump instructions + for most calls and jumps. CallFull/JumpFull must also be generated in the same number of bytes irrespective of + displacement for the same reason, but they must be able to span the full (32-bit or 64-bit) address space because + they are used to call code in the C runtime, which may be distant from the code zone" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>jumpLongConditionalByteSize (in category 'accessing') ----- + jumpLongConditionalByteSize + ^8! Item was added: + ----- Method: CogARMv8Compiler>>jumpLongTargetBeforeFollowingAddress: (in category 'inline cacheing') ----- + jumpLongTargetBeforeFollowingAddress: mcpc + "C6.2.26 B C6-799" + ^self callTargetFromReturnAddress: mcpc! Item was added: + ----- Method: CogARMv8Compiler>>jumpTargetPCAt: (in category 'disassembly') ----- + jumpTargetPCAt: pc + + | operand word | + "cogit processor disassembleInstructionAt: pc In: objectMemory memory" + word := self instructionAt: pc. + self assert: word >> 26 = 2r10101. + operand := word >> 5 bitAnd: 16r7FFFF. + (operand anyMask: 16r40000) ifTrue: + [operand := operand - 16r80000]. + ^self + cCode: [operand * 4 + pc] + inSmalltalk: [operand * 4 + pc bitAnd: cogit addressSpaceMask]! Item was added: + ----- Method: CogARMv8Compiler>>leafCallStackPointerDelta (in category 'abi') ----- + leafCallStackPointerDelta + "Answer the delta from the stack pointer after a call to the stack pointer + immediately prior to the call. This is used to compute the stack pointer + immediately prior to a call from within a leaf routine, which in turn is used + to capture the c stack pointer to use in trampolines back into the C run-time." + "This might actually be false, since directly after a call, lr, fp and variable registers need be pushed onto the stack. It depends on the implementation of call." + ^0! Item was added: + ----- Method: CogARMv8Compiler>>literal32BeforeFollowingAddress: (in category 'inline cacheing') ----- + literal32BeforeFollowingAddress: followingAddress + "Answer the 32-bit constant loaded by the instruction sequence just before this address: + CmpC32R MoveC32R" + ^self instructionAt: + (self pcRelativeAddressAt: + (self instructionAddressBefore: + ((self instructionIsPCRelativeLoad: (self instructionBeforeAddress: followingAddress)) + ifTrue: [followingAddress] + ifFalse: [followingAddress - 4])))! Item was added: + ----- Method: CogARMv8Compiler>>literalAlignment (in category 'accessing') ----- + literalAlignment + "Answer the required alignment for literals embedded in code." + + ^8! Item was added: + ----- Method: CogARMv8Compiler>>literalBeforeFollowingAddress: (in category 'inline cacheing') ----- + literalBeforeFollowingAddress: followingAddress + "Answer the literal referenced by the instruction immediately preceding followingAddress. + ArithCwR MoveCwR PushCw" + ^objectMemory longAt: + (self pcRelativeAddressAt: + (self instructionAddressBefore: + ((self instructionIsPCRelativeLoad: (self instructionBeforeAddress: followingAddress)) + ifTrue: [followingAddress] + ifFalse: [followingAddress - 4])))! Item was added: + ----- Method: CogARMv8Compiler>>literalLoadInstructionBytes (in category 'accessing') ----- + literalLoadInstructionBytes + "Answer the size of a literal load instruction (which does not include the size of the literal). + With out-of-line literals this is always a single LDR instruction that refers to the literal." + + ^4! Item was added: + ----- Method: CogARMv8Compiler>>literalOpcodeIndex (in category 'generate machine code') ----- + literalOpcodeIndex + "Hack: To know how far away a literal is from its referencing instruction we store + its opcodeIndex, or -1, if as yet unassigned, in the second operand of the literal." + + self assert: opcode = Literal. + ^(operands at: 2) asInteger! Item was added: + ----- Method: CogARMv8Compiler>>literalSize (in category 'generate machine code') ----- + literalSize + "Hack: To handle both 32-bit and 64-bit literals, store the literal's size in a field of the second operand." + + self assert: opcode = Literal. + ^(operands at: 1) "If not set, default to bytesPerOop" + ifNil: [objectMemory bytesPerOop] + ifNotNil: [((operands at: 1) >> 1) bitAnd: 15]! Item was added: + ----- Method: CogARMv8Compiler>>loadLiteralByteSize (in category 'accessing') ----- + loadLiteralByteSize + "Answer the byte size of a MoveCwR opcode's corresponding machine code. + On ARMv8 this is a single instruction pc-relative register load" + ^4! Item was added: + ----- Method: CogARMv8Compiler>>loadPICLiteralByteSize (in category 'accessing') ----- + loadPICLiteralByteSize + "Answer the byte size of a MoveCwR opcode's corresponding machine code + when the argument is a PIC. This is for the self-reference at the end of a + closed PIC. On ARM this is a single instruction pc-relative register load." + ^4! Item was added: + ----- Method: CogARMv8Compiler>>machineCodeAt: (in category 'accessing') ----- + machineCodeAt: anOffset + "read aWord from machineCode, with little endian" + + ^machineCode at: anOffset // 4! Item was added: + ----- Method: CogARMv8Compiler>>machineCodeAt:put: (in category 'accessing') ----- + machineCodeAt: anOffset put: aWord + "add aWord to machineCode, with little endian" + + machineCode at: anOffset // 4 put: aWord! Item was added: + ----- Method: CogARMv8Compiler>>machineCodeBytes (in category 'generate machine code') ----- + machineCodeBytes + "Answer the maximum number of bytes of machine code generated for any abstract instruction. + Likely to be quite different for AARCH64" + ^12! Item was added: + ----- Method: CogARMv8Compiler>>machineCodeWords (in category 'generate machine code') ----- + machineCodeWords + "Answer the maximum number of words of machine code generated for any abstract instruction. + Likely to be quite different for AARCH64" + ^self machineCodeBytes // 4! Item was added: + ----- Method: CogARMv8Compiler>>mapEntryAddress (in category 'generate machine code') ----- + mapEntryAddress + "Typically map entries apply to the end of an instruction, for two reasons: + a) to cope with literals embedded in variable-length instructions, since, e.g. + on x86, the literal typically comes at the end of the instruction. + b) in-line cache detection is based on return addresses, which are typically + to the instruction following a call. + But on ARMv8 we use out-of-line literals so the mapEntryAddress of a literal is simply the instruction's address." + + ^opcode = Literal + ifTrue: [address] + ifFalse: [address + machineCodeSize]! Item was added: + ----- Method: CogARMv8Compiler>>movern:rd: (in category 'generate machine code - support') ----- + movern: srcReg rd: destReg + ^self addrn: srcReg rd: destReg imm: 0 shiftBy12: false! Item was added: + ----- Method: CogARMv8Compiler>>nameForRegister: (in category 'printing') ----- + nameForRegister: reg "" + + | default | + default := super nameForRegister: reg. + ^default last = $? + ifTrue: + [reg = 31 + ifTrue: + ['SP/XZR'] + ifFalse: + [#(LR CArg0Reg CArg1Reg CArg2Reg CArg3Reg) + detect: [:sym| (thisContext method methodClass classPool at: sym) = reg] + ifNone: [default]]] + ifFalse: + [default]! Item was added: + ----- Method: CogARMv8Compiler>>noteFollowingConditionalBranch: (in category 'abstract instructions') ----- + noteFollowingConditionalBranch: branch + "Morph an Overflow/NoOverflow check after a MulOverflow into an efficient + test for overflow, hence avoiding having to set and test the V flag. + MulOverflowRRR generates + mul Rd,Rm,Rn + smulh RISCTempReg,Rm,Rn + cmp RISCTempReg, #0x1 + so it must be followed by an unsigned conditional jump, Above for Overflow, BelowOrEqual for NoOverflow." + + + + (opcode = MulOverflowRRR + and: [branch opcode = JumpOverflow or: [branch opcode = JumpNoOverflow]]) ifTrue: + [branch opcode: (branch opcode = JumpOverflow + ifTrue: [JumpMulOverflow] + ifFalse: [JumpNoMulOverflow])]. + + ^branch! Item was added: + ----- Method: CogARMv8Compiler>>numDCacheFlushOpcodes (in category 'inline cacheing') ----- + numDCacheFlushOpcodes + ^cogit getCodeToDataDelta ~= 0 ifTrue: [15] ifFalse: [0]! Item was added: + ----- Method: CogARMv8Compiler>>numICacheFlushOpcodes (in category 'inline cacheing') ----- + numICacheFlushOpcodes + ^24! Item was added: + ----- Method: CogARMv8Compiler>>numIntRegArgs (in category 'accessing') ----- + numIntRegArgs + "See e.g. http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf + Table 3-1 Register Usage in AArch64 SMC32, HVC32, SMC64, and HVC64 calls" + ^6! Item was added: + ----- Method: CogARMv8Compiler>>numLowLevelLockOpcodes (in category 'multi-threading') ----- + numLowLevelLockOpcodes + + ^14 "12 opcodes in 8.0 LDAXR/STLXR version, plus two words for the vmOwnerLockAddress"! Item was added: + ----- Method: CogARMv8Compiler>>outOfLineLiteralOpcodeLimit (in category 'generate machine code') ----- + outOfLineLiteralOpcodeLimit + "The maximum offset in a LDR (literal) is -2^18 to 2^18-1. + And this is multiplied by 4 to produce the effective address. + This is a huge range; we have no grounds for concern." + ^1 << 18 - 1! Item was added: + ----- Method: CogARMv8Compiler>>outputMachineCodeAt: (in category 'generate machine code') ----- + outputMachineCodeAt: targetAddress + "Override to move machine code a word at a time." + + 0 to: machineCodeSize - 1 by: 4 do: + [:j| + cogit codeLong32At: targetAddress + j put: (machineCode at: j // 4)]! Item was added: + ----- Method: CogARMv8Compiler>>padIfPossibleWithStopsFrom:to: (in category 'generate machine code') ----- + padIfPossibleWithStopsFrom: startAddr to: endAddr + | nullBytes | + nullBytes := (endAddr - startAddr + 1) \\ 4. + self stopsFrom: startAddr to: endAddr - nullBytes. + endAddr - nullBytes + 1 to: endAddr + do: [ :p | cogit codeByteAt: p put: 16rFF]! Item was added: + ----- Method: CogARMv8Compiler>>pcRelativeAddressAt: (in category 'inline cacheing') ----- + pcRelativeAddressAt: mcpc + "Extract the address of the adr rX, offset instruction at address mcpc + C6.2.131 LDR (literal) C6-979" + | instr | + instr := self instructionAt: mcpc. + "cogit processor disassembleInstructionAt: mcpc In: objectMemory memory" + self assert: (self instructionIsPCRelativeLoad: instr). + ^(instr >> 3 bitAnd: 1 << 22 - 4) - (instr >> 2 bitAnd: 1 << 21) + mcpc! Item was added: + ----- Method: CogARMv8Compiler>>printCTR_EL0 (in category 'feature detection') ----- + printCTR_EL0 + + ^String streamContents: + [:s| | ctr_el0 fieldPrinter l1ip | + ctr_el0 := self ctrEl0. + fieldPrinter := [:name :startBit| | field | + s nextPutAll: name; nextPutAll: ', ['; print: startBit + 3; nextPut: $,; print: startBit; nextPutAll: '] log2 words: '. + s print: (field := ctr_el0 >> startBit bitAnd: 15); nextPutAll: ' ('; print: 8 << field; nextPutAll: ' bytes)'; cr]. + s + nextPutAll: 'DIC, bit [29] Instruction cache invalidation requirements for instruction to data coherence. The meaning of this bit is:'; + crtab; + nextPutAll: ((ctr_el0 noMask: 1 << 29) + ifTrue: ['0b0 Instruction cache invalidation to the Point of Unification is required for instruction to data coherence.'] + ifFalse: ['0b1 Instruction cache cleaning to the Point of Unification is not required for instruction to data coherence.']); + cr. + s + nextPutAll: 'IDC, bit [28] Data cache clean requirements for instruction to data coherence. The meaning of this bit is:'; + crtab; + nextPutAll: ((ctr_el0 noMask: 1 << 28) + ifTrue: ['0b0 Data cache clean to the Point of Unification is required for instruction to data coherence, unless CLIDR.LoC == 0b000 or (CLIDR.LoUIS == 0b000 && CLIDR.LoUU == 0b000).'] + ifFalse: ['0b1 Data cache clean to the Point of Unification is not required for instruction to data coherence.']); + cr. + + fieldPrinter + value: 'Cache writeback granule' value: 24; + value: 'Exclusives reservation granule' value: 20; + value: 'DminLine' value: 16; + value: 'IminLine' value: 0. + s + nextPutAll: 'Level 1 instruction cache policy: '; print: (l1ip := ctr_el0 >> 14 bitAnd: 2); space; + nextPutAll: (#( 'VMID aware Physical Index, Physical tag (VPIPT)' + 'ASID-tagged Virtual Index, Virtual Tag (AIVIVT)' + 'Virtual Index, Physical Tag (VIPT)' + 'Physical Index, Physical Tag (PIPT)') at: l1ip + 1); + cr]! Item was added: + ----- Method: CogARMv8Compiler>>prn:imm:shiftBy12: (in category 'generate machine code - support') ----- + prn: baseReg imm: offset shiftBy12: shiftBy12 + "C6.2.211 PRFM (immediate) C6-1136" + + "Unsigned offset, C6-1136" + "This is the only casde we can make use of so far..." + self assert: (offset \\ 8 = 0 + and: [offset / 8 between: 0 and: 1 << 12 - 1]). + ^2r1111100101 << 22 + + (offset << 7 "10 - 3") + + (baseReg << 5) + + 0 "prfop = PLD:L1:KEEP"! Item was added: + ----- Method: CogARMv8Compiler>>pushLinkRegisterByteSize (in category 'accessing') ----- + pushLinkRegisterByteSize + ^4! Item was added: + ----- Method: CogARMv8Compiler>>relocateCallBeforeReturnPC:by: (in category 'inline cacheing') ----- + relocateCallBeforeReturnPC: retpc by: delta + | instr distanceDiv4 | + "C6.2.26 B C6-799 + C6.2.33 BL C6-812" + self assert: delta \\ 4 = 0. + delta ~= 0 ifTrue: + [instr := self instructionBeforeAddress: retpc. + self assert: (self instructionIsImm26BorBL: instr). + + distanceDiv4 := instr bitAnd: 2 << 26 - 1. + distanceDiv4 := distanceDiv4 + (delta // 4). + cogit + codeLong32At: (self instructionAddressBefore: retpc) + put: ((instr bitAnd: 16rFC000000) bitOr: (distanceDiv4 bitAnd: 16r3FFFFFF))] + + "cogit processor disassembleInstructionAt: (self instructionAddressBefore: retpc) In: objectMemory memory"! Item was added: + ----- Method: CogARMv8Compiler>>relocateMethodReferenceBeforeAddress:by: (in category 'inline cacheing') ----- + relocateMethodReferenceBeforeAddress: pc by: delta + "We generate the method address using pc-relative addressing. + Simply check that pc-relative addressing is being used. c.f. + emitMoveCw:intoR:at:" + + self assert: ((self instructionIsADR: (self instructionAt: pc - 4)) "MoveCwR" + or: [self instructionIsADR: (self instructionAt: pc - 8)]) "PushCwR" + + "cogit processor disassembleInstructionAt: (self instructionAddressBefore: pc - 4) In: objectMemory memory" + "cogit processor disassembleInstructionAt: (self instructionAddressBefore: pc) In: objectMemory memory"! Item was added: + ----- Method: CogARMv8Compiler>>rewriteCPICJumpAt:target: (in category 'inline cacheing') ----- + rewriteCPICJumpAt: addressFollowingJump target: jumpTargetAddr + "Rewrite a jump instruction to call a different target. This variant is used to reset the + jumps in the prototype CPIC to suit each use,. + Answer the extent of the code change which is used to compute the range of the icache to flush." + + + + "cogit processor disassembleInstructionAt: addressFollowingJump - 4 In: objectMemory memory" + self rewriteImm19JumpBefore: addressFollowingJump target: jumpTargetAddr! Item was added: + ----- Method: CogARMv8Compiler>>rewriteCallAt:target: (in category 'inline cacheing') ----- + rewriteCallAt: callSiteReturnAddress target: callTargetAddress + "Rewrite a call instruction to call a different target. This variant is used to link PICs + in ceSendMiss et al, and to rewrite cached primitive calls. Answer the extent of + the code change which is used to compute the range of the icache to flush." + + + cogit codeLong32At: callSiteReturnAddress - 4 put: (self bl: callTargetAddress - (callSiteReturnAddress - 4)). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>rewriteImm19JumpBefore:target: (in category 'inline cacheing') ----- + rewriteImm19JumpBefore: followingAddress target: targetAddress + "Rewrite a long jump/call instruction to jump/call to a different target. + Answer the extent of the code change which is used to compute the range of the icache to flush. + C6.2.25 B.cond C6-798" + | mcpc offset instruction instrOpcode | + "cogit processor disassembleInstructionAt: followingAddress - 4 In: objectMemory memory" + mcpc := self instructionAddressBefore: followingAddress. + offset := targetAddress - mcpc. + instruction := self instructionBeforeAddress: followingAddress. + instrOpcode := instruction >> 26. + self assert: instrOpcode = 2r10101. + cogit + codeLong32At: mcpc + put: instrOpcode << 26 + ((offset >>> 2 bitAnd: 1 << 19 - 1) << 5) + (instruction bitAnd: 2r1111). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>rewriteImm26JumpBefore:target: (in category 'inline cacheing') ----- + rewriteImm26JumpBefore: followingAddress target: targetAddress + "Rewrite a long jump/call instruction to jump/call to a different target. + Answer the extent of the code change which is used to compute the range of the icache to flush. + C6.2.26 B C6-799 + C6.2.33 BL C6-812" + | mcpc offset instrOpcode | + "cogit processor disassembleInstructionAt: followingAddress - 4 In: objectMemory memory" + mcpc := self instructionAddressBefore: followingAddress. + offset := targetAddress - mcpc. + instrOpcode := (self instructionBeforeAddress: followingAddress) >> 26. + self assert: (instrOpcode = 2r101 or: [instrOpcode = 2r100101]). + cogit + codeLong32At: mcpc + put: instrOpcode << 26 + (offset >>> 2 bitAnd: 1 << 26 - 1). + ^4! Item was added: + ----- Method: CogARMv8Compiler>>rewriteInlineCacheAt:tag:target: (in category 'inline cacheing') ----- + rewriteInlineCacheAt: callSiteReturnAddress tag: cacheTag target: callTargetAddress + "Rewrite an inline cache to call a different target for a new tag. This variant is used + to link unlinked sends in ceSend:to:numArgs: et al. Answer the extent of the code + change which is used to compute the range of the icache to flush. + N.B. On 64-bit platforms the inline cache tag is only 32-bits wide, hence this code + is very similar to that for ARM32 CogOutOfLineLiteralsARMCompiler." + + + | call callDistance | + (cogit initialized and: [callTargetAddress < cogit minCallAddress]) ifTrue: + [self error: 'linking callsite to invalid address']. + callDistance := (callTargetAddress - (callSiteReturnAddress - 4 "return offset")) signedIntToLong. + self assert: (self isInImmediateJumpRange: callDistance). "we don't support long call updates here" + call := self bl: callDistance. + cogit + codeLong32At: (self instructionAddressBefore: callSiteReturnAddress) put: call; + codeLong32At: (self pcRelativeAddressAt: callSiteReturnAddress - 8) put: cacheTag signedIntToLong. + self assert: (self inlineCacheTagAt: callSiteReturnAddress) signedIntFromLong = cacheTag. + "self cCode: '' + inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 8 to: (self pcRelativeAddressAt: callSiteReturnAddress - 8)]." + ^4! Item was added: + ----- Method: CogARMv8Compiler>>rewriteInlineCacheTag:at: (in category 'inline cacheing') ----- + rewriteInlineCacheTag: cacheTag at: callSiteReturnAddress + "Rewrite an inline cache with a new tag. This variant is used + by the garbage collector. RThis cannot happen in 64-bits as cache tags are guaranteed to be 32-bits or less." + self error: 'should not happen'! Item was added: + ----- Method: CogARMv8Compiler>>rewriteJumpFullAt:target: (in category 'full transfer run-time support') ----- + rewriteJumpFullAt: callSiteReturnAddress target: callTargetAddress + "Rewrite a JumpFull instruction to jump to a different target. This variant is used to rewrite cached primitive calls. + Answer the extent of the code change which is used to compute the range of the icache to flush." + "cogit processor disassembleInstructionAt: callSiteReturnAddress - 8 In: objectMemory memory" + "cogit processor disassembleInstructionAt: callSiteReturnAddress - 4 In: objectMemory memory" + cogit + codeLongAt: (self pcRelativeAddressAt: callSiteReturnAddress - 8) + put: callTargetAddress. + ^0! Item was added: + ----- Method: CogARMv8Compiler>>rewriteJumpLongAt:target: (in category 'inline cacheing') ----- + rewriteJumpLongAt: callSiteReturnAddress target: callTargetAddress + "Rewrite a long jump instruction to jump to a different target. This variant + is used to rewrite cached primitive calls. Answer the extent of the + code change which is used to compute the range of the icache to flush." + + ^self rewriteImm26JumpBefore: callSiteReturnAddress target: callTargetAddress! Item was added: + ----- Method: CogARMv8Compiler>>roundUpToMethodAlignment: (in category 'method zone and entry point alignment') ----- + roundUpToMethodAlignment: numBytes + "Determine the default alignment for the start of a CogMehtod, which in turn + determines the size of the mask used to distinguish the checked and unchecked + entry-points, used to distinguish normal and super sends on method unlinking. + This is implemented here to allow processors with coarse instructions (ARM) to + increase the alignment if required." + "extra parens to placate gdb :-(" + ^numBytes + 15 bitAnd: -16! Item was added: + ----- Method: CogARMv8Compiler>>saveAndRestoreLinkRegAround: (in category 'abi') ----- + saveAndRestoreLinkRegAround: aBlock + "If the processor's ABI includes a link register, generate instructions + to save and restore it around aBlock, which is assumed to generate code." + + | inst | + inst := cogit PushR: LinkReg. + aBlock value. + cogit PopR: LinkReg. + ^inst! Item was added: + ----- Method: CogARMv8Compiler>>saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: (in category 'abi') ----- + saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: aBlock + "Extra7Reg is callee-saved and not live at point of send." + + | inst | + inst := cogit MoveR: LinkReg R: Extra8Reg. + aBlock value. + cogit MoveR: Extra8Reg R: LinkReg! Item was added: + ----- Method: CogARMv8Compiler>>setCtrEl0: (in category 'feature detection') ----- + setCtrEl0: n + + "For want of somewhere to put the variable..." + self class instVarNamed: 'ctrEl0' put: n! Item was added: + ----- Method: CogARMv8Compiler>>setIdISAR0: (in category 'feature detection') ----- + setIdISAR0: n + + "For want of somewhere to put the variable..." + self class instVarNamed: 'idISAR0' put: n! Item was added: + ----- Method: CogARMv8Compiler>>setLiteralOpcodeIndex: (in category 'generate machine code') ----- + setLiteralOpcodeIndex: index + "Hack: To know how far away a literal is from its referencing instruction we store + its opcodeIndex, or -1, if as yet unassigned, in the second operand of the literal." + + self assert: opcode = Literal. + operands at: 2 put: index! Item was added: + ----- Method: CogARMv8Compiler>>setLiteralSize: (in category 'generate machine code - support') ----- + setLiteralSize: sizeOfLiteral + "Set the size field. The only complication is that in Smalltalk (operands at: 1) may be nil." + operands + at: 1 + put: ((operands at: 1) ifNil: [0] ifNotNil: [:operand| operand bitClear: 30]) + + (sizeOfLiteral << 1)! Item was added: + ----- Method: CogARMv8Compiler>>setsConditionCodesFor: (in category 'testing') ----- + setsConditionCodesFor: aConditionalJumpOpcode + "to save Slang from having to be a real compiler (it can't inline switches that return)" + "Answer if the receiver's opcode sets the condition codes correctly for the given conditional jump opcode. + ARMv8 appears not to set condition codes at all in its shift instruction(s), which are aliases for + SBFM (signed bit field move) and C6.2.332 UBFM. + + C6.2.232 SBFM C6-1170 + C6.2.332 UBFM C6-1351" + + ^false "All cases below answer false, so..." + "^opcode caseOf: + { [ArithmeticShiftRightCqR] -> [false]. + [ArithmeticShiftRightRR] -> [false]. + [LogicalShiftLeftCqR] -> [false]. + [LogicalShiftLeftRR] -> [false]. + [LogicalShiftRightCqR] -> [false]. + [XorRR] -> [false]. + [ClzRR] -> [false] + } + otherwise: [self halt: 'unhandled opcode in setsConditionCodesFor:'. false]"! Item was added: + ----- Method: CogARMv8Compiler>>sizePCDependentInstructionAt: (in category 'generate machine code') ----- + sizePCDependentInstructionAt: eventualAbsoluteAddress + "Size a jump and set its address. The target may be another instruction + or an absolute address. On entry the address inst var holds our virtual + address. On exit address is set to eventualAbsoluteAddress, which is + where this instruction will be output. The span of a jump to a following + instruction is therefore between that instruction's address and this + instruction's address ((which are both still their virtual addresses), but the + span of a jump to a preceding instruction or to an absolute address is + between that instruction's address (which by now is its eventual absolute + address) or absolute address and eventualAbsoluteAddress. + + ARMv8 is simple; the 26-bit call/jump range (for a signed 28 bit extent, +/- 128Mb) and + 19 bit conditional branch range (for a signed 21 bit extent, +/- 1Mb) means no short + jumps. This routine only has to determine the targets of jumps, not determine sizes. + + This version also deals with out-of-line literals. If this is the real literal, + update the stand-in in literalsManager with the address (because instructions + referring to the literal are referring to the stand-in). If this is annotated with + IsObjectReference transfer the annotation to the stand-in, whence it will be + transferred to the real literal, simplifying update of literals." + + opcode = AlignmentNops ifTrue: + [| alignment | + address := eventualAbsoluteAddress. + alignment := operands at: 0. + ^machineCodeSize := (eventualAbsoluteAddress + (alignment - 1) bitAnd: alignment negated) + - eventualAbsoluteAddress]. + self assert: (self isJump or: [opcode = Call or: [opcode = CallFull + or: [dependent notNil and: [dependent opcode = Literal]]]]). + self isJump ifTrue: [self resolveJumpTarget]. + address := eventualAbsoluteAddress. + (dependent notNil and: [dependent opcode = Literal]) ifTrue: + [opcode = Literal ifTrue: + [dependent address: address]. + annotation = cogit getIsObjectReference ifTrue: + [dependent annotation: annotation. + annotation := nil]]. + ^machineCodeSize := maxSize! Item was added: + ----- Method: CogARMv8Compiler>>st:rn:rt:imm:shiftBy12: (in category 'generate machine code - support') ----- + st: unitSizeLog2MinusOne rn: baseReg rt: targetReg imm: offset shiftBy12: shiftBy12 + "C6.2.273 STR (immediate) C6-1239 + C6.2.275 STRB (immediate) C6-1244" + + | unitSize | + unitSize := 1 << unitSizeLog2MinusOne. + self deny: SP = targetReg. + self deny: baseReg = targetReg. + "Unsigned offset, C6-1240" + (offset \\ unitSize = 0 + and: [offset / unitSize between: 0 and: 1 << 12 - 1]) ifTrue: + [^unitSizeLog2MinusOne << 30 + + (2r11100100 << 22) + + (offset << (10 - unitSizeLog2MinusOne)) + + (baseReg << 5) + + targetReg]. + self assert: (offset between: -256 and: 255). + ^unitSizeLog2MinusOne << 30 + + (2r111000000 << 21) + + ((offset bitAnd: 511) << 12) + + (baseReg << 5) + + targetReg! Item was added: + ----- Method: CogARMv8Compiler>>stop (in category 'encoding') ----- + stop + "generate a HLT; C6.2.92 Arm ARM" + + ^2r11010100010000000000000000000000 "16rD4400000"! Item was added: + ----- Method: CogARMv8Compiler>>stopsFrom:to: (in category 'generate machine code - support') ----- + stopsFrom: startAddr to: endAddr + self assert: endAddr - startAddr + 1 \\ 4 = 0. + startAddr to: endAddr by: 4 do: + [:addr | cogit codeLong32At: addr put: self stop]! Item was added: + ----- Method: CogARMv8Compiler>>storeLiteral32:beforeFollowingAddress: (in category 'inline cacheing') ----- + storeLiteral32: literal beforeFollowingAddress: followingAddress + "Rewrite the 32-bit literal in the instruction immediately preceding followingAddress." + cogit + codeLong32At: + (self pcRelativeAddressAt: + (self instructionAddressBefore: + ((self instructionIsPCRelativeLoad: (self instructionBeforeAddress: followingAddress)) + ifTrue: [followingAddress] + ifFalse: [followingAddress - 4]))) + put: literal! Item was added: + ----- Method: CogARMv8Compiler>>storeLiteral:beforeFollowingAddress: (in category 'inline cacheing') ----- + storeLiteral: literal beforeFollowingAddress: followingAddress + "Rewrite the literal in the instruction immediately preceding followingAddress." + cogit + codeLongAt: + (self pcRelativeAddressAt: + (self instructionAddressBefore: + ((self instructionIsPCRelativeLoad: (self instructionBeforeAddress: followingAddress)) + ifTrue: [followingAddress] + ifFalse: [followingAddress - 4]))) + put: literal! Item was added: + ----- Method: CogARMv8Compiler>>usesNativeSPReg (in category 'testing') ----- + usesNativeSPReg + "Answer if the code model implemented by the receiver uses the native stack pointer for SPReg. + Because ARMv8 mandates 16-bit stack pointer alignment when the SA0 bit is set in SCTLR_EL1, + and that this choice is common and immutable on typical ARMv8 OS's, we do not use the native + stack pointer in Smalltalk machine code." + ^false! Item was added: + ----- Method: CogARMv8Compiler>>usesOutOfLineLiteral (in category 'testing') ----- + usesOutOfLineLiteral + "Answer if the receiver uses an out-of-line literal. Needs only + to work for the opcodes created with gen:literal:operand: et al." + + opcode + caseOf: { + [CallFull] -> [^true]. + [JumpFull] -> [^true]. + "Arithmetic" + [AddCqR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|false] ifFalse: [true]]. + [AddCqRR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|false] ifFalse: [true]]. + [SubCqR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|false] ifFalse: [true]]. + [CmpCqR] -> [^self isPossiblyShiftableNegatableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:ign|false] ifFalse: [true]]. + [LoadEffectiveAddressMwrR] + -> [^self isPossiblyShiftableImm12: (operands at: 0) signedIntFromLong64 + ifTrue: [:shift12|false] ifFalse:[true]]. + [AndCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|false] ifFalse:[true]]. + [AndCqRR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|false] ifFalse:[true]]. + [OrCqRR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|false] ifFalse:[true]]. + [OrCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|false] ifFalse:[true]]. + [TstCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|false] ifFalse:[true]]. + [XorCqR] -> [^self isImmNImmSImmREncodableBitmask: (operands at: 0) ifTrue: [:n :imms :immr|false] ifFalse:[true]]. + [AddCwR] -> [^true]. + [AndCwR] -> [^true]. + [CmpCwR] -> [^true]. + [CmpC32R] -> [^true]. + [OrCwR] -> [^true]. + [SubCwR] -> [^true]. + [XorCwR] -> [^true]. + "Data Movement" + [MoveCqR] -> [self isPossiblyShiftableImm12: (operands at: 0) + ifTrue: [:shift12| ^false] ifFalse:[]. + ^self isImmNImmSImmREncodableBitmask: (operands at: 0) + ifTrue: [:n :imms :immr|false] ifFalse: [true]]. + [MoveC32R] -> [^true]. + [MoveCwR] -> [^(self inCurrentCompilation: (operands at: 0)) not]. + [MoveAwR] -> [^(self isAddressRelativeToVarBase: (operands at: 0)) not]. + [MoveRAw] -> [^(self isAddressRelativeToVarBase: (operands at: 1)) not]. + [MoveAbR] -> [^(self isAddressRelativeToVarBase: (operands at: 0)) not]. + [MoveRAb] -> [^(self isAddressRelativeToVarBase: (operands at: 1)) not]. + [MoveMwrR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|false] ifFalse:[true]]. + [MoveRMwr] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|false] ifFalse:[true]]. + [MoveMbrR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|false] ifFalse:[true]]. + [MoveRMbr] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|false] ifFalse:[true]]. + [MoveM16rR] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 0) ifTrue: [:shift12|false] ifFalse:[true]]. + [MoveRM16r] -> [^self isPossiblyShiftableImm12orImm9: (operands at: 1) ifTrue: [:shift12|false] ifFalse:[true]]. + [MoveRdM64r] -> [^(self isUnsigned12BitMultipleOf8: (operands at: 1)) not]. + [MoveM64rRd] -> [^(self isUnsigned12BitMultipleOf8: (operands at: 0)) not]. + [PushCw] -> [^(self inCurrentCompilation: (operands at: 0)) not]. + [PushCq] -> [^((operands at: 0) between: -256 and: 255) not]. + [PrefetchAw] -> [^(self isAddressRelativeToVarBase: (operands at: 0)) not]. + } + otherwise: [self assert: false]. + ^false "to keep C compiler quiet" + ! Item was added: + ----- Method: CogARMv8Compiler>>wantsNearAddressFor: (in category 'simulation') ----- + wantsNearAddressFor: anObject + "A hack hook to allow ARM to override the simulated address for the short-cut trampolines" + + ^anObject == #ceShortCutTraceLinkedSend: + or: [anObject == #ceShortCutTraceBlockActivation: + or: [anObject == #ceShortCutTraceStore:]]! Item was added: + ----- Method: CogARMv8Compiler>>zoneCallsAreRelative (in category 'inline cacheing') ----- + zoneCallsAreRelative + "Answer if Call and JumpLong are relative and hence need to take the caller's + relocation delta into account during code compaction, rather than just the + callee's delta." + ^true! Item was added: + CogARMv8Compiler subclass: #CogARMv8CompilerForTests + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: CogARMv8CompilerForTests class>>dataRegistersWithAccessorsGiven:do: (in category 'accessing') ----- + dataRegistersWithAccessorsGiven: aProcessorSimulator do: aTrinaryBlock + "We can't use RISCTempReg, because some opcodes may be encoded as multiple instructions using RISCTempReg." + (0 to: 31) withIndexDo: + [:reg :i| + (self isRISCTempRegister: reg) ifFalse: + [aTrinaryBlock + value: reg + value: (aProcessorSimulator registerStateGetters at: i) + value: (aProcessorSimulator registerStateSetters at: i)]]! Item was added: + ----- Method: CogARMv8CompilerForTests class>>isRISCTempRegister: (in category 'testing') ----- + isRISCTempRegister: reg + "For tests to filter-out bogus values left in the RISCTempRegister, if any." + ^reg = R28! Item was added: + ----- Method: CogARMv8CompilerForTests>>concretizeAt: (in category 'generating machine code') ----- + concretizeAt: actualAddress + "Override to check maxSize and machineCodeSize" + + | maxAddress nextAddress | + maxSize ifNil: [maxSize := self computeMaximumSize]. + maxAddress := actualAddress + maxSize. + nextAddress := super concretizeAt: actualAddress. + self assert: (maxSize notNil + and: [self isPCDependent + ifTrue: [maxAddress >= nextAddress] + ifFalse: [maxAddress = nextAddress]]). + ^nextAddress! Item was added: + AbstractInstructionTests subclass: #CogARMv8CompilerTests + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-Tests'! Item was added: + ----- Method: CogARMv8CompilerTests>>concreteCompilerClass (in category 'accessing') ----- + concreteCompilerClass + ^CogARMv8CompilerForTests! Item was added: + ----- Method: CogARMv8CompilerTests>>isaName (in category 'accessing') ----- + isaName + ^#ARMv8! Item was added: + ----- Method: CogARMv8CompilerTests>>processor (in category 'accessing') ----- + processor + processor ifNil: + [processor := GdbARMv8Alien new]. + ^processor! Item was added: + OutOfLineLiteralsManager subclass: #OutOfLineLiteralsManagerFor64Bits + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'VMMaker-JIT'! + + !OutOfLineLiteralsManagerFor64Bits commentStamp: 'eem 12/17/2019 12:42' prior: 0! + OutOfLineLiteralsManagerFor64Bits specializes OutOfLineLiteralsManager to segregate 64-bit and 32-bit literals to achieve correct alignment and more compact code.! Item was added: + ----- Method: OutOfLineLiteralsManagerFor64Bits class>>translationClasses (in category 'translation') ----- + translationClasses + ^{superclass. self}! Item was added: + ----- Method: OutOfLineLiteralsManagerFor64Bits>>checkLiteral32:forInstruction: (in category 'compile abstract instructions') ----- + checkLiteral32: literal forInstruction: anInstruction + + + anInstruction usesOutOfLineLiteral ifTrue: + [anInstruction dependent: (self locateLiteral: literal size: 4)]. + ^anInstruction! Item was added: + ----- Method: OutOfLineLiteralsManagerFor64Bits>>checkLiteral:forInstruction: (in category 'compile abstract instructions') ----- + checkLiteral: literal forInstruction: anInstruction + + + anInstruction usesOutOfLineLiteral ifTrue: + [anInstruction dependent: (self locateLiteral: literal size: objectMemory bytesPerOop)]. + ^anInstruction! Item was added: + ----- Method: OutOfLineLiteralsManagerFor64Bits>>dumpLiterals: (in category 'compile abstract instructions') ----- + dumpLiterals: generateBranchAround + "Output all pending literal instructions, making the originals dependents on the generated ones + so that a later pass will copy the address of each generated literal inst to its original in literals, + and hence allow the instruction using the literal to compute the correct address. + + Override to segregate 64-bit and 32-bit literals" + | jump litInst | + + generateBranchAround ifTrue: + [jump := cogit Jump: 0]. + "Align and dump the 64-bit literals. + We may waste a slot here we could fill with a 32-bit literal, but for now, KISS..." + cogit backEnd literalAlignment > cogit backEnd codeGranularity ifTrue: + [cogit gen: AlignmentNops operand: cogit backEnd literalAlignment]. + lastDumpedLiteralIndex to: nextLiteralIndex - 1 do: + [:i| + litInst := self literalInstructionAt: i. + litInst literalSize = 8 ifTrue: + [(cogit gen: Literal operand: (litInst operands at: 0)) + dependent: litInst; + setLiteralSize: 8. + litInst setLiteralOpcodeIndex: cogit getOpcodeIndex]]. + "Now dump the 32-bit literals" + lastDumpedLiteralIndex to: nextLiteralIndex - 1 do: + [:i| + litInst := self literalInstructionAt: i. + litInst literalSize = 4 ifTrue: + [(cogit gen: Literal operand: (litInst operands at: 0)) + dependent: litInst; + setLiteralSize: 4. + litInst setLiteralOpcodeIndex: cogit getOpcodeIndex]]. + generateBranchAround ifTrue: + [jump jmpTarget: cogit Label]. + + firstOpcodeIndex := cogit getOpcodeIndex. + lastDumpedLiteralIndex := nextLiteralIndex! Item was added: + ----- Method: OutOfLineLiteralsManagerFor64Bits>>locateLiteral: (in category 'compile abstract instructions') ----- + locateLiteral: aLiteral + self shouldNotImplement! Item was added: + ----- Method: OutOfLineLiteralsManagerFor64Bits>>locateLiteral:size: (in category 'compile abstract instructions') ----- + locateLiteral: aLiteral size: litSize + "Search for a Literal instruction that is in-range and answer it. Otherwise + allocate a new sharable Literal instruction for the literal and answer it." + + + | litInst | + + 0 to: nextLiteralIndex - 1 do: + [:i| + litInst := self literalInstructionAt: i. + (litInst literalSize = litSize + and: [(litInst operands at: 0) = aLiteral + and: [litInst isSharable + and: [self literalInstructionInRange: litInst]]]) ifTrue: + [^litInst]]. + nextLiteralIndex >= literalsSize ifTrue: + [self allocateLiterals: literalsSize + 8]. + litInst := self literalInstructionAt: nextLiteralIndex. + litInst + initializeSharableLiteral: aLiteral; + setLiteralSize: litSize. + nextLiteralIndex := nextLiteralIndex + 1. + "Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal)" + firstOpcodeIndex > cogit getOpcodeIndex ifTrue: + [firstOpcodeIndex := cogit getOpcodeIndex - 1]. + ^litInst! From noreply at github.com Fri Jan 8 07:09:43 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 23:09:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 70f88d: CogVM source as per VMMaker.oscog-eem.2930 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 70f88d58cc66f7d9d3297f7ef9724979df270f4a https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/70f88d58cc66f7d9d3297f7ef9724979df270f4a Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2930 Time to bring the ARMv8 work back into Cog/VMMaker under full MIT. x86/x86_64 Cog MTVM: Add the code to handle the lock already having the right value to x86/x86_64 generateLowLevelTryLock:. Always use a REX prefix for SETE. From stes at telenet.be Fri Jan 8 07:11:38 2021 From: stes at telenet.be (stes@PANDORA.BE) Date: Fri, 8 Jan 2021 08:11:38 +0100 (CET) Subject: [Vm-dev] getReturnAddress fix Message-ID: <433739470.73276289.1610089898547.JavaMail.zimbra@telenet.be> Hello, the current GIT sources have an issue in the spur64src/vm/cogit.c file. The cogit.c file includes cogitX64SysV.c for me. The following fixes compilation for me: bash-4.4$ git diff diff --git a/spur64src/vm/cogitX64SysV.c b/spur64src/vm/cogitX64SysV.c index 3e9ed64be..2c18e045f 100644 --- a/spur64src/vm/cogitX64SysV.c +++ b/spur64src/vm/cogitX64SysV.c @@ -11,6 +11,7 @@ char *__cogitBuildInfo = __buildInfo; #include #include "sqConfig.h" #include "sqMemoryAccess.h" +#include "sqPlatformSpecific.h" #include "sqCogStackAlignment.h" #include "dispdbg.h" #include "cogmethod.h" So I think there is a missing #include of sqPlatformSpecific.h. But there may be alternative solutions... From commits at source.squeak.org Fri Jan 8 07:22:10 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 8 Jan 2021 07:22:10 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2931.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2931.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2931 Author: eem Time: 7 January 2021, 11:21:34.239308 pm UUID: c36d665e-3e2a-4b3c-aeef-d53a86f8a660 Ancestors: VMMaker.oscog-eem.2930 Have the Cogits include sqPlatformSpecific.h for solaris. =============== Diff against VMMaker.oscog-eem.2930 =============== Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" "N.B. We *do not* include sq.h; it pulls in conflicting definitions now that sqVirtualMachine.h declares cointerp's functions, and declares some of them inaccurately for histrical reasons. We pull in CoInterpreter's api via cointerp.h which is accurate." aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" addHeaderFile:''; addHeaderFile:''; addHeaderFile:''; addHeaderFile:'"sqConfig.h"'; + addHeaderFile:'"sqPlatformSpecific.h"'; "e.g. solaris overrides things for sqCogStackAlignment.h" addHeaderFile:'"sqMemoryAccess.h"'; addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner declareC: '#if COGMTVM\usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t)\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! From commits at source.squeak.org Fri Jan 8 07:32:27 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 8 Jan 2021 07:32:27 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2932.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2932.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2932 Author: eem Time: 7 January 2021, 11:32:18.447764 pm UUID: 76d9b938-e297-44f0-a9e9-2420252f3184 Ancestors: VMMaker.oscog-eem.2931 Harumph; sqMemoryAccess.h& sqPlatformSpecific.h must be included in that order :-( =============== Diff against VMMaker.oscog-eem.2931 =============== Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" "N.B. We *do not* include sq.h; it pulls in conflicting definitions now that sqVirtualMachine.h declares cointerp's functions, and declares some of them inaccurately for histrical reasons. We pull in CoInterpreter's api via cointerp.h which is accurate." aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" addHeaderFile:''; addHeaderFile:''; addHeaderFile:''; addHeaderFile:'"sqConfig.h"'; - addHeaderFile:'"sqPlatformSpecific.h"'; "e.g. solaris overrides things for sqCogStackAlignment.h" addHeaderFile:'"sqMemoryAccess.h"'; + addHeaderFile:'"sqPlatformSpecific.h"'; "e.g. solaris overrides things for sqCogStackAlignment.h" addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner declareC: '#if COGMTVM\usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t)\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! From noreply at github.com Fri Jan 8 07:37:38 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 07 Jan 2021 23:37:38 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 2df05d: CogVM source as per VMMaker.oscog-eem.2931 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 2df05d0d8fe29be67ee5855a0e22fdb53ed422c7 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2df05d0d8fe29be67ee5855a0e22fdb53ed422c7 Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M src/vm/cogit.h M src/vm/cogitARMv5.c M src/vm/cogitIA32.c M src/vm/cogitMIPSEL.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2931 Have the Cogits include sqPlatformSpecific.h for solaris. Commit: a0ae387a629fe3d302efae9154a1f4dd11595ec2 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a0ae387a629fe3d302efae9154a1f4dd11595ec2 Author: Eliot Miranda Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M src/vm/cogit.h M src/vm/cogitARMv5.c M src/vm/cogitIA32.c M src/vm/cogitMIPSEL.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2932 Harumph; sqMemoryAccess.h & sqPlatformSpecific.h must be included in that order :-( Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/70f88d58cc66...a0ae387a629f From no-reply at appveyor.com Fri Jan 8 07:47:25 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jan 2021 07:47:25 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2356 Message-ID: <20210108074725.1.CD7B353FA195790F@appveyor.com> An HTML attachment was scrubbed... URL: From stes at telenet.be Fri Jan 8 08:06:55 2021 From: stes at telenet.be (stes@PANDORA.BE) Date: Fri, 8 Jan 2021 09:06:55 +0100 (CET) Subject: [Vm-dev] getReturnAddress fix In-Reply-To: <433739470.73276289.1610089898547.JavaMail.zimbra@telenet.be> References: <433739470.73276289.1610089898547.JavaMail.zimbra@telenet.be> Message-ID: <313764195.73476488.1610093215583.JavaMail.zimbra@telenet.be> It is working now for me, seems fixed in CoInterpreter VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf ----- Op 8 jan 2021 om 8:11 schreef stes stes at telenet.be: > Hello, the current GIT sources have an issue in the spur64src/vm/cogit.c file. > > The cogit.c file includes cogitX64SysV.c for me. > > The following fixes compilation for me: > > bash-4.4$ git diff > diff --git a/spur64src/vm/cogitX64SysV.c b/spur64src/vm/cogitX64SysV.c > index 3e9ed64be..2c18e045f 100644 > --- a/spur64src/vm/cogitX64SysV.c > +++ b/spur64src/vm/cogitX64SysV.c > @@ -11,6 +11,7 @@ char *__cogitBuildInfo = __buildInfo; > #include > #include "sqConfig.h" > #include "sqMemoryAccess.h" > +#include "sqPlatformSpecific.h" > #include "sqCogStackAlignment.h" > #include "dispdbg.h" > #include "cogmethod.h" > > > So I think there is a missing #include of sqPlatformSpecific.h. > > But there may be alternative solutions... From no-reply at appveyor.com Fri Jan 8 08:23:44 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jan 2021 08:23:44 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2357 Message-ID: <20210108082344.1.1F283D571C47A098@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Sat Jan 9 03:51:25 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 08 Jan 2021 19:51:25 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a7bbe8: Bochs CPU simulator plugins: Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a7bbe8aa86549f78bab189ba75ea9a90e65d5092 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a7bbe8aa86549f78bab189ba75ea9a90e65d5092 Author: Eliot Miranda Date: 2021-01-08 (Fri, 08 Jan 2021) Changed paths: M platforms/Cross/plugins/BochsIA32Plugin/sqBochsIA32Plugin.cpp M platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp Log Message: ----------- Bochs CPU simulator plugins: Bochs caches flags internalls. Must force the flags to an externally visible state for explicit flag manipulation in the simulation of compare-and-swap to work properly. [ci skip] From commits at source.squeak.org Sat Jan 9 20:57:11 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 9 Jan 2021 20:57:11 0000 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.48.mcz Message-ID: David T. Lewis uploaded a new version of ImageFormat to project VM Maker: http://source.squeak.org/VMMaker/ImageFormat-dtl.48.mcz ==================== Summary ==================== Name: ImageFormat-dtl.48 Author: dtl Time: 9 January 2021, 3:57:11.202896 pm UUID: 68bd5259-64ad-4c49-b8e9-cb296c94beea Ancestors: ImageFormat-dtl.47 Update ImageFileHeader to support Cog/Spur image headers for 32-bit and 64-bit images. Update test tests to match current header formats. Tests are changed because previous implementations were written prior to availability of 64-bit Cog and Spur, this brings tests and implementation up to date. =============== Diff against ImageFormat-dtl.47 =============== Item was changed: ImageFileHeader subclass: #CogImageFileHeader + instanceVariableNames: 'desiredNumStackPages unknownShortOrCodeSizeInKs desiredEdenBytes maxExtSemTabSizeSet the2ndUnknownShort firstSegmentBytes bytesLeftInOldSpace' - instanceVariableNames: 'desiredNumStackPages unknownShortOrCodeSizeInKs desiredEdenBytes maxExtSemTabSizeSet' classVariableNames: '' poolDictionaries: '' category: 'ImageFormat-Header'! !CogImageFileHeader commentStamp: 'dtl 10/31/2012 20:23' prior: 0! CogImageFileHeader is an extension of ImageFileHeader with additional fields that are used by Cog and Stack VMs. Some of the additional fields are encoded as short short integers, which are 16 bits when the header word size is 32, and 32 bits when the header word size is 64. All current Cog VMs use 32 bit word size with 16 bit short integer fields.! Item was changed: ----- Method: CogImageFileHeader>>fromEntryStream: (in category 'reading') ----- fromEntryStream: streamOfHeaderStateObjects super fromEntryStream: streamOfHeaderStateObjects. desiredNumStackPages := streamOfHeaderStateObjects next. unknownShortOrCodeSizeInKs := streamOfHeaderStateObjects next. desiredEdenBytes := streamOfHeaderStateObjects next. maxExtSemTabSizeSet := streamOfHeaderStateObjects next. + the2ndUnknownShort := streamOfHeaderStateObjects next. + firstSegmentBytes := streamOfHeaderStateObjects next. + bytesLeftInOldSpace := streamOfHeaderStateObjects next. ! Item was added: + ----- Method: CogImageFileHeader>>packedLongSize (in category 'writing') ----- + packedLongSize + "Standard interpreter VM writes integers to the file header as 64 bits for + a 64 bit image or 32 bits for a 32 bit image. Cog/Spur VMs use 32 bits + where possible, otherwise 64 bits for long values on a 64 bit system." + + ^ 4! Item was changed: ----- Method: CogImageFileHeader>>readFieldsFrom:startingAt:headerWordSize:littleEndian:into: (in category 'reading') ----- readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection "Read data fields and answer number of bytes read" | remainder bytesRead | bytesRead := super readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection. + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "desiredNumStackPages" + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "unknownShortOrCodeSizeInKs" + aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "desiredEdenBytes" + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "maxExtSemTabSizeSet" + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "the2ndUnknownShort" + aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "firstSegmentBytes" + aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "bytesLeftInOldSpace" + self nextNumber: 2 from: aStream littleEndian: littleEndian. - aCollection add: (self nextNumber: headerWordSize / 2 from: aStream littleEndian: littleEndian). "desiredNumStackPages" - aCollection add: (self nextNumber: headerWordSize / 2 from: aStream littleEndian: littleEndian). "unknownShortOrCodeSizeInKs" - aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "desiredEdenBytes" - aCollection add: (self nextNumber: headerWordSize / 2 from: aStream littleEndian: littleEndian). "maxExtSemTabSizeSet" - self nextNumber: headerWordSize / 2 from: aStream littleEndian: littleEndian. remainder := headerSize - (12 * imageFormat wordSize). self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" ^3 * imageFormat wordSize + bytesRead. ! Item was added: + ----- Method: CogImageFileHeader>>writeFieldsTo:littleEndian: (in category 'writing') ----- + writeFieldsTo: aStream littleEndian: littleEnder + "Write data fields and answer number of bytes written" + + | bytesWritten | + bytesWritten := super writeFieldsTo: aStream littleEndian: littleEnder. + self nextNumber: 2 put: desiredNumStackPages to: aStream littleEndian: littleEnder. + self nextNumber: 2 put: unknownShortOrCodeSizeInKs to: aStream littleEndian: littleEnder. + self nextNumber: 4 put: desiredEdenBytes to: aStream littleEndian: littleEnder. + self nextNumber: 2 put: maxExtSemTabSizeSet to: aStream littleEndian: littleEnder. + self nextNumber: 2 put: (the2ndUnknownShort ifNil: [0]) to: aStream littleEndian: littleEnder. + self nextNumber: 4 put: (firstSegmentBytes ifNil: [0]) to: aStream littleEndian: littleEnder. + self nextNumber: 4 put: (bytesLeftInOldSpace ifNil: [0]) to: aStream littleEndian: littleEnder. + ^20 + bytesWritten. + ! Item was removed: - ----- Method: CogImageFileHeader>>writeFieldsTo:littleEndian:headerWordSize: (in category 'writing') ----- - writeFieldsTo: aStream littleEndian: littleEnder headerWordSize: headerWordSize - "Write data fields and answer number of bytes written" - - | bytesWritten | - bytesWritten := super writeFieldsTo: aStream littleEndian: littleEnder headerWordSize: headerWordSize. - self nextNumber: headerWordSize / 2 put: desiredNumStackPages to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize / 2 put: unknownShortOrCodeSizeInKs to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: desiredEdenBytes to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize / 2 put: maxExtSemTabSizeSet to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize / 2 put: 0 to: aStream littleEndian: littleEnder. - ^3 * imageFormat wordSize + bytesWritten. - ! Item was changed: ----- Method: ImageFileHeader>>nextNumber:put:to:littleEndian: (in category 'writing') ----- nextNumber: n put: v to: aStream littleEndian: littleEnder littleEnder + ifTrue: [aStream nextLittleEndianNumber: n put: v] + ifFalse: [aStream nextNumber: n put: v]. + ^ n.! - ifTrue: [^aStream nextLittleEndianNumber: n put: v] - ifFalse: [^aStream nextNumber: n put: v]! Item was added: + ----- Method: ImageFileHeader>>packedLongSize (in category 'writing') ----- + packedLongSize + "Standard interpreter VM writes integers to the file header as 64 bits for + a 64 bit image or 32 bits for a 32 bit image. Cog/Spur VMs use 32 bits + where possible, otherwise 64 bits for long values on a 64 bit system." + + ^ imageFormat wordSize! Item was changed: ----- Method: ImageFileHeader>>readFieldsFrom:startingAt:headerWordSize:littleEndian:into: (in category 'reading') ----- readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection "Read data fields and answer number of bytes read" | remainder screenSizeWord | headerSize := self nextNumber: headerWordSize from: aStream littleEndian: littleEndian. aCollection add: headerSize. + aCollection add: ( self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "imageBytes" + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "startOfMemory" + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "specialObjectsOop" + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "lastHash" + screenSizeWord := self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian. - aCollection add: ( self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "imageBytes" - aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "startOfMemory" - aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "specialObjectsOop" - aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "lastHash" - screenSizeWord := self nextNumber: headerWordSize from: aStream littleEndian: littleEndian. aCollection add: ((screenSizeWord >> 16) @ (screenSizeWord bitAnd: 16rFFFF)). + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "imageHeaderFlags" - aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "imageHeaderFlags" aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "extraVMMemory" remainder := headerSize - (9 * imageFormat wordSize). self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" ^9 * imageFormat wordSize. ! Item was changed: ----- Method: ImageFileHeader>>readImageVersionFrom:startingAt: (in category 'reading') ----- readImageVersionFrom: aStream startingAt: imageOffset "Look for image format in the next 4 or 8 bytes and set imageFormat. Answer true if the header is written in little endian format." (aStream nextNumber: 4) caseOf: { [ 16r00001966 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. ^false ] . [ 16r66190000 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. ^true ] . [ 16r00001968 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. ^false ] . [ 16r68190000 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. ^true ] . [ 16r00001969 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. ^false ] . [ 16r69190000 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. ^true ] . [ 16r00001979 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. ^false ] . [ 16r79190000 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. ^true ] . + [ 16rA0090100 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. aStream next: 4. ^true ] . "format number in 64 bit integer" - [ 16rA0090100 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. aStream next: 4. ^true ] . [ 16rA2090100 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. aStream next: 4. ^true ] . [ 16rA3090100 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. aStream next: 4. ^true ] . + [ 16rB3090100 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. ^true ] . "Cog/Spur always puts format number in first 32 bits" + [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. ^false ] . + [ 16rB5090100 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. ^true ] . + [ 16r000109B5 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. ^false ] . - [ 16rB3090100 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. aStream next: 4. ^true ] . - [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. aStream next: 4. ^false ] . - [ 16rB5090100 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. aStream next: 4. ^true ] . - [ 16r000109B5 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. aStream next: 4. ^false ] . [ 16r00000000 ] -> [ "Standard interpreter VM puts the format number in the first 64 bits for a 64 bit image, so the leading 4 bytes are zero in this case. Cog/Spur VMs put the format number in the first 32 bits for both 32 and 64 bit images." (aStream nextNumber: 4) caseOf: { [ 16r000109A0 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. ^false ] . [ 16r000109A2 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. ^false ] . + [ 16r000109A3 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. ^false ] - [ 16r000109A3 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. ^false ] . - [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. ^false ] } otherwise: [self error: self asString , ' unrecognized format number'] ] } otherwise: [self error: self asString , ' unrecognized format number'] "ImageFormat versionNumberByteArrays do: [:e | Transcript cr; show: e printString , ': ', (ImageFormat fromBytes: e) description] #[0 0 25 102]: a 32-bit image with no closure support and no native platform float word order requirement (6502) #[102 25 0 0]: a 32-bit image with no closure support and no native platform float word order requirement (6502) #[0 0 25 104]: a 32-bit image with closure support and no native platform float word order requirement (6504) #[104 25 0 0]: a 32-bit image with closure support and no native platform float word order requirement (6504) #[0 0 0 0 0 1 9 160]: a 64-bit image with no closure support and no native platform float word order requirement (68000) #[160 9 1 0 0 0 0 0]: a 64-bit image with no closure support and no native platform float word order requirement (68000) #[0 0 0 0 0 1 9 162]: a 64-bit image with closure support and no native platform float word order requirement (68002) #[162 9 1 0 0 0 0 0]: a 64-bit image with closure support and no native platform float word order requirement (68002) #[0 0 25 105]: a 32-bit image with closure support and float words stored in native platform order (6505) #[105 25 0 0]: a 32-bit image with closure support and float words stored in native platform order (6505) #[0 0 0 0 0 1 9 163]: a 64-bit image with closure support and float words stored in native platform order (68003) #[163 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order (68003) #[0 0 25 121]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521) #[121 25 0 0]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521) #[0 0 0 0 0 1 9 179]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019) #[179 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019) #[0 0 0 0 0 1 9 181]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021) #[181 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021) " ! Item was added: + ----- Method: ImageFileHeader>>writeFieldsTo:littleEndian: (in category 'writing') ----- + writeFieldsTo: aStream littleEndian: littleEnder + "Write data fields and answer number of bytes written" + + | bytesWritten | + bytesWritten := + self nextNumber: self packedLongSize put: imageFormat asInteger to: aStream littleEndian: littleEnder. + bytesWritten := bytesWritten + + (self nextNumber: self packedLongSize put: headerSize to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: imageFormat wordSize put: imageBytes to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: imageFormat wordSize put: startOfMemory to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: imageFormat wordSize put: specialObjectsOop to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: imageFormat wordSize put: lastHash to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: imageFormat wordSize put: ((screenSize x) << 16 + (screenSize y)) to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: imageFormat wordSize put: imageHeaderFlags to: aStream littleEndian: littleEnder). + bytesWritten := bytesWritten + + (self nextNumber: self packedLongSize put: extraVMMemory asInteger to: aStream littleEndian: littleEnder). + ^bytesWritten. + ! Item was removed: - ----- Method: ImageFileHeader>>writeFieldsTo:littleEndian:headerWordSize: (in category 'writing') ----- - writeFieldsTo: aStream littleEndian: littleEnder headerWordSize: headerWordSize - "Write data fields and answer number of bytes written" - - self nextNumber: headerWordSize put: imageFormat asInteger to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: headerSize to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: imageBytes to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: startOfMemory to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: specialObjectsOop to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: lastHash to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: ((screenSize x) << 16 + (screenSize y)) to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: imageHeaderFlags to: aStream littleEndian: littleEnder. - self nextNumber: headerWordSize put: extraVMMemory to: aStream littleEndian: littleEnder. - ^9 * imageFormat wordSize. - ! Item was changed: ----- Method: ImageFileHeader>>writeTo:littleEndian: (in category 'writing') ----- writeTo: aStream littleEndian: littleEnder + | remainder bytesWritten | + bytesWritten := self writeFieldsTo: aStream littleEndian: littleEnder. - | headerWordSize remainder bytesWritten | - headerWordSize := imageFormat wordSize. - bytesWritten := self writeFieldsTo: aStream littleEndian: littleEnder headerWordSize: headerWordSize. remainder := headerSize - bytesWritten. self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" remainder timesRepeat: [aStream nextPut: 0]. ! Item was added: + ----- Method: ImageFileHeaderTest>>testCurrentImageHeaderFile (in category 'testing') ----- + testCurrentImageHeaderFile + "Verify that the current image file can be read into an ImageHeader and written + back with matching bytes. Results may vary depending on the current image, + This is a check that the ImageFormat code is up to date with whatever image + is currently being run." + + | headerClass fs bytes header result | + headerClass := Smalltalk isRunningCog + ifFalse: [ ImageFileHeader ] + ifTrue: [ CogImageFileHeader ]. + fs := (FileStream readOnlyFileNamed: Smalltalk imageName) binary. + ([ bytes := fs next: 1000 ] ensure: [ fs close ]). + header := headerClass readFrom: bytes readStream. + result := ByteArray streamContents: [ :strm | header writeTo: strm littleEndian: Smalltalk isLittleEndian]. + self assert: header headerSize equals: result size. + self assert: result equals: (bytes first: result size). + + + ! Item was changed: ----- Method: ImageFileHeaderTest>>testReadWrite64BitCogBigEndian (in category 'testing') ----- testReadWrite64BitCogBigEndian "Read and write with data in all byte positions" | hdr ws b1 b2 | b1 := ByteArray new: 128. + #[0 1 9 181 0 0 0 128] withIndexDo: [ :e :i | b1 at: i put: e]. + 9 to: 128 do: [ :i | b1 at: i put: i ]. - #[0 0 0 0 0 1 9 162 0 0 0 0 0 0 0 128] withIndexDo: [ :e :i | b1 at: i put: e]. - 17 to: 128 do: [ :i | b1 at: i put: i ]. hdr := CogImageFileHeader readFrom: (ReadStream on: b1). ws := WriteStream on: ByteArray new. hdr writeTo: ws littleEndian: false. b2 := ws contents. + self assert: (b2 first: 80) = (b1 first: 80). + self assert: (b2 last: (128 - 80)) asSet size = 1. "all zeros"! - self assert: (b2 first: 92) = (b1 first: 92). - self assert: (b2 last: (128 - 92)) asSet size = 1. "all zeros"! Item was changed: ----- Method: ImageFileHeaderTest>>testReadWrite64BitCogLittleEndian (in category 'testing') ----- testReadWrite64BitCogLittleEndian "Read and write with data in all byte positions" | hdr ws b1 b2 | b1 := ByteArray new: 128. + #[181 9 1 0 128 0 0 0] withIndexDo: [ :e :i | b1 at: i put: e]. + 9 to: 128 do: [ :i | b1 at: i put: i ]. - #[162 9 1 0 0 0 0 0 128 0 0 0 0 0 0 0] withIndexDo: [ :e :i | b1 at: i put: e]. - 17 to: 128 do: [ :i | b1 at: i put: i ]. hdr := CogImageFileHeader readFrom: (ReadStream on: b1). ws := WriteStream on: ByteArray new. hdr writeTo: ws littleEndian: true. b2 := ws contents. + self assert: (b2 first: 80) = (b1 first: 80). + self assert: (b2 last: (128 - 80)) asSet size = 1. "all zeros"! - self assert: (b2 first: 92) = (b1 first: 92). - self assert: (b2 last: (128 - 92)) asSet size = 1. "all zeros"! Item was changed: ----- Method: ImageFileHeaderTest>>testReadWriteCogBigEndian (in category 'testing') ----- testReadWriteCogBigEndian "Read and write with data in all byte positions" | hdr ws b1 b2 | b1 := ByteArray new: 64. b1 at: 4 put: 104; at: 3 put: 25; at: 2 put: 0; at: 1 put: 0. "a valid image format number" b1 at: 8 put: 64; at: 7 put: 0; at: 6 put: 0; at: 5 put: 0. "header size 64" 9 to: 64 do: [ :i | b1 at: i put: i ]. hdr := CogImageFileHeader readFrom: (ReadStream on: b1). ws := WriteStream on: ByteArray new. hdr writeTo: ws littleEndian: false. b2 := ws contents. + self assert: (b2 first: 56) = (b1 first: 56). + self assert: (b2 last: (64 - 56)) asSet size = 1. "all zeros"! - self assert: (b2 first: 46) = (b1 first: 46). - self assert: (b2 last: (64 - 46)) asSet size = 1. "all zeros"! Item was changed: ----- Method: ImageFileHeaderTest>>testReadWriteCogLittleEndian (in category 'testing') ----- testReadWriteCogLittleEndian "Read and write with data in all byte positions" | hdr ws b1 b2 | b1 := ByteArray new: 64. b1 at: 1 put: 104; at: 2 put: 25; at: 3 put: 0; at: 4 put: 0. "a valid image format number" b1 at: 5 put: 64; at: 6 put: 0; at: 7 put: 0; at: 8 put: 0. "header size 64" 9 to: 64 do: [ :i | b1 at: i put: i ]. hdr := CogImageFileHeader readFrom: (ReadStream on: b1). ws := WriteStream on: ByteArray new. hdr writeTo: ws littleEndian: true. b2 := ws contents. + self assert: (b2 first: 56) = (b1 first: 56). + self assert: (b2 last: (64 - 56)) asSet size = 1. "all zeros"! - self assert: (b2 first: 46) = (b1 first: 46). - self assert: (b2 last: (64 - 46)) asSet size = 1. "all zeros"! From noreply at github.com Sat Jan 9 21:40:12 2021 From: noreply at github.com (Eliot Miranda) Date: Sat, 09 Jan 2021 13:40:12 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] ddfa07: Avoid a compiler warning on Windows. [ci skip] Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: ddfa072e3102fe2ef7f06c72d6f39978179fc0b0 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ddfa072e3102fe2ef7f06c72d6f39978179fc0b0 Author: Eliot Miranda Date: 2021-01-09 (Sat, 09 Jan 2021) Changed paths: M platforms/Cross/vm/sqAtomicOps.h Log Message: ----------- Avoid a compiler warning on Windows. [ci skip] From noreply at github.com Sat Jan 9 21:43:15 2021 From: noreply at github.com (Nicolas Cellier) Date: Sat, 09 Jan 2021 13:43:15 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a5c0f3: Upgrade libssh2 to 1.9.0 in cmake builds too Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a5c0f36609c0224e6c9af3f55e4ead706e1d2e8b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a5c0f36609c0224e6c9af3f55e4ead706e1d2e8b Author: Nicolas Cellier Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M cmake/LibSSH2.cmake Log Message: ----------- Upgrade libssh2 to 1.9.0 in cmake builds too Commit: dd2abe328c4c2727aee3ca19ec4166b52f80214a https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/dd2abe328c4c2727aee3ca19ec4166b52f80214a Author: Nicolas Cellier Date: 2021-01-09 (Sat, 09 Jan 2021) Changed paths: M cmake/OpenSSL.cmake Log Message: ----------- Upgrade openssl to 1.1.1i in cmake build too Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/07aad2fbc115...dd2abe328c4c From noreply at github.com Sat Jan 9 21:48:05 2021 From: noreply at github.com (Eliot Miranda) Date: Sat, 09 Jan 2021 13:48:05 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] bbdb3d: Nuke some obsolete files [ci skip] Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: bbdb3d41a7b3e2ece9578788153d436d1b891118 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/bbdb3d41a7b3e2ece9578788153d436d1b891118 Author: Eliot Miranda Date: 2021-01-09 (Sat, 09 Jan 2021) Changed paths: R platforms/win32/extras/3.4.3/BBCompositing.cs R platforms/win32/extras/FontPlugin.st R platforms/win32/extras/RePlugin.st Log Message: ----------- Nuke some obsolete files [ci skip] From no-reply at appveyor.com Sat Jan 9 23:04:47 2021 From: no-reply at appveyor.com (AppVeyor) Date: Sat, 09 Jan 2021 23:04:47 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2358 Message-ID: <20210109230447.1.DC1D4DB89EF8874F@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sun Jan 10 05:39:07 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 10 Jan 2021 05:39:07 0000 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.49.mcz Message-ID: David T. Lewis uploaded a new version of ImageFormat to project VM Maker: http://source.squeak.org/VMMaker/ImageFormat-dtl.49.mcz ==================== Summary ==================== Name: ImageFormat-dtl.49 Author: dtl Time: 10 January 2021, 12:39:07.044039 am UUID: 9ae715d1-1e3e-4379-bf4a-4d45b67eb5e1 Ancestors: ImageFormat-dtl.48 Let ImageFileHeader class>>readFrom: invoke a concrete subclass for Cog/Spur or V3. Simplify instance creation. =============== Diff against ImageFormat-dtl.48 =============== Item was added: + ----- Method: CogImageFileHeader>>readFieldsFrom:littleEndian:into: (in category 'reading') ----- + readFieldsFrom: aStream littleEndian: littleEndian into: aCollection + "Read data fields and answer number of bytes read" + + | remainder bytesRead | + bytesRead := super readFieldsFrom: aStream littleEndian: littleEndian into: aCollection. + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "desiredNumStackPages" + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "unknownShortOrCodeSizeInKs" + aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "desiredEdenBytes" + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "maxExtSemTabSizeSet" + aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "the2ndUnknownShort" + aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "firstSegmentBytes" + aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "bytesLeftInOldSpace" + self nextNumber: 2 from: aStream littleEndian: littleEndian. + remainder := headerSize - (12 * imageFormat wordSize). + self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" + ^3 * imageFormat wordSize + bytesRead. + ! Item was removed: - ----- Method: CogImageFileHeader>>readFieldsFrom:startingAt:headerWordSize:littleEndian:into: (in category 'reading') ----- - readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection - "Read data fields and answer number of bytes read" - - | remainder bytesRead | - bytesRead := super readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection. - aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "desiredNumStackPages" - aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "unknownShortOrCodeSizeInKs" - aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "desiredEdenBytes" - aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "maxExtSemTabSizeSet" - aCollection add: (self nextNumber: 2 from: aStream littleEndian: littleEndian). "the2ndUnknownShort" - aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "firstSegmentBytes" - aCollection add: (self nextNumber: 4 from: aStream littleEndian: littleEndian). "bytesLeftInOldSpace" - self nextNumber: 2 from: aStream littleEndian: littleEndian. - remainder := headerSize - (12 * imageFormat wordSize). - self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" - ^3 * imageFormat wordSize + bytesRead. - ! Item was added: + ----- Method: ImageFileHeader class>>concreteClass: (in category 'instance creation') ----- + concreteClass: imageFormat + + imageFormat requiresNativeFloatWordOrder + ifTrue: [ ^CogImageFileHeader ] + ifFalse: [ ^self ]! Item was changed: ----- Method: ImageFileHeader class>>readFrom:startingAt: (in category 'instance creation') ----- readFrom: aStream startingAt: imageOffset + ^self readFrom: aStream startingAt: imageOffset into: OrderedCollection new! - ^self basicNew readFrom: aStream startingAt: imageOffset into: OrderedCollection new! Item was added: + ----- Method: ImageFileHeader class>>readFrom:startingAt:into: (in category 'private') ----- + readFrom: aStream startingAt: imageOffset into: aCollection + + | formatInfo imageFormat cls hdr remainder bytesRead | + formatInfo := self readImageVersionFrom: aStream startingAt: imageOffset. + imageFormat := formatInfo first. + aCollection add: imageFormat asInteger. + cls := self concreteClass: imageFormat. + hdr := cls new imageFormat: imageFormat. + bytesRead := hdr readFieldsFrom: aStream littleEndian: formatInfo second into: aCollection. + remainder := hdr headerSize - bytesRead. + self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" + aStream next: (hdr headerSize - bytesRead). + ^hdr fromEntryStream: aCollection readStream. + ! Item was added: + ----- Method: ImageFileHeader class>>readImageVersionFrom:startingAt: (in category 'private') ----- + readImageVersionFrom: aStream startingAt: imageOffset + "Look for image format in the next 4 or 8 bytes and set imageFormat. Answer a + two element array with image format, and a boolean true if the header is written + in little endian format." + + | imageFormat littleEndian | + (aStream nextNumber: 4) caseOf: + { + [ 16r00001966 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. littleEndian := false ] . + [ 16r66190000 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. littleEndian := true ] . + [ 16r00001968 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. littleEndian := false ] . + [ 16r68190000 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. littleEndian := true ] . + [ 16r00001969 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. littleEndian := false ] . + [ 16r69190000 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. littleEndian := true ] . + [ 16r00001979 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. littleEndian := false ] . + [ 16r79190000 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. littleEndian := true ] . + [ 16rA0090100 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. aStream next: 4. littleEndian := true ] . "format number in 64 bit integer" + [ 16rA2090100 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. aStream next: 4. littleEndian := true ] . + [ 16rA3090100 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. aStream next: 4. littleEndian := true ] . + [ 16rB3090100 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. littleEndian := true ] . "Cog/Spur always puts format number in first 32 bits" + [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. littleEndian := false ] . + [ 16rB5090100 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. littleEndian := true ] . + [ 16r000109B5 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. littleEndian := false ] . + [ 16r00000000 ] -> [ + "Standard interpreter VM puts the format number in the first 64 bits for a 64 bit image, so + the leading 4 bytes are zero in this case. Cog/Spur VMs put the format number in the first + 32 bits for both 32 and 64 bit images." + (aStream nextNumber: 4) caseOf: { + [ 16r000109A0 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. littleEndian := false ] . + [ 16r000109A2 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. littleEndian := false ] . + [ 16r000109A3 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. littleEndian := false ] + } otherwise: [self error: self asString , ' unrecognized format number'] + ] + } otherwise: [self error: self asString , ' unrecognized format number']. + ^ { imageFormat . littleEndian } + + "ImageFormat versionNumberByteArrays do: [:e | + Transcript cr; show: e printString , ': ', (ImageFormat fromBytes: e) description] + + #[0 0 25 102]: a 32-bit image with no closure support and no native platform float word order requirement (6502) + #[102 25 0 0]: a 32-bit image with no closure support and no native platform float word order requirement (6502) + #[0 0 25 104]: a 32-bit image with closure support and no native platform float word order requirement (6504) + #[104 25 0 0]: a 32-bit image with closure support and no native platform float word order requirement (6504) + #[0 0 0 0 0 1 9 160]: a 64-bit image with no closure support and no native platform float word order requirement (68000) + #[160 9 1 0 0 0 0 0]: a 64-bit image with no closure support and no native platform float word order requirement (68000) + #[0 0 0 0 0 1 9 162]: a 64-bit image with closure support and no native platform float word order requirement (68002) + #[162 9 1 0 0 0 0 0]: a 64-bit image with closure support and no native platform float word order requirement (68002) + #[0 0 25 105]: a 32-bit image with closure support and float words stored in native platform order (6505) + #[105 25 0 0]: a 32-bit image with closure support and float words stored in native platform order (6505) + #[0 0 0 0 0 1 9 163]: a 64-bit image with closure support and float words stored in native platform order (68003) + #[163 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order (68003) + #[0 0 25 121]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521) + #[121 25 0 0]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521) + #[0 0 0 0 0 1 9 179]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019) + #[179 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019) + #[0 0 0 0 0 1 9 181]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021) + #[181 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021) + " + ! Item was changed: + ----- Method: ImageFileHeader>>packedLongSize (in category 'converting') ----- - ----- Method: ImageFileHeader>>packedLongSize (in category 'writing') ----- packedLongSize "Standard interpreter VM writes integers to the file header as 64 bits for a 64 bit image or 32 bits for a 32 bit image. Cog/Spur VMs use 32 bits where possible, otherwise 64 bits for long values on a 64 bit system." ^ imageFormat wordSize! Item was added: + ----- Method: ImageFileHeader>>readFieldsFrom:littleEndian:into: (in category 'reading') ----- + readFieldsFrom: aStream littleEndian: littleEndian into: aCollection + "Read data fields and answer number of bytes read" + + | remainder screenSizeWord | + headerSize := self nextNumber: self packedLongSize from: aStream littleEndian: littleEndian. + aCollection add: headerSize. + aCollection add: ( self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "imageBytes" + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "startOfMemory" + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "specialObjectsOop" + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "lastHash" + screenSizeWord := self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian. + aCollection add: ((screenSizeWord >> 16) @ (screenSizeWord bitAnd: 16rFFFF)). + aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "imageHeaderFlags" + aCollection add: (self nextNumber: self packedLongSize from: aStream littleEndian: littleEndian). "extraVMMemory" + remainder := headerSize - (9 * imageFormat wordSize). + self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" + ^9 * imageFormat wordSize. + ! Item was removed: - ----- Method: ImageFileHeader>>readFieldsFrom:startingAt:headerWordSize:littleEndian:into: (in category 'reading') ----- - readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection - "Read data fields and answer number of bytes read" - - | remainder screenSizeWord | - headerSize := self nextNumber: headerWordSize from: aStream littleEndian: littleEndian. - aCollection add: headerSize. - aCollection add: ( self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "imageBytes" - aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "startOfMemory" - aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "specialObjectsOop" - aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "lastHash" - screenSizeWord := self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian. - aCollection add: ((screenSizeWord >> 16) @ (screenSizeWord bitAnd: 16rFFFF)). - aCollection add: (self nextNumber: imageFormat wordSize from: aStream littleEndian: littleEndian). "imageHeaderFlags" - aCollection add: (self nextNumber: headerWordSize from: aStream littleEndian: littleEndian). "extraVMMemory" - remainder := headerSize - (9 * imageFormat wordSize). - self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" - ^9 * imageFormat wordSize. - ! Item was removed: - ----- Method: ImageFileHeader>>readFrom:startingAt:into: (in category 'reading') ----- - readFrom: aStream startingAt: imageOffset into: aCollection - - | remainder bytesRead headerWordSize littleEndian | - littleEndian := self readImageVersionFrom: aStream startingAt: imageOffset. - headerWordSize := aStream position - imageOffset. - aCollection add: imageFormat asInteger. - bytesRead := self readFieldsFrom: aStream startingAt: imageOffset headerWordSize: headerWordSize littleEndian: littleEndian into: aCollection. - remainder := headerSize - bytesRead. - self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" - aStream next: (headerSize - bytesRead). - - self fromEntryStream: aCollection readStream. - ! Item was removed: - ----- Method: ImageFileHeader>>readImageVersionFrom:startingAt: (in category 'reading') ----- - readImageVersionFrom: aStream startingAt: imageOffset - "Look for image format in the next 4 or 8 bytes and set imageFormat. Answer true - if the header is written in little endian format." - - (aStream nextNumber: 4) caseOf: - { - [ 16r00001966 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. ^false ] . - [ 16r66190000 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. ^true ] . - [ 16r00001968 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. ^false ] . - [ 16r68190000 "6504" ] -> [ imageFormat := ImageFormat fromInteger: 6504. ^true ] . - [ 16r00001969 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. ^false ] . - [ 16r69190000 "6505" ] -> [ imageFormat := ImageFormat fromInteger: 6505. ^true ] . - [ 16r00001979 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. ^false ] . - [ 16r79190000 "6521" ] -> [ imageFormat := ImageFormat fromInteger: 6521. ^true ] . - [ 16rA0090100 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. aStream next: 4. ^true ] . "format number in 64 bit integer" - [ 16rA2090100 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. aStream next: 4. ^true ] . - [ 16rA3090100 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. aStream next: 4. ^true ] . - [ 16rB3090100 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. ^true ] . "Cog/Spur always puts format number in first 32 bits" - [ 16r000109B3 "68019" ] -> [ imageFormat := ImageFormat fromInteger: 68019. ^false ] . - [ 16rB5090100 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. ^true ] . - [ 16r000109B5 "68021" ] -> [ imageFormat := ImageFormat fromInteger: 68021. ^false ] . - [ 16r00000000 ] -> [ - "Standard interpreter VM puts the format number in the first 64 bits for a 64 bit image, so - the leading 4 bytes are zero in this case. Cog/Spur VMs put the format number in the first - 32 bits for both 32 and 64 bit images." - (aStream nextNumber: 4) caseOf: { - [ 16r000109A0 "68000" ] -> [ imageFormat := ImageFormat fromInteger: 68000. ^false ] . - [ 16r000109A2 "68002" ] -> [ imageFormat := ImageFormat fromInteger: 68002. ^false ] . - [ 16r000109A3 "68003" ] -> [ imageFormat := ImageFormat fromInteger: 68003. ^false ] - } otherwise: [self error: self asString , ' unrecognized format number'] - ] - } otherwise: [self error: self asString , ' unrecognized format number'] - - "ImageFormat versionNumberByteArrays do: [:e | - Transcript cr; show: e printString , ': ', (ImageFormat fromBytes: e) description] - - #[0 0 25 102]: a 32-bit image with no closure support and no native platform float word order requirement (6502) - #[102 25 0 0]: a 32-bit image with no closure support and no native platform float word order requirement (6502) - #[0 0 25 104]: a 32-bit image with closure support and no native platform float word order requirement (6504) - #[104 25 0 0]: a 32-bit image with closure support and no native platform float word order requirement (6504) - #[0 0 0 0 0 1 9 160]: a 64-bit image with no closure support and no native platform float word order requirement (68000) - #[160 9 1 0 0 0 0 0]: a 64-bit image with no closure support and no native platform float word order requirement (68000) - #[0 0 0 0 0 1 9 162]: a 64-bit image with closure support and no native platform float word order requirement (68002) - #[162 9 1 0 0 0 0 0]: a 64-bit image with closure support and no native platform float word order requirement (68002) - #[0 0 25 105]: a 32-bit image with closure support and float words stored in native platform order (6505) - #[105 25 0 0]: a 32-bit image with closure support and float words stored in native platform order (6505) - #[0 0 0 0 0 1 9 163]: a 64-bit image with closure support and float words stored in native platform order (68003) - #[163 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order (68003) - #[0 0 25 121]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521) - #[121 25 0 0]: a 32-bit image with closure support and float words stored in native platform order using Spur object format (6521) - #[0 0 0 0 0 1 9 179]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019) - #[179 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (obsolete) (68019) - #[0 0 0 0 0 1 9 181]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021) - #[181 9 1 0 0 0 0 0]: a 64-bit image with closure support and float words stored in native platform order using Spur object format (68021) - " - ! From kksubbu.ml at gmail.com Sun Jan 10 06:00:50 2021 From: kksubbu.ml at gmail.com (K K Subbu) Date: Sun, 10 Jan 2021 11:30:50 +0530 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.49.mcz In-Reply-To: References: Message-ID: On 10/01/21 5:39 am, commits at source.squeak.org wrote: > + ----- Method: CogImageFileHeader>>readFieldsFrom:littleEndian:into: (in category 'reading') ----- > + readFieldsFrom: aStream littleEndian: littleEndian into: aCollection Passing endian flag to every read looks like an overkill, doesn't it? > + [ 16r00001966 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. littleEndian := false ] . The endianness is fixed when the imageFormat is instantiated. If it could be encapsulated as part of this instance, then there is no need to pass it as an argument for every read from the store associated with this image instance. Ideally, the image store type (little/big endian) should be separated from the image encoding format (32-bit, 64-bit, ....). But I guess this separation can evolve over time. Regards .. Subbu From lewis at mail.msen.com Sun Jan 10 16:11:30 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 10 Jan 2021 11:11:30 -0500 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.49.mcz In-Reply-To: References: Message-ID: <20210110161130.GA41444@shell.msen.com> On Sun, Jan 10, 2021 at 11:30:50AM +0530, K K Subbu wrote: > > On 10/01/21 5:39 am, commits at source.squeak.org wrote: > >+ ----- Method: CogImageFileHeader>>readFieldsFrom:littleEndian:into: (in > >category 'reading') ----- > >+ readFieldsFrom: aStream littleEndian: littleEndian into: aCollection > > Passing endian flag to every read looks like an overkill, doesn't it? > > >+ [ 16r00001966 "6502" ] -> [ imageFormat := > >ImageFormat fromInteger: 6502. littleEndian := false ] . > > The endianness is fixed when the imageFormat is instantiated. If it > could be encapsulated as part of this instance, then there is no need to > pass it as an argument for every read from the store associated with > this image instance. > > Ideally, the image store type (little/big endian) should be separated > from the image encoding format (32-bit, 64-bit, ....). But I guess this > separation can evolve over time. > > Regards .. Subbu Hi Subbu, It is an interesting question and I'm glad you spotted it. In the VM, the logic for reading and writing the snapshot header is buried in the code where most people will never see or think about it. So I am trying to make it more accessible. Although I have reorganized it a bit, the code that you are quoting is patterned after the actual image loading methods in VMMaker. When loading an image file, the very first thing that happens is that the first few bytes of the file are read and decoded. The method that does this figures out the endianness as a side effect of decoding the image format number, so it is a function with two side effects. At this point it knows the endianness of the data stored in the image file, which will be the endianness of whatever machine actually saved the file, not the endianness of the machine that is currently loading the file. This endianness information is needed only for the remainder of the image loading process. Once the image is loaded into memory, and before the VM begins actually running that image, the endianness flag is no longer required and can be discarded. The reason for this complication is that we want an image file that was saved by a big endian machine to be loadable on a little endian machine and vice versa. We also want this to be fast and efficient, so the policy is to always write an image file in the natural endianness of the machine that is running it, and do extra byte swapping if and only if the image file is being loaded by a different kind of computer. This was a design decision that was made many years ago, and it still works well today. But computers are a lot faster today, and it might be perfectly legitimate to adopt a policy of always saving an image file in e.g. network byte order. With today's fast computers, it is possible that you would never notice any performance impact. I have never tried it, but this might be an interesting experiment for a student to try. Dave From lewis at mail.msen.com Sun Jan 10 16:32:15 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 10 Jan 2021 11:32:15 -0500 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.49.mcz In-Reply-To: <20210110161130.GA41444@shell.msen.com> References: <20210110161130.GA41444@shell.msen.com> Message-ID: <20210110163215.GA52004@shell.msen.com> On Sun, Jan 10, 2021 at 11:11:30AM -0500, David T. Lewis wrote: > > On Sun, Jan 10, 2021 at 11:30:50AM +0530, K K Subbu wrote: > > > > On 10/01/21 5:39 am, commits at source.squeak.org wrote: > > >+ ----- Method: CogImageFileHeader>>readFieldsFrom:littleEndian:into: (in > > >category 'reading') ----- > > >+ readFieldsFrom: aStream littleEndian: littleEndian into: aCollection > > > > Passing endian flag to every read looks like an overkill, doesn't it? > > > > >+ [ 16r00001966 "6502" ] -> [ imageFormat := > > >ImageFormat fromInteger: 6502. littleEndian := false ] . > > > > The endianness is fixed when the imageFormat is instantiated. If it > > could be encapsulated as part of this instance, then there is no need to > > pass it as an argument for every read from the store associated with > > this image instance. > > > > Ideally, the image store type (little/big endian) should be separated > > from the image encoding format (32-bit, 64-bit, ....). But I guess this > > separation can evolve over time. > > > > Regards .. Subbu > > Hi Subbu, > > It is an interesting question and I'm glad you spotted it. In the VM, > the logic for reading and writing the snapshot header is buried in the > code where most people will never see or think about it. So I am trying > to make it more accessible. > I should add one more thing - I did not really answer your question of whether the image file endianness should be saved as an instance variable somewhere, as opposed to passing it around as a flag. I don't really have a good answer right now. For the case of simply reading and writing an ImageFileHeader, I think it's better to leave at as a flag used only in the process of reading. But I can imagine other use cases where it might be useful to keep it as an instance variable. Dave From commits at source.squeak.org Sun Jan 10 20:31:04 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 10 Jan 2021 20:31:04 0000 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.50.mcz Message-ID: David T. Lewis uploaded a new version of ImageFormat to project VM Maker: http://source.squeak.org/VMMaker/ImageFormat-dtl.50.mcz ==================== Summary ==================== Name: ImageFormat-dtl.50 Author: dtl Time: 10 January 2021, 3:26:52.350451 pm UUID: 90f06857-91ab-4950-a856-957d3bb6ddc0 Ancestors: ImageFormat-dtl.49 Provide ImageHileHeader class>>headerAndFlagsFrom: to read header from an image file and remember the endianness flag used during the read. Intended to enable ImageSnapshot to be instantiated from an image file as well as directly from a VM primitive. =============== Diff against ImageFormat-dtl.49 =============== Item was added: + ----- Method: ImageFileHeader class>>headerAndFlagFrom: (in category 'instance creation') ----- + headerAndFlagFrom: aStream + "Answer an array with new image file header and with boolean, true if + the image file in aStream was saved from a littleEndian machine." + + ^self headerAndFlagFrom: aStream startingAt: 0! Item was added: + ----- Method: ImageFileHeader class>>headerAndFlagFrom:startingAt: (in category 'instance creation') ----- + headerAndFlagFrom: aStream startingAt: imageOffset + "Answer an array with new image file header and with boolean, true if + the image file in aStream was saved from a littleEndian machine." + + ^self headerAndFlagFrom: aStream startingAt: imageOffset into: OrderedCollection new! Item was added: + ----- Method: ImageFileHeader class>>headerAndFlagFrom:startingAt:into: (in category 'private') ----- + headerAndFlagFrom: aStream startingAt: imageOffset into: aCollection + "Answer an array with new image file header and with boolean, true if + the image file in aStream was saved from a littleEndian machine." + + | formatInfo imageFormat cls hdr remainder bytesRead | + formatInfo := self readImageVersionFrom: aStream startingAt: imageOffset. + imageFormat := formatInfo first. + aCollection add: imageFormat asInteger. + cls := self concreteClass: imageFormat. + hdr := cls new imageFormat: imageFormat. + bytesRead := hdr readFieldsFrom: aStream littleEndian: formatInfo second into: aCollection. + remainder := hdr headerSize - bytesRead. + self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" + aStream next: (hdr headerSize - bytesRead). + ^{ hdr fromEntryStream: aCollection readStream . formatInfo second } + ! Item was changed: ----- Method: ImageFileHeader class>>readFrom:startingAt:into: (in category 'private') ----- readFrom: aStream startingAt: imageOffset into: aCollection + ^(self headerAndFlagFrom: aStream startingAt: imageOffset into: aCollection) first - | formatInfo imageFormat cls hdr remainder bytesRead | - formatInfo := self readImageVersionFrom: aStream startingAt: imageOffset. - imageFormat := formatInfo first. - aCollection add: imageFormat asInteger. - cls := self concreteClass: imageFormat. - hdr := cls new imageFormat: imageFormat. - bytesRead := hdr readFieldsFrom: aStream littleEndian: formatInfo second into: aCollection. - remainder := hdr headerSize - bytesRead. - self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" - aStream next: (hdr headerSize - bytesRead). - ^hdr fromEntryStream: aCollection readStream. ! From commits at source.squeak.org Sun Jan 10 20:38:14 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 10 Jan 2021 20:38:14 0000 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.50.mcz Message-ID: David T. Lewis uploaded a new version of ImageFormat to project VM Maker: http://source.squeak.org/VMMaker/ImageFormat-dtl.50.mcz ==================== Summary ==================== Name: ImageFormat-dtl.50 Author: dtl Time: 10 January 2021, 3:38:11.803376 pm UUID: 13859148-5b61-4b2a-8b6b-7cf0cfdb74fe Ancestors: ImageFormat-dtl.49 Provide ImageFileHeader class>>headerAndFlagsFrom: to read header from an image file and remember the endianness flag used during the read. Intended to enable ImageSnapshot to be instantiated from an image file as well as directly from a VM primitive. =============== Diff against ImageFormat-dtl.49 =============== Item was added: + ----- Method: ImageFileHeader class>>headerAndFlagFrom: (in category 'instance creation') ----- + headerAndFlagFrom: aStream + "Answer an array with new image file header and with boolean, true if + the image file in aStream was saved from a littleEndian machine." + + ^self headerAndFlagFrom: aStream startingAt: 0! Item was added: + ----- Method: ImageFileHeader class>>headerAndFlagFrom:startingAt: (in category 'instance creation') ----- + headerAndFlagFrom: aStream startingAt: imageOffset + "Answer an array with new image file header and with boolean, true if + the image file in aStream was saved from a littleEndian machine." + + ^self headerAndFlagFrom: aStream startingAt: imageOffset into: OrderedCollection new! Item was added: + ----- Method: ImageFileHeader class>>headerAndFlagFrom:startingAt:into: (in category 'private') ----- + headerAndFlagFrom: aStream startingAt: imageOffset into: aCollection + "Answer an array with new image file header and with boolean, true if + the image file in aStream was saved from a littleEndian machine." + + | formatInfo imageFormat cls hdr remainder bytesRead | + formatInfo := self readImageVersionFrom: aStream startingAt: imageOffset. + imageFormat := formatInfo first. + aCollection add: imageFormat asInteger. + cls := self concreteClass: imageFormat. + hdr := cls new imageFormat: imageFormat. + bytesRead := hdr readFieldsFrom: aStream littleEndian: formatInfo second into: aCollection. + remainder := hdr headerSize - bytesRead. + self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" + aStream next: (hdr headerSize - bytesRead). + ^{ hdr fromEntryStream: aCollection readStream . formatInfo second } + ! Item was changed: ----- Method: ImageFileHeader class>>readFrom:startingAt:into: (in category 'private') ----- readFrom: aStream startingAt: imageOffset into: aCollection + ^(self headerAndFlagFrom: aStream startingAt: imageOffset into: aCollection) first - | formatInfo imageFormat cls hdr remainder bytesRead | - formatInfo := self readImageVersionFrom: aStream startingAt: imageOffset. - imageFormat := formatInfo first. - aCollection add: imageFormat asInteger. - cls := self concreteClass: imageFormat. - hdr := cls new imageFormat: imageFormat. - bytesRead := hdr readFieldsFrom: aStream littleEndian: formatInfo second into: aCollection. - remainder := hdr headerSize - bytesRead. - self assert: remainder >= 0. "n.b. Mantis 7455 bug in original 64 bit image due to VMM error" - aStream next: (hdr headerSize - bytesRead). - ^hdr fromEntryStream: aCollection readStream. ! From lewis at mail.msen.com Sun Jan 10 20:40:49 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 10 Jan 2021 15:40:49 -0500 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.50.mcz In-Reply-To: References: Message-ID: <20210110204049.GA87089@shell.msen.com> On Sun, Jan 10, 2021 at 08:38:14PM +0000, commits at source.squeak.org wrote: > > David T. Lewis uploaded a new version of ImageFormat to project VM Maker: > http://source.squeak.org/VMMaker/ImageFormat-dtl.50.mcz > > ==================== Summary ==================== > > Name: ImageFormat-dtl.50 > Author: dtl > Time: 10 January 2021, 3:38:11.803376 pm > UUID: 13859148-5b61-4b2a-8b6b-7cf0cfdb74fe > Ancestors: ImageFormat-dtl.49 > > Provide ImageFileHeader class>>headerAndFlagsFrom: to read header from an image file and remember the endianness flag used during the read. Intended to enable ImageSnapshot to be instantiated from an image file as well as directly from a VM primitive. > > Saved twice on source.squeak.org to fix a typo in the commit notice, sorry for the noise. Dave From kksubbu.ml at gmail.com Mon Jan 11 07:35:52 2021 From: kksubbu.ml at gmail.com (K K Subbu) Date: Mon, 11 Jan 2021 13:05:52 +0530 Subject: [Vm-dev] VM Maker: ImageFormat-dtl.49.mcz In-Reply-To: <20210110161130.GA41444@shell.msen.com> References: <20210110161130.GA41444@shell.msen.com> Message-ID: On 10/01/21 9:41 pm, David T. Lewis wrote: > Although I have reorganized it a bit, the code that you are quoting > is patterned after the actual image loading methods in VMMaker. When > loading an image file, the very first thing that happens is that the > first few bytes of the file are read and decoded. The method that does > this figures out the endianness as a side effect of decoding the image > format number, so it is a function with two side effects. At this point > it knows the endianness of the data stored in the image file, which > will be the endianness of whatever machine actually saved the file, > not the endianness of the machine that is currently loading the file. This dumping of object graph into image file worked well as long there were only one or two formats. But now there are so many image variants that stream reader/writers like in GIF or PNG would be simpler and cleaner (ImageReader/ImageWriter?). It would also allow new VMs to "import" all old formats. You're right about byte-swap cost not being significant on modern machines. If htonx/ntohx works for network i/o it should work better for storage I/O. Perhaps, the next iteration of image format could settle on network byte order and eliminate endian image variants. > This endianness information is needed only for the remainder of the > image loading process. Once the image is loaded into memory, and > before the VM begins actually running that image, the endianness > flag is no longer required and can be discarded. The VM works with only one image at a time, so the cost of one property in ImageReader singleton will be small compared to simplification of messages. The property will also be reclaimed when the stream is closed. Regards .. Subbu From notifications at github.com Mon Jan 11 12:43:46 2021 From: notifications at github.com (Nicolas Cellier) Date: Mon, 11 Jan 2021 04:43:46 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix the mingw Squeak3D build. MSVC defines size_t in vcruntime.h. But for (d485f8e) In-Reply-To: References: Message-ID: size_t is officially defined in , at least according to C89 and C99 standard https://en.cppreference.com/w/c/types/size_t core crt seems fragile to me (I have at least a machine on which this fails) -- 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/commit/d485f8e94961b4dc1fc623ebc3aea35dbdc2c3e2#commitcomment-45842580 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Mon Jan 11 13:40:29 2021 From: noreply at github.com (Nicolas Cellier) Date: Mon, 11 Jan 2021 05:40:29 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] e455fe: Accept a pattern for windows_dll spec in cmake builds Message-ID: Branch: refs/heads/upgrade_libpng Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: e455fe2e4b5581c90567d00c823ba7227fc7c586 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e455fe2e4b5581c90567d00c823ba7227fc7c586 Author: Nicolas Cellier Date: 2021-01-11 (Mon, 11 Jan 2021) Changed paths: M cmake/ThirdPartyDependenciesMacros.cmake Log Message: ----------- Accept a pattern for windows_dll spec in cmake builds This is necessary for OpenSSL library for example because it could be libssl-1.1.dll or libssl-1.1-x64.dll From no-reply at appveyor.com Mon Jan 11 17:22:17 2021 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 11 Jan 2021 17:22:17 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2359 Message-ID: <20210111172217.1.A0A654392EE587A3@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 00:04:33 2021 From: noreply at github.com (Nicolas Cellier) Date: Mon, 11 Jan 2021 16:04:33 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a4d9d2: Nuke WIN CE support in minheadless variant Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a4d9d2d2088b8ac1ad41cc684bcdabf318b7f3ab https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a4d9d2d2088b8ac1ad41cc684bcdabf318b7f3ab Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/minheadless/windows/sqWin32Directory.c M platforms/minheadless/windows/sqWin32Heartbeat.c M platforms/minheadless/windows/sqWin32Time.c Log Message: ----------- Nuke WIN CE support in minheadless variant Commit: 8e0a93ec932cf7cf339ea145bf562165639f1f3e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8e0a93ec932cf7cf339ea145bf562165639f1f3e Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/minheadless/windows/sqPlatformSpecific-Win32.h Log Message: ----------- Avoid PATH_MAX redefinition in Win32 minheadless Commit: eb4aa2e695c328c4650c86340eed506ccedda877 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/eb4aa2e695c328c4650c86340eed506ccedda877 Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/minheadless/common/sqPlatformSpecificCommon.h Log Message: ----------- Don't let error be too generic, give an arg to the macro Commit: af72d3a03e5e6b51bf9f527a876a793ac1bcb437 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/af72d3a03e5e6b51bf9f527a876a793ac1bcb437 Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/win32/vm/sqPlatformSpecific.h Log Message: ----------- Replace obscure with standard in win32 for size_t See https://en.cppreference.com/w/c/types/size_t Hence, this may later become a generic solution rather than a platform specific one... Commit: 78af62071b8c65706c495db858cc217eed2c576c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/78af62071b8c65706c495db858cc217eed2c576c Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/minheadless/common/sqPlatformSpecificCommon.h Log Message: ----------- Revert "Don't let error be too generic, give an arg to the macro" This reverts commit eb4aa2e695c328c4650c86340eed506ccedda877. Commit: c73cbe922f71211d6a0468bc96b0fcee2c5baf7d https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c73cbe922f71211d6a0468bc96b0fcee2c5baf7d Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/minheadless/common/sqWindow-Dispatch.c M platforms/minheadless/common/sqWindow-Null.c M platforms/minheadless/common/sqWindow.h Log Message: ----------- Provide a NULL dropRequestURI to minheadless Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/bbdb3d41a7b3...c73cbe922f71 From no-reply at appveyor.com Tue Jan 12 00:18:19 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 12 Jan 2021 00:18:19 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2360 Message-ID: <20210112001819.1.0559F939177525CC@appveyor.com> An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Tue Jan 12 05:15:23 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Mon, 11 Jan 2021 21:15:23 -0800 Subject: [Vm-dev] [squeak-dev] Squeak and Sound In-Reply-To: <1610397362-e6a8a67e130b246c1df9b9d6d5aeb5b0@pckswarms.ch> References: <1610363028-4d793d76dcd8e2af2f2b50ea42e4c815@pckswarms.ch> <1610397362-e6a8a67e130b246c1df9b9d6d5aeb5b0@pckswarms.ch> Message-ID: On Mon, Jan 11, 2021 at 12:36 PM Bruce O'Neel wrote: > > Hi, > > It seems that libpulse-dev only needs to be installed on the build > machine. That is quite logical, it is a dev package. It also looks that > pulse audio is picked by default, at least on new? linux versions. > OK, then let's make sure that this info gets in all the linux.buildXXX/HowToBuild files. > > I am unable to test on the PI. I can't convince it to work with a > bluetooth speaker so I guess I need a USB speaker. > > I also notice that on the newest version of Raspberry PI OS seems not to > get all the way through the build though there are no obvious errors. it > stops right after the ar of vm.a, and does not do the libtool parts. Both > the older PI 3 and the new PI 4 have the same packages installed after the > installation but maybe a different base set. > > I'll look more tomorrow. > > cheers > > bruce > > > > *11 January 2021 19:11 Eliot Miranda > wrote:* > > Hi Bruce, Hi squeak.org maintainers, > > this kind of information is incredibly important for new users who > grab squeak and want to get things done. We should make sure there is on > squeak.org a "tips and tricks" page, or series of items on the download > page that help new users solve these kinds of issues. The last thing we > want is for a new user to find themselves blocked and have to go to the > mailing list to get help. In that arc from being blocked to asking for > help many people may simply give up and we will, I believe, lose users that > way. > > So Bruce, this inf should be in HowToBuild, but all, it should also be on > squeak.org, and prominently. > > On Mon, Jan 11, 2021 at 3:04 AM Bruce O'Neel > wrote: > >> Hi, >> >> I just installed Mint 20.1, which is based on the most recent Ubuntu, on >> a x86-64 system ran >> >> apt install libpulse-dev >> >> and then built the VM at the git HEAD, and unlike before sound works >> perfectly. This is with a 5.3 image. >> >> Off to try this on my PI 400... >> >> cheers >> >> bruce >> >> >> > > -- > > _,,,^..^,,,_ > best, Eliot > > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 10:10:22 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 02:10:22 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 310223: Finish type change of ioMSecs -> unsigned int Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 31022381ed6d6552de05945e0aa84448f9b1959f https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/31022381ed6d6552de05945e0aa84448f9b1959f Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/Plan9/vm/sqPlan9io.c M platforms/iOS/vm/Common/Classes/sqMacV2Time.c M platforms/minheadless/generic/sqPlatformSpecific-Generic.c M platforms/minheadless/unix/sqUnixHeartbeat.c M platforms/minheadless/windows/sqWin32Heartbeat.c M platforms/minheadless/windows/sqWin32Time.c M platforms/unix/misc/threadValidate/sqUnixHeartbeat.c Log Message: ----------- Finish type change of ioMSecs -> unsigned int It should be everywhere From no-reply at appveyor.com Tue Jan 12 10:23:46 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 12 Jan 2021 10:23:46 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2361 Message-ID: <20210112102346.1.925557C2DAAB343C@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 13:00:56 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 05:00:56 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 133e6f: Fix the #define/#undef incantation on non spur VM ... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 133e6ffe5def226ba4f0deb66a91e516b01662ec https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/133e6ffe5def226ba4f0deb66a91e516b01662ec Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/unix/vm/sqPlatformSpecific.h Log Message: ----------- Fix the #define/#undef incantation on non spur VM (V3) Those define are for a default implementation, but do we really use it? Shouldn't it be protected by some USE_DEFAULT_ALLOCATION or something? Commit: 85fc1d429d232a790c6d8780c34cbb38692042ef https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/85fc1d429d232a790c6d8780c34cbb38692042ef Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/win32/vm/sqPlatformSpecific.h Log Message: ----------- Replace stddef.h by string.h in win32 platform specifics For some reasons, fails to compile on my machine, but fails on the C.I. The stack of uncompatible macros is getting really fragile... This commit is only a wild guess. IMO we should try and follow standards where possible. Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/31022381ed6d...85fc1d429d23 From nicolas.cellier.aka.nice at gmail.com Tue Jan 12 13:18:54 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 14:18:54 +0100 Subject: [Vm-dev] [squeak-dev] some stupid failures In-Reply-To: References: Message-ID: Here is another source of frequent C.I. failures: MCMethodDefinitionTest ✗ #testLoadAndUnload (20255ms) TestFailure: Test timed out Presumably not a lean and mean test... Le mar. 5 janv. 2021 à 17:59, Ron Teitelbaum a écrit : > > > Seems like more of a warning and not a failure. > > All the best, > > Ron Teitelbaum > > On Tue, Jan 5, 2021 at 3:22 AM Marcel Taeumel wrote: >> >> Hi Nicolas. >> >> > Do we really want to keep this kind of test? >> >> Such benchmarks (and benchmark-like tests) should at least average over several runs and only fail as a test if something actually got slower on average. Or something like that. A single misbehaving run should not be the reason for such a test failure. >> >> Maybe we can tweak #should:notTakeMoreThan: to evaluate the block several times? But then it cannot fail early on as it is doing now ... Hmmm... >> >> Best, >> Marcel >> >> Am 05.01.2021 09:08:46 schrieb Nicolas Cellier : >> >> >> Hi all, >> sometimes, some build fail for just 1 test... >> >> Here https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 >> a squeak.stack.v3 >> >> RenderBugz >> ✗ #testSetForward (7ms) >> TestFailure: Block evaluation took more than the expected 0:00:00:00.004 >> RenderBugz(TestCase)>>assert:description: >> RenderBugz(TestCase)>>should:notTakeMoreThan: >> RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: >> RenderBugz>>shouldntTakeLong: >> RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: 180.0 . >> self assert: ( t forwardDirection = 0.0 ) ] >> RenderBugz(TestCase)>>performTest >> >> 4ms, really? On C.I. infrastructure, anything can happen... >> Do we really want to keep this kind of test? >> We eventually could once startup performance is known (see >> isLowerPerformance discussion on squeak-dev), but in the interim, I >> suggest we neutralize this specific test in Smalltalk-CI. >> >> From nicolas.cellier.aka.nice at gmail.com Tue Jan 12 14:23:48 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 15:23:48 +0100 Subject: [Vm-dev] [squeak-dev] some stupid failures In-Reply-To: References: Message-ID: Yet another one (stack.v3) SUnitToolBuilderTests 837fef_b498 ✗ #testHandlingNotification (18863ms) Le mar. 12 janv. 2021 à 14:18, Nicolas Cellier a écrit : > > Here is another source of frequent C.I. failures: > > MCMethodDefinitionTest > > ✗ #testLoadAndUnload (20255ms) > > TestFailure: Test timed out > > Presumably not a lean and mean test... > > Le mar. 5 janv. 2021 à 17:59, Ron Teitelbaum a écrit : > > > > > > Seems like more of a warning and not a failure. > > > > All the best, > > > > Ron Teitelbaum > > > > On Tue, Jan 5, 2021 at 3:22 AM Marcel Taeumel wrote: > >> > >> Hi Nicolas. > >> > >> > Do we really want to keep this kind of test? > >> > >> Such benchmarks (and benchmark-like tests) should at least average over several runs and only fail as a test if something actually got slower on average. Or something like that. A single misbehaving run should not be the reason for such a test failure. > >> > >> Maybe we can tweak #should:notTakeMoreThan: to evaluate the block several times? But then it cannot fail early on as it is doing now ... Hmmm... > >> > >> Best, > >> Marcel > >> > >> Am 05.01.2021 09:08:46 schrieb Nicolas Cellier : > >> > >> > >> Hi all, > >> sometimes, some build fail for just 1 test... > >> > >> Here https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 > >> a squeak.stack.v3 > >> > >> RenderBugz > >> ✗ #testSetForward (7ms) > >> TestFailure: Block evaluation took more than the expected 0:00:00:00.004 > >> RenderBugz(TestCase)>>assert:description: > >> RenderBugz(TestCase)>>should:notTakeMoreThan: > >> RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: > >> RenderBugz>>shouldntTakeLong: > >> RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: 180.0 . > >> self assert: ( t forwardDirection = 0.0 ) ] > >> RenderBugz(TestCase)>>performTest > >> > >> 4ms, really? On C.I. infrastructure, anything can happen... > >> Do we really want to keep this kind of test? > >> We eventually could once startup performance is known (see > >> isLowerPerformance discussion on squeak-dev), but in the interim, I > >> suggest we neutralize this specific test in Smalltalk-CI. > >> > >> From nicolas.cellier.aka.nice at gmail.com Tue Jan 12 14:41:55 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 15:41:55 +0100 Subject: [Vm-dev] [squeak-dev] some stupid failures In-Reply-To: References: Message-ID: And the fun of it, each time I retry, I see a different random failure... ######################### # 1 tests did not pass: # ######################### CompiledMethodTest 16ccae_ca85 ✗ #testCopyWithTrailerBytes (11332ms) Le mar. 12 janv. 2021 à 15:23, Nicolas Cellier a écrit : > > Yet another one (stack.v3) > > SUnitToolBuilderTests > 837fef_b498 > > ✗ #testHandlingNotification (18863ms) > > Le mar. 12 janv. 2021 à 14:18, Nicolas Cellier > a écrit : > > > > Here is another source of frequent C.I. failures: > > > > MCMethodDefinitionTest > > > > ✗ #testLoadAndUnload (20255ms) > > > > TestFailure: Test timed out > > > > Presumably not a lean and mean test... > > > > Le mar. 5 janv. 2021 à 17:59, Ron Teitelbaum a écrit : > > > > > > > > > Seems like more of a warning and not a failure. > > > > > > All the best, > > > > > > Ron Teitelbaum > > > > > > On Tue, Jan 5, 2021 at 3:22 AM Marcel Taeumel wrote: > > >> > > >> Hi Nicolas. > > >> > > >> > Do we really want to keep this kind of test? > > >> > > >> Such benchmarks (and benchmark-like tests) should at least average over several runs and only fail as a test if something actually got slower on average. Or something like that. A single misbehaving run should not be the reason for such a test failure. > > >> > > >> Maybe we can tweak #should:notTakeMoreThan: to evaluate the block several times? But then it cannot fail early on as it is doing now ... Hmmm... > > >> > > >> Best, > > >> Marcel > > >> > > >> Am 05.01.2021 09:08:46 schrieb Nicolas Cellier : > > >> > > >> > > >> Hi all, > > >> sometimes, some build fail for just 1 test... > > >> > > >> Here https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 > > >> a squeak.stack.v3 > > >> > > >> RenderBugz > > >> ✗ #testSetForward (7ms) > > >> TestFailure: Block evaluation took more than the expected 0:00:00:00.004 > > >> RenderBugz(TestCase)>>assert:description: > > >> RenderBugz(TestCase)>>should:notTakeMoreThan: > > >> RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: > > >> RenderBugz>>shouldntTakeLong: > > >> RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: 180.0 . > > >> self assert: ( t forwardDirection = 0.0 ) ] > > >> RenderBugz(TestCase)>>performTest > > >> > > >> 4ms, really? On C.I. infrastructure, anything can happen... > > >> Do we really want to keep this kind of test? > > >> We eventually could once startup performance is known (see > > >> isLowerPerformance discussion on squeak-dev), but in the interim, I > > >> suggest we neutralize this specific test in Smalltalk-CI. > > >> > > >> From notifications at github.com Tue Jan 12 14:47:21 2021 From: notifications at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 06:47:21 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Upgrade libpng (#545) Message-ID: upgrade the version of several thirdparty libraries used by pharo - to avoid distributing binaries crippled by security issues (IMO we should better link dynamically to up-to-date binaries and let package managers and distro managers deal with the security issues) - to let the libraries compile on up-to-date OS/machines - to paint the C.I. results in green TODO: also upgrade libgit2 that has been officially released (as version 1.1.0 yet). Unfortunately, I could not compile it on my own machine - at least not thru the cmake complexifications. TODO: do not even recompile those libraries, or more exactly, compile them elsewhere, and import the released binaries. We could as well deprecate all those builds since no one seems to care. You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/545 -- Commit Summary -- * Try and rescue macos libpng builds for Pharo * also upgrade pixman to 0.40.0 * And let 32 bits builds pollute their own cache (x86 rather than x86_64) * And also upgrade cairo to 1.15.14 * Nuke win specific libpng.spec * Nuke pixman patch, the upgrade solved the thing * Workaround zlib configure bug for 32bits macos * SDL 2.0.14 & SSL 1.1.1i * Also update version of libpng, pixman and cairo in cmake builds * upgrade to SDL 2.10.4 in cmake builds too * Ugrade freetype 2.9.1 -> 2.10.4 * Upgrade libssh2 to 1.9.0 in cmake builds too * Upgrade openssl to 1.1.1i in cmake build too * Accept a pattern for windows_dll spec in cmake builds -- File Changes -- M build.macos32x86/common/Makefile.lib.extra (2) M build.macos32x86/pharo.cog.spur.lowcode/Makefile (9) M build.macos32x86/pharo.cog.spur.minheadless/Makefile (9) M build.macos32x86/pharo.cog.spur/Makefile (7) M build.macos32x86/pharo.cog.v3/Makefile (7) M build.macos32x86/pharo.sista.spur/Makefile (7) M build.macos32x86/pharo.stack.spur.lowcode/Makefile (7) M build.macos32x86/pharo.stack.spur/Makefile (7) M build.macos32x86/third-party/Makefile.libpng (6) A build.macos32x86/third-party/Makefile.zlib (40) M build.macos64x64/pharo.cog.spur.lowcode/Makefile (9) M build.macos64x64/pharo.cog.spur/Makefile (7) M build.macos64x64/pharo.sista.spur/Makefile (7) M build.macos64x64/pharo.stack.spur.lowcode/Makefile (9) M build.macos64x64/pharo.stack.spur/Makefile (7) M build.macos64x64/squeak.stack.spur/Makefile (2) M build.macos64x64/third-party/Makefile.cairo (2) M build.macos64x64/third-party/Makefile.freetype2 (2) M build.macos64x64/third-party/Makefile.libpng (6) A build.macos64x64/third-party/Makefile.zlib (40) M build.win32x86/third-party/Makefile.freetype2 (1) M build.win32x86/third-party/Makefile.libpng (2) M build.win64x64/third-party/Makefile.freetype2 (42) M build.win64x64/third-party/Makefile.libpng (4) M cmake/Cairo.cmake (8) M cmake/FreeType2.cmake (14) M cmake/LibGit2.cmake (5) M cmake/LibPNG.cmake (19) M cmake/LibSSH2.cmake (8) M cmake/OpenSSL.cmake (19) M cmake/Pixman.cmake (11) M cmake/PkgConfig.cmake (6) M cmake/SDL2.cmake (10) M cmake/ThirdPartyDependenciesMacros.cmake (10) M platforms/iOS/plugins/FT2Plugin/Makefile (1) M third-party/cairo.spec (6) M third-party/freetype2.spec (6) D third-party/freetype291.patch (28) M third-party/libpng.spec (7) D third-party/libpng.spec.win (11) M third-party/libsdl2.spec (17) M third-party/openssl.spec (6) M third-party/openssl.spec.win64 (6) D third-party/pixman.clang.patch (27) M third-party/pixman.spec (10) M third-party/zlib.spec (3) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/545.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/545.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/545 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 14:48:18 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 06:48:18 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 61faab: Try and rescue macos libpng builds for Pharo Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 61faabba1f68c1b5ba6b161f8571020b0ce755ec https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/61faabba1f68c1b5ba6b161f8571020b0ce755ec Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M build.macos32x86/pharo.cog.spur.lowcode/Makefile M build.macos32x86/pharo.cog.spur.minheadless/Makefile M build.macos32x86/pharo.cog.spur/Makefile M build.macos32x86/pharo.cog.v3/Makefile M build.macos32x86/pharo.sista.spur/Makefile M build.macos32x86/pharo.stack.spur.lowcode/Makefile M build.macos32x86/pharo.stack.spur/Makefile M build.macos32x86/third-party/Makefile.libpng A build.macos32x86/third-party/Makefile.zlib M build.macos64x64/pharo.cog.spur.lowcode/Makefile M build.macos64x64/pharo.cog.spur/Makefile M build.macos64x64/pharo.sista.spur/Makefile M build.macos64x64/pharo.stack.spur.lowcode/Makefile M build.macos64x64/pharo.stack.spur/Makefile M build.macos64x64/squeak.stack.spur/Makefile M build.macos64x64/third-party/Makefile.cairo M build.macos64x64/third-party/Makefile.freetype2 M build.macos64x64/third-party/Makefile.libpng A build.macos64x64/third-party/Makefile.zlib M platforms/iOS/plugins/FT2Plugin/Makefile M third-party/libpng.spec M third-party/zlib.spec Log Message: ----------- Try and rescue macos libpng builds for Pharo On macosx, zlib is a pre-requisite of libpng, so it has to be compiled While at it, upgrade libpng to 1.16.37 due to CVE-2019-7317 - see http://www.libpng.org/pub/png/libpng.html Commit: afe4f5abdc7cc2e6a8a7ab2d74237f0b6e3a8326 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/afe4f5abdc7cc2e6a8a7ab2d74237f0b6e3a8326 Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M third-party/pixman.spec Log Message: ----------- also upgrade pixman to 0.40.0 This is required on macos because newer version of clang do not anymore provide a `__builtin_shuffle` Commit: 8c26fc240e4e50f3a84fb1d3e1ebb734802e0b48 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8c26fc240e4e50f3a84fb1d3e1ebb734802e0b48 Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M build.macos32x86/common/Makefile.lib.extra Log Message: ----------- And let 32 bits builds pollute their own cache (x86 rather than x86_64) Commit: 6c33c2bb3f54acf1f0d302349dcee2e82bb4122c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/6c33c2bb3f54acf1f0d302349dcee2e82bb4122c Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M third-party/cairo.spec Log Message: ----------- And also upgrade cairo to 1.15.14 Commit: 8eb93486803c5fcef43fa088c433a053eaa8515b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8eb93486803c5fcef43fa088c433a053eaa8515b Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: M build.win32x86/third-party/Makefile.libpng M build.win64x64/third-party/Makefile.libpng R third-party/libpng.spec.win Log Message: ----------- Nuke win specific libpng.spec Commit: 3abac662759b8cd7bc54ea94b016da83b280b9bc https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3abac662759b8cd7bc54ea94b016da83b280b9bc Author: Nicolas Cellier Date: 2021-01-03 (Sun, 03 Jan 2021) Changed paths: R third-party/pixman.clang.patch Log Message: ----------- Nuke pixman patch, the upgrade solved the thing Commit: d22281a16078ce42efca185db3520f87910359c4 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d22281a16078ce42efca185db3520f87910359c4 Author: Nicolas Cellier Date: 2021-01-04 (Mon, 04 Jan 2021) Changed paths: M build.macos32x86/third-party/Makefile.zlib Log Message: ----------- Workaround zlib configure bug for 32bits macos configure fails to apply $ARCHS flags to $SFLAGS (the compiler options for compiling shared library) It's a single line patch for configure, but rather than patching, just workaround by forcing CFLAGS and LDFLAGS. Commit: 05907a069ffbc3eee22cc9bddb3d8c3811197957 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/05907a069ffbc3eee22cc9bddb3d8c3811197957 Author: Nicolas Cellier Date: 2021-01-05 (Tue, 05 Jan 2021) Changed paths: M third-party/libsdl2.spec M third-party/openssl.spec M third-party/openssl.spec.win64 Log Message: ----------- SDL 2.0.14 & SSL 1.1.1i Commit: e38f6acf530b774cced4fbda2c5f701e8e8493fd https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e38f6acf530b774cced4fbda2c5f701e8e8493fd Author: Nicolas Cellier Date: 2021-01-06 (Wed, 06 Jan 2021) Changed paths: M cmake/Cairo.cmake M cmake/FreeType2.cmake M cmake/LibGit2.cmake M cmake/LibPNG.cmake M cmake/LibSSH2.cmake M cmake/Pixman.cmake M cmake/PkgConfig.cmake M cmake/SDL2.cmake M cmake/ThirdPartyDependenciesMacros.cmake Log Message: ----------- Also update version of libpng, pixman and cairo in cmake builds There is no reason why cmake should use a different version. Use whatever hash is given by hosting sites, this is not necessarily SHA256. Change the ThirdPartyDependenciesMacros accordingly. Commit: 836cba12034fc762b88312723023c60866e10d74 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/836cba12034fc762b88312723023c60866e10d74 Author: Nicolas Cellier Date: 2021-01-06 (Wed, 06 Jan 2021) Changed paths: M cmake/SDL2.cmake Log Message: ----------- upgrade to SDL 2.10.4 in cmake builds too Commit: 07aad2fbc11587faf5f93d0594da15bab12fcf5e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/07aad2fbc11587faf5f93d0594da15bab12fcf5e Author: Nicolas Cellier Date: 2021-01-06 (Wed, 06 Jan 2021) Changed paths: M build.win32x86/third-party/Makefile.freetype2 M build.win64x64/third-party/Makefile.freetype2 M cmake/FreeType2.cmake M third-party/freetype2.spec R third-party/freetype291.patch Log Message: ----------- Ugrade freetype 2.9.1 -> 2.10.4 hence - remove the now useless patch - rebuild the win64 dll (same makefile as win32) rather than download from files.pharo.org Commit: a5c0f36609c0224e6c9af3f55e4ead706e1d2e8b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a5c0f36609c0224e6c9af3f55e4ead706e1d2e8b Author: Nicolas Cellier Date: 2021-01-07 (Thu, 07 Jan 2021) Changed paths: M cmake/LibSSH2.cmake Log Message: ----------- Upgrade libssh2 to 1.9.0 in cmake builds too Commit: dd2abe328c4c2727aee3ca19ec4166b52f80214a https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/dd2abe328c4c2727aee3ca19ec4166b52f80214a Author: Nicolas Cellier Date: 2021-01-09 (Sat, 09 Jan 2021) Changed paths: M cmake/OpenSSL.cmake Log Message: ----------- Upgrade openssl to 1.1.1i in cmake build too Commit: e455fe2e4b5581c90567d00c823ba7227fc7c586 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e455fe2e4b5581c90567d00c823ba7227fc7c586 Author: Nicolas Cellier Date: 2021-01-11 (Mon, 11 Jan 2021) Changed paths: M cmake/ThirdPartyDependenciesMacros.cmake Log Message: ----------- Accept a pattern for windows_dll spec in cmake builds This is necessary for OpenSSL library for example because it could be libssl-1.1.dll or libssl-1.1-x64.dll Commit: bb567e51fca23cf3310fd9a7d98b1678fa29d6e6 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/bb567e51fca23cf3310fd9a7d98b1678fa29d6e6 Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M build.macos32x86/common/Makefile.lib.extra M build.macos32x86/pharo.cog.spur.lowcode/Makefile M build.macos32x86/pharo.cog.spur.minheadless/Makefile M build.macos32x86/pharo.cog.spur/Makefile M build.macos32x86/pharo.cog.v3/Makefile M build.macos32x86/pharo.sista.spur/Makefile M build.macos32x86/pharo.stack.spur.lowcode/Makefile M build.macos32x86/pharo.stack.spur/Makefile M build.macos32x86/third-party/Makefile.libpng A build.macos32x86/third-party/Makefile.zlib M build.macos64x64/pharo.cog.spur.lowcode/Makefile M build.macos64x64/pharo.cog.spur/Makefile M build.macos64x64/pharo.sista.spur/Makefile M build.macos64x64/pharo.stack.spur.lowcode/Makefile M build.macos64x64/pharo.stack.spur/Makefile M build.macos64x64/squeak.stack.spur/Makefile M build.macos64x64/third-party/Makefile.cairo M build.macos64x64/third-party/Makefile.freetype2 M build.macos64x64/third-party/Makefile.libpng A build.macos64x64/third-party/Makefile.zlib M build.win32x86/third-party/Makefile.freetype2 M build.win32x86/third-party/Makefile.libpng M build.win64x64/third-party/Makefile.freetype2 M build.win64x64/third-party/Makefile.libpng M cmake/Cairo.cmake M cmake/FreeType2.cmake M cmake/LibGit2.cmake M cmake/LibPNG.cmake M cmake/LibSSH2.cmake M cmake/OpenSSL.cmake M cmake/Pixman.cmake M cmake/PkgConfig.cmake M cmake/SDL2.cmake M cmake/ThirdPartyDependenciesMacros.cmake M platforms/iOS/plugins/FT2Plugin/Makefile M third-party/cairo.spec M third-party/freetype2.spec R third-party/freetype291.patch M third-party/libpng.spec R third-party/libpng.spec.win M third-party/libsdl2.spec M third-party/openssl.spec M third-party/openssl.spec.win64 R third-party/pixman.clang.patch M third-party/pixman.spec M third-party/zlib.spec Log Message: ----------- Merge pull request #545 from OpenSmalltalk/upgrade_libpng Upgrade libpng Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/85fc1d429d23...bb567e51fca2 From notifications at github.com Tue Jan 12 14:48:18 2021 From: notifications at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 06:48:18 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Upgrade libpng (#545) In-Reply-To: References: Message-ID: Merged #545 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/545#event-4196267469 -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Jan 12 14:57:12 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 12 Jan 2021 14:57:12 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2362 Message-ID: <20210112145712.1.94864B1BB86D5E95@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 15:11:06 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 07:11:06 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 152e1f: Like in unix, win32 needs to #undef the default im... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 152e1fa8bd335f21d72ba36549ef0e68f5c8d853 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/152e1fa8bd335f21d72ba36549ef0e68f5c8d853 Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/win32/vm/sqWin32Alloc.h Log Message: ----------- Like in unix, win32 needs to #undef the default implementation afterwards... From no-reply at appveyor.com Tue Jan 12 15:34:40 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 12 Jan 2021 15:34:40 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2364 Message-ID: <20210112153440.1.3A9CE6B7B009120D@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Jan 12 15:41:54 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 12 Jan 2021 15:41:54 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2365 Message-ID: <20210112154154.1.40515CF3F485CE79@appveyor.com> An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Tue Jan 12 16:16:52 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 17:16:52 +0100 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2365 In-Reply-To: <20210112154154.1.40515CF3F485CE79@appveyor.com> References: <20210112154154.1.40515CF3F485CE79@appveyor.com> Message-ID: Arghh! I feel like Leprechauns' interest in ruining the builds is proportional to the efforts you deploy to make it green! Appveyor: ERROR: Could not find a valid gem 'dpl' (>= 0), here is why: Unable to download data from https://rubygems.org/ - bad response Gateway Error 502 (https://rubygems.org/specs.4.8.gz) Travis: ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response Gateway Error 502 (https://rubygems.org/quick/Marshal.4.8/dpl-1.4.0.gemspec.rz) Script failed with status 1 Someone stole the gems probably... Le mar. 12 janv. 2021 à 16:42, AppVeyor a écrit : > > > > Build opensmalltalk-vm 1.0.2365 failed > > Commit 152e1fa8bd by Nicolas Cellier on 1/12/2021 3:10 PM: > Like in unix, win32 needs to #undef the default implementation afterwards... > > Configure your notification preferences From Das.Linux at gmx.de Tue Jan 12 16:38:26 2021 From: Das.Linux at gmx.de (Tobias Pape) Date: Tue, 12 Jan 2021 17:38:26 +0100 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2365 In-Reply-To: References: <20210112154154.1.40515CF3F485CE79@appveyor.com> Message-ID: <4CC63C13-C9D3-4F35-A81D-7D60135351E8@gmx.de> > On 12. Jan 2021, at 17:16, Nicolas Cellier wrote: > > > Arghh! > I feel like Leprechauns' interest in ruining the builds is > proportional to the efforts you deploy to make it green! > > Appveyor: > > ERROR: Could not find a valid gem 'dpl' (>= 0), here is why: Unable to > download data from https://rubygems.org/ - bad response Gateway Error > 502 (https://rubygems.org/specs.4.8.gz) > > Travis: > > ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) > > bad response Gateway Error 502 > (https://rubygems.org/quick/Marshal.4.8/dpl-1.4.0.gemspec.rz) > > Script failed with status 1 > > Someone stole the gems probably... 🤣 > > > Le mar. 12 janv. 2021 à 16:42, AppVeyor a écrit : >> >> >> >> Build opensmalltalk-vm 1.0.2365 failed >> >> Commit 152e1fa8bd by Nicolas Cellier on 1/12/2021 3:10 PM: >> Like in unix, win32 needs to #undef the default implementation afterwards... >> >> Configure your notification preferences From marcel.taeumel at hpi.de Tue Jan 12 16:41:02 2021 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Tue, 12 Jan 2021 17:41:02 +0100 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2365 In-Reply-To: References: <20210112154154.1.40515CF3F485CE79@appveyor.com> Message-ID: Hi Nicolas. > Arghh! > I feel like Leprechauns' interest in ruining the builds is > proportional to the efforts you deploy to make it green! Keep going! You can do it! :-) Thanks for looking into these issues.  Best, Marcel Am 12.01.2021 17:17:13 schrieb Nicolas Cellier : Arghh! I feel like Leprechauns' interest in ruining the builds is proportional to the efforts you deploy to make it green! Appveyor: ERROR: Could not find a valid gem 'dpl' (>= 0), here is why: Unable to download data from https://rubygems.org/ - bad response Gateway Error 502 (https://rubygems.org/specs.4.8.gz) Travis: ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response Gateway Error 502 (https://rubygems.org/quick/Marshal.4.8/dpl-1.4.0.gemspec.rz) Script failed with status 1 Someone stole the gems probably... Le mar. 12 janv. 2021 à 16:42, AppVeyor a écrit : > > > > Build opensmalltalk-vm 1.0.2365 failed > > Commit 152e1fa8bd by Nicolas Cellier on 1/12/2021 3:10 PM: > Like in unix, win32 needs to #undef the default implementation afterwards... > > Configure your notification preferences -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 20:33:56 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 12:33:56 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 6cf1e9: Temporarily disable RenderBugz tests Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 6cf1e9dde82a43c8b3001542be7e2b8eca14ac11 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/6cf1e9dde82a43c8b3001542be7e2b8eca14ac11 Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M tests/smalltalk.ston Log Message: ----------- Temporarily disable RenderBugz tests They are catching an infinite loop with a 4ms timeout That's way too fast for some CI infrastructure and is causing random failures From notifications at github.com Tue Jan 12 21:49:18 2021 From: notifications at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 13:49:18 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] jpeg plugin crashes in win64 cygwin/mingw builds (#526) In-Reply-To: References: Message-ID: I think that a good part of the problem is that we call `_setjmp` but then `longjmp` instead of `_longjmp` in `error_exit`. If we (re)`#define setjmp` then we must also (re)`#define longjmp _longjmp` -- 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/526#issuecomment-759054202 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 12 22:07:34 2021 From: noreply at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 14:07:34 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 0cc49f: Fix issue #526 (jpeg plugin crash on mingw win32/64) Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 0cc49f9111527e1326b638ef754c03ee39a1b649 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/0cc49f9111527e1326b638ef754c03ee39a1b649 Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M platforms/Cross/vm/sqSetjmpShim.h Log Message: ----------- Fix issue #526 (jpeg plugin crash on mingw win32/64) If we define setjmp then we must also define longjmp. Commit: 75b842240b4d4451e8eac5b13ed490062664ba2a https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/75b842240b4d4451e8eac5b13ed490062664ba2a Author: Nicolas Cellier Date: 2021-01-12 (Tue, 12 Jan 2021) Changed paths: M tests/smalltalk.ston Log Message: ----------- Oups, fixup STON syntax typo Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/6cf1e9dde82a...75b842240b4d From notifications at github.com Tue Jan 12 22:55:31 2021 From: notifications at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 14:55:31 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] jpeg plugin crashes in win64 cygwin/mingw builds (#526) In-Reply-To: References: Message-ID: The commit fixed it for me -- 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/526#issuecomment-759089224 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Tue Jan 12 22:55:31 2021 From: notifications at github.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 14:55:31 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] jpeg plugin crashes in win64 cygwin/mingw builds (#526) In-Reply-To: References: Message-ID: Closed #526. -- 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/526#event-4198398378 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Tue Jan 12 22:58:36 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Tue, 12 Jan 2021 23:58:36 +0100 Subject: [Vm-dev] [squeak-dev] some stupid failures In-Reply-To: References: Message-ID: Hmm, for the sake of documenting the randomly failing tests, here are two others: ###################################################### # Squeak-4.6 on Travis CI (2361.31) # # 3396 Tests with 2 Failures and 0 Errors in 158.13s # ###################################################### ######################### # 2 tests did not pass: # ######################### PureBehaviorTest 8401de_4bcf ✗ #testMethodCategoryReorganization (20517ms) SecureHashAlgorithmTest b63682_4bcf ✗ #testEmptyInput (12145ms) Le mar. 12 janv. 2021 à 15:41, Nicolas Cellier a écrit : > > And the fun of it, each time I retry, I see a different random failure... > > ######################### > > # 1 tests did not pass: # > > ######################### > > CompiledMethodTest > 16ccae_ca85 > > ✗ #testCopyWithTrailerBytes (11332ms) > > Le mar. 12 janv. 2021 à 15:23, Nicolas Cellier > a écrit : > > > > Yet another one (stack.v3) > > > > SUnitToolBuilderTests > > 837fef_b498 > > > > ✗ #testHandlingNotification (18863ms) > > > > Le mar. 12 janv. 2021 à 14:18, Nicolas Cellier > > a écrit : > > > > > > Here is another source of frequent C.I. failures: > > > > > > MCMethodDefinitionTest > > > > > > ✗ #testLoadAndUnload (20255ms) > > > > > > TestFailure: Test timed out > > > > > > Presumably not a lean and mean test... > > > > > > Le mar. 5 janv. 2021 à 17:59, Ron Teitelbaum a écrit : > > > > > > > > > > > > Seems like more of a warning and not a failure. > > > > > > > > All the best, > > > > > > > > Ron Teitelbaum > > > > > > > > On Tue, Jan 5, 2021 at 3:22 AM Marcel Taeumel wrote: > > > >> > > > >> Hi Nicolas. > > > >> > > > >> > Do we really want to keep this kind of test? > > > >> > > > >> Such benchmarks (and benchmark-like tests) should at least average over several runs and only fail as a test if something actually got slower on average. Or something like that. A single misbehaving run should not be the reason for such a test failure. > > > >> > > > >> Maybe we can tweak #should:notTakeMoreThan: to evaluate the block several times? But then it cannot fail early on as it is doing now ... Hmmm... > > > >> > > > >> Best, > > > >> Marcel > > > >> > > > >> Am 05.01.2021 09:08:46 schrieb Nicolas Cellier : > > > >> > > > >> > > > >> Hi all, > > > >> sometimes, some build fail for just 1 test... > > > >> > > > >> Here https://travis-ci.com/github/OpenSmalltalk/opensmalltalk-vm/jobs/468407844 > > > >> a squeak.stack.v3 > > > >> > > > >> RenderBugz > > > >> ✗ #testSetForward (7ms) > > > >> TestFailure: Block evaluation took more than the expected 0:00:00:00.004 > > > >> RenderBugz(TestCase)>>assert:description: > > > >> RenderBugz(TestCase)>>should:notTakeMoreThan: > > > >> RenderBugz(TestCase)>>should:notTakeMoreThanMilliseconds: > > > >> RenderBugz>>shouldntTakeLong: > > > >> RenderBugz>>testSetForward ...shouldntTakeLong: [ t forwardDirection: 180.0 . > > > >> self assert: ( t forwardDirection = 0.0 ) ] > > > >> RenderBugz(TestCase)>>performTest > > > >> > > > >> 4ms, really? On C.I. infrastructure, anything can happen... > > > >> Do we really want to keep this kind of test? > > > >> We eventually could once startup performance is known (see > > > >> isLowerPerformance discussion on squeak-dev), but in the interim, I > > > >> suggest we neutralize this specific test in Smalltalk-CI. > > > >> > > > >> From no-reply at appveyor.com Tue Jan 12 23:56:45 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 12 Jan 2021 23:56:45 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2366 Message-ID: <20210112235645.1.F718724C41FF1B1E@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Jan 15 00:32:58 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 15 Jan 2021 00:32:58 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2933.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2933.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2933 Author: eem Time: 14 January 2021, 4:32:48.434554 pm UUID: 40063e45-0e58-4195-a825-e21b1df79769 Ancestors: VMMaker.oscog-eem.2932 Float>>coerceTo:sim: should handle #double as well. =============== Diff against VMMaker.oscog-eem.2932 =============== Item was changed: ----- Method: Float>>coerceTo:sim: (in category '*VMMaker-interpreter simulator') ----- coerceTo: cTypeString sim: interpreter + cTypeString = #float ifTrue: - cTypeString = #'float' ifTrue: [^self]. + cTypeString = #double ifTrue: + [^self]. self halt! From nicolas.cellier.aka.nice at gmail.com Fri Jan 15 02:15:44 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Fri, 15 Jan 2021 03:15:44 +0100 Subject: [Vm-dev] primitiveHighBit interesting bug Message-ID: Hi all, I got this on uptodate Mingw Win 64 bits Squeak.cog.spur VM: (1to: 8) collect: [:i|-2942842961920 highBitOfMagnitude] -> #(6 6 42 42 42 42 42 42) That is correct once jitted, but wrong first two times... I just can't understand when/how it fails by reading the code... Any clue? Nicolas From nicolas.cellier.aka.nice at gmail.com Fri Jan 15 02:35:40 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Fri, 15 Jan 2021 03:35:40 +0100 Subject: [Vm-dev] primitiveHighBit interesting bug In-Reply-To: References: Message-ID: Ah! Got it! The generated code is incorrect! Source: leadingZeroCount = 0 ifTrue: ["highBit is not defined for negative Integer" self primitiveFail] ifFalse: ["Nice bit trick: 1-based high-bit is (32 - clz) - 1 to account for tag bit. This is like two-complement - clz - 1 on 5 bits, or in other words a bit-invert operation clz ^16r1F" self pop: 1 thenPushInteger: (leadingZeroCount bitXor: (BytesPerWord * 8 - 1))]. ^self]. Generated: if (leadingZeroCount == 0) { /* highBit is not defined for negative Integer */ /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } } /* begin pop:thenPushInteger: */ longAtput((sp = GIV(stackPointer) + ((0) * BytesPerWord)), (((usqInt)(leadingZeroCount ^ ((BytesPerWord * 8) - 1)) << 3) | 1)); GIV(stackPointer) = sp; The ifFalse: branch has been gobbled... Hence with always push (0 bitXor: 16r3F) as small integer in place of the receiver, the fail the primitive... The fallback code proceeds with 16r3F and answers 6... Correct. WE MUST FIX THE GENERATOR ASAP ! Le ven. 15 janv. 2021 à 03:15, Nicolas Cellier a écrit : > > Hi all, > I got this on uptodate Mingw Win 64 bits Squeak.cog.spur VM: > > (1to: 8) collect: [:i|-2942842961920 highBitOfMagnitude] > -> #(6 6 42 42 42 42 42 42) > > That is correct once jitted, but wrong first two times... > I just can't understand when/how it fails by reading the code... > Any clue? > > Nicolas From eliot.miranda at gmail.com Fri Jan 15 05:21:06 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Thu, 14 Jan 2021 21:21:06 -0800 Subject: [Vm-dev] primitiveHighBit interesting bug In-Reply-To: References: Message-ID: <573B0567-1A3B-402F-812E-0FCC54EDB4ED@gmail.com> I’ll fix it tomorrow morning. Thanks!! _,,,^..^,,,_ (phone) > On Jan 14, 2021, at 6:36 PM, Nicolas Cellier wrote: > >  > Ah! Got it! > The generated code is incorrect! > Source: > > leadingZeroCount = 0 > ifTrue: > ["highBit is not defined for negative Integer" > self primitiveFail] > ifFalse: > ["Nice bit trick: 1-based high-bit is (32 - clz) - > 1 to account for tag bit. > This is like two-complement - clz - 1 on 5 bits, > or in other words a bit-invert operation clz ^16r1F" > self pop: 1 thenPushInteger: (leadingZeroCount > bitXor: (BytesPerWord * 8 - 1))]. > ^self]. > > Generated: > > if (leadingZeroCount == 0) { > > /* highBit is not defined for negative Integer */ > /* begin primitiveFail */ > if (!GIV(primFailCode)) { > GIV(primFailCode) = 1; > } > } > /* begin pop:thenPushInteger: */ > longAtput((sp = GIV(stackPointer) + ((0) * BytesPerWord)), > (((usqInt)(leadingZeroCount ^ ((BytesPerWord * 8) - 1)) << 3) | 1)); > GIV(stackPointer) = sp; > > The ifFalse: branch has been gobbled... > Hence with always push (0 bitXor: 16r3F) as small integer in place of > the receiver, the fail the primitive... > The fallback code proceeds with 16r3F and answers 6... Correct. > > WE MUST FIX THE GENERATOR ASAP ! > >> Le ven. 15 janv. 2021 à 03:15, Nicolas Cellier >> a écrit : >> >> Hi all, >> I got this on uptodate Mingw Win 64 bits Squeak.cog.spur VM: >> >> (1to: 8) collect: [:i|-2942842961920 highBitOfMagnitude] >> -> #(6 6 42 42 42 42 42 42) >> >> That is correct once jitted, but wrong first two times... >> I just can't understand when/how it fails by reading the code... >> Any clue? >> >> Nicolas From eliot.miranda at gmail.com Fri Jan 15 05:44:25 2021 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Thu, 14 Jan 2021 21:44:25 -0800 Subject: [Vm-dev] primitiveHighBit interesting bug In-Reply-To: References: Message-ID: Hi Nicolas, On Thu, Jan 14, 2021 at 6:36 PM Nicolas Cellier < nicolas.cellier.aka.nice at gmail.com> wrote: > > Ah! Got it! > The generated code is incorrect! > Source: > > leadingZeroCount = 0 > ifTrue: > ["highBit is not defined for negative Integer" > self primitiveFail] > ifFalse: > ["Nice bit trick: 1-based high-bit is (32 - clz) - > 1 to account for tag bit. > This is like two-complement - clz - 1 on 5 bits, > or in other words a bit-invert operation clz ^16r1F" > self pop: 1 thenPushInteger: (leadingZeroCount > bitXor: (BytesPerWord * 8 - 1))]. > ^self]. > > The source I have looks like: "Note: in gcc, result is undefined if input is zero (for compatibility with BSR fallback when no CLZ instruction available). but input is never zero because we pass the oop with tag bits set, so we are safe" objectMemory wordSize = 4 ifTrue: [leadingZeroCount := self __builtin_clz: integerReceiverOop] ifFalse: [leadingZeroCount := self __builtin_clzll: integerReceiverOop]. leadingZeroCount = 0 ifTrue: "highBit is not defined for negative Integer" [self primitiveFail]. "Nice bit trick: 1-based high-bit is (32 - clz) - 1 to account for tag bit. This is like two-complement - clz - 1 on 5 bits, or in other words a bit-invert operation clz ^16r1F" self pop: 1 thenPushInteger: (leadingZeroCount bitXor: (BytesPerWord * 8 - 1)) so the problem is not in the generator. Did you fix this and not publish? Generated: > > if (leadingZeroCount == 0) { > > /* highBit is not defined for negative Integer */ > /* begin primitiveFail */ > if (!GIV(primFailCode)) { > GIV(primFailCode) = 1; > } > } > /* begin pop:thenPushInteger: */ > longAtput((sp = GIV(stackPointer) + ((0) * BytesPerWord)), > (((usqInt)(leadingZeroCount ^ ((BytesPerWord * 8) - 1)) << 3) | 1)); > GIV(stackPointer) = sp; > > The ifFalse: branch has been gobbled... > Hence with always push (0 bitXor: 16r3F) as small integer in place of > the receiver, the fail the primitive... > The fallback code proceeds with 16r3F and answers 6... Correct. > > WE MUST FIX THE GENERATOR ASAP ! > > Le ven. 15 janv. 2021 à 03:15, Nicolas Cellier > a écrit : > > > > Hi all, > > I got this on uptodate Mingw Win 64 bits Squeak.cog.spur VM: > > > > (1to: 8) collect: [:i|-2942842961920 highBitOfMagnitude] > > -> #(6 6 42 42 42 42 42 42) > > > > That is correct once jitted, but wrong first two times... > > I just can't understand when/how it fails by reading the code... > > Any clue? > > > > Nicolas > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Jan 15 05:48:24 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 15 Jan 2021 05:48:24 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2934.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2934.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2934 Author: eem Time: 14 January 2021, 9:48:15.416798 pm UUID: 8fba4a5b-3424-47bb-b2de-f632bd307408 Ancestors: VMMaker.oscog-eem.2933 Fix a slip in primitiveHighBit when #'__GNUC__' defined =============== Diff against VMMaker.oscog-eem.2933 =============== Item was changed: ----- Method: InterpreterPrimitives>>primitiveHighBit (in category 'arithmetic integer primitives') ----- primitiveHighBit | integerReceiverOop leadingZeroCount highestBitZeroBased | integerReceiverOop := self stackTop. "Convert the receiver Oop to use a single tag bit" objectMemory numSmallIntegerTagBits > 1 ifTrue: [integerReceiverOop := (integerReceiverOop >>> (objectMemory numSmallIntegerTagBits-1) bitOr: 1)]. self cppIf: #'__GNUC__' defined ifTrue: ["Note: in gcc, result is undefined if input is zero (for compatibility with BSR fallback when no CLZ instruction available). but input is never zero because we pass the oop with tag bits set, so we are safe" objectMemory wordSize = 4 ifTrue: [leadingZeroCount := self __builtin_clz: integerReceiverOop] ifFalse: [leadingZeroCount := self __builtin_clzll: integerReceiverOop]. leadingZeroCount = 0 ifTrue: "highBit is not defined for negative Integer" + [^self primitiveFail]. - [self primitiveFail]. "Nice bit trick: 1-based high-bit is (32 - clz) - 1 to account for tag bit. This is like two-complement - clz - 1 on 5 bits, or in other words a bit-invert operation clz ^16r1F" self pop: 1 thenPushInteger: (leadingZeroCount bitXor: (BytesPerWord * 8 - 1))] cppIf: #'_MSC_VER' defined | #'__ICC' defined ifTrue: ["In MSVC, _lzcnt and _lzcnt64 builtins do not fallback to BSR when not supported by CPU Instead of messing with __cpuid() we always use the BSR intrinsic" + - "Trick: we test the oop sign rather than the integerValue. Assume oop are signed (so far, they are, sqInt are signed)" integerReceiverOop < 0 ifTrue: [^self primitiveFail]. "Setting this variable is useless, but VMMaker will generate an automatic initialization at a worse place if this isn't initialized explicitly." highestBitZeroBased := 0. "We do not even test the return value, because integerReceiverOop is never zero" objectMemory wordSize = 4 ifTrue: [self _BitScanReverse: (self addressOf: highestBitZeroBased) _: integerReceiverOop] ifFalse: [self _BitScanReverse64: (self addressOf: highestBitZeroBased) _: integerReceiverOop]. "thanks to the tag bit, the +1 operation for getting 1-based rank is not necessary" self pop: 1 thenPushInteger: highestBitZeroBased] ifFalse: ["not gcc/clang, nor MSVC/ICC, you have to implement if your compiler provides useful builtins" self cCode: [self primitiveFail] inSmalltalk: "Simulate so that the simulator is closer to the actual VM" [integerReceiverOop < 0 ifTrue: [^self primitiveFail]. self pop: 1 thenPushInteger: integerReceiverOop highBit - 1]]! From noreply at github.com Fri Jan 15 05:59:17 2021 From: noreply at github.com (Eliot Miranda) Date: Thu, 14 Jan 2021 21:59:17 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d8b9a1: CogVM source as per VMMaker.oscog-eem.2934 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d8b9a1ad38049fb334167aeb2808a6e785d7745f https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d8b9a1ad38049fb334167aeb2808a6e785d7745f Author: Eliot Miranda Date: 2021-01-14 (Thu, 14 Jan 2021) Changed paths: M nsspur64src/vm/cointerp.c M nsspur64src/vm/cointerp.h M nsspur64src/vm/gcc3x-cointerp.c 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/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/cointerp.c M spurlowcode64src/vm/cointerp.h M spurlowcode64src/vm/gcc3x-cointerp.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/cointerp.c M spursista64src/vm/cointerp.h M spursista64src/vm/gcc3x-cointerp.c M spursistasrc/vm/cointerp.c M spursistasrc/vm/cointerp.h M spursistasrc/vm/gcc3x-cointerp.c 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/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c M src/plugins/DESPlugin/DESPlugin.c M src/plugins/DSAPrims/DSAPrims.c M src/plugins/FloatMathPlugin/FloatMathPlugin.c M src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c M src/plugins/Klatt/Klatt.c M src/plugins/LargeIntegers/LargeIntegers.c M src/plugins/MD5Plugin/MD5Plugin.c M src/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c M src/plugins/SHA2Plugin/SHA2Plugin.c M src/plugins/ScratchPlugin/ScratchPlugin.c M src/plugins/SoundPlugin/SoundPlugin.c M src/plugins/StarSqueakPlugin/StarSqueakPlugin.c M src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c M src/plugins/ZipPlugin/ZipPlugin.c 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.2934 Fix a slip in primitiveHighBit when #'__GNUC__' defined Regenerate plugins given the number formatting improvements in VMMaker.oscog-nice.2913. From nicolas.cellier.aka.nice at gmail.com Fri Jan 15 08:10:42 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Fri, 15 Jan 2021 09:10:42 +0100 Subject: [Vm-dev] primitiveHighBit interesting bug In-Reply-To: References: Message-ID: Hi Eliot, Le ven. 15 janv. 2021 à 06:44, Eliot Miranda a écrit : > > > Hi Nicolas, > > On Thu, Jan 14, 2021 at 6:36 PM Nicolas Cellier wrote: >> >> >> Ah! Got it! >> The generated code is incorrect! >> Source: >> >> leadingZeroCount = 0 >> ifTrue: >> ["highBit is not defined for negative Integer" >> self primitiveFail] >> ifFalse: >> ["Nice bit trick: 1-based high-bit is (32 - clz) - >> 1 to account for tag bit. >> This is like two-complement - clz - 1 on 5 bits, >> or in other words a bit-invert operation clz ^16r1F" >> self pop: 1 thenPushInteger: (leadingZeroCount >> bitXor: (BytesPerWord * 8 - 1))]. >> ^self]. >> > > The source I have looks like: > > "Note: in gcc, result is undefined if input is zero (for compatibility with BSR fallback when no CLZ instruction available). > but input is never zero because we pass the oop with tag bits set, so we are safe" > objectMemory wordSize = 4 > ifTrue: [leadingZeroCount := self __builtin_clz: integerReceiverOop] > ifFalse: [leadingZeroCount := self __builtin_clzll: integerReceiverOop]. > leadingZeroCount = 0 ifTrue: "highBit is not defined for negative Integer" > [self primitiveFail]. > "Nice bit trick: 1-based high-bit is (32 - clz) - 1 to account for tag bit. > This is like two-complement - clz - 1 on 5 bits, or in other words a bit-invert operation clz ^16r1F" > self pop: 1 thenPushInteger: (leadingZeroCount bitXor: (BytesPerWord * 8 - 1)) > so the problem is not in the generator. Did you fix this and not publish? > Oups, too many VMMaker images, I picked the source from the wrong one, so this is not a generator bug, just a refactoring slip indeed. Thanks for the quick fix. Note that the bug might have altered the printString of some negative Float... It might be the regression that you were tracking by the end of last year... cheers >> Generated: >> >> if (leadingZeroCount == 0) { >> >> /* highBit is not defined for negative Integer */ >> /* begin primitiveFail */ >> if (!GIV(primFailCode)) { >> GIV(primFailCode) = 1; >> } >> } >> /* begin pop:thenPushInteger: */ >> longAtput((sp = GIV(stackPointer) + ((0) * BytesPerWord)), >> (((usqInt)(leadingZeroCount ^ ((BytesPerWord * 8) - 1)) << 3) | 1)); >> GIV(stackPointer) = sp; >> >> The ifFalse: branch has been gobbled... >> Hence with always push (0 bitXor: 16r3F) as small integer in place of >> the receiver, the fail the primitive... >> The fallback code proceeds with 16r3F and answers 6... Correct. >> >> WE MUST FIX THE GENERATOR ASAP ! >> >> Le ven. 15 janv. 2021 à 03:15, Nicolas Cellier >> a écrit : >> > >> > Hi all, >> > I got this on uptodate Mingw Win 64 bits Squeak.cog.spur VM: >> > >> > (1to: 8) collect: [:i|-2942842961920 highBitOfMagnitude] >> > -> #(6 6 42 42 42 42 42 42) >> > >> > That is correct once jitted, but wrong first two times... >> > I just can't understand when/how it fails by reading the code... >> > Any clue? >> > >> > Nicolas > > > > -- > _,,,^..^,,,_ > best, Eliot From notifications at github.com Fri Jan 15 13:45:36 2021 From: notifications at github.com (Nicolas Cellier) Date: Fri, 15 Jan 2021 05:45:36 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Uninitialized scale in B3DShaderPlugin>>computeDirection (#434) In-Reply-To: References: Message-ID: >From what I understand, this is quite a mess! - it can be used in dotProduct with `PrimLightDirection `in `computeSpotFactor` but then, the `cosAngle ` dotProduct is negated (after negation, it is expected positive, > minCos) - it can be used in dotProduct with `PrimVtxNormal` in `shadeVertex` for diffuse part again, the `cosAngle ` dotProduct is expected to be positive, - after being copied to `l2vSpecDir` and transformed into specular direction, it is also used for specular part again, the `cosAngle ` dotProduct is expected to be positive, The light direction (pointed by `PrimLightDirection ` offset) is used as parameter `GL_SPOT_DIRECTION ` for the `glLightfv `function. >From what I understand, it sets the main direction of **propagation** of light (from light source which is at top of the cone, to center of enlighted surface which is a circular section of the cone). Thus, the 1st usage suggests that the l2vDirection is vertex to light and not light to vertex as the name does NOT tell! The 2nd and 3rd usage confirm this - if ever the normal of vertex is oriented outside the visible face... This would explain the `-1*scale`... **But** for source at infinite distance, `(lightFlags anyMask: FlagDirectional)`, the light to vertex direction is constant and equal to the `PrimLightDirection`, so that's what is simply copied in `computeDirection`... I perfectly understand that, **EXCEPT THIS**, there is no -1 scale in this branch??? So I definitely understand nothing to this code, this is highly contradictory. Maybe it only works for `(vbFlags bitAnd: VBTwoSidedLighting)` which enables a `cosAngle` of opposite sign? Despite knowing that the code is incorrect, it's very hard to modify a code that one does not understand, there is a high risk of breaking the fragile edifice. What is required is test cases of some sort for non regression. Des that only exist? -- 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/434#issuecomment-760950333 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Fri Jan 15 21:55:08 2021 From: notifications at github.com (Ronie Salgado) Date: Fri, 15 Jan 2021 13:55:08 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Plumb OS X custom url scheme events into drop events (#546) Message-ID: These changes are needed for handling custom url schemes in OS X, which gets translated into drop events. Feature requested by Eliot. You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/546 -- Commit Summary -- * I implemented the missing plumbing machinery for translating custom URL schemes in OS X into drop events. -- File Changes -- M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.h (1) M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m (17) M platforms/iOS/vm/OSX/sqSqueakOSXCGView.m (37) M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m (17) M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m (34) M platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m (36) M platforms/iOS/vm/OSX/sqSqueakOSXView.h (7) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/546.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/546.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/546 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Fri Jan 15 23:19:15 2021 From: notifications at github.com (Eliot Miranda) Date: Fri, 15 Jan 2021 15:19:15 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Plumb OS X custom url scheme events into drop events (#546) In-Reply-To: References: Message-ID: @eliotmiranda approved this pull request. -- 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/546#pullrequestreview-569760725 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Fri Jan 15 23:19:33 2021 From: notifications at github.com (Eliot Miranda) Date: Fri, 15 Jan 2021 15:19:33 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Plumb OS X custom url scheme events into drop events (#546) In-Reply-To: References: Message-ID: Closed #546. -- 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/546#event-4213300897 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Fri Jan 15 23:22:57 2021 From: notifications at github.com (Eliot Miranda) Date: Fri, 15 Jan 2021 15:22:57 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Plumb OS X custom url scheme events into drop events (#546) In-Reply-To: References: Message-ID: Merged #546 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/546#event-4213308272 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Fri Jan 15 23:23:04 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 15 Jan 2021 15:23:04 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 1fcc86: I implemented the missing plumbing machinery for t... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 1fcc861e1b02bff9f807340d478acef9f277fc7e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/1fcc861e1b02bff9f807340d478acef9f277fc7e Author: Ronie Salgado Date: 2021-01-15 (Fri, 15 Jan 2021) Changed paths: M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.h M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m M platforms/iOS/vm/OSX/sqSqueakOSXCGView.m M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m M platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m M platforms/iOS/vm/OSX/sqSqueakOSXView.h Log Message: ----------- I implemented the missing plumbing machinery for translating custom URL schemes in OS X into drop events. Commit: 35ae52c78101c1251e111842cd1cf891770bed84 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/35ae52c78101c1251e111842cd1cf891770bed84 Author: Eliot Miranda Date: 2021-01-15 (Fri, 15 Jan 2021) Changed paths: M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.h M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m M platforms/iOS/vm/OSX/sqSqueakOSXCGView.m M platforms/iOS/vm/OSX/sqSqueakOSXDropAPI.m M platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m M platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m M platforms/iOS/vm/OSX/sqSqueakOSXView.h Log Message: ----------- Merge pull request #546 from ronsaldo/feature-osx-drop-uri-plumbing Plumb OS X custom url scheme events into drop events Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/d8b9a1ad3804...35ae52c78101 From notifications at github.com Fri Jan 15 23:23:05 2021 From: notifications at github.com (Eliot Miranda) Date: Fri, 15 Jan 2021 15:23:05 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Plumb OS X custom url scheme events into drop events (#546) In-Reply-To: References: Message-ID: Merged #546 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/546#event-4213308563 -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Fri Jan 15 23:59:37 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 15 Jan 2021 23:59:37 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2370 Message-ID: <20210115235937.1.63013798FDEA5CD4@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Fri Jan 15 23:59:54 2021 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 15 Jan 2021 23:59:54 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2371 Message-ID: <20210115235954.1.354A6A8CF45EB697@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sat Jan 16 02:58:10 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 16 Jan 2021 02:58:10 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2935.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2935.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2935 Author: eem Time: 15 January 2021, 6:58:00.402875 pm UUID: 51b2c0b0-0b96-402b-8823-e578d4b939c4 Ancestors: VMMaker.oscog-eem.2934 OCD (and not so OCD) cleanup of the FilePlugin. Simulate primitiveFileDescriptorType. =============== Diff against VMMaker.oscog-eem.2934 =============== Item was changed: ----- Method: FilePlugin>>connectToFd:write: (in category 'private') ----- connectToFd: fd write: writeFlag "Connect to the supplied file descriptor. Answer the file oop. On POSIX platforms this translates to fdopen(). writeFlag must be compatible with the existing file access." | file fileOop | - fileOop := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: self fileRecordSize. file := self fileValueOf: fileOop. interpreterProxy failed ifFalse: [self sqConnect: file ToFile: fd Descriptor: writeFlag]. ^fileOop! Item was changed: ----- Method: FilePlugin>>connectToFile:write: (in category 'private') ----- connectToFile: cfile write: writeFlag "Open the FILE* as file. Answer the file oop. writeFlag must be compatible with the existing file access." | file fileOop | - fileOop := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: self fileRecordSize. file := self fileValueOf: fileOop. interpreterProxy failed ifFalse: [self sqConnect: file To: cfile File: writeFlag]. ^fileOop! Item was changed: ----- Method: FilePlugin>>fileOpenName:size:write:secure: (in category 'file primitives') ----- fileOpenName: nameIndex size: nameSize write: writeFlag secure: secureFlag "Open the named file, possibly checking security. Answer the file oop." | file fileOop okToOpen | + - - fileOop := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: self fileRecordSize. file := self fileValueOf: fileOop. + interpreterProxy failed ifFalse: + [secureFlag ifTrue: + "If the security plugin can be loaded, use it to check for permission. + If not, assume it's ok" + [sCOFfn ~= 0 ifTrue: + [okToOpen := self cCode: '((sqInt (*) (char *, sqInt, sqInt)) sCOFfn)(nameIndex, nameSize, writeFlag)'. + okToOpen ifFalse: + [^interpreterProxy primitiveFailFor: PrimErrOperationFailed]]]. + self sqFileOpen: file _: nameIndex _: nameSize _: writeFlag]. + ^fileOop! - interpreterProxy failed - ifFalse: [ secureFlag ifTrue: [ - "If the security plugin can be loaded, use it to check for permission. - If not, assume it's ok" - sCOFfn ~= 0 - ifTrue: [okToOpen := self cCode: '((sqInt (*) (char *, sqInt, sqInt)) sCOFfn)(nameIndex, nameSize, writeFlag)' inSmalltalk:[true]. - okToOpen - ifFalse: [interpreterProxy primitiveFail]]]]. - interpreterProxy failed - ifFalse: [self cCode: 'sqFileOpen(file, nameIndex, nameSize, writeFlag)' inSmalltalk: [file]]. - ^ fileOop! Item was changed: ----- Method: FilePlugin>>fileOpenNewName:size:secure: (in category 'file primitives') ----- fileOpenNewName: nameIndex size: nameSize secure: secureFlag "Open the new named file, possibly checking security. Answer the file oop." + | file fileOop okToOpen exists | + - | file fileOop okToOpen | - - fileOop := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: self fileRecordSize. file := self fileValueOf: fileOop. + interpreterProxy failed ifFalse: + [secureFlag ifTrue: + "If the security plugin can be loaded, use it to check for permission. + If not, assume it's ok" + [sCOFfn ~= 0 ifTrue: + [okToOpen := self cCode: '((sqInt (*) (char *, sqInt, sqInt)) sCOFfn)(nameIndex, nameSize, true)'. + okToOpen ifFalse: + [^interpreterProxy primitiveFailFor: PrimErrOperationFailed]]]. + exists := false. + self sqFileOpenNew: file _: nameIndex _: nameSize _: (self addressOf: exists). + (interpreterProxy failed or: [exists]) ifTrue: "worry not; it is sqFileOpenNew's responsibility to close the file if it exists" + [interpreterProxy primitiveFailFor: PrimErrInappropriate]]. + ^fileOop! - interpreterProxy failed - ifFalse: [ secureFlag ifTrue: [ - "If the security plugin can be loaded, use it to check for permission. - If not, assume it's ok" - sCOFfn ~= 0 - ifTrue: [ - okToOpen := self cCode: '((sqInt (*) (char *, sqInt, sqInt)) sCOFfn)(nameIndex, nameSize, true)' inSmalltalk:[true]. - okToOpen - ifFalse: [interpreterProxy primitiveFail]]]]. - interpreterProxy failed - ifFalse: [| exists | - exists := false. - self cCode: 'sqFileOpenNew(file, nameIndex, nameSize, &exists)' inSmalltalk: [file]. - (interpreterProxy failed - and: [exists]) - ifTrue: [interpreterProxy primitiveFailFor: PrimErrInappropriate]]. - ^ fileOop! Item was changed: ----- Method: FilePlugin>>fileValueOf: (in category 'file primitives') ----- fileValueOf: objectPointer "Return a pointer to the first byte of of the file record within the given Smalltalk object, or nil if objectPointer is not a file record." + (((interpreterProxy isBytes: objectPointer) + and: [(interpreterProxy byteSizeOf: objectPointer) = self fileRecordSize])) ifFalse: + [interpreterProxy primitiveFailFor: PrimErrBadArgument. ^nil]. - (((interpreterProxy isBytes: objectPointer) and: - [(interpreterProxy byteSizeOf: objectPointer) = self fileRecordSize])) - ifFalse:[interpreterProxy primitiveFail. ^nil]. ^interpreterProxy firstIndexableField: objectPointer! Item was changed: ----- Method: FilePlugin>>pointerFrom: (in category 'private') ----- pointerFrom: pointerByteArray "Answer the machine address contained in anExternalAddressOop." + + | ptr | + + ((interpreterProxy isBytes: pointerByteArray) + and: [(interpreterProxy stSizeOf: pointerByteArray) = (self sizeof: #'void *')]) ifFalse: + [interpreterProxy primitiveFailFor: PrimErrBadArgument. + ^nil]. + ptr := interpreterProxy firstIndexableField: pointerByteArray. + ^ptr at: 0! - - | ptr addressUnion idx | - - - - ((interpreterProxy is: pointerByteArray KindOf: 'ByteArray') and: - [(interpreterProxy stSizeOf: pointerByteArray) = self sizeOfPointer]) - ifFalse: [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. - ptr := interpreterProxy arrayValueOf: pointerByteArray. - interpreterProxy failed ifTrue: [^nil]. - idx := 0. - [idx < self sizeOfPointer] whileTrue: - [self cCode: 'addressUnion.bytes[idx] = ptr[idx]'. - idx := idx + 1]. - ^ self cCode: 'addressUnion.address' inSmalltalk: [addressUnion] - ! Item was changed: ----- Method: FilePlugin>>primitiveConnectToFileDescriptor (in category 'file primitives') ----- primitiveConnectToFileDescriptor "Connect to the existing file identified by fileDescriptor. fileDescriptor must be an integer. writeFlag is aboolean indicating whether to open in read or write mode and must be compatible with the existing file access." + | writeFlag fdPointer filePointer | - | writeFlag fdPointer fd filePointer | - writeFlag := interpreterProxy booleanValueOf: (interpreterProxy stackValue: 0). fdPointer := interpreterProxy stackValue: 1. + (interpreterProxy failed not + and: [interpreterProxy isIntegerObject: fdPointer]) ifFalse: + [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. + filePointer := self connectToFd: (interpreterProxy integerValueOf: fdPointer) write: writeFlag. - (interpreterProxy isIntegerObject: fdPointer) - ifFalse: [^ interpreterProxy primitiveFailFor: PrimErrBadArgument]. - fd := interpreterProxy integerValueOf: fdPointer. - interpreterProxy failed ifTrue: [ - "Ensure that the appropriate failure code has been set" - ^interpreterProxy primitiveFailFor: PrimErrBadArgument]. - filePointer := self connectToFd: fd write: writeFlag. interpreterProxy failed ifFalse: [interpreterProxy methodReturnValue: filePointer]! Item was changed: ----- Method: FilePlugin>>primitiveDirectoryDelete (in category 'directory primitives') ----- primitiveDirectoryDelete | dirName dirNameIndex dirNameSize okToDelete | + - dirName := interpreterProxy stackValue: 0. (interpreterProxy isBytes: dirName) ifFalse: [^interpreterProxy primitiveFail]. dirNameIndex := interpreterProxy firstIndexableField: dirName. dirNameSize := interpreterProxy byteSizeOf: dirName. "If the security plugin can be loaded, use it to check for permission. If not, assume it's ok" sCDPfn ~= 0 ifTrue: [okToDelete := self cCode: ' ((sqInt (*)(char *, sqInt))sCDPfn)(dirNameIndex, dirNameSize)' inSmalltalk: [false]. okToDelete ifFalse: [^interpreterProxy primitiveFail]]. (self cCode: 'dir_Delete(dirNameIndex, dirNameSize)' inSmalltalk: [false]) ifFalse: [^interpreterProxy primitiveFail]. interpreterProxy pop: 1! Item was changed: ----- Method: FilePlugin>>primitiveDirectoryEntry (in category 'directory primitives') ----- primitiveDirectoryEntry "Two arguments - directory path, and simple file name; returns an array (see primitiveDirectoryLookup) describing the file or directory, or nil if it does not exist. Primitive fails if the outer path does not identify a readable directory. (This is a lookup-by-name variant of primitiveDirectoryLookup.)" | requestedName pathName pathNameIndex pathNameSize status entryName entryNameSize createDate modifiedDate dirFlag posixPermissions symlinkFlag fileSize okToList reqNameIndex reqNameSize | + + + - - - requestedName := interpreterProxy stackValue: 0. pathName := interpreterProxy stackValue: 1. (interpreterProxy isBytes: pathName) ifFalse: [^interpreterProxy primitiveFail]. "Outbound string parameters" pathNameIndex := interpreterProxy firstIndexableField: pathName. pathNameSize := interpreterProxy byteSizeOf: pathName. reqNameIndex := interpreterProxy firstIndexableField: requestedName. reqNameSize := interpreterProxy byteSizeOf: requestedName. self cCode: '' inSmalltalk: [entryName := ByteString new: 256. entryNameSize := createDate := modifiedDate := dirFlag := fileSize := posixPermissions := symlinkFlag := nil]. "If the security plugin can be loaded, use it to check for permission. If not, assume it's ok" okToList := sCLPfn ~= 0 ifTrue: [self cCode: '((sqInt (*)(char *, sqInt))sCLPfn)(pathNameIndex, pathNameSize)' inSmalltalk: [true]] ifFalse: [true]. status := okToList ifTrue: [self dir_EntryLookup: pathNameIndex _: pathNameSize _: reqNameIndex _: reqNameSize _: entryName _: (self addressOf: entryNameSize put: [:v| entryNameSize := v]) _: (self addressOf: createDate put: [:v| createDate := v]) _: (self addressOf: modifiedDate put: [:v| modifiedDate := v]) _: (self addressOf: dirFlag put: [:v| dirFlag := v]) _: (self addressOf: fileSize put: [:v| fileSize := v]) _: (self addressOf: posixPermissions put: [:v| posixPermissions := v]) _: (self addressOf: symlinkFlag put: [:v| symlinkFlag := v])] ifFalse: [DirNoMoreEntries]. interpreterProxy failed ifTrue: [^nil]. status = DirNoMoreEntries ifTrue: "no entry; return nil" [interpreterProxy "pop pathName, index, rcvr" pop: 3 thenPush: interpreterProxy nilObject. ^nil]. status = DirBadPath ifTrue: [^interpreterProxy primitiveFail]."bad path" interpreterProxy pop: 3 "pop pathName, index, rcvr" thenPush: (self cppIf: PharoVM ifTrue: [self makeDirEntryName: entryName size: entryNameSize createDate: createDate modDate: modifiedDate isDir: dirFlag fileSize: fileSize posixPermissions: posixPermissions isSymlink: symlinkFlag] ifFalse: [self makeDirEntryName: entryName size: entryNameSize createDate: createDate modDate: modifiedDate isDir: dirFlag fileSize: fileSize])! Item was changed: ----- Method: FilePlugin>>primitiveDirectoryGetMacTypeAndCreator (in category 'directory primitives') ----- primitiveDirectoryGetMacTypeAndCreator | creatorString typeString fileName creatorStringIndex typeStringIndex fileNameIndex fileNameSize okToGet | + + + - - - creatorString := interpreterProxy stackValue: 0. typeString := interpreterProxy stackValue: 1. fileName := interpreterProxy stackValue: 2. ((interpreterProxy isBytes: creatorString) and: [(interpreterProxy byteSizeOf: creatorString) = 4]) ifFalse: [^interpreterProxy primitiveFail]. ((interpreterProxy isBytes: typeString) and: [(interpreterProxy byteSizeOf: typeString) = 4]) ifFalse: [^interpreterProxy primitiveFail]. (interpreterProxy isBytes: fileName) ifFalse: [^interpreterProxy primitiveFail]. creatorStringIndex := interpreterProxy firstIndexableField: creatorString. typeStringIndex := interpreterProxy firstIndexableField: typeString. fileNameIndex := interpreterProxy firstIndexableField: fileName. fileNameSize := interpreterProxy byteSizeOf: fileName. "If the security plugin can be loaded, use it to check for permission. If not, assume it's ok" sCGFTfn ~= 0 ifTrue: [okToGet := self cCode: ' ((sqInt (*)(char *, sqInt))sCGFTfn)(fileNameIndex, fileNameSize)'. okToGet ifFalse: [^interpreterProxy primitiveFail]]. (self cCode: 'dir_GetMacFileTypeAndCreator(fileNameIndex, fileNameSize, typeStringIndex, creatorStringIndex)' inSmalltalk: [true]) ifFalse: [^interpreterProxy primitiveFail]. interpreterProxy pop: 3! Item was changed: ----- Method: FilePlugin>>primitiveDirectoryLookup (in category 'directory primitives') ----- primitiveDirectoryLookup | index pathName pathNameIndex pathNameSize status entryName entryNameSize createDate modifiedDate dirFlag symlinkFlag posixPermissions fileSize okToList | + + - - index := interpreterProxy stackIntegerValue: 0. pathName := interpreterProxy stackValue: 1. (interpreterProxy isBytes: pathName) ifFalse: [^interpreterProxy primitiveFail]. pathNameIndex := interpreterProxy firstIndexableField: pathName. pathNameSize := interpreterProxy byteSizeOf: pathName. self cCode: '' inSmalltalk: [entryName := ByteString new: 256. entryNameSize := createDate := modifiedDate := dirFlag := fileSize := posixPermissions := symlinkFlag := nil]. "If the security plugin can be loaded, use it to check for permission. If not, assume it's ok" okToList := sCLPfn ~= 0 ifTrue: [self cCode: '((sqInt (*)(char *, sqInt))sCLPfn)(pathNameIndex, pathNameSize)' inSmalltalk: [true]] ifFalse: [true]. status := okToList ifTrue: [self dir_Lookup: pathNameIndex _: pathNameSize _: index _: entryName _: (self addressOf: entryNameSize put: [:v| entryNameSize := v]) _: (self addressOf: createDate put: [:v| createDate := v]) _: (self addressOf: modifiedDate put: [:v| modifiedDate := v]) _: (self addressOf: dirFlag put: [:v| dirFlag := v]) _: (self addressOf: fileSize put: [:v| fileSize := v]) _: (self addressOf: posixPermissions put: [:v| posixPermissions := v]) _: (self addressOf: symlinkFlag put: [:v| symlinkFlag := v])] ifFalse: [DirNoMoreEntries]. interpreterProxy failed ifTrue: [^nil]. status = DirNoMoreEntries ifTrue: "no more entries; return nil" [interpreterProxy "pop pathName, index, rcvr" pop: 3 thenPush: interpreterProxy nilObject. ^nil]. status = DirBadPath ifTrue: [^interpreterProxy primitiveFail]."bad path" interpreterProxy pop: 3 "pop pathName, index, rcvr" thenPush: (self cppIf: PharoVM ifTrue: [self makeDirEntryName: entryName size: entryNameSize createDate: createDate modDate: modifiedDate isDir: dirFlag fileSize: fileSize posixPermissions: posixPermissions isSymlink: symlinkFlag] ifFalse: [self makeDirEntryName: entryName size: entryNameSize createDate: createDate modDate: modifiedDate isDir: dirFlag fileSize: fileSize])! Item was changed: ----- Method: FilePlugin>>primitiveDirectorySetMacTypeAndCreator (in category 'directory primitives') ----- primitiveDirectorySetMacTypeAndCreator | creatorString typeString fileName creatorStringIndex typeStringIndex fileNameIndex fileNameSize okToSet | + + + - - - creatorString := interpreterProxy stackValue: 0. typeString := interpreterProxy stackValue: 1. fileName := interpreterProxy stackValue: 2. ((interpreterProxy isBytes: creatorString) and: [(interpreterProxy isBytes: typeString) and: [(interpreterProxy isBytes: fileName) and: [(interpreterProxy byteSizeOf: creatorString) = 4 and: [(interpreterProxy byteSizeOf: typeString) = 4]]]]) ifFalse: [^interpreterProxy primitiveFail]. creatorStringIndex := interpreterProxy firstIndexableField: creatorString. typeStringIndex := interpreterProxy firstIndexableField: typeString. fileNameIndex := interpreterProxy firstIndexableField: fileName. fileNameSize := interpreterProxy byteSizeOf: fileName. "If the security plugin can be loaded, use it to check for permission. If not, assume it's ok" sCSFTfn ~= 0 ifTrue: [okToSet := self cCode: '((sqInt (*)(char *, sqInt))sCSFTfn)(fileNameIndex, fileNameSize)' inSmalltalk: [true]. okToSet ifFalse: [^interpreterProxy primitiveFail]]. (self cCode: 'dir_SetMacFileTypeAndCreator(fileNameIndex, fileNameSize, typeStringIndex, creatorStringIndex)' inSmalltalk: [true]) ifFalse: [^interpreterProxy primitiveFail]. interpreterProxy pop: 3! Item was changed: ----- Method: FilePlugin>>primitiveFileAtEnd (in category 'file primitives') ----- primitiveFileAtEnd | file atEnd | - file := self fileValueOf: (interpreterProxy stackValue: 0). + interpreterProxy failed ifFalse: + [atEnd := self sqFileAtEnd: file. + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnBool: atEnd]]! - interpreterProxy failed - ifFalse: [atEnd := self sqFileAtEnd: file]. - interpreterProxy failed - ifFalse: [interpreterProxy methodReturnBool: atEnd]! Item was changed: ----- Method: FilePlugin>>primitiveFileClose (in category 'file primitives') ----- primitiveFileClose - | file | - file := self fileValueOf: (interpreterProxy stackValue: 0). + interpreterProxy failed ifFalse: + [self sqFileClose: file. + interpreterProxy failed ifFalse: + [interpreterProxy pop: 1]] "pop file; leave rcvr on stack"! - interpreterProxy failed ifFalse: [ self sqFileClose: file ]. - interpreterProxy failed ifFalse: [ interpreterProxy pop: 1 "pop file; leave rcvr on stack" ].! Item was changed: ----- Method: FilePlugin>>primitiveFileDelete (in category 'file primitives') ----- primitiveFileDelete | namePointer nameIndex nameSize okToDelete | + - namePointer := interpreterProxy stackValue: 0. + (interpreterProxy isBytes: namePointer) ifFalse: + [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. - (interpreterProxy isBytes: namePointer) - ifFalse: [^ interpreterProxy primitiveFail]. nameIndex := interpreterProxy firstIndexableField: namePointer. nameSize := interpreterProxy byteSizeOf: namePointer. "If the security plugin can be loaded, use it to check for permission. If not, assume it's ok" sCDFfn ~= 0 ifTrue: [okToDelete := self cCode: ' ((sqInt (*)(char *, sqInt))sCDFfn)(nameIndex, nameSize)' inSmalltalk: [true]. okToDelete ifFalse: [^ interpreterProxy primitiveFail]]. self sqFileDeleteName: nameIndex Size: nameSize. interpreterProxy failed ifFalse: [interpreterProxy pop: 1]! Item was changed: ----- Method: FilePlugin>>primitiveFileDescriptorType (in category 'file primitives') ----- primitiveFileDescriptorType + | fdPointer | - | fileType fd fdPointer | "Allow to test if the standard input/output files are from a console or not Return values: * -1 - Error * 0 - no console (windows only) * 1 - normal terminal (unix terminal / windows console) * 2 - pipe * 3 - file * 4 - cygwin terminal (windows only)" fdPointer := interpreterProxy stackValue: 0. + (interpreterProxy isIntegerObject: fdPointer) ifFalse: + [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. + interpreterProxy methodReturnInteger: (self sqFileDescriptorType: (interpreterProxy integerValueOf: fdPointer))! - (interpreterProxy isIntegerObject: fdPointer) - ifFalse: [^ interpreterProxy primitiveFailFor: PrimErrBadArgument]. - fd := interpreterProxy integerValueOf: fdPointer. - interpreterProxy failed ifTrue: [ - "Ensure that the appropriate failure code has been set" - ^interpreterProxy primitiveFailFor: PrimErrBadArgument]. - fileType := self - cCode: 'sqFileDescriptorType(fd)' - inSmalltalk: [1]. - interpreterProxy methodReturnInteger: fileType! Item was changed: ----- Method: FilePlugin>>primitiveFileFlush (in category 'file primitives') ----- primitiveFileFlush | file | - file := self fileValueOf: (interpreterProxy stackValue: 0). + interpreterProxy failed ifFalse: + [self sqFileFlush: file. + interpreterProxy failed ifFalse: + [interpreterProxy pop: 1]]! - interpreterProxy failed ifFalse:[self sqFileFlush: file]. - interpreterProxy failed ifFalse: [interpreterProxy pop: 1].! Item was changed: ----- Method: FilePlugin>>primitiveFileGetPosition (in category 'file primitives') ----- primitiveFileGetPosition | file position | + - - file := self fileValueOf: (interpreterProxy stackValue: 0). + interpreterProxy failed ifFalse: + [position := self sqFileGetPosition: file. + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnValue: (interpreterProxy positive64BitIntegerFor: position)]]! - interpreterProxy failed ifFalse: [position := self sqFileGetPosition: file]. - interpreterProxy failed ifFalse: [ - interpreterProxy methodReturnValue: (interpreterProxy positive64BitIntegerFor: position)].! Item was changed: ----- Method: FilePlugin>>primitiveFileOpen (in category 'file primitives') ----- primitiveFileOpen | writeFlag namePointer filePointer nameIndex nameSize | + - + writeFlag := interpreterProxy booleanValueOf: (interpreterProxy stackValue: 0). - writeFlag := interpreterProxy - booleanValueOf: (interpreterProxy stackValue: 0). namePointer := interpreterProxy stackValue: 1. + (interpreterProxy isBytes: namePointer) ifFalse: + [^interpreterProxy primitiveFail]. - (interpreterProxy isBytes: namePointer) - ifFalse: [^ interpreterProxy primitiveFail]. nameIndex := interpreterProxy firstIndexableField: namePointer. nameSize := interpreterProxy byteSizeOf: namePointer. filePointer := self fileOpenName: nameIndex size: nameSize write: writeFlag secure: true. + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnValue: filePointer]! - interpreterProxy failed - ifFalse: [interpreterProxy methodReturnValue: filePointer] - ! Item was changed: ----- Method: FilePlugin>>primitiveFileOpenNew (in category 'file primitives') ----- primitiveFileOpenNew | namePointer filePointer nameIndex nameSize | + - namePointer := interpreterProxy stackValue: 0. + (interpreterProxy isBytes: namePointer) ifFalse: + [^interpreterProxy primitiveFail]. - (interpreterProxy isBytes: namePointer) - ifFalse: [^ interpreterProxy primitiveFail]. nameIndex := interpreterProxy firstIndexableField: namePointer. nameSize := interpreterProxy byteSizeOf: namePointer. filePointer := self fileOpenNewName: nameIndex size: nameSize secure: true. + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnValue: filePointer]! - interpreterProxy failed - ifFalse: [ - interpreterProxy methodReturnValue: filePointer] - ! Item was changed: ----- Method: FilePlugin>>primitiveFileReadWithPinning (in category 'file primitives') ----- primitiveFileReadWithPinning "This version of primitiveFileRead is for garbage collectors that support pinning." | count startIndex array file slotSize elementSize bytesRead | - count := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 0). startIndex := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 1). array := interpreterProxy stackValue: 2. file := self fileValueOf: (interpreterProxy stackValue: 3). (interpreterProxy failed "buffer can be any indexable words or bytes object except CompiledMethod" or: [(interpreterProxy isWordsOrBytes: array) not]) ifTrue: [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. slotSize := interpreterProxy slotSizeOf: array. (startIndex >= 1 and: [startIndex + count - 1 <= slotSize]) ifFalse: [^interpreterProxy primitiveFailFor: PrimErrBadIndex]. "Note: adjust startIndex for zero-origin byte indexing" elementSize := slotSize = 0 ifTrue: [1] ifFalse: [(interpreterProxy byteSizeOf: array) // slotSize]. bytesRead := self sqFile: file Read: count * elementSize Into: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *') At: startIndex - 1 * elementSize. interpreterProxy failed ifFalse: [interpreterProxy methodReturnInteger: bytesRead // elementSize] "answer # of elements read"! Item was changed: ----- Method: FilePlugin>>primitiveFileReadWithoutPinning (in category 'file primitives') ----- primitiveFileReadWithoutPinning "This version of primitiveFileRead is for garbage collectors without support for pinning." | retryCount count startIndex array file elementSize bytesRead | - retryCount := 0. count := interpreterProxy positive32BitValueOf: (interpreterProxy stackValue: 0). startIndex := interpreterProxy positive32BitValueOf: (interpreterProxy stackValue: 1). [array := interpreterProxy stackValue: 2. file := self fileValueOf: (interpreterProxy stackValue: 3). (interpreterProxy failed "buffer can be any indexable words or bytes object except CompiledMethod" or: [(interpreterProxy isWordsOrBytes: array) not]) ifTrue: [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. elementSize := (interpreterProxy isWords: array) ifTrue: [4] ifFalse: [1]. (startIndex >= 1 and: [(startIndex + count - 1) <= (interpreterProxy slotSizeOf: array)]) ifFalse: [^interpreterProxy primitiveFailFor: PrimErrBadIndex]. "Note: adjust startIndex for zero-origin indexing" bytesRead := self sqFile: file Read: count * elementSize Into: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *') At: (startIndex - 1) * elementSize. interpreterProxy primitiveFailureCode = PrimErrObjectMayMove and: [(retryCount := retryCount + 1) <= 2] "Two objects, the file and the array can move"] whileTrue: [interpreterProxy tenuringIncrementalGC; primitiveFailFor: PrimNoErr]. interpreterProxy failed ifFalse: [interpreterProxy methodReturnInteger: bytesRead // elementSize "push # of elements read"]! Item was changed: ----- Method: FilePlugin>>primitiveFileRename (in category 'file primitives') ----- primitiveFileRename | oldNamePointer newNamePointer oldNameIndex oldNameSize newNameIndex newNameSize okToRename | + + - - newNamePointer := interpreterProxy stackValue: 0. oldNamePointer := interpreterProxy stackValue: 1. ((interpreterProxy isBytes: newNamePointer) + and: [interpreterProxy isBytes: oldNamePointer]) ifFalse: + [^interpreterProxy primitiveFail]. - and: [interpreterProxy isBytes: oldNamePointer]) - ifFalse: [^interpreterProxy primitiveFail]. newNameIndex := interpreterProxy firstIndexableField: newNamePointer. newNameSize := interpreterProxy byteSizeOf: newNamePointer. oldNameIndex := interpreterProxy firstIndexableField: oldNamePointer. oldNameSize := interpreterProxy byteSizeOf: oldNamePointer. "If the security plugin can be loaded, use it to check for rename permission. If not, assume it's ok" sCRFfn ~= 0 ifTrue: [okToRename := self cCode: ' ((sqInt (*)(char *, sqInt))sCRFfn)(oldNameIndex, oldNameSize)' inSmalltalk: [true]. okToRename ifFalse: [^interpreterProxy primitiveFail]]. self sqFileRenameOld: oldNameIndex Size: oldNameSize New: newNameIndex Size: newNameSize. interpreterProxy failed ifFalse: [interpreterProxy pop: 2]! Item was changed: ----- Method: FilePlugin>>primitiveFileSetPosition (in category 'file primitives') ----- primitiveFileSetPosition | newPosition file | + - - (interpreterProxy byteSizeOf: (interpreterProxy stackValue: 0)) > (self sizeof: #squeakFileOffsetType) ifTrue: [^interpreterProxy primitiveFail]. newPosition := interpreterProxy positive64BitValueOf: (interpreterProxy stackValue: 0). file := self fileValueOf: (interpreterProxy stackValue: 1). interpreterProxy failed ifFalse: + [self sqFile: file SetPosition: newPosition. + interpreterProxy failed ifFalse: + [interpreterProxy pop: 2]] "pop position, file; leave rcvr on stack"! - [self sqFile: file SetPosition: newPosition ]. - interpreterProxy failed ifFalse: - [interpreterProxy pop: 2] "pop position, file; leave rcvr on stack"! Item was changed: ----- Method: FilePlugin>>primitiveFileSize (in category 'file primitives') ----- primitiveFileSize | file size | + - - file := self fileValueOf: (interpreterProxy stackValue: 0). interpreterProxy failed ifFalse:[size := self sqFileSize: file]. + interpreterProxy failed ifFalse: + [interpreterProxy methodReturnValue: (interpreterProxy positive64BitIntegerFor: size)].! - interpreterProxy failed ifFalse: [ - interpreterProxy methodReturnValue: (interpreterProxy positive64BitIntegerFor: size)].! Item was changed: ----- Method: FilePlugin>>primitiveFileSync (in category 'file primitives') ----- primitiveFileSync | file | - file := self fileValueOf: (interpreterProxy stackValue: 0). interpreterProxy failed ifFalse:[self sqFileSync: file]. interpreterProxy failed ifFalse: [interpreterProxy pop: 1].! Item was changed: ----- Method: FilePlugin>>primitiveFileTruncate (in category 'file primitives') ----- primitiveFileTruncate + "ftruncate is not an ansi function so we have a macro to point to a suitable platform implementation" - "ftruncate is not an ansi function so we have a macro to point to a suitable platform implementation" | truncatePosition file | - (interpreterProxy isIntegerObject: (interpreterProxy stackValue: 0)) ifFalse: [(interpreterProxy byteSizeOf: (interpreterProxy stackValue: 0)) > (self sizeof: #squeakFileOffsetType) ifTrue: [^interpreterProxy primitiveFail]]. truncatePosition := interpreterProxy positive64BitValueOf: (interpreterProxy stackValue: 0). file := self fileValueOf: (interpreterProxy stackValue: 1). interpreterProxy failed ifFalse: [self sqFile: file Truncate: truncatePosition]. interpreterProxy failed ifFalse: [interpreterProxy pop: 2 "pop position, file; leave rcvr on stack"]! Item was changed: ----- Method: FilePlugin>>primitiveFileWrite (in category 'file primitives') ----- primitiveFileWrite | count startIndex array file slotSize elementSize bytesWritten | + + - - - count := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 0). startIndex := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 1). array := interpreterProxy stackValue: 2. file := self fileValueOf: (interpreterProxy stackValue: 3). (interpreterProxy failed "buffer can be any indexable words or bytes object except CompiledMethod" or: [(interpreterProxy isWordsOrBytes: array) not]) ifTrue: [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. slotSize := interpreterProxy slotSizeOf: array. (startIndex >= 1 and: [startIndex + count - 1 <= slotSize]) ifFalse: [^interpreterProxy primitiveFailFor: PrimErrBadIndex]. "Note: adjust startIndex for zero-origin byte indexing" elementSize := slotSize = 0 ifTrue: [1] ifFalse: [(interpreterProxy byteSizeOf: array) // slotSize]. bytesWritten := self sqFile: file Write: count * elementSize From: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *') At: startIndex - 1 * elementSize. interpreterProxy failed ifFalse: [interpreterProxy methodReturnInteger: bytesWritten // elementSize] "answer # of elements written"! Item was added: + ----- Method: FilePluginSimulator>>sqFileDescriptorType: (in category 'simulation') ----- + sqFileDescriptorType: fd + "Allow to test if the standard input/output files are from a console or not + Return values: + -1 - Error + 0 - no console (windows only) + 1 - normal terminal (unix terminal / windows console) + 2 - pipe + 3 - file + 4 - cygwin terminal (windows only)" + ^fd < 0 + ifTrue: [-1] + ifFalse: + [fd <= 2 "i.e. stdio,stdout,stderr" + ifTrue: [1] + ifFalse: [3]]! From noreply at github.com Sat Jan 16 02:59:38 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 15 Jan 2021 18:59:38 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] faf329: CogVM source as per VMMaker.oscog-eem.2935 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: faf3291f06eaf0c0e3a9942865046552b821422a https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/faf3291f06eaf0c0e3a9942865046552b821422a Author: Eliot Miranda Date: 2021-01-15 (Fri, 15 Jan 2021) Changed paths: M src/plugins/FilePlugin/FilePlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2935 OCD (and not so OCD) cleanup of the FilePlugin. From no-reply at appveyor.com Sat Jan 16 06:41:08 2021 From: no-reply at appveyor.com (AppVeyor) Date: Sat, 16 Jan 2021 06:41:08 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2372 Message-ID: <20210116064108.1.F9271EC41B918091@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Mon Jan 18 22:43:36 2021 From: noreply at github.com (David T Lewis) Date: Mon, 18 Jan 2021 14:43:36 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 92119e: Fix missing KeyRelease events when multiple keys a... Message-ID: Branch: refs/heads/mantis-7579 Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 92119ef98936767a29b740bf54dc8706f5cfc254 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/92119ef98936767a29b740bf54dc8706f5cfc254 Author: David T. Lewis Date: 2021-01-18 (Mon, 18 Jan 2021) Changed paths: M platforms/unix/vm-display-X11/sqUnixX11.c Log Message: ----------- Fix missing KeyRelease events when multiple keys are depressed. Reference Mantis 0007597 http://bugs.squeak.org/view.php?id=7597. Rather than keep a single lastKey to remember the last previously pressed key value, maintain an array size 256 of last key pressed values indexed by X11 KeyCode. Works for any number of simultaneous keys. From notifications at github.com Mon Jan 18 22:56:30 2021 From: notifications at github.com (David T Lewis) Date: Mon, 18 Jan 2021 14:56:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix missing KeyRelease events when multiple keys are depressed. (#547) Message-ID: Reference Mantis 0007597 http://bugs.squeak.org/view.php?id=7597. Rather than keep a single lastKey to remember the last previously pressed key value, maintain an array size 256 of last key pressed values indexed by X11 KeyCode. Works for any number of simultaneous keys. You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/547 -- Commit Summary -- * Fix missing KeyRelease events when multiple keys are depressed. -- File Changes -- M platforms/unix/vm-display-X11/sqUnixX11.c (73) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/547.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/547.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/547 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Jan 19 01:00:56 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 19 Jan 2021 01:00:56 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2936.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2936.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2936 Author: eem Time: 18 January 2021, 5:00:46.89368 pm UUID: 69233536-ece4-4ea1-b523-c28c4aa7d4c2 Ancestors: VMMaker.oscog-eem.2935 Fix simulation of the ARMv5 code generator (increase method alignment to allow the entry alignment mask to be large enough, a la ARMv8). Fix simulation of the V3 simulator (needs to implement getStackPointer for SmartSyntaxPlugin simulation). Fix some speeling rorres in conemnts. =============== Diff against VMMaker.oscog-eem.2935 =============== Item was changed: ----- Method: CoInterpreter>>isCodeCompactingPrimitiveIndex: (in category 'primitive support') ----- isCodeCompactingPrimitiveIndex: primIndex "If instVarAt:, slotAt: or shallowCopy operate on a Context then they compute a + bytecode pc and hence may provoke a code compaction. Hence primitive invocation - bytecode pc and hence may provoke a code compaction. Hence primtiive invocation from these primitives must use a static return address (cePrimReturnEnterCogCode:)." self cCode: [] inSmalltalk: [#primitiveClone. #primitiveInstVarAt. #primitiveSlotAt]. "For senders..." ^primIndex = PrimNumberInstVarAt or: [primIndex = PrimNumberShallowCopy or: [primIndex = PrimNumberSlotAt]]! Item was added: + ----- Method: CogARMCompiler>>roundUpToMethodAlignment: (in category 'method zone and entry point alignment') ----- + roundUpToMethodAlignment: numBytes + "Determine the default alignment for the start of a CogMethod, which in turn + determines the size of the mask used to distinguish the checked and unchecked + entry-points, used to distinguish normal and super sends on method unlinking. + This is implemented here to allow processors with coarse instructions (ARM) to + increase the alignment if required." + "extra parens to placate gdb :-(" + ^numBytes + 15 bitAnd: -16! Item was changed: ----- Method: CogARMv8Compiler>>roundUpToMethodAlignment: (in category 'method zone and entry point alignment') ----- roundUpToMethodAlignment: numBytes + "Determine the default alignment for the start of a CogMethod, which in turn - "Determine the default alignment for the start of a CogMehtod, which in turn determines the size of the mask used to distinguish the checked and unchecked entry-points, used to distinguish normal and super sends on method unlinking. This is implemented here to allow processors with coarse instructions (ARM) to increase the alignment if required." "extra parens to placate gdb :-(" ^numBytes + 15 bitAnd: -16! Item was changed: ----- Method: CogAbstractInstruction>>roundUpToMethodAlignment: (in category 'method zone and entry point alignment') ----- roundUpToMethodAlignment: numBytes + "Determine the default alignment for the start of a CogMethod, which in turn - "Determine the default alignment for the start of a CogMehtod, which in turn determines the size of the mask used to distinguish the checked and unchecked entry-points, used to distinguish normal and super sends on method unlinking. This is implemented here to allow processors with coarse instructions (ARM) to increase the alignment if required." ^numBytes + 7 bitAnd: -8! Item was added: + ----- Method: NewObjectMemory>>getStackPointer (in category 'interpreter access') ----- + getStackPointer + "hack around the CoInterpreter/ObjectMemory split refactoring" + + ^coInterpreter getStackPointer! Item was removed: - ----- Method: NewObjectMemorySimulator>>getStackPointer (in category 'interpreter access') ----- - getStackPointer - "hack around the CoInterpreter/ObjectMemory split refactoring" - ^coInterpreter getStackPointer! Item was changed: ----- Method: SimpleStackBasedCogit>>compileInterpreterPrimitive:flags: (in category 'primitive generators') ----- compileInterpreterPrimitive: primitiveRoutine flags: flags "Compile a call to an interpreter primitive. Call the C routine with the usual stack-switching dance, test the primFailCode and then either return on success or continue to the method body." | jmp jmpSamplePrim continuePostSamplePrim jmpSampleNonPrim continuePostSampleNonPrim | - - - - - "Save processor fp, sp and return pc in the interpreter's frame stack and instruction pointers" self genExternalizePointersForPrimitiveCall. "Switch to the C stack." self genLoadCStackPointersForPrimCall. (flags anyMask: PrimCallCollectsProfileSamples) ifTrue: ["Test nextProfileTick for being non-zero and call checkProfileTick if so" objectMemory wordSize = 4 ifTrue: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self MoveAw: coInterpreter nextProfileTickAddress + objectMemory wordSize R: ClassReg. self OrR: TempReg R: ClassReg] ifFalse: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self CmpCq: 0 R: TempReg]. "If set, jump to record sample call." jmpSampleNonPrim := self JumpNonZero: 0. continuePostSampleNonPrim := self Label]. "Old full prim trace is in VMMaker-eem.550 and prior" self recordPrimTrace ifTrue: [self genFastPrimTraceUsing: ClassReg and: SendNumArgsReg]. "Clear the primFailCode and set argumentCount" self MoveCq: 0 R: TempReg. self MoveR: TempReg Aw: coInterpreter primFailCodeAddress. methodOrBlockNumArgs ~= 0 ifTrue: [self MoveCq: methodOrBlockNumArgs R: TempReg]. self MoveR: TempReg Aw: coInterpreter argumentCountAddress. "If required, set primitiveFunctionPointer and newMethod" (flags anyMask: PrimCallNeedsPrimitiveFunction) ifTrue: [self MoveCw: primitiveRoutine asInteger R: TempReg. primSetFunctionLabel := self MoveR: TempReg Aw: coInterpreter primitiveFunctionPointerAddress]. (flags anyMask: PrimCallNeedsNewMethod+PrimCallMayEndureCodeCompaction) ifTrue: ["The ceActivateFailingPrimitiveMethod: machinery can't handle framelessness." (flags anyMask: PrimCallMayEndureCodeCompaction) ifTrue: [needsFrame := true]. methodLabel addDependent: (self annotateAbsolutePCRef: (self MoveCw: methodLabel asInteger R: ClassReg)). self MoveMw: (self offset: CogMethod of: #methodObject) r: ClassReg R: TempReg. self MoveR: TempReg Aw: coInterpreter newMethodAddress]. "Invoke the primitive" self PrefetchAw: coInterpreter primFailCodeAddress. (flags anyMask: PrimCallMayEndureCodeCompaction) ifTrue: "Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode." ["On Spur ceActivateFailingPrimitiveMethod: would like to retry if forwarders are found. So insist on PrimCallNeedsPrimitiveFunction being set too." + objectMemory hasSpurMemoryManagerAPI ifTrue: + [self assert: (flags anyMask: PrimCallNeedsPrimitiveFunction)]. - self assert: (flags anyMask: PrimCallNeedsPrimitiveFunction). backEnd genMarshallNArgs: 0 arg: nil arg: nil arg: nil arg: nil; genSubstituteReturnAddress: ((flags anyMask: PrimCallCollectsProfileSamples) ifTrue: [cePrimReturnEnterCogCodeProfiling] ifFalse: [cePrimReturnEnterCogCode]). primInvokeInstruction := self JumpFullRT: primitiveRoutine asInteger. jmp := jmpSamplePrim := continuePostSamplePrim := nil] ifFalse: ["Call the C primitive routine." backEnd genMarshallNArgs: 0 arg: 0 arg: 0 arg: 0 arg: 0. primInvokeInstruction := self CallFullRT: primitiveRoutine asInteger. backEnd genRemoveNArgsFromStack: 0. (flags anyMask: PrimCallCollectsProfileSamples) ifTrue: [self assert: (flags anyMask: PrimCallNeedsNewMethod). "Test nextProfileTick for being non-zero and call checkProfileTick if so" objectMemory wordSize = 4 ifTrue: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self MoveAw: coInterpreter nextProfileTickAddress + objectMemory wordSize R: ClassReg. self OrR: TempReg R: ClassReg] ifFalse: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self CmpCq: 0 R: TempReg]. "If set, jump to record sample call." jmpSamplePrim := self JumpNonZero: 0. continuePostSamplePrim := self Label]. objectRepresentation maybeCompileRetryOnPrimitiveFail: primitiveIndex. "Switch back to the Smalltalk stack. Stack better be in either of these two states: success: stackPointer -> result (was receiver) arg1 ... argN return pc failure: receiver arg1 ... stackPointer -> argN return pc In either case we can push the instructionPointer or load it into the LinkRegister to reestablish the return pc" self MoveAw: coInterpreter instructionPointerAddress R: (backEnd hasLinkRegister ifTrue: [LinkReg] ifFalse: [ClassReg]). backEnd genLoadStackPointers. "Test primitive failure" self MoveAw: coInterpreter primFailCodeAddress R: TempReg. backEnd hasLinkRegister ifFalse: [self PushR: ClassReg]. "Restore return pc on CISCs" self flag: 'ask concrete code gen if move sets condition codes?'. self CmpCq: 0 R: TempReg. jmp := self JumpNonZero: 0. "Fetch result from stack" self MoveMw: (backEnd hasLinkRegister ifTrue: [0] ifFalse: [objectMemory wordSize]) r: SPReg R: ReceiverResultReg. self RetN: objectMemory wordSize]. "return to caller, popping receiver" (flags anyMask: PrimCallCollectsProfileSamples) ifTrue: ["The sample is collected by cePrimReturnEnterCogCode for external calls" jmpSamplePrim ifNotNil: ["Call ceCheckProfileTick: to record sample and then continue." jmpSamplePrim jmpTarget: self Label. self assert: (flags anyMask: PrimCallNeedsNewMethod). self CallFullRT: (self cCode: [#ceCheckProfileTick asUnsignedIntegerPtr] inSmalltalk: [self simulatedTrampolineFor: #ceCheckProfileTick]). "reenter the post-primitive call flow" self Jump: continuePostSamplePrim]. "Null newMethod and call ceCheckProfileTick: to record sample and then continue. ceCheckProfileTick will map null/0 to coInterpreter nilObject" jmpSampleNonPrim jmpTarget: self Label. self MoveCq: 0 R: TempReg. self MoveR: TempReg Aw: coInterpreter newMethodAddress. self CallFullRT: (self cCode: [#ceCheckProfileTick asUnsignedIntegerPtr] inSmalltalk: [self simulatedTrampolineFor: #ceCheckProfileTick]). "reenter the post-primitive call flow" self Jump: continuePostSampleNonPrim]. jmp ifNotNil: ["Jump to restore of receiver reg and proceed to frame build for failure." jmp jmpTarget: self Label. "Restore receiver reg from stack. If on RISCs ret pc is in LinkReg, if on CISCs ret pc is on stack." self MoveMw: objectMemory wordSize * (methodOrBlockNumArgs + (backEnd hasLinkRegister ifTrue: [0] ifFalse: [1])) r: SPReg R: ReceiverResultReg]. ^0! From notifications at github.com Tue Jan 19 01:09:51 2021 From: notifications at github.com (Eliot Miranda) Date: Mon, 18 Jan 2021 17:09:51 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix missing KeyRelease events when multiple keys are depressed. (#547) In-Reply-To: References: Message-ID: @eliotmiranda commented on this pull request. Hi David, I would bite the bullet and write an explicit initializer for lastKeyValue containing 256 -1's, get rid of the initialization lines in storeLastKeyValue (lines 1722 through 1727). Looks perfect otherwise. -- 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/547#pullrequestreview-570843625 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 19 01:15:35 2021 From: noreply at github.com (Eliot Miranda) Date: Mon, 18 Jan 2021 17:15:35 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 52d0b5: CogVM source as per VMMaker.oscog-eem.2936 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 52d0b5d3b19974c3451d396aba88d33af3335f05 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/52d0b5d3b19974c3451d396aba88d33af3335f05 Author: Eliot Miranda Date: 2021-01-18 (Mon, 18 Jan 2021) 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 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/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.2936 Cogit ARMv5 code generator: increase method alignment to allow the entry alignment mask to be large enough, a la ARMv8. This is work in trying to provide a V3 32-bit ARM JIT. From noreply at github.com Tue Jan 19 01:30:43 2021 From: noreply at github.com (Eliot Miranda) Date: Mon, 18 Jan 2021 17:30:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] ea326f: Add a build directory for the v3 JIT on linux 32-b... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: ea326f93baaed828f7590be14effe8dc0aa5cc8c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ea326f93baaed828f7590be14effe8dc0aa5cc8c Author: Eliot Miranda Date: 2021-01-18 (Mon, 18 Jan 2021) Changed paths: A build.linux32ARMv6/squeak.cog.v3/build.assert/mvm A build.linux32ARMv6/squeak.cog.v3/build.debug/mvm A build.linux32ARMv6/squeak.cog.v3/build/mvm A build.linux32ARMv6/squeak.cog.v3/makeallclean A build.linux32ARMv6/squeak.cog.v3/makealldirty A build.linux32ARMv6/squeak.cog.v3/plugins.ext A build.linux32ARMv6/squeak.cog.v3/plugins.int Log Message: ----------- Add a build directory for the v3 JIT on linux 32-bit ARM. Inlcyde fbdev in all squeak linux 32-bit ARM builds (untested). Add -m32 to all linux 32-bit ARM builds, hoping for cross compilation on pi4. From notifications at github.com Tue Jan 19 15:19:43 2021 From: notifications at github.com (David T Lewis) Date: Tue, 19 Jan 2021 07:19:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix missing KeyRelease events when multiple keys are depressed. (#547) In-Reply-To: References: Message-ID: OK I will do an update. Also as reminded by Tim, the index into array should probably be masked to ensure 1 -255. A KeyCode is always in that range, but there is no real guarantee that there is not some scenario in which it might be set to -1 for example, so better to be safe. -- 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/547#issuecomment-762910531 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 19 16:30:16 2021 From: noreply at github.com (David T Lewis) Date: Tue, 19 Jan 2021 08:30:16 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 018c35: Initialize lastKeyValue array at compile time. For... Message-ID: Branch: refs/heads/mantis-7579 Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 018c35e194afb7ce21ee2a7340bcd39317f7b5b4 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/018c35e194afb7ce21ee2a7340bcd39317f7b5b4 Author: David T. Lewis Date: 2021-01-19 (Tue, 19 Jan 2021) Changed paths: M platforms/unix/vm-display-X11/sqUnixX11.c Log Message: ----------- Initialize lastKeyValue array at compile time. For safety, mask index into lastKeyValue to ensure array bounds are honored. From notifications at github.com Tue Jan 19 16:30:19 2021 From: notifications at github.com (David T Lewis) Date: Tue, 19 Jan 2021 08:30:19 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix missing KeyRelease events when multiple keys are depressed. (#547) In-Reply-To: References: Message-ID: @dtlewis290 pushed 1 commit. 018c35e194afb7ce21ee2a7340bcd39317f7b5b4 Initialize lastKeyValue array at compile time. For safety, mask index -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/547/files/92119ef98936767a29b740bf54dc8706f5cfc254..018c35e194afb7ce21ee2a7340bcd39317f7b5b4 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Tue Jan 19 19:13:31 2021 From: notifications at github.com (Eliot Miranda) Date: Tue, 19 Jan 2021 11:13:31 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix missing KeyRelease events when multiple keys are depressed. (#547) In-Reply-To: References: Message-ID: Merged #547 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/547#event-4224193809 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 19 19:13:31 2021 From: noreply at github.com (David T Lewis) Date: Tue, 19 Jan 2021 11:13:31 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] c3a43b: Fix missing KeyRelease events when multiple keys a... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: c3a43bc998bad28e314cd3bd972015fe0a8e02aa https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c3a43bc998bad28e314cd3bd972015fe0a8e02aa Author: David T Lewis Date: 2021-01-19 (Tue, 19 Jan 2021) Changed paths: M platforms/unix/vm-display-X11/sqUnixX11.c Log Message: ----------- Fix missing KeyRelease events when multiple keys are depressed. (#547) * Fix missing KeyRelease events when multiple keys are depressed. Reference Mantis 0007597 http://bugs.squeak.org/view.php?id=7597. Rather than keep a single lastKey to remember the last previously pressed key value, maintain an array size 256 of last key pressed values indexed by X11 KeyCode. Works for any number of simultaneous keys. * Initialize lastKeyValue array at compile time. For safety, mask index into lastKeyValue to ensure array bounds are honored. Co-authored-by: David T. Lewis From noreply at github.com Tue Jan 19 19:13:43 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 19 Jan 2021 11:13:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Message-ID: Branch: refs/heads/mantis-7579 Home: https://github.com/OpenSmalltalk/opensmalltalk-vm From no-reply at appveyor.com Tue Jan 19 19:17:42 2021 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 19 Jan 2021 19:17:42 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2377 Message-ID: <20210119191742.1.54128989F0F0C0CB@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 19 19:20:03 2021 From: noreply at github.com (Eliot Miranda) Date: Tue, 19 Jan 2021 11:20:03 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 253cbf: Make retrieve/storeLastKeyValue inline. Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 253cbfc149cd7a3f6e04149c9002eec96530ef95 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/253cbfc149cd7a3f6e04149c9002eec96530ef95 Author: Eliot Miranda Date: 2021-01-19 (Tue, 19 Jan 2021) Changed paths: M platforms/unix/vm-display-X11/sqUnixX11.c Log Message: ----------- Make retrieve/storeLastKeyValue inline. From commits at source.squeak.org Wed Jan 20 04:45:16 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 20 Jan 2021 04:45:16 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2937.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2937.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2937 Author: eem Time: 19 January 2021, 8:45:06.642772 pm UUID: 9f7b8c1a-4f51-4b69-92f4-37bbdc45b73a Ancestors: VMMaker.oscog-eem.2936 doWithIndex: => withIndexDo: =============== Diff against VMMaker.oscog-eem.2936 =============== Item was changed: ----- Method: CCodeGenerator>>addClass: (in category 'public') ----- addClass: aClass "Add the variables and methods of the given class to the code base." aClass prepareToBeAddedToCodeGenerator: self. self checkClassForNameConflicts: aClass. self addClassVarsFor: aClass. "ikp..." self addPoolVarsFor: aClass. (aClass inheritsFrom: VMStructType) ifFalse: [variables addAll: (self instVarNamesForClass: aClass)]. self retainMethods: (aClass requiredMethodNames: self options). 'Adding Class ' , aClass name , '...' displayProgressAt: Sensor cursorPoint from: 0 to: aClass selectors size during: [:bar | + aClass selectors withIndexDo: - aClass selectors doWithIndex: [:sel :i | | source | bar value: i. self addMethodFor: aClass selector: sel]]. aClass declareCVarsIn: self! Item was changed: ----- Method: CCodeGenerator>>addStructClass: (in category 'public') ----- addStructClass: aClass "Add the non-accessor methods of the given struct class to the code base." aClass prepareToBeAddedToCodeGenerator: self. self addClassVarsFor: aClass. self addPoolVarsFor: aClass. self retainMethods: (aClass requiredMethodNames: self options). 'Adding Class ' , aClass name , '...' displayProgressAt: Sensor cursorPoint from: 0 to: aClass selectors size during: [:bar | + aClass selectors withIndexDo: - aClass selectors doWithIndex: [:sel :i | | source | bar value: i. self addStructMethodFor: aClass selector: sel]]. aClass declareCVarsIn: self! Item was changed: ----- Method: CCodeGenerator>>doBasicInlining: (in category 'inlining') ----- doBasicInlining: inlineFlagOrSymbol "Inline the bodies of all methods that are suitable for inlining. This method does only the basic inlining suitable for both the core VM and plugins - no bytecode inlining etc" | pass progress | self collectInlineList: inlineFlagOrSymbol. pass := 0. progress := true. [progress] whileTrue: [ "repeatedly attempt to inline methods until no further progress is made" progress := false. ('Inlining pass ', (pass := pass + 1) printString, '...') displayProgressAt: Sensor cursorPoint from: 0 to: methods size during: [:bar | + (self sortMethods: methods) withIndexDo: [:m :i | - (self sortMethods: methods) doWithIndex: [:m :i | bar value: i. currentMethod := m. (m tryToInlineMethodsIn: self) ifTrue: [progress := true]]]]. ! Item was changed: ----- Method: CCodeGenerator>>emitCMethods:on: (in category 'C code generator') ----- emitCMethods: methodList on: aStream 'Writing Translated Code...' displayProgressAt: Sensor cursorPoint from: 0 to: methods size during: [:bar | + methodList withIndexDo: - methodList doWithIndex: [ :m :i | bar value: i. (m isRealMethod and: [self shouldGenerateMethod: m]) ifTrue: [m emitCCodeOn: aStream generator: self]]]! Item was changed: ----- Method: CCodeGenerator>>removeAssertions (in category 'inlining') ----- removeAssertions "Remove all assertions in method bodies. This is for the benefit of inlining, which fails to recognise and disregard empty method bodies when checking the inlinability of sends." | newMethods | newMethods := Dictionary new. 'Removing assertions...' displayProgressAt: Sensor cursorPoint from: 0 to: methods size during: [ :bar | + methods withIndexDo: [ :m :i | - methods doWithIndex: [ :m :i | bar value: i. m isAssertion ifFalse: [ newMethods at: m selector put: m. m removeAssertions]]]. methods := newMethods.! Item was changed: ----- Method: CogARMv8Compiler class>>initialize (in category 'class initialization') ----- initialize "Initialize various ARM64 instruction-related constants." "self initialize" "main registers; a minor complication in reading the doc. ARM refer to the 64bit registers as X0...30 and use R0...30 to refer to the 32bit lower halves. They also use a whole suite of names for the floating point/SIMD registers. See ARMARM DDI0487 B1.2.1 etc for the gory details. Note that R30 (yes, yes, X30) is used as the link register and as such is not really a general purpose register. Also note that 31 in a general register field means R31, and that in most of these instructions R31 is the zero register named XZR in ARM doc. but in the rest of these instructions R31 the effective SP register. XZR is a pseudo-register that always reads as 0 and writes to /dev/null. And note that unlike the ARM32, there is no general purpose register for the PC; a big difference. See ARMARM DDI0487 C1.2.5. wrt to both the lack of a PC register and the XZR/SP distinction." "and initialize most sets of variables that run from 0 to N - 1..." #( "General registers, 0 to 31. We stick with R0...30 to refer to the 64 bit general regs and D0...31 (note the extra reg here!!) for the FP/SIMD regs" (R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R20 R21 R22 R23 R24 R25 R26 R27 R28 R29 R30 R31) "Floating-point registers, 0 to 31" (D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31) "C argument registers, 0 to 6" (CArg0Reg CArg1Reg CArg2Reg CArg3Reg CArg4Reg CArg5Reg CArg6Reg) "Condition Codes 0 to 16. Note that cc=16rF is mapped back to AL in AARCH64. Generally it shouldn't be used." (EQ NE CS CC MI PL VS VC HI LS GE LT GT LE AL) "Logical Op Codes" (LogicalAnd LogicalOr LogicalXor LogicalAndS) "Arithmetic Opcodes" "ADD (shifted register) on page C6-763 10001011 ADDS (shifted register) on page C6-771 10101011 CMN (shifted register) on page C6-854 10101011 Rd=XZR SUB (shifted register) on page C6-1313 11001011 SUBS (shifted register) on page C6-1323 11101011 CMP (shifted register) on page C6-860 11101011 Rd=XZR NEG (shifted register) on page C6-1114 11001011 Rn=XZR NEGS on page C6-1116 11101011 Rn=XZR" (ArithmeticAdd ArithmeticAddS ArithmeticSub ArithmeticSubS) "Extension Methods " (UXTB UXTH UXTW UXTX "a.k.a. LSL" SXTB SXTH SXTW SXTX)) do: [:classVarNames| + classVarNames withIndexDo: - classVarNames doWithIndex: [:k :v| CogARMv8Compiler classPool at: k put: v - 1]]. SP := XZR := R31. LR := R30. FP := R29. "DC variant selectors; see concretizeDataCacheControl" DC_CISW := 13. DC_CIVAC := 14. DC_CSW := 15. DC_CVAC := 16. DC_CVAU := 19. DC_ISW := 26. DC_IVAC := 27. DC_ZVA := 28. "IC variant selectors; see concretizeInstructionCacheControl" IC_IALLU := 0. IC_IALLUIS := 1. IC_IVAU := 2. "DSB domains and types C6.2.81 DSB C6-891" DSB_OSH := 0. "Domain_OuterSharable" DSB_NSH := 1. "Domain_NonSharable" DSB_ISH := 2. "Domain_InnerSharable" DSB_SY := 3. "Domain_FullSystem" DSB_ALLSY := 0. "Types_All; domain = Domain_FullSystem" DSB_READS := 1. "Types_Reads" DSB_WRITES := 2. "Types_Writes" DSB_ALL := 3. "Types_All; domain ~= Domain_FullSystem" "Specific instructions" self initializeSpecificOpcodes: #(MulRRR MulOverflowRRR SMULHRRR DivRRR MSubRRR "N.B. ARMv8 has MSUBRRRR but we only support three operands" MoveAwRR MoveRRAw NativePushRR NativePopRR "these map to ldp/stp" "Cache control and memory barrier" "B2.3.7 Memory barriers B2-124" DC IC DMB DSB ISB MRS_CTR_EL0 MRS_ID_AA64ISAR0_EL1 CASAL CBNZ CBZ CCMPNE CSET CLREX LDAXR STLXR STLR) in: thisContext method! Item was changed: ----- Method: CogX64Compiler class>>initialize (in category 'class initialization') ----- initialize "Initialize various x64 instruction-related constants. [1] IA-32 Intel� Architecture Software Developer's Manual Volume 2A: Instruction Set Reference, A-M" "CogX64Compiler initialize" self ~~ CogX64Compiler ifTrue: [^self]. (InitializationOptions ifNil: [Dictionary new]) at: #ABI ifPresent: [:abi| SysV := abi asUppercase ~= #WIN64 and: [abi asUppercase ~= #'_WIN64']] ifAbsent: [SysV := true]. "Default ABI; set to true for SysV, false for WIN64/_WIN64" "Initialize most sets of variables that run from 0 to N - 1..." #( "16 integer registers, rcx, rdx, rbx bizarrely inconsistent" (RAX RCX RDX RBX RSP RBP RSI RDI R8 R9 R10 R11 R12 R13 R14 R15) "16 lower half floating point registers" (XMM0L XMM1L XMM2L XMM3L XMM4L XMM5L XMM6L XMM7L XMM8L XMM9L XMM10L XMM11L XMM12L XMM13L XMM14L XMM15L) "Mod R/M Mod fields. See [1] Sec 2.4, 2.5 & 2.6 & Table 2-2" (ModRegInd ModRegRegDisp8 ModRegRegDisp32 ModReg ModRegIndSIB ModRegIndDisp32) "SIB Scaled Index modes. See [1] Sec 2.4, 2.5 & 2.6 & Table 2-3" (SIB1 SIB2 SIB4 SIB8)) do: [:classVarNames| + classVarNames withIndexDo: - classVarNames doWithIndex: [:k :v| self classPool at: k put: v - 1]]. "Specific instructions" self initializeSpecificOpcodes: #(CPUID "Arithmetic:" CDQ IDIVR IMULRR XCHGRR "Bit count/data movement:" CLD REP MOVSB MOVSQ BSR "Multi-processing:" LFENCE MFENCE SFENCE LOCK CMPXCHGRMr SETE MoveRAwNoVBR) in: thisContext method extraClassVarNames: #(CArg0Reg CArg1Reg CArg2Reg CArg3Reg)! Item was changed: ----- Method: InterpreterSimulator>>ioLoadFunction:From: (in category 'plugin support') ----- ioLoadFunction: functionString From: pluginString "Load and return the requested function from a module" | plugin fnSymbol | fnSymbol := functionString asSymbol. transcript cr; show:'Looking for ', functionString, ' in '. pluginString isEmpty ifTrue:[transcript show: 'vm'] ifFalse:[transcript show: pluginString]. plugin := pluginList detect:[:any| any key = pluginString asString] ifNone:[self loadNewPlugin: pluginString]. plugin ifNil:[ "Transcript cr; show:'Failed ... no plugin found'." ^ 0]. plugin := plugin value. + mappedPluginEntries withIndexDo:[:pluginAndName :index| - mappedPluginEntries doWithIndex:[:pluginAndName :index| ((pluginAndName at: 1) == plugin and:[(pluginAndName at: 2) == fnSymbol]) ifTrue:[ "Transcript show:' ... okay'." ^ index]]. (plugin respondsTo: fnSymbol) ifFalse:[ "Transcript cr; show:'Failed ... primitive not in plugin'." ^ 0]. mappedPluginEntries := mappedPluginEntries copyWith: (Array with: plugin with: fnSymbol). "Transcript show:' ... okay'." ^ mappedPluginEntries size! Item was changed: ----- Method: KlattSynthesizerPlugin class>>initialize (in category 'class initialization') ----- initialize " KlattSynthesizerPlugin initialize " | parameterClass | parameterClass := (Smalltalk hasClassNamed: #KlattFrame) ifTrue: [Smalltalk at: #KlattFrame "original package structure"] ifFalse: [Smalltalk at: #KlattResonatorIndices "repackaged to separate plugin from Speech dependency"]. + parameterClass parameterNames withIndexDo: + [ :each :i | self classPool at: each capitalized asSymbol put: i - 1]. + PI := Float pi. - parameterClass parameterNames - doWithIndex: [ :each :i | self classPool at: each capitalized asSymbol put: i-1]. - PI := Float pi . Epsilon := 1.0e-04! Item was changed: ----- Method: StackInterpreter class>>table:from: (in category 'initialization') ----- table: anArray from: specArray "SpecArray is an array of one of (index selector) or (index1 index2 selector) or (index nil) or (index1 index2 nil). If selector then the entry is the selector, but if nil the entry is the index." | contiguous | contiguous := 0. specArray do: [:spec | (spec at: 1) = contiguous ifFalse: [self error: 'Non-contiguous table entry']. spec size = 2 ifTrue: [anArray at: (spec at: 1) + 1 put: ((spec at: 2) ifNil: [spec at: 1] ifNotNil: [:sym| sym]). contiguous := contiguous + 1] ifFalse: [(spec at: 1) to: (spec at: 2) do: [:i | anArray at: i + 1 put: ((spec at: 3) ifNil: [i] ifNotNil: [:sym| sym])]. contiguous := contiguous + ((spec at: 2) - (spec at: 1)) + 1]]. + anArray withIndexDo: - anArray doWithIndex: [:entry :index| entry isSymbol ifTrue: [(self shouldIncludeMethodForSelector: entry) ifFalse: [anArray at: index put: 0]]]! Item was changed: ----- Method: VMInterfaceConsistencyTests>>testInterpreterProxyInterfaceIsConsistentFor: (in category 'private-support') ----- testInterpreterProxyInterfaceIsConsistentFor: aClass | ccg | ccg := VMPluginCodeGenerator new. InterpreterProxy selectors asArray sort do: [:sel| | pm | ((#(initialize #'initialize-release' private) includes: (InterpreterProxy whichCategoryIncludesSelector: sel)) or: [ccg noteUsedPluginFunction: sel]) ifFalse: [pm := ccg compileToTMethodSelector: sel in: InterpreterProxy. (aClass whichClassIncludesSelector: sel) ifNotNil: [:impClass| | im pt it | im := ccg compileToTMethodSelector: sel in: impClass. "A number of functions are actually void in the interpreter but declared as sqInt in sqVirtualMachine.c, e.g. push" self assert: ((pt := pm returnType) = (it := im returnType) or: [pt = #sqInt and: [it = #void]]) description: 'inconsistent returnType for ', sel, ' in InterpreterProxy vs ', impClass, ' ', pt, ' vs ', it. + pm args withIndexDo: - pm args doWithIndex: [:pma :i| | ima | ima := im args at: i. self assert: (pt := pm typeFor: pma in: ccg) = (it := im typeFor: ima in: ccg) description: 'inconsistent ', i printString, (#('st' 'nd') at: i ifAbsent: 'th'), ' arg type for ', sel, ' in InterpreterProxy vs ', impClass, ' ', pt, ' vs ', it]]]]! From commits at source.squeak.org Wed Jan 20 04:47:08 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 20 Jan 2021 04:47:08 0000 Subject: [Vm-dev] VM Maker: Cog-eem.434.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.434.mcz ==================== Summary ==================== Name: Cog-eem.434 Author: eem Time: 19 January 2021, 8:47:05.865683 pm UUID: ee50579f-beb7-487a-816e-23bc0ce7d244 Ancestors: Cog-eem.433 doWithIndex: => withIndexDo: =============== Diff against Cog-eem.433 =============== Item was changed: ----- Method: GdbARMv8Alien>>printRegisterState:on: (in category 'printing') ----- printRegisterState: registerStateVector on: aStream (registerStateVector size >= 64 ifTrue: [#( (r0 r1 r2 r3 cr) (r4 r5 r6 r7 cr) (r8 r9 r10 r11 cr) (r12 r13 r14 r15 cr) (r16 r17 r18 r19 cr) (r20 r21 r22 r23 cr) (r24 r25 r26 r27 cr) (r28 fp lr sp cr) (d0 d1 d2 d3 cr) (d4 d5 d6 d7 cr) (d8 d9 d10 d11 cr) (d12 d13 d14 d15 cr) (d16 d17 d18 d19 cr) (d20 d21 d22 d23 cr) (d24 d25 d26 d27 cr) (d28 d29 d30 d31 cr))] ifFalse: [#( (r0 r1 r2 r3 cr) (r4 r5 r6 r7 cr) (r8 r9 r10 r11 cr) (r12 r13 r14 r15 cr) (r16 r17 r18 r19 cr) (r20 r21 r22 r23 cr) (r24 r25 r26 r27 cr) + (r28 fp lr sp cr))]) withIndexDo: - (r28 fp lr sp cr))]) doWithIndex: [:subset :index| (subset anySatisfy: [:getter| getter ~~ #cr and: [(self perform: getter) ~= 0]]) ifTrue: [self printFields: subset inRegisterState: (registerStateVector copyFrom: index * 4 - 3 to: index * 4) on: aStream]]. registerStateVector size = 34 "i.e. imtegerRegisterState" ifTrue: [self printFields: #(pc rawCPSR cr) inRegisterState: (registerStateVector last: 2) on: aStream] ifFalse: [self printFields: #(pc CPSR FPSR FPCR nextpc cr) inRegisterState: (registerStateVector last: 5) on: aStream]! Item was changed: ----- Method: GdbARMv8AlienTests>>singleStepNFibFor:numTimes:on: (in category 'examples') ----- singleStepNFibFor: v numTimes: n on: aStream "self new singleStepNFibFor: 2 numTimes: 32 on: Transcript" | memory p state newState | memory := Bitmap new: 1024 * 2 withAll: self processor nopOpcode. memory replaceFrom: 1 to: self nfib size with: self nfib asWordArray startingAt: 1. (p := self processor) r0: n; lr: memory size * 2; "return address" pc: 0; sp: (memory size * 4) - 16. p printRegistersOn: aStream. state := p registerState. aStream cr; flush. n timesRepeat: [| first | aStream nextPutAll: (p disassembleNextInstructionIn: memory); space. p singleStepIn: memory readExecuteOnlyBelow: memory size / 2. newState := p registerState. first := true. + state withIndexDo: - state doWithIndex: [:rv :i| | nv | rv ~= (nv := newState at: i) ifTrue: [first ifTrue: [aStream crtab: 2. first := false]. aStream nextPutAll: (p registerStateSetters at: i); space; print: rv; nextPutAll: ' -> '; print: nv; space]]. aStream cr; flush. state := newState]. ^p r0! Item was changed: ----- Method: MIPSSimulator>>printRegisterState:on: (in category 'user interface') ----- printRegisterState: registerStateVector on: aStream #( (at v0 v1 cr) (a0 a1 a2 a3 cr) (t0 t1 t2 t3 cr) (t4 t5 t6 t7 cr) (s0 s1 s2 s3 cr) (s4 s5 s6 s7 cr) (t8 t9 k0 k1 cr) + (gp sp fp ra cr)) withIndexDo: - (gp sp fp ra cr)) doWithIndex: [:subset :index| (subset anySatisfy: [:getter| getter ~~ #cr and: [(self perform: getter) ~= 0]]) ifTrue: [self printFields: subset inRegisterState: (registerStateVector copyFrom: index * 4 - 3 to: index * 4) on: aStream]]. self printFields: #(pc cr) inRegisterState: (registerStateVector last: 1) on: aStream! From commits at source.squeak.org Thu Jan 21 03:17:12 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 21 Jan 2021 03:17:12 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2938.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2938.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2938 Author: eem Time: 20 January 2021, 7:17:02.642438 pm UUID: d0498f14-0205-4d9d-925f-016fa65847a3 Ancestors: VMMaker.oscog-eem.2937 SmartSyntaxPlugin Slang compilation: Eliminate a little dead code following final conditional return. Don't bother to check for failure when returning results of positive32BitIntegerFor:, which cannot fail. Cleaner adding of prologs/epilogs to parseTree's statements. =============== Diff against VMMaker.oscog-eem.2937 =============== Item was changed: ----- Method: SmartSyntaxPluginTMethod>>endsWithMethodReturnExpression (in category 'testing') ----- endsWithMethodReturnExpression | operativeReturn methodReturns | operativeReturn := (parseTree statements last isReturn and: [parseTree statements last expression isLeaf]) ifTrue: [(parseTree statements last: 2) first] ifFalse: [parseTree statements last]. + (operativeReturn isSend + and: [operativeReturn selector == #ifFalse: + and: [operativeReturn receiver isSend + and: [operativeReturn receiver selector == #failed + and: [operativeReturn receiver receiver isLeaf + and: [operativeReturn receiver receiver name = 'interpreterProxy' + and: [operativeReturn args size = 1 + and: [operativeReturn args first statements first isReturn]]]]]]]) ifTrue: + [operativeReturn := operativeReturn args first statements first expression]. methodReturns := #( methodReturnReceiver methodReturnFloat: methodReturnValue: methodReturnInteger: methodReturnBool: methodReturnString: + methodReturnStringOrNil: + + asBooleanObj + asFloatObj + asPositiveIntegerObj + asSmallIntegerObj). - methodReturnStringOrNil:). ^operativeReturn isSend and: [(methodReturns includes: operativeReturn selector) or: [operativeReturn isConditionalSend and: [(operativeReturn args collect: [:stmts| stmts statements last]) anySatisfy: [:stmt| stmt isSend and: [methodReturns includes: stmt selector]]]]]! Item was changed: ----- Method: SmartSyntaxPluginTMethod>>extractPrimitiveDirectives (in category 'specifying primitives') ----- extractPrimitiveDirectives "Save selector in fullSelector and args in fullArgs. Scan top-level statements for a directive of the form: self primitive: or self primitive: parameters: or self primitive: parameters: receiver: or an assignment of that expression to a local, and manipulate the state and parse tree accordingly." parseTree setStatements: (Array streamContents: [:sStream | parseTree statements do: [:stmt | (self primitiveDirectiveWasHandled: stmt on: sStream) ifFalse: [sStream nextPut: stmt]]]). isPrimitive ifTrue: [export := true. + parseTree statements addAllFirst: self namedPrimitiveProlog. - parseTree - setStatements: self namedPrimitiveProlog, - parseTree statements. self fixUpReturns. self replaceSizeMessages. ^true] ifFalse: [self removeFinalSelfReturnIn: nil]. ^false! Item was changed: ----- Method: SmartSyntaxPluginTMethod>>resultExpressionCanFail: (in category 'private') ----- resultExpressionCanFail: aTSendNode + "Neither asSmallIntegerObj nor asBooleanObj nor asPositiveIntegerObj can fail. + asPositiveIntegerObj maps to positive32BitIntegerFor: which uses + eeInstantiateSmallClassIndex:format:numSlots: which does not GC and does not fail." + ^(#(asSmallIntegerObj asPositiveIntegerObj asBooleanObj nilObject trueObject falseObject) includes: aTSendNode selector) not! - "Neither asSmallIntegerObj nor asBooleanObj can fail." - ^(#(asSmallIntegerObj asBooleanObj nilObject trueObject falseObject) includes: aTSendNode selector) not! Item was changed: ----- Method: TMethod>>preparePrimitivePrologue (in category 'primitive compilation') ----- preparePrimitivePrologue "Add a prolog and postlog to a primitive method. The prolog copies any instance variables referenced by this primitive method into local variables. The postlog copies values of assigned-to variables back into the instance. The names of the new locals are added to the local variables list. The declarations dictionary defines the types of any non-integer variables (locals, arguments, or instance variables). In particular, it may specify the types: int * -- an array of 32-bit values (e.g., a BitMap) short * -- an array of 16-bit values (e.g., a SoundBuffer) char * -- an array of unsigned bytes (e.g., a String) double -- a double precision floating point number (e.g., 3.14159) Undeclared variables are taken to be integers and will be converted from Smalltalk to C ints." "Current restrictions: o method must not contain message sends o method must not allocate objects o method must not manipulate raw oops o method cannot access class variables o method can only return an integer" | prolog postlog instVarsUsed varsAssignedTo instVarList primArgCount varName endsWithReturn aClass | self assert: selector ~~ #setInterpreter:. aClass := definingClass. prolog := OrderedCollection new. postlog := OrderedCollection new. instVarsUsed := self freeVariableReferences asSet. varsAssignedTo := self variablesAssignedTo asSet. instVarList := aClass allInstVarNames. primArgCount := args size. "add receiver fetch and arg conversions to prolog" prolog addAll: self fetchRcvrExpr. 1 to: args size do: [:argIndex | varName := args at: argIndex. prolog addAll: (self argConversionExprFor: varName stackIndex: args size - argIndex)]. "add success check to postlog" postlog addAll: self checkSuccessExpr. "add instance variable fetches to prolog and instance variable stores to postlog" 1 to: instVarList size do: [:varIndex | varName := instVarList at: varIndex. (instVarsUsed includes: varName) ifTrue: [ locals add: varName. prolog addAll: (self instVarGetExprFor: varName offset: varIndex - 1). (varsAssignedTo includes: varName) ifTrue: [ postlog addAll: (self instVarPutExprFor: varName offset: varIndex - 1)]]]. prolog addAll: self checkSuccessExpr. ((locals includes: 'rcvr') or: [(locals intersection: args) notEmpty]) ifTrue: [self error: 'local name conflicts with instance variable name']. locals add: 'rcvr'; addAll: args. args := args class new. endsWithReturn := self endsWithReturn. self fixUpReturns: primArgCount postlog: postlog. + parseTree statements addAllFirst: prolog. + endsWithReturn ifFalse: + [postlog addAll: (self popArgsExpr: primArgCount). + parseTree statements addAllLast: postlog]. - endsWithReturn - ifTrue: [parseTree setStatements: prolog, parseTree statements] - ifFalse: [ - postlog addAll: (self popArgsExpr: primArgCount). - parseTree setStatements: prolog, parseTree statements, postlog]. ! From noreply at github.com Thu Jan 21 03:21:27 2021 From: noreply at github.com (Eliot Miranda) Date: Wed, 20 Jan 2021 19:21:27 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 7f2dbb: CogVM source as per VMMaker.oscog-eem.2938 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 7f2dbbc501e96a18abba1fa59411b02b6cf6b446 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7f2dbbc501e96a18abba1fa59411b02b6cf6b446 Author: Eliot Miranda Date: 2021-01-20 (Wed, 20 Jan 2021) Changed paths: M src/plugins/BitBltPlugin/BitBltPlugin.c M src/plugins/JoystickTabletPlugin/JoystickTabletPlugin.c M src/plugins/Mpeg3Plugin/Mpeg3Plugin.c M src/plugins/SocketPlugin/SocketPlugin.c M src/plugins/SoundPlugin/SoundPlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2938 SmartSyntaxPlugin Slang compilation: Eliminate a little dead code following final conditional return. Don't bother to check for failure when returning results of positive32BitIntegerFor:, which cannot fail. From lists at fniephaus.com Fri Jan 22 16:04:14 2021 From: lists at fniephaus.com (Fabio Niephaus) Date: Fri, 22 Jan 2021 17:04:14 +0100 Subject: [Vm-dev] Fwd: Bintray account for OpenSmalltalk has been rate-limited In-Reply-To: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> References: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> Message-ID: Hi all, Looks like our Bintray account has been rate-limited again, possibly due to too many builds that pushed binaries to Bintray without deleting older ones. This possibly can cause CI builds to fail (if they fail to deploy to Bintray). I'm afraid I don't have much time to look into this, but I will monitor and forward the communication with Bintray support. Best, Fabio ---------- Forwarded message --------- From: Bintray Date: Thu, Jan 21, 2021 at 7:11 AM Subject: Bintray account for OpenSmalltalk has been rate-limited To: Hi OpenSmalltalk, Your Bintray account is currently rate-limited due to overuse. Customer Support should contact you at the earliest to remove the limits from your account. You may also contact them directly at support at jfrog.com. Regards, The Bintray Team From commits at source.squeak.org Fri Jan 22 19:49:30 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 22 Jan 2021 19:49:30 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2939.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2939.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2939 Author: eem Time: 22 January 2021, 11:49:18.757235 am UUID: f054050f-19cd-41d1-9a3e-7cfd1a2e6e0a Ancestors: VMMaker.oscog-eem.2938 Extend the HostWindowPlugin with a primitive to answer an array of screen rectangles for the available monitors. =============== Diff against VMMaker.oscog-eem.2938 =============== Item was added: + ----- Method: HostWindowPlugin>>primitiveScreenRectangles (in category 'system primitives') ----- + primitiveScreenRectangles + + "Answer an Array of pairs of packed x,y repreeentation origins and extents for all the available monitors." + self primitive: 'primitiveScreenRectangles'. + self ioScreenRectangles + ifNil: [interpreterProxy primitiveFailFor: PrimErrNoMemory] + ifNotNil: [:screenRectangles| interpreterProxy methodReturnValue: screenRectangles]! Item was added: + ----- Method: HostWindowPluginSimulator>>ioScreenRectangles (in category 'primitive simulation') ----- + ioScreenRectangles + self ioScreenRectanglesPrimitive + ifNil: [interpreterProxy primitiveFailFor: PrimErrNoMemory] + ifNotNil: + [:a| + (interpreterProxy instantiateClass: interpreterProxy classArray indexableSize: a size) + ifNil: [interpreterProxy primitiveFailFor: PrimErrNoMemory] + ifNotNil: + [:result| + 1 to: a size do: + [:i| interpreterProxy storeInteger: i - 1 ofObject: result withValue: (a at: i)]. + ^result]]. + ^nil! Item was added: + ----- Method: HostWindowPluginSimulator>>ioScreenRectanglesPrimitive (in category 'primitive simulation') ----- + ioScreenRectanglesPrimitive + + ^nil + + "self basicNew ioScreenRectanglesPrimitive" + "self basicNew ioScreenRectanglesPrimitive collect: + [:pp| | x y | + x := pp bitShift: -16. + y := pp bitAnd: 16rFFFF. + y > 32767 ifTrue: [y := y - 65536]. + x at y]"! From noreply at github.com Fri Jan 22 19:52:04 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 22 Jan 2021 11:52:04 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 8e4e01: CogVM source as per VMMaker.oscog-eem.2939 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 8e4e01255c8004fa89eb7ba0f212ba1562afb587 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8e4e01255c8004fa89eb7ba0f212ba1562afb587 Author: Eliot Miranda Date: 2021-01-22 (Fri, 22 Jan 2021) Changed paths: M platforms/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h M platforms/iOS/plugins/HostWindowPlugin/sqMacHostWindow.m M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c M src/plugins/HostWindowPlugin/HostWindowPlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2939 Extend the HostWindowPlugin with a primitive to answer an array of screen rectangles for the available monitors (TerfVM only). Implement on MacOS and provide a suitable stub on Windows. From noreply at github.com Fri Jan 22 19:57:41 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 22 Jan 2021 11:57:41 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] e992f9: Oops. Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: e992f966dccbb507199e907c5c2018e69fb8e608 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e992f966dccbb507199e907c5c2018e69fb8e608 Author: Eliot Miranda Date: 2021-01-22 (Fri, 22 Jan 2021) Changed paths: M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c Log Message: ----------- Oops. From noreply at github.com Sat Jan 23 03:46:19 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 22 Jan 2021 19:46:19 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 462025: Add multiple monitor support for Win32 (TeefVM onl... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 46202559a8d74c32c81cd9cd211dcc3008982a72 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/46202559a8d74c32c81cd9cd211dcc3008982a72 Author: Eliot Miranda Date: 2021-01-22 (Fri, 22 Jan 2021) Changed paths: M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c Log Message: ----------- Add multiple monitor support for Win32 (TeefVM only). [ci skip] From commits at source.squeak.org Sat Jan 23 05:29:44 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sat, 23 Jan 2021 05:29:44 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2940.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2940.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2940 Author: eem Time: 22 January 2021, 9:29:33.858798 pm UUID: 29171f50-756f-4560-8488-ced65f2d4841 Ancestors: VMMaker.oscog-eem.2939 Implement primitive 18, makePoint in the JIT for Spur, mainly to reduce the noise in the primTraceLog. =============== Diff against VMMaker.oscog-eem.2939 =============== Item was added: + ----- Method: CogObjectRepresentation>>genPrimitiveMakePoint (in category 'primitive generators') ----- + genPrimitiveMakePoint + "subclasses override if they so desire" + ^UnimplementedPrimitive! Item was added: + ----- Method: CogObjectRepresentationForSpur>>genPrimitiveMakePoint (in category 'primitive generators') ----- + genPrimitiveMakePoint + "" + | allocSize newPointHeader jumpFail resultReg scratchReg | + resultReg := ClassReg. + scratchReg := SendNumArgsReg. + "" + allocSize := objectMemory baseHeaderSize + (objectMemory wordSize * 2). + newPointHeader := objectMemory + headerForSlots: 2 + format: objectMemory nonIndexablePointerFormat + classIndex: ClassPointCompactIndex. + cogit + MoveAw: objectMemory freeStartAddress R: resultReg; + LoadEffectiveAddressMw: allocSize r: resultReg R: scratchReg; + CmpCq: objectMemory getScavengeThreshold R: scratchReg. + jumpFail := cogit JumpAboveOrEqual: 0. + cogit MoveR: scratchReg Aw: objectMemory freeStartAddress. + self genStoreHeader: newPointHeader intoNewInstance: resultReg using: scratchReg. + cogit + MoveR: ReceiverResultReg Mw: objectMemory baseHeaderSize r: resultReg; + MoveR: Arg0Reg Mw: objectMemory baseHeaderSize + objectMemory wordSize r: resultReg; + MoveR: resultReg R: ReceiverResultReg; + genPrimReturn. + jumpFail jmpTarget: cogit Label. + ^0! Item was changed: ----- Method: ObjectMemory class>>initializeCompactClassIndices (in category 'initialization') ----- initializeCompactClassIndices "Initialize indices for compact classes we are going to depend on being compact. The VI allows classes to become compact and become uncompact. For efficiency the VM assumes certain classes are compact with particular indices." "Smalltalk compactClassesArray" "{Array. LargePositiveInteger. Float. MethodContext. } collect: [:c| c -> c indexIfCompact]" ClassArrayCompactIndex := 3. ClassLargeNegativeIntegerCompactIndex := 4. "Was PseudoContext class" ClassLargePositiveIntegerCompactIndex := 5. ClassFloatCompactIndex := 6. ClassBlockClosureCompactIndex := 0 "12". "Prospective. May still be TranslatedMethod class" ClassByteStringCompactIndex := 11. ClassBlockContextCompactIndex := 13. ClassMethodContextCompactIndex := 14. ClassByteArrayCompactIndex := 0. ClassMessageCompactIndex := 0. + ClassBitmapCompactIndex := 0. + ClassPointCompactIndex := 0! - ClassBitmapCompactIndex := 0! Item was changed: ----- Method: SimpleStackBasedCogit class>>initializePrimitiveTableForSqueak (in category 'class initialization') ----- initializePrimitiveTableForSqueak "Initialize the table of primitive generators. This does not include normal primitives implemented in the coInterpreter. N.B. primitives that don't have an explicit arg count (the integer following the generator) may be variadic." "SimpleStackBasedCogit initializePrimitiveTableForSqueak" MaxCompiledPrimitiveIndex := self objectRepresentationClass wordSize = 8 ifTrue: [575] ifFalse: [575]. primitiveTable := CArrayAccessor on: (Array new: MaxCompiledPrimitiveIndex + 1). self table: primitiveTable from: #( "Integer Primitives (0-19)" (1 genPrimitiveAdd 1) (2 genPrimitiveSubtract 1) (3 genPrimitiveLessThan 1) (4 genPrimitiveGreaterThan 1) (5 genPrimitiveLessOrEqual 1) (6 genPrimitiveGreaterOrEqual 1) (7 genPrimitiveEqual 1) (8 genPrimitiveNotEqual 1) (9 genPrimitiveMultiply 1) (10 genPrimitiveDivide 1) (11 genPrimitiveMod 1) (12 genPrimitiveDiv 1) (13 genPrimitiveQuo 1) (14 genPrimitiveBitAnd 1) (15 genPrimitiveBitOr 1) (16 genPrimitiveBitXor 1) (17 genPrimitiveBitShift 1) + (18 genPrimitiveMakePoint 1) "this is here mainly to remove noise from printPrimTraceLog()" - "(18 primitiveMakePoint)" "(19 primitiveFail)" "Guard primitive for simulation -- *must* fail" "LargeInteger Primitives (20-39)" "(20 primitiveFail)" "(21 primitiveAddLargeIntegers)" "(22 primitiveSubtractLargeIntegers)" "(23 primitiveLessThanLargeIntegers)" "(24 primitiveGreaterThanLargeIntegers)" "(25 primitiveLessOrEqualLargeIntegers)" "(26 primitiveGreaterOrEqualLargeIntegers)" "(27 primitiveEqualLargeIntegers)" "(28 primitiveNotEqualLargeIntegers)" "(29 primitiveMultiplyLargeIntegers)" "(30 primitiveDivideLargeIntegers)" "(31 primitiveModLargeIntegers)" "(32 primitiveDivLargeIntegers)" "(33 primitiveQuoLargeIntegers)" "(34 primitiveBitAndLargeIntegers)" "(35 primitiveBitOrLargeIntegers)" "(36 primitiveBitXorLargeIntegers)" "(37 primitiveBitShiftLargeIntegers)" "Float Primitives (38-59)" "(38 genPrimitiveFloatAt)" "(39 genPrimitiveFloatAtPut)" (40 genPrimitiveAsFloat 0) (41 genPrimitiveFloatAdd 1) (42 genPrimitiveFloatSubtract 1) (43 genPrimitiveFloatLessThan 1) (44 genPrimitiveFloatGreaterThan 1) (45 genPrimitiveFloatLessOrEqual 1) (46 genPrimitiveFloatGreaterOrEqual 1) (47 genPrimitiveFloatEqual 1) (48 genPrimitiveFloatNotEqual 1) (49 genPrimitiveFloatMultiply 1) (50 genPrimitiveFloatDivide 1) "(51 genPrimitiveTruncated)" "(52 genPrimitiveFractionalPart)" "(53 genPrimitiveExponent)" "(54 genPrimitiveTimesTwoPower)" (55 genPrimitiveFloatSquareRoot 0) "(56 genPrimitiveSine)" "(57 genPrimitiveArctan)" "(58 genPrimitiveLogN)" "(59 genPrimitiveExp)" "Subscript and Stream Primitives (60-67)" (60 genPrimitiveAt 1) (61 genPrimitiveAtPut 2) (62 genPrimitiveSize 0) (63 genPrimitiveStringAt 1) (64 genPrimitiveStringAtPut 2) "The stream primitives no longer pay their way; normal Smalltalk code is faster." (65 genFastPrimFail)"was primitiveNext" (66 genFastPrimFail) "was primitiveNextPut" (67 genFastPrimFail) "was primitiveAtEnd" "StorageManagement Primitives (68-79)" (68 genPrimitiveObjectAt 1) "Good for debugger/InstructionStream performance" "(69 primitiveObjectAtPut)" (70 genPrimitiveNew 0) (71 genPrimitiveNewWithArg 1) "(72 primitiveArrayBecomeOneWay)" "Blue Book: primitiveBecome" "(73 primitiveInstVarAt)" "(74 primitiveInstVarAtPut)" (75 genPrimitiveIdentityHash 0) "(76 primitiveStoreStackp)" "Blue Book: primitiveAsObject" "(77 primitiveSomeInstance)" "(78 primitiveNextInstance)" (79 genPrimitiveNewMethod 2) "Control Primitives (80-89)" "(80 primitiveFail)" "Blue Book: primitiveBlockCopy" "(81 primitiveFail)" "Blue Book: primitiveValue" "(82 primitiveFail)" "Blue Book: primitiveValueWithArgs" (83 genPrimitivePerform) "(84 primitivePerformWithArgs)" "(85 primitiveSignal)" "(86 primitiveWait)" "(87 primitiveResume)" "(88 primitiveSuspend)" "(89 primitiveFlushCache)" "(90 primitiveMousePoint)" "(91 primitiveTestDisplayDepth)" "Blue Book: primitiveCursorLocPut" "(92 primitiveSetDisplayMode)" "Blue Book: primitiveCursorLink" "(93 primitiveInputSemaphore)" "(94 primitiveGetNextEvent)" "Blue Book: primitiveSampleInterval" "(95 primitiveInputWord)" "(96 primitiveFail)" "primitiveCopyBits" "(97 primitiveSnapshot)" "(98 primitiveStoreImageSegment)" "(99 primitiveLoadImageSegment)" "(100 primitivePerformInSuperclass)" "Blue Book: primitiveSignalAtTick" "(101 primitiveBeCursor)" "(102 primitiveBeDisplay)" "(103 primitiveScanCharacters)" "(104 primitiveFail)" "primitiveDrawLoop" (105 genPrimitiveStringReplace) "(106 primitiveScreenSize)" "(107 primitiveMouseButtons)" "(108 primitiveKbdNext)" "(109 primitiveKbdPeek)" "System Primitives (110-119)" (110 genPrimitiveIdentical 1) (111 genPrimitiveClass) "Support both class and Context>>objectClass:" "(112 primitiveBytesLeft)" "(113 primitiveQuit)" "(114 primitiveExitToDebugger)" "(115 primitiveChangeClass)" "Blue Book: primitiveOopsLeft" "(116 primitiveFlushCacheByMethod)" "(117 primitiveExternalCall)" "(118 primitiveDoPrimitiveWithArgs)" "(119 primitiveFlushCacheSelective)" (148 genPrimitiveShallowCopy 0) "a.k.a. clone" (158 genPrimitiveStringCompareWith 1) (159 genPrimitiveHashMultiply 0) (165 genPrimitiveIntegerAt 1) "Signed version of genPrimitiveAt" (166 genPrimitiveIntegerAtPut 2) "Signed version of genPrimitiveAtPut" (169 genPrimitiveNotIdentical 1) (170 genPrimitiveAsCharacter) "SmallInteger>>asCharacter, Character class>>value:" (171 genPrimitiveImmediateAsInteger 0) "Character>>value SmallFloat64>>asInteger" "(173 primitiveSlotAt 1)" "(174 primitiveSlotAtPut 2)" (175 genPrimitiveIdentityHash 0) "Behavior>>identityHash" "Old closure primitives" "(186 primitiveFail)" "was primitiveClosureValue" "(187 primitiveFail)" "was primitiveClosureValueWithArgs" "Perform method directly" "(188 primitiveExecuteMethodArgsArray)" "(189 primitiveExecuteMethod)" "Unwind primitives" "(195 primitiveFindNextUnwindContext)" "(196 primitiveTerminateTo)" "(197 primitiveFindHandlerContext)" (198 genFastPrimFail "primitiveMarkUnwindMethod") (199 genFastPrimFail "primitiveMarkHandlerMethod") "new closure primitives" "(200 primitiveClosureCopyWithCopiedValues)" (201 genPrimitiveClosureValue 0) "value" (202 genPrimitiveClosureValue 1) "value:" (203 genPrimitiveClosureValue 2) "value:value:" (204 genPrimitiveClosureValue 3) "value:value:value:" (205 genPrimitiveClosureValue 4) "value:value:value:value:" "(206 genPrimitiveClosureValueWithArgs)" "valueWithArguments:" (207 genPrimitiveFullClosureValue) "value[:value:value:value:] et al" "(208 genPrimitiveFullClosureValueWithArgs)" "valueWithArguments:" (209 genPrimitiveFullClosureValue) "valueNoContextSwitch[:value:] et al" "(210 primitiveContextAt)" "(211 primitiveContextAtPut)" "(212 primitiveContextSize)" "(218 primitiveDoNamedPrimitiveWithArgs)" "(219 primitiveFail)" "reserved for Cog primitives" "(220 primitiveFail)" "reserved for Cog primitives" (221 genPrimitiveClosureValue 0) "valueNoContextSwitch" (222 genPrimitiveClosureValue 1) "valueNoContextSwitch:" "SmallFloat primitives (540-559)" (541 genPrimitiveSmallFloatAdd 1) (542 genPrimitiveSmallFloatSubtract 1) (543 genPrimitiveSmallFloatLessThan 1) (544 genPrimitiveSmallFloatGreaterThan 1) (545 genPrimitiveSmallFloatLessOrEqual 1) (546 genPrimitiveSmallFloatGreaterOrEqual 1) (547 genPrimitiveSmallFloatEqual 1) (548 genPrimitiveSmallFloatNotEqual 1) (549 genPrimitiveSmallFloatMultiply 1) (550 genPrimitiveSmallFloatDivide 1) "(551 genPrimitiveSmallFloatTruncated 0)" "(552 genPrimitiveSmallFloatFractionalPart 0)" "(553 genPrimitiveSmallFloatExponent 0)" "(554 genPrimitiveSmallFloatTimesTwoPower 1)" (555 genPrimitiveSmallFloatSquareRoot 0) "(556 genPrimitiveSmallFloatSine 0)" "(557 genPrimitiveSmallFloatArctan 0)" "(558 genPrimitiveSmallFloatLogN 0)" "(559 genPrimitiveSmallFloatExp 0)" (575 genPrimitiveHighBit 0) )! Item was changed: ----- Method: SpurMemoryManager class>>initializeCompactClassIndices (in category 'class initialization') ----- initializeCompactClassIndices "Reuse the compact class indices to name known classIndices. This helps reduce the churn in the interpreters." "c.f. SpurBootstrap>>defineKnownClassIndices" FirstValidClassIndex := ClassLargeNegativeIntegerCompactIndex := 32. ClassLargePositiveIntegerCompactIndex := 33. ClassFloatCompactIndex := 34. ClassMessageCompactIndex := 35. ClassMethodContextCompactIndex := 36. ClassBlockContextCompactIndex := 0. ClassBlockClosureCompactIndex := 37. ClassFullBlockClosureCompactIndex := 38. ClassByteArrayCompactIndex := 50. ClassArrayCompactIndex := 51. ClassByteStringCompactIndex := 52. + ClassBitmapCompactIndex := 53. + ClassPointCompactIndex := 54! - ClassBitmapCompactIndex := 53! Item was changed: VMBasicConstants subclass: #VMSqueakClassIndices instanceVariableNames: '' + classVariableNames: 'ClassArrayCompactIndex ClassBitmapCompactIndex ClassBlockClosureCompactIndex ClassBlockContextCompactIndex ClassByteArrayCompactIndex ClassByteStringCompactIndex ClassFloatCompactIndex ClassFullBlockClosureCompactIndex ClassLargeNegativeIntegerCompactIndex ClassLargePositiveIntegerCompactIndex ClassMessageCompactIndex ClassMethodContextCompactIndex ClassPointCompactIndex' - classVariableNames: 'ClassArrayCompactIndex ClassBitmapCompactIndex ClassBlockClosureCompactIndex ClassBlockContextCompactIndex ClassByteArrayCompactIndex ClassByteStringCompactIndex ClassFloatCompactIndex ClassFullBlockClosureCompactIndex ClassLargeNegativeIntegerCompactIndex ClassLargePositiveIntegerCompactIndex ClassMessageCompactIndex ClassMethodContextCompactIndex' poolDictionaries: '' category: 'VMMaker-Interpreter'! From noreply at github.com Sat Jan 23 05:37:37 2021 From: noreply at github.com (Eliot Miranda) Date: Fri, 22 Jan 2021 21:37:37 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 704a2a: CogVM source as per VMMaker.oscog-eem.2940 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 704a2adfc17b8a36b494d1afd4fbe860c561e64b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/704a2adfc17b8a36b494d1afd4fbe860c561e64b Author: Eliot Miranda Date: 2021-01-22 (Fri, 22 Jan 2021) Changed paths: 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/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/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/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerp.c M spursrc/vm/gcc3x-cointerpmt.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/validImage.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2940 Implement primitive 18, makePoint, in the JIT for Spur, mainly to reduce the noise in the primTraceLog. From notifications at github.com Sat Jan 23 11:20:43 2021 From: notifications at github.com (Holger Freyther) Date: Sat, 23 Jan 2021 03:20:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Add --quiet option to allow an app to own stdout and stderr (#395) In-Reply-To: References: Message-ID: Closing as contributing seemed too hard. -- 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/395#issuecomment-765907953 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Jan 23 11:20:43 2021 From: notifications at github.com (Holger Freyther) Date: Sat, 23 Jan 2021 03:20:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Add --quiet option to allow an app to own stdout and stderr (#395) In-Reply-To: References: Message-ID: Closed #395. -- 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/395#event-4241375620 -------------- next part -------------- An HTML attachment was scrubbed... URL: From leves at caesar.elte.hu Sat Jan 23 20:08:26 2021 From: leves at caesar.elte.hu (Levente Uzonyi) Date: Sat, 23 Jan 2021 21:08:26 +0100 (CET) Subject: [Vm-dev] Fwd: Bintray account for OpenSmalltalk has been rate-limited In-Reply-To: References: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> Message-ID: Why was Bintray chosen to store the builds? Levente On Fri, 22 Jan 2021, Fabio Niephaus wrote: > > Hi all, > > Looks like our Bintray account has been rate-limited again, possibly > due to too many builds that pushed binaries to Bintray without > deleting older ones. This possibly can cause CI builds to fail (if > they fail to deploy to Bintray). I'm afraid I don't have much time to > look into this, but I will monitor and forward the communication with > Bintray support. > > Best, > Fabio > > ---------- Forwarded message --------- > From: Bintray > Date: Thu, Jan 21, 2021 at 7:11 AM > Subject: Bintray account for OpenSmalltalk has been rate-limited > To: > > > Hi OpenSmalltalk, > > Your Bintray account is currently rate-limited due to overuse. > > Customer Support should contact you at the earliest to remove the > limits from your account. You may also contact them directly at > support at jfrog.com. > > Regards, > The Bintray Team From lists at fniephaus.com Sat Jan 23 21:01:57 2021 From: lists at fniephaus.com (Fabio Niephaus) Date: Sat, 23 Jan 2021 22:01:57 +0100 Subject: [Vm-dev] Fwd: Bintray account for OpenSmalltalk has been rate-limited In-Reply-To: References: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> Message-ID: On Sat, 23 Jan 2021 at 9:08 pm, Levente Uzonyi wrote: > > Why was Bintray chosen to store the builds? Simply because it is free for open source projects. Fabio > > > Levente > > On Fri, 22 Jan 2021, Fabio Niephaus wrote: > > > > > Hi all, > > > > Looks like our Bintray account has been rate-limited again, possibly > > due to too many builds that pushed binaries to Bintray without > > deleting older ones. This possibly can cause CI builds to fail (if > > they fail to deploy to Bintray). I'm afraid I don't have much time to > > look into this, but I will monitor and forward the communication with > > Bintray support. > > > > Best, > > Fabio > > > > ---------- Forwarded message --------- > > From: Bintray > > Date: Thu, Jan 21, 2021 at 7:11 AM > > Subject: Bintray account for OpenSmalltalk has been rate-limited > > To: > > > > > > Hi OpenSmalltalk, > > > > Your Bintray account is currently rate-limited due to overuse. > > > > Customer Support should contact you at the earliest to remove the > > limits from your account. You may also contact them directly at > > support at jfrog.com. > > > > Regards, > > The Bintray Team > -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Sat Jan 23 23:36:51 2021 From: noreply at github.com (Eliot Miranda) Date: Sat, 23 Jan 2021 15:36:51 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 6f1d60: Fix the y value in ioPositionOfScreenWorkArea & io... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 6f1d6084b0da13e7231f383d6f71622ad8743d2b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/6f1d6084b0da13e7231f383d6f71622ad8743d2b Author: Eliot Miranda Date: 2021-01-23 (Sat, 23 Jan 2021) Changed paths: M platforms/iOS/plugins/HostWindowPlugin/sqMacHostWindow.m Log Message: ----------- Fix the y value in ioPositionOfScreenWorkArea & ioScreenRectangles in the Mac HostWindowPlugin. From notifications at github.com Sun Jan 24 18:57:30 2021 From: notifications at github.com (Christoph Thiede) Date: Sun, 24 Jan 2021 10:57:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Trouble running OSVM in an Ubuntu 20/aarch64 docker (raspi) (#544) In-Reply-To: References: Message-ID: Hi all, thanks a lot for your help. In the meantime, I have finally been able to succeed in the entire build process. Because it was a quite costly setup, I have summarized all relevant docker files and build scripts in this repository: https://github.com/LinqLover/squeak-raspi-docker Please feel free to add your suggestions for improvements or to share this link! :-) Happy Squeaking, Christoph -- 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-766412957 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Jan 25 02:59:09 2021 From: notifications at github.com (David T Lewis) Date: Sun, 24 Jan 2021 18:59:09 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] UnixProcess forkSqueak broken since October (#548) Message-ID: UnixProcess class>>forkSqueak is no longer working. The forked child process VM crashes with segmentation fault. Testing with VMs from bintray shows that version 5.0-202009300634 works, and any version 5.0-202010192227 or later fails. Stack dump sometimes (but not always) shows failure in aioPoll() for example: */usr/local/bin/../lib/squeak/5.0-202101160259/squeak(aioPoll+0x12e)[0x4bc0fe] I am not able to catch the failure in gdb because it happens in the child process. My initial guess is that it may be related to the epoll enhancements added in this time frame, because forking the VM requires initializing things like this in the new child VM 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/548 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.vrany at fit.cvut.cz Mon Jan 25 06:49:17 2021 From: jan.vrany at fit.cvut.cz (Jan Vrany) Date: Mon, 25 Jan 2021 06:49:17 +0000 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] UnixProcess forkSqueak broken since October (#548) In-Reply-To: References: Message-ID: On Sun, 2021-01-24 at 18:59 -0800, David T Lewis wrote: > >    */usr/local/bin/../lib/squeak/5.0- > 202101160259/squeak(aioPoll+0x12e)[0x4bc0fe] > > I am not able to catch the failure in gdb because it happens in the > child process. GDB can follow fork(), see (gdb) help set follow-fork-mode Set debugger response to a program call of fork or vfork. A fork or vfork creates a new process. follow-fork-mode can be: parent - the original process is debugged after a fork child - the new process is debugged after a fork The unfollowed process will continue to run. By default, the debugger will follow the parent process. HTH, Jan From lists at fniephaus.com Mon Jan 25 09:56:46 2021 From: lists at fniephaus.com (Fabio Niephaus) Date: Mon, 25 Jan 2021 10:56:46 +0100 Subject: [Vm-dev] Bintray account for OpenSmalltalk has been rate-limited In-Reply-To: References: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> Message-ID: Here's an update from Bintray support: Hi Fabio, Thank you for reaching out to JFrog Support. With regards to your query on getting rate-limited, We have unblocked your Bintray account opensmalltalk and increased the storage quota to 13GB. Your current storage is 10.28 GB/13 GB (80)%. However in future in order to avoid this issue, we strongly recommend you to clear the unused files to save the storage. Please let us know if everything is working as expected after unblocking the account. Best regards, JFrog Support On Fri, Jan 22, 2021 at 5:04 PM Fabio Niephaus wrote: > > Hi all, > > Looks like our Bintray account has been rate-limited again, possibly > due to too many builds that pushed binaries to Bintray without > deleting older ones. This possibly can cause CI builds to fail (if > they fail to deploy to Bintray). I'm afraid I don't have much time to > look into this, but I will monitor and forward the communication with > Bintray support. > > Best, > Fabio > > ---------- Forwarded message --------- > From: Bintray > Date: Thu, Jan 21, 2021 at 7:11 AM > Subject: Bintray account for OpenSmalltalk has been rate-limited > To: > > > Hi OpenSmalltalk, > > Your Bintray account is currently rate-limited due to overuse. > > Customer Support should contact you at the earliest to remove the > limits from your account. You may also contact them directly at > support at jfrog.com. > > Regards, > The Bintray Team From nicolas.cellier.aka.nice at gmail.com Mon Jan 25 10:37:56 2021 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Mon, 25 Jan 2021 11:37:56 +0100 Subject: [Vm-dev] Bintray account for OpenSmalltalk has been rate-limited In-Reply-To: References: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> Message-ID: Bah, too many successful builds these days ;) Le lun. 25 janv. 2021 à 10:57, Fabio Niephaus a écrit : > > > Here's an update from Bintray support: > > Hi Fabio, > > Thank you for reaching out to JFrog Support. With regards to your > query on getting rate-limited, We have unblocked your Bintray account > opensmalltalk and increased the storage quota to 13GB. Your current > storage is 10.28 GB/13 GB (80)%. However in future in order to avoid > this issue, we strongly recommend you to clear the unused files to > save the storage. > > Please let us know if everything is working as expected after > unblocking the account. > > Best regards, > JFrog Support > > On Fri, Jan 22, 2021 at 5:04 PM Fabio Niephaus wrote: > > > > Hi all, > > > > Looks like our Bintray account has been rate-limited again, possibly > > due to too many builds that pushed binaries to Bintray without > > deleting older ones. This possibly can cause CI builds to fail (if > > they fail to deploy to Bintray). I'm afraid I don't have much time to > > look into this, but I will monitor and forward the communication with > > Bintray support. > > > > Best, > > Fabio > > > > ---------- Forwarded message --------- > > From: Bintray > > Date: Thu, Jan 21, 2021 at 7:11 AM > > Subject: Bintray account for OpenSmalltalk has been rate-limited > > To: > > > > > > Hi OpenSmalltalk, > > > > Your Bintray account is currently rate-limited due to overuse. > > > > Customer Support should contact you at the earliest to remove the > > limits from your account. You may also contact them directly at > > support at jfrog.com. > > > > Regards, > > The Bintray Team From notifications at github.com Mon Jan 25 14:02:10 2021 From: notifications at github.com (Christoph Thiede) Date: Mon, 25 Jan 2021 06:02:10 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] doc: Add link to example build for Debian (64-bit) [ci-skip] (#549) Message-ID: /cc @eliotmiranda You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/549 -- Commit Summary -- * doc: Add link to example build for Debian (64-bit) -- File Changes -- M build.linux64ARMv8/HowToBuild (4) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/549.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/549.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/549 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Jan 25 22:13:14 2021 From: notifications at github.com (David T Lewis) Date: Mon, 25 Jan 2021 14:13:14 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] UnixProcess forkSqueak broken since October (#548) In-Reply-To: References: Message-ID: Thank you Jan! -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/548#issuecomment-767147652 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Mon Jan 25 22:15:50 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Mon, 25 Jan 2021 17:15:50 -0500 Subject: [Vm-dev] Bintray account for OpenSmalltalk has been rate-limited In-Reply-To: References: <20210121061112.1.AB56D1309B11C812@mailer.bintray.com> Message-ID: <20210125221550.GA13374@shell.msen.com> On Mon, Jan 25, 2021 at 11:37:56AM +0100, Nicolas Cellier wrote: > > Bah, too many successful builds these days ;) > And thank you very much for that "problem" :-) Dave > Le lun. 25 janv. 2021 ?? 10:57, Fabio Niephaus a ??crit : > > > > > > Here's an update from Bintray support: > > > > Hi Fabio, > > > > Thank you for reaching out to JFrog Support. With regards to your > > query on getting rate-limited, We have unblocked your Bintray account > > opensmalltalk and increased the storage quota to 13GB. Your current > > storage is 10.28 GB/13 GB (80)%. However in future in order to avoid > > this issue, we strongly recommend you to clear the unused files to > > save the storage. > > > > Please let us know if everything is working as expected after > > unblocking the account. > > > > Best regards, > > JFrog Support > > > > On Fri, Jan 22, 2021 at 5:04 PM Fabio Niephaus wrote: > > > > > > Hi all, > > > > > > Looks like our Bintray account has been rate-limited again, possibly > > > due to too many builds that pushed binaries to Bintray without > > > deleting older ones. This possibly can cause CI builds to fail (if > > > they fail to deploy to Bintray). I'm afraid I don't have much time to > > > look into this, but I will monitor and forward the communication with > > > Bintray support. > > > > > > Best, > > > Fabio > > > > > > ---------- Forwarded message --------- > > > From: Bintray > > > Date: Thu, Jan 21, 2021 at 7:11 AM > > > Subject: Bintray account for OpenSmalltalk has been rate-limited > > > To: > > > > > > > > > Hi OpenSmalltalk, > > > > > > Your Bintray account is currently rate-limited due to overuse. > > > > > > Customer Support should contact you at the earliest to remove the > > > limits from your account. You may also contact them directly at > > > support at jfrog.com. > > > > > > Regards, > > > The Bintray Team From notifications at github.com Tue Jan 26 00:56:50 2021 From: notifications at github.com (Eliot Miranda) Date: Mon, 25 Jan 2021 16:56:50 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] doc: Add link to example build for Debian (64-bit) [ci-skip] (#549) In-Reply-To: References: Message-ID: Merged #549 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/549#event-4248382800 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Jan 26 00:56:50 2021 From: noreply at github.com (Christoph Thiede) Date: Mon, 25 Jan 2021 16:56:50 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 108075: doc: Add link to example build for Debian (64-bit)... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 108075d58c78a1203e8d19fee1abedf8fab2b18c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/108075d58c78a1203e8d19fee1abedf8fab2b18c Author: Christoph Thiede <38782922+LinqLover at users.noreply.github.com> Date: 2021-01-25 (Mon, 25 Jan 2021) Changed paths: M build.linux64ARMv8/HowToBuild Log Message: ----------- doc: Add link to example build for Debian (64-bit) (#549) From commits at source.squeak.org Tue Jan 26 02:53:56 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 26 Jan 2021 02:53:56 0000 Subject: [Vm-dev] VM Maker: Cog-eem.435.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.435.mcz ==================== Summary ==================== Name: Cog-eem.435 Author: eem Time: 25 January 2021, 6:53:54.410949 pm UUID: d02b8a08-b3b8-40f2-afa7-992cd048c258 Ancestors: Cog-eem.434 Fix an edit slip in cloneObjects. Thanks Tim!! =============== Diff against Cog-eem.434 =============== Item was changed: ----- Method: Spur32BitPreen>>cloneObjects (in category 'bootstrap image') ----- cloneObjects "Clone all normal objects. Of hidden objects only clone the freeLists object and the classTableRoot and class table pages. In particular, dont clone objStacks. The refs to the objStacks are nilled out in fillInHeap." | i freeListsObject | i := 0. freeListsObject := oldHeap freeListsObject. oldHeap allOldSpaceObjectsDo: [:obj32| (i := i + 1) >= 100000 ifTrue: [Transcript nextPut: $:; flush. i := 0]. obj32 = freeListsObject ifTrue: [self cloneFreeLists: obj32] ifFalse: + [(self shouldClone: obj32) ifTrue: - [(self shouldcloneObject: obj32) ifTrue: [self cloneObject: obj32]]]! Item was changed: ----- Method: SpurMtoNBitImageConverter>>cloneObjects (in category 'bootstrap image') ----- cloneObjects "Clone all normal objects. Of hidden objects only clone the freeLists object and the classTableRoot and class table pages. In particular, dont clone objStacks. The refs to the objStacks are nilled out in fillInHeap." | i freeListsObject | i := 0. freeListsObject := sourceHeap freeListsObject. sourceHeap allOldSpaceObjectsDo: [:sourceObj| (i := i + 1) >= 100000 ifTrue: [Transcript nextPut: $:; flush. i := 0]. sourceObj = freeListsObject ifTrue: [self cloneFreeLists: sourceObj] ifFalse: + [(self shouldClone: sourceObj) ifTrue: - [(self shouldcloneObject: sourceObj) ifTrue: [self cloneObject: sourceObj]]]! From noreply at github.com Tue Jan 26 04:18:59 2021 From: noreply at github.com (Eliot Miranda) Date: Mon, 25 Jan 2021 20:18:59 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 010c20: Abstract the shift and mask for mouse button event... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 010c20edc9e759ea565e68d2049443ad6a6d2c47 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/010c20edc9e759ea565e68d2049443ad6a6d2c47 Author: Eliot Miranda Date: 2021-01-25 (Mon, 25 Jan 2021) Changed paths: M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.h M platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m Log Message: ----------- Abstract the shift and mask for mouse button event processing into manifest constants on MacOS in preparation for including more buttons from gaming mice. From stes at telenet.be Tue Jan 26 15:53:41 2021 From: stes at telenet.be (stes@PANDORA.BE) Date: Tue, 26 Jan 2021 16:53:41 +0100 (CET) Subject: [Vm-dev] missing file sqFFIPlugin.c in config.cmake Message-ID: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, Please have a look at the following fixes for SVN squeak classical VM. Patches for platforms/unix/plugins/SqueakFFIPrims (see below). Those are against revision 3796 latest (I think) from svn. The issues are 1) missing #include in any-libffi.c 2) missing sqFFIPlugin.c file in config.cmake 3) ffi-config refers to non-existing ../../config/config.guess Thanks if this can be applied to subversion. David Stes Index: plugins/SqueakFFIPrims/any-libffi.c =================================================================== - --- plugins/SqueakFFIPrims/any-libffi.c (revision 3796) +++ plugins/SqueakFFIPrims/any-libffi.c (working copy) @@ -13,6 +13,7 @@ * *****************************************************************************/ #include "sq.h" +#include "sqVirtualMachine.h" /* primitiveFail in struct VirtualMachine */ #include "sqFFI.h" #ifndef NO_FFI_SUPPORT Index: plugins/SqueakFFIPrims/config.cmake =================================================================== - --- plugins/SqueakFFIPrims/config.cmake (revision 3796) +++ plugins/SqueakFFIPrims/config.cmake (working copy) @@ -46,7 +46,7 @@ PLUGIN_DISABLE () ENDIF () ENABLE_LANGUAGE (ASM) - - PLUGIN_SOURCES ("${cross}/plugins/${plugin}/sqManualSurface.c ${SQFFIC} ${unix}/plugins/${plugin}/${cpu}-${abi}.c ${unix}/plugins/${plugin}/${cpu}-${abi}-asm.S") + PLUGIN_SOURCES ("${cross}/plugins/${plugin}/sqFFIPlugin.c ${cross}/plugins/${plugin}/sqManualSurface.c ${SQFFIC} ${unix}/plugins/${plugin}/${cpu}-${abi}.c ${unix}/plugins/${plugin}/${cpu}-${abi}-asm.S") IF (CMAKE_COMPILER_IS_GNUCC) SET (CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}") SET (CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -c") Index: plugins/SqueakFFIPrims/ffi-config =================================================================== - --- plugins/SqueakFFIPrims/ffi-config (revision 3796) +++ plugins/SqueakFFIPrims/ffi-config (working copy) @@ -7,7 +7,7 @@ # -lib print nothing if supported, otherwise `-lffi' # -query exit with status 0 if supported, 1 if libffi required - -cfgdir=../../config +cfgdir=../../cmake if [ $# -gt 0 ]; then case $1 in @@ -39,6 +39,7 @@ case ${abi} in linux) abi=sysv;; + solaris*) abi=sysv;; darwin*) abi=darwin;; *) abi=libffi; lib="-lffi";; esac -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJgEDpfAAoJEAwpOKXMq1MaD+gH/jpY8bPYrJ+ScYisjjZbpLbF fiD+yOMQBG4UmBWGdgF+41xRrLjKQV/nXLotTsUQS1qHtox+Jl7yGXiYCMuxndvd x7EwirGO6q81dpmBAwYX/yPWlwRCiBYsjiGPFIB/tu0C/0TpT4WbLOi95xs+PqN6 m8+0585aPPV3bDNxo/eRqWaZdPUG4tN19v0OXqvh77SUMDVpQwMaVWCUKjA1Qn1D s0esq2bOgkH8VBUP7zUjY/ka9Q+E1W8qAHz3MFZi1ACFbBDZgx6mBd6lD8AR7LQg kHu/TwWcTuGHGe2faKskgJk54xAOjvTHVz+dcYnFgfrS5vby0L7iNavlGpcm3Fw= =6Rov -----END PGP SIGNATURE----- From commits at source.squeak.org Wed Jan 27 01:37:37 2021 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 27 Jan 2021 01:37:37 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2941.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2941.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2941 Author: eem Time: 26 January 2021, 5:37:27.815241 pm UUID: 84ab4f06-0db7-4eca-b3de-b5ac04b17b92 Ancestors: VMMaker.oscog-eem.2940 Add explicit variables for the handler and unwind primitive markers (PrimNumberHandlerMarker & PrimNumberUnwindMarker), and add 123 as the no-context-switch marker (PrimNumberNoContextSwitchMarker). =============== Diff against VMMaker.oscog-eem.2940 =============== Item was changed: ----- Method: CurrentImageCoInterpreterFacade>>canContextSwitchIfActivating:header: (in category 'accessing') ----- canContextSwitchIfActivating: method header: header "Would like to do ^coInterpreter canContextSwitchIfActivating: method header: header but the bytecode access to get at the primitive number defeats us :-(, so the following may well get out-of-date..." + ^(self objectForOop: method) primitive ~= PrimNumberUnwindMarker + and: [(self objectForOop: method) primitive ~= PrimNumberNoContextSwitchMarker]! - ^(self objectForOop: method) primitive ~= 198! Item was changed: ----- Method: Interpreter>>isHandlerMarked: (in category 'compiled methods') ----- isHandlerMarked: aContext "Is this a MethodContext whose meth has a primitive number of 199?" | header meth pIndex | "NB: the use of a primitive number for marking the method is pretty grungy, but it is simple to use for a test sytem, not too expensive and we don't actually have the two spare method header bits we need. We can probably obtain them when the method format is changed. NB 2: actually, the jitter will probably implement the prim to actually mark the volatile frame by changing the return function pointer." header := self baseHeader: aContext. (self isMethodContextHeader: header) ifFalse: [^false]. meth := self fetchPointer: MethodIndex ofObject: aContext. pIndex := self primitiveIndexOf: meth. + ^pIndex == PrimNumberHandlerMarker - ^pIndex == 199 ! Item was changed: ----- Method: StackInterpreter class>>initializePrimitiveTable (in category 'initialization') ----- (excessive size, no diff calculated) Item was changed: ----- Method: StackInterpreter>>canContextSwitchIfActivating:header: (in category 'message sending') ----- canContextSwitchIfActivating: theMethod header: methodHeader + "Context switch should not be allowed on every method activation. In particular the + implementation of ensure: and ifCurtailed: depends on there being no suspension point + on failing primitive 198 (primitiveMarkUnwindMethod, primitiveMarkUnwindMethod). + slowPrimitiveResponse used to state - "Context switch should not be allowed on every method activation. In particular - the implementation of ensure: and ifCurtailed: depends on there being no - suspension point on failing primitive 198 (primitiveMarkUnwindMethod). - slowPrimitiveResponse states ``N.B. This means there is no suspension point on primitive failure which methods such as ensure: and ifCurtailed: rely on.'' Rather than prevent context switch on all primitives but the ones we really need to be suspension points (primitiveSignal et al) we choose to allow context switch + for all but primitiveMarkUnwindMethod and PrimNumberNoContextSwitch." - for all but primitiveMarkUnwindMethod." | primitiveIndex | primitiveIndex := self primitiveIndexOfMethod: theMethod header: methodHeader. ^self cppIf: true ifTrue: + [primitiveIndex ~= PrimNumberUnwindMarker "198 primitiveMarkUnwindMethod" + and: [primitiveIndex ~= PrimNumberNoContextSwitchMarker "123"]] - [primitiveIndex ~= 198] "primitiveMarkUnwindMethod" ifFalse: [primitiveIndex = 0 or: [(primitiveIndex between: 85 and: 88) "primitiveSignal primitiveWait primitiveResume primitiveSuspend" or: [primitiveIndex = 167 "primitiveYield" or: [primitiveIndex between: 185 and: 186 "primitiveExitCriticalSection primitiveEnterCriticalSection"]]]]! Item was changed: ----- Method: StackInterpreter>>findUnwindThroughContext: (in category 'return bytecodes') ----- findUnwindThroughContext: homeContext + "Search for either an unwind-protect (activation of method with primitive 198, PrimNumberUnwindMarker) - "Search for either an unwind-protect (activation of method with primitive 198) or homeContext along the sender chain, which ever is found first. Return values: 0 home context was found on sender chain with no intervening unwind-protects nilObj home context could not be found => cannotReturn context the context of an intervening unwind-protect implies home context was found" | onSamePage ctxtOrNilOrZero theMethod | "Almost always (98%) the home is on the same page, in which case we know it will be found." onSamePage := (self isStillMarriedContext: homeContext) and: [(stackPages pageIndexFor: framePointer) = (stackPages pageIndexFor: (self frameOfMarriedContext: homeContext))]. "Since nothing changes we don't need to internalize." + ctxtOrNilOrZero := self findMethodWithPrimitive: PrimNumberUnwindMarker FromFP: framePointer UpToContext: homeContext. - ctxtOrNilOrZero := self findMethodWithPrimitive: 198 FromFP: framePointer UpToContext: homeContext. self deny: (onSamePage and: [ctxtOrNilOrZero = objectMemory nilObject]). ctxtOrNilOrZero = 0 ifTrue: [theMethod := objectMemory fetchPointer: MethodIndex ofObject: homeContext. + (self primitiveIndexOf: theMethod) = PrimNumberUnwindMarker ifTrue: - (self primitiveIndexOf: theMethod) = 198 ifTrue: [^homeContext]. ^0]. "If an unwind was found, can the home context be found also? No need to look if on the same page. No need to look if cannot return (ctxtOrNilOrZero = objectMemory nilObject)" (onSamePage or: [ctxtOrNilOrZero = objectMemory nilObject]) ifFalse: [(self findMethodWithPrimitive: 0 FromContext: ctxtOrNilOrZero UpToContext: homeContext) = objectMemory nilObject ifTrue: [^objectMemory nilObject]]. ^ctxtOrNilOrZero! Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveFindHandlerContext (in category 'control primitives') ----- primitiveFindHandlerContext "Primitive. Search up the context stack for the next method context marked for exception handling starting at the receiver. Return nil if none found" | handlerOrNilOrZero | self externalWriteBackHeadFramePointers. handlerOrNilOrZero := self + findMethodWithPrimitive: PrimNumberHandlerMarker - findMethodWithPrimitive: 199 FromContext: self stackTop UpToContext: objectMemory nilObject. handlerOrNilOrZero = 0 ifTrue: [handlerOrNilOrZero := objectMemory nilObject]. self pop: 1 thenPush: handlerOrNilOrZero! Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveFindNextUnwindContext (in category 'control primitives') ----- primitiveFindNextUnwindContext "Primitive. Search up the context stack for the next method context marked for unwind handling from the receiver up to but not including the argument. Return nil if none found." | stopContext calleeContext handlerOrNilOrZero | stopContext := self stackTop. calleeContext := self stackValue: 1. (stopContext = objectMemory nilObject or: [objectMemory isContext: stopContext]) ifFalse: [^self primitiveFail]. "The following should never be true, but developing full blocks, early in September 2016 we were seeing invalid invocations of this primitive.. Hence the assert:" self assert: stopContext ~= calleeContext. self externalWriteBackHeadFramePointers. (self isStillMarriedContext: calleeContext) ifTrue: [| theFP | theFP := self frameOfMarriedContext: calleeContext. (self isBaseFrame: theFP) ifTrue: + [handlerOrNilOrZero := self findMethodWithPrimitive: PrimNumberUnwindMarker - [handlerOrNilOrZero := self findMethodWithPrimitive: 198 FromContext: (self frameCallerContext: theFP) UpToContext: stopContext] ifFalse: + [handlerOrNilOrZero := self findMethodWithPrimitive: PrimNumberUnwindMarker - [handlerOrNilOrZero := self findMethodWithPrimitive: 198 FromFP: (self frameCallerFP: theFP) UpToContext: stopContext]] ifFalse: [| startContext | startContext := objectMemory fetchPointer: SenderIndex ofObject: calleeContext. (objectMemory isContext: startContext) ifTrue: + [handlerOrNilOrZero := self findMethodWithPrimitive: PrimNumberUnwindMarker - [handlerOrNilOrZero := self findMethodWithPrimitive: 198 FromContext: startContext UpToContext: stopContext] ifFalse: [handlerOrNilOrZero := 0]]. handlerOrNilOrZero = 0 ifTrue: [handlerOrNilOrZero := objectMemory nilObject]. self pop: 2 thenPush: handlerOrNilOrZero! Item was changed: SharedPool subclass: #VMBasicConstants instanceVariableNames: '' + classVariableNames: 'BaseHeaderSize BytecodeSetHasExtensions BytesPerOop BytesPerWord COGMTVM COGVM CloneOnGC CloneOnScavenge DisownVMForFFICall DisownVMForThreading DoAssertionChecks DoExpensiveAssertionChecks GCCheckPrimCall GCModeBecome GCModeFreeSpace GCModeFull GCModeImageSegment GCModeIncremental GCModeNewSpace HashMultiplyConstant HashMultiplyMask IMMUTABILITY LowcodeVM MULTIPLEBYTECODESETS NewspeakVM PharoVM PrimErrBadArgument PrimErrBadIndex PrimErrBadMethod PrimErrBadNumArgs PrimErrBadReceiver PrimErrCallbackError PrimErrFFIException PrimErrGenericFailure PrimErrInappropriate PrimErrLimitExceeded PrimErrNamedInternal PrimErrNeedCompaction PrimErrNoCMemory PrimErrNoMemory PrimErrNoModification PrimErrNotFound PrimErrOSError PrimErrObjectIsPinned PrimErrObjectMayMove PrimErrObjectMoved PrimErrObjectNotPinned PrimErrOperationFailed PrimErrUnsupported PrimErrWritePastObject PrimNoErr PrimNumberHandlerMarker PrimNumberNoContextSwitchMarker PrimNumberUnwindMarker SPURVM STACKV M SistaVM TempVectReadBarrier VMBIGENDIAN' - classVariableNames: 'BaseHeaderSize BytecodeSetHasExtensions BytesPerOop BytesPerWord COGMTVM COGVM CloneOnGC CloneOnScavenge DisownVMForFFICall DisownVMForThreading DoAssertionChecks DoExpensiveAssertionChecks GCCheckPrimCall GCModeBecome GCModeFreeSpace GCModeFull GCModeImageSegment GCModeIncremental GCModeNewSpace HashMultiplyConstant HashMultiplyMask IMMUTABILITY LowcodeVM MULTIPLEBYTECODESETS NewspeakVM PharoVM PrimErrBadArgument PrimErrBadIndex PrimErrBadMethod PrimErrBadNumArgs PrimErrBadReceiver PrimErrCallbackError PrimErrFFIException PrimErrGenericFailure PrimErrInappropriate PrimErrLimitExceeded PrimErrNamedInternal PrimErrNeedCompaction PrimErrNoCMemory PrimErrNoMemory PrimErrNoModification PrimErrNotFound PrimErrOSError PrimErrObjectIsPinned PrimErrObjectMayMove PrimErrObjectMoved PrimErrObjectNotPinned PrimErrOperationFailed PrimErrUnsupported PrimErrWritePastObject PrimNoErr SPURVM STACKVM SistaVM TempVectReadBarrier VMBIGENDIAN' poolDictionaries: '' category: 'VMMaker-Interpreter'! !VMBasicConstants commentStamp: '' prior: 0! I am a shared pool for basic constants upon which the VM as a whole depends. self ensureClassPool. self classPool declare: #BytesPerWord from: VMSqueakV3ObjectRepresentationConstants classPool. self classPool declare: #BaseHeaderSize from: VMSqueakV3ObjectRepresentationConstants classPool (ObjectMemory classPool keys select: [:k| k beginsWith: 'Byte']) do: [:k| self classPool declare: k from: ObjectMemory classPool]! From marcel.taeumel at hpi.de Thu Jan 28 11:42:56 2021 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Thu, 28 Jan 2021 12:42:56 +0100 Subject: [Vm-dev] CfP | Programming Experience Workshop PX/21 Message-ID: ===== PX/21 Call for Papers ===== Welcome to the 7th Edition of the Programming Experience Workshop   https://2021.programming-conference.org/home/px-2021 [https://2021.programming-conference.org/home/px-2021] Co-located with 2021   https://2021.programming-conference.org/ [https://2021.programming-conference.org/] ## Abstract Some programming feels fun, other programming feels annoying. Why? For a while now the study of programming has forced improvements to be described through the Fordist lens of usability and productivity, where the thing that matters is how much software can get built, how quickly. But along the way, something has gone missing. What makes programmers feel the way they do when they’re programming? It’s not usually fun to spend an age doing something that could have been done easily, so efficiency and usability still matter, but they’re not the end of the story. Some environments, activities, contexts, languages, infrastructures make programming feel alive, others feel like working in a bureaucracy. This is not purely technologically determined, writing Lisp to do your taxes probably still isn’t fun, but it’s also not technologically neutral, writing XML to produce performance art is still likely to be . Whilst we can probably mostly agree about what isn’t fun, what is remains more personal and without a space within the academy to describe it. In its past editions, PX set its focus on questions like: Do programmers create text that is transformed into running behavior (the old way), or do they operate on behavior directly (“liveness”); are they exploring the live domain to understand the true nature of the requirements; are they like authors creating new worlds; does visualization matter; is the experience immediate, immersive, vivid and continuous; do fluency, literacy, and learning matter; do they build tools, meta-tools; are they creating languages to express new concepts quickly and easily; and curiously, is joy relevant to the experience? In this 7th edition of PX, we will expand its focus to also cover the experience that programmers have. What makes it and what breaks it? For whom? What can we build to share the joy of programming with others? Here is a list of topic areas to get you thinking:  - creating programs  - experience of programming  - exploratory programming  - liveness  - non-standard tools  - visual, auditory, tactile, and other non-textual languages  - text and more than text  - program understanding  - domain-specific languages  - psychology of programming  - error tolerance  - user studies Correctness, performance, standard tools, foundations, and text-as-program are important traditional research areas, but the experience of programming and how to improve and evolve it are the focus of this workshop. We also welcome a wide spectrum of contributions on programming experience. ## Submissions Submissions are solicited for Programming Experience 2021 (PX/21). The thrust of the workshop is to explore the human experience of programming—what it feels like to program, or what it should feel like. The technical topics include exploratory programming, live programming, authoring, representation of active content, visualization, navigation, modularity mechanisms, immediacy, literacy, fluency, learning, tool building, and language engineering. Submissions by academics, professional programmers, and non-professional programmer are welcome. Submissions can be in any form and format, including but not limited to papers, presentations, demos, videos, panels, debates, essays, writers’ workshops, and art. Presentation slots are expected to be between 20 minutes and one hour (if time allows), depending on quality, form, and relevance to the workshop. Submissions of academic papers directed toward publication should be so marked, and the program committee will engage in peer review for all such papers. All artifacts are to be submitted via EasyChair [2]. Papers and essays must be written in English, provided as PDF documents, and follow the new ACM Conference ‘acmart’ Format with the ‘sigconf’ option [3] using the Times New Roman font family with 10 point font size. If you are formatting your paper using LaTeX, you will need to set the ‘10pt’ option in the ‘\documentclass’ command. If you are formatting your paper using Word, you may wish to use the provided Word template that supports this font size. Please include page numbers in your submission for review using the LaTeX command ‘\settopmatter{printfolios=true}’ (see examples in template). 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. There is no page limit on submitted papers and essays. It is, however, the responsibility of the authors to keep the reviewers interested and motivated to read the paper. Reviewers are under no obligation to read all or even a substantial portion of a paper or essay if they do not find the initial part of it interesting. ## Publication Authors of accepted contributions will be invited to present their work at the workshop. *Papers accepted for publication* will appear in the ACM Digital Library (ACM DL) as part of the ‹Programming› 2021 Conference Companion. ## Upcoming Deadlines (AoE UTC-12h) Submissions:   Sun 14 Feb 2021 Notifications:   Sun 28 Feb 2021 Pre-workshop versions:   Sun 14 Mar 2021 Workshop:   Mon 22 Mar 2021 Final versions:   Fri 9 Apr 2021 ## More Information [1] https://2021.programming-conference.org/home/px-2021 [https://2021.programming-conference.org/home/px-2021] [2] https://easychair.org/conferences/?conf=px21 [https://easychair.org/conferences/?conf=px21] [3] http://www.acm.org/publications/proceedings-template [http://www.acm.org/publications/proceedings-template] -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Fri Jan 29 18:43:03 2021 From: stes at telenet.be (stes@PANDORA.BE) Date: Fri, 29 Jan 2021 19:43:03 +0100 (CET) Subject: [Vm-dev] missing file sqFFIPlugin.c in config.cmake In-Reply-To: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> References: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> Message-ID: <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Any news on the patches below please for SVN (subversion) ? Thanks, David Stes - -- Hi, Please have a look at the following fixes for SVN squeak classical VM. Patches for platforms/unix/plugins/SqueakFFIPrims (see below). Those are against revision 3796 latest (I think) from svn. The issues are 1) missing #include in any-libffi.c 2) missing sqFFIPlugin.c file in config.cmake 3) ffi-config refers to non-existing ../../config/config.guess Thanks if this can be applied to subversion. David Stes Index: plugins/SqueakFFIPrims/any-libffi.c =================================================================== - --- plugins/SqueakFFIPrims/any-libffi.c (revision 3796) +++ plugins/SqueakFFIPrims/any-libffi.c (working copy) @@ -13,6 +13,7 @@ * *****************************************************************************/ #include "sq.h" +#include "sqVirtualMachine.h" /* primitiveFail in struct VirtualMachine */ #include "sqFFI.h" #ifndef NO_FFI_SUPPORT Index: plugins/SqueakFFIPrims/config.cmake =================================================================== - --- plugins/SqueakFFIPrims/config.cmake (revision 3796) +++ plugins/SqueakFFIPrims/config.cmake (working copy) @@ -46,7 +46,7 @@ PLUGIN_DISABLE () ENDIF () ENABLE_LANGUAGE (ASM) - - PLUGIN_SOURCES ("${cross}/plugins/${plugin}/sqManualSurface.c ${SQFFIC} ${unix}/plugins/${plugin}/${cpu}-${abi}.c ${unix}/plugins/${plugin}/${cpu}-${abi}-asm.S") + PLUGIN_SOURCES ("${cross}/plugins/${plugin}/sqFFIPlugin.c ${cross}/plugins/${plugin}/sqManualSurface.c ${SQFFIC} ${unix}/plugins/${plugin}/${cpu}-${abi}.c ${unix}/plugins/${plugin}/${cpu}-${abi}-asm.S") IF (CMAKE_COMPILER_IS_GNUCC) SET (CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}") SET (CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -c") Index: plugins/SqueakFFIPrims/ffi-config =================================================================== - --- plugins/SqueakFFIPrims/ffi-config (revision 3796) +++ plugins/SqueakFFIPrims/ffi-config (working copy) @@ -7,7 +7,7 @@ # -lib print nothing if supported, otherwise `-lffi' # -query exit with status 0 if supported, 1 if libffi required - -cfgdir=../../config +cfgdir=../../cmake if [ $# -gt 0 ]; then case $1 in @@ -39,6 +39,7 @@ case ${abi} in linux) abi=sysv;; + solaris*) abi=sysv;; darwin*) abi=darwin;; *) abi=libffi; lib="-lffi";; esac -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJgFFbaAAoJEAwpOKXMq1MaS4IH/iMQhdxKfE4axp673m+tzjmZ JXGnd31HrhAisHBiyQmPmPE/OleiRJ8TkESe2HfSR0JqUJgF1yQEmLH0aCrBklip SCkP6Mpy1dIy+ThTqkpwn2tpI+6IeCbJXyDggWACgke5Y2bcEVuG4N2Q+sG/K/ba aEvCaq96EYDtUuFzMgnB3hEyeV00GVUnjPGUlMrcg/AVOEAJ0Un0pJmP9m4evWTS y8ME8nbZCO+hChpU3lN5QmvlxAVCj0E2R9m3wuTAClPZ0mteA2pETV1NBRFcC0MP RkDWZrXAk1XBKnNisXPUNcJRqynUai3AIC4uv3obK/l5scfNH56nsSKdbN3wiGo= =5ets -----END PGP SIGNATURE----- From lewis at mail.msen.com Sat Jan 30 00:02:02 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 29 Jan 2021 19:02:02 -0500 Subject: [Vm-dev] missing file sqFFIPlugin.c in config.cmake In-Reply-To: <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> References: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> Message-ID: <20210130000202.GA43112@shell.msen.com> Hi David, Sorry I did not reply earlier. I'll try to follow up this weekend. If you have a chance, could you please send a copy of the patch file as an attachment? I'm using a mutt mail client and I was having trouble extracting it. Thanks, Dave On Fri, Jan 29, 2021 at 07:43:03PM +0100, stes at PANDORA.BE wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > > Any news on the patches below please for SVN (subversion) ? > > Thanks, > David Stes > > - -- > > Hi, > > Please have a look at the following fixes for SVN squeak classical VM. > > Patches for platforms/unix/plugins/SqueakFFIPrims (see below). > > Those are against revision 3796 latest (I think) from svn. > > The issues are > > 1) missing #include in any-libffi.c > 2) missing sqFFIPlugin.c file in config.cmake > 3) ffi-config refers to non-existing ../../config/config.guess > > Thanks if this can be applied to subversion. > > David Stes > > > Index: plugins/SqueakFFIPrims/any-libffi.c > =================================================================== > - --- plugins/SqueakFFIPrims/any-libffi.c (revision 3796) > +++ plugins/SqueakFFIPrims/any-libffi.c (working copy) > @@ -13,6 +13,7 @@ > * > *****************************************************************************/ > #include "sq.h" > +#include "sqVirtualMachine.h" /* primitiveFail in struct VirtualMachine */ > #include "sqFFI.h" > > #ifndef NO_FFI_SUPPORT > Index: plugins/SqueakFFIPrims/config.cmake > =================================================================== > - --- plugins/SqueakFFIPrims/config.cmake (revision 3796) > +++ plugins/SqueakFFIPrims/config.cmake (working copy) > @@ -46,7 +46,7 @@ > PLUGIN_DISABLE () > ENDIF () > ENABLE_LANGUAGE (ASM) > - - PLUGIN_SOURCES ("${cross}/plugins/${plugin}/sqManualSurface.c ${SQFFIC} ${unix}/plugins/${plugin}/${cpu}-${abi}.c ${unix}/plugins/${plugin}/${cpu}-${abi}-asm.S") > + PLUGIN_SOURCES ("${cross}/plugins/${plugin}/sqFFIPlugin.c ${cross}/plugins/${plugin}/sqManualSurface.c ${SQFFIC} ${unix}/plugins/${plugin}/${cpu}-${abi}.c ${unix}/plugins/${plugin}/${cpu}-${abi}-asm.S") > IF (CMAKE_COMPILER_IS_GNUCC) > SET (CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}") > SET (CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -c") > Index: plugins/SqueakFFIPrims/ffi-config > =================================================================== > - --- plugins/SqueakFFIPrims/ffi-config (revision 3796) > +++ plugins/SqueakFFIPrims/ffi-config (working copy) > @@ -7,7 +7,7 @@ > # -lib print nothing if supported, otherwise `-lffi' > # -query exit with status 0 if supported, 1 if libffi required > > - -cfgdir=../../config > +cfgdir=../../cmake > > if [ $# -gt 0 ]; then > case $1 in > @@ -39,6 +39,7 @@ > > case ${abi} in > linux) abi=sysv;; > + solaris*) abi=sysv;; > darwin*) abi=darwin;; > *) abi=libffi; lib="-lffi";; > esac > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJgFFbaAAoJEAwpOKXMq1MaS4IH/iMQhdxKfE4axp673m+tzjmZ > JXGnd31HrhAisHBiyQmPmPE/OleiRJ8TkESe2HfSR0JqUJgF1yQEmLH0aCrBklip > SCkP6Mpy1dIy+ThTqkpwn2tpI+6IeCbJXyDggWACgke5Y2bcEVuG4N2Q+sG/K/ba > aEvCaq96EYDtUuFzMgnB3hEyeV00GVUnjPGUlMrcg/AVOEAJ0Un0pJmP9m4evWTS > y8ME8nbZCO+hChpU3lN5QmvlxAVCj0E2R9m3wuTAClPZ0mteA2pETV1NBRFcC0MP > RkDWZrXAk1XBKnNisXPUNcJRqynUai3AIC4uv3obK/l5scfNH56nsSKdbN3wiGo= > =5ets > -----END PGP SIGNATURE----- From stes at telenet.be Sat Jan 30 10:50:22 2021 From: stes at telenet.be (stes@PANDORA.BE) Date: Sat, 30 Jan 2021 11:50:22 +0100 (CET) Subject: [Vm-dev] missing file sqFFIPlugin.c in config.cmake In-Reply-To: <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> References: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> Message-ID: <350904839.61688766.1612003822744.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, Thanks if you can double check before adding the patches. Patch 01 does not affect Linux I think, because it relates to "any-libffi.c" which I think is not used on Linux, but you'd better double check. The idea is that any-libffi.c is for "any libffi" implementation, which is the one used for Solaris. So that may explain why it worked in the past, but when the header files changed, it went by unnoticed. Patch 02 is most important. I don't quite understand how it can work without the missing file. I think this affects both Solaris and Linux, but it may work on Linux perhaps due to some other difference. Patch 03 only affects Solaris, it adds Solaris to the ffi-config script. On Solaris both any-libffi and the optimized version would be possible, although I'd be inclined to just keep using the generic any-libffi.c code. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJgFTkzAAoJEAwpOKXMq1MaIZYIAI4TS1qmPzX8IpzQy7MNpVqF IKabGyke5QBF7pw6On5tfUoXZXrzn7iOsxf7aRnNR3qvSD4SUp5X/TiG4anM38m1 0n2Blo/bP1RA7fLXnx69IjWRc8bEbUqOGHDw6XcWjRUpfDHE9jR1Nuf8g2NsUxqr FrP6m4WEarnnlpST3Qn09VI0dyXYIPlUlqTRL6f2zTJaG3X3C8YWqfGYyT65S8EV PiTQrAY7TXiYmV2FZ26HwOgBoJenbvGDzOyMNX+RgdOYwpg9kqAs76sbU9NdeiLy KjsAHw41Gs63vF/W94tfstjFs0Pd/K6i0Mv6OOV+2Rkw77efs2l1fliD5qo1Qxg= =2dKa -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: 01-any-libffi.c.patch Type: text/x-patch Size: 415 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 02-config.cmake.patch Type: text/x-patch Size: 757 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 03-ffi-config.patch Type: text/x-patch Size: 553 bytes Desc: not available URL: From lewis at mail.msen.com Sat Jan 30 15:27:57 2021 From: lewis at mail.msen.com (David T. Lewis) Date: Sat, 30 Jan 2021 10:27:57 -0500 Subject: [Vm-dev] missing file sqFFIPlugin.c in config.cmake In-Reply-To: <350904839.61688766.1612003822744.JavaMail.zimbra@telenet.be> References: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> <350904839.61688766.1612003822744.JavaMail.zimbra@telenet.be> Message-ID: <20210130152757.GA85544@shell.msen.com> Thanks David, I committed your patches to SVN r3797 Dave On Sat, Jan 30, 2021 at 11:50:22AM +0100, stes at PANDORA.BE wrote: > > Hi, > > Thanks if you can double check before adding the patches. > > Patch 01 does not affect Linux I think, > because it relates to "any-libffi.c" which I think is not used on Linux, > but you'd better double check. > > The idea is that any-libffi.c is for "any libffi" implementation, > which is the one used for Solaris. > > So that may explain why it worked in the past, but when the header files > changed, it went by unnoticed. > > Patch 02 is most important. > > I don't quite understand how it can work without the missing file. > I think this affects both Solaris and Linux, but it may work on Linux perhaps > due to some other difference. > > > Patch 03 only affects Solaris, it adds Solaris to the ffi-config script. > > On Solaris both any-libffi and the optimized version would be possible, > although I'd be inclined to just keep using the generic any-libffi.c code. > > > David Stes > From stes at telenet.be Sat Jan 30 18:06:11 2021 From: stes at telenet.be (stes@PANDORA.BE) Date: Sat, 30 Jan 2021 19:06:11 +0100 (CET) Subject: [Vm-dev] missing file sqFFIPlugin.c in config.cmake In-Reply-To: <350904839.61688766.1612003822744.JavaMail.zimbra@telenet.be> References: <1760325530.48203381.1611676421546.JavaMail.zimbra@telenet.be> <449287112.59809944.1611945783003.JavaMail.zimbra@telenet.be> <350904839.61688766.1612003822744.JavaMail.zimbra@telenet.be> Message-ID: <1473024013.63077364.1612029971503.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Thanks. The patch seems to work; I've rebuilt with revision 3797. In revision 3796 I had the following error: bash-5.0$ squeak sq64-20101106-dtl.image failed loading module /usr/lib/amd64/squeak/4.19.5-3796/so.SqueakFFIPrims due to ld.so.1: squeakvm64: relocation error: file /usr/lib/amd64/squeak/4.19.5-3796/so.SqueakFFIPrims: symbol ffiLogFileNameOfLength: referenced symbol not found bash-5.0$ ckformat sq64-20101106-dtl.image 68000 But that's fixed now. Many thanks, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJgFZ/FAAoJEAwpOKXMq1Ma1xkH/3yIPQDn7d9ze4u06+wp+z20 XY6dHgDK9sntcDReS4sVCl481B5ZXq04lVtXC82wZbiCOsg/lCbLkD0RzC5kiNVA xvGuyPxTmvAvQjgB63XCEcHdo52Xs5ZM7rMyj76BnpPdvEYTcjFQcwLDNJjiCZka taMui6TBLRiGIN69zzQnDfkFC3y1YjOYKCixUiOvANA7EJMEdTR8har1zE1UFPX6 JX8rCYE5m2jGP8gJ4cA/JB0x8ZsXdLZTN62Sn8/Vfi/MKLK1Ll/141mg6vAr4jJH SM2FRL4HWjPESgCwTbRIj5aTvmwX45EV5FQE4Wr/w+tOOpTvbB5W1b9QSxwABg0= =lPjt -----END PGP SIGNATURE----- From notifications at github.com Sat Jan 30 21:33:25 2021 From: notifications at github.com (David T Lewis) Date: Sat, 30 Jan 2021 13:33:25 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] UnixProcess forkSqueak broken since October (#548) In-Reply-To: References: Message-ID: The segfault happens in the child process that was forked by the forkSqueak prim. It occurs in the new epoll code. I don't yet see the cause (there is no obvious null pointer issue) but the gdb backtrace is: (gdb) bt #0 0x0000000000dd39b0 in ?? () #1 0x00000000004d62dc in aioPoll (microSeconds=0) at /home/lewis/squeak/git/opensmalltalk-vm/platforms/unix/vm/aio.c:405 #2 0x00007fa016315e39 in display_ioProcessEvents () at /home/lewis/squeak/git/opensmalltalk-vm/platforms/unix/vm-display-X11/sqUnixX11.c:4867 #3 0x0000000000417ca3 in ioProcessEvents () at /home/lewis/squeak/git/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:726 #4 0x0000000000441f58 in checkForEventsMayContextSwitch (mayContextSwitch=1) at /home/lewis/squeak/git/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:50306 #5 0x00000000004401ca in handleStackOverflowOrEventAllowContextSwitch (mayContextSwitch=1) at /home/lewis/squeak/git/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:53718 #6 0x0000000000426cbd in interpret () at /home/lewis/squeak/git/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:5844 #7 0x000000000043ab1f in enterSmalltalkExecutiveImplementation () at /home/lewis/squeak/git/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:51798 #8 0x000000000041d4ba in interpret () at /home/lewis/squeak/git/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2493 #9 0x000000000041ad0a in main (argc=2, argv=0x7ffc3ba11f78, envp=0x7ffc3ba11f90) at /home/lewis/squeak/git/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2164 -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/548#issuecomment-770284089 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Jan 30 22:38:06 2021 From: notifications at github.com (smalltalking) Date: Sat, 30 Jan 2021 14:38:06 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] UnixProcess forkSqueak broken since October (#548) In-Reply-To: References: Message-ID: The problem is that the file descriptors and structures are shared between parent and child after fork. However, after the fork, the epoll structures point to data that belongs to the parent. At line 405 the child process tries to access that data, and I think that causes the segfault. The child should close the inherited epoll file descriptor and recreate it along with the necessary data structures. This can be done by a handler registered with pthread_atfork(). -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/548#issuecomment-770291427 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Jan 30 22:41:41 2021 From: notifications at github.com (Nicolas Cellier) Date: Sat, 30 Jan 2021 14:41:41 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] UnixProcess forkSqueak broken since October (#548) In-Reply-To: References: Message-ID: See it explained at https://copyconstruct.medium.com/the-method-to-epolls-madness-d9d2d6378642 Le sam. 30 janv. 2021 à 23:38, smalltalking a écrit : > The problem is that the file descriptors and structures are shared between > parent and child after fork. However, after the fork, the epoll structures > point to data that belongs to the parent. At line 405 the child process > tries to access that data, and I think that causes the segfault. > The child should close the inherited epoll file descriptor and recreate it > along with the necessary data structures. This can be done by a handler > registered with pthread_atfork(). > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/548#issuecomment-770291776 -------------- next part -------------- An HTML attachment was scrubbed... URL: