Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: ec421b99cf41fc5f2f5fb734b536d6233cdde809 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ec421b99cf41fc5f2f5... Author: Eliot Miranda eliot.miranda@gmail.com Date: 2023-10-13 (Fri, 13 Oct 2023)
Changed paths: M building/macos64ARMv8/common/Makefile.app M building/macos64ARMv8/common/Makefile.vm M building/macos64ARMv8/squeak.cog.spur/mvm M building/macos64ARMv8/squeak.sista.spur/mvm M building/macos64ARMv8/squeak.stack.spur/mvm M building/macos64x64/common/Makefile.app M building/macos64x64/common/Makefile.vm M building/macos64x64/squeak.cog.spur/mvm M building/macos64x64/squeak.sista.spur/mvm M building/macos64x64/squeak.stack.spur/mvm M src/plugins/FilePlugin/FilePlugin.c M src/spur32.cog.lowcode/cogit.h M src/spur32.cog.lowcode/cogitARMv5.c M src/spur32.cog.lowcode/cogitIA32.c M src/spur32.cog.lowcode/cointerp.c M src/spur32.cog.lowcode/cointerp.h M src/spur32.cog.lowcode/gcc3x-cointerp.c M src/spur32.cog/cogit.h M src/spur32.cog/cogitARMv5.c M src/spur32.cog/cogitIA32.c M src/spur32.cog/cointerp.c M src/spur32.cog/cointerp.h M src/spur32.cog/cointerpmt.c M src/spur32.cog/cointerpmt.h M src/spur32.cog/gcc3x-cointerp.c M src/spur32.cog/gcc3x-cointerpmt.c M src/spur32.sista/cogit.h M src/spur32.sista/cogitARMv5.c M src/spur32.sista/cogitIA32.c M src/spur32.sista/cointerp.c M src/spur32.sista/cointerp.h M src/spur32.sista/gcc3x-cointerp.c M src/spur32.stack.lowcode/gcc3x-interp.c M src/spur32.stack.lowcode/interp.c M src/spur32.stack/gcc3x-interp.c M src/spur32.stack/interp.c M src/spur32.stack/validImage.c M src/spur64.cog.lowcode/cogit.h M src/spur64.cog.lowcode/cogitARMv8.c M src/spur64.cog.lowcode/cogitX64SysV.c M src/spur64.cog.lowcode/cogitX64WIN64.c M src/spur64.cog.lowcode/cointerp.c M src/spur64.cog.lowcode/cointerp.h M src/spur64.cog.lowcode/gcc3x-cointerp.c M src/spur64.cog/cogit.h M src/spur64.cog/cogitARMv8.c M src/spur64.cog/cogitX64SysV.c M src/spur64.cog/cogitX64WIN64.c M src/spur64.cog/cointerp.c M src/spur64.cog/cointerp.h M src/spur64.cog/cointerpmt.c M src/spur64.cog/cointerpmt.h M src/spur64.cog/gcc3x-cointerp.c M src/spur64.cog/gcc3x-cointerpmt.c M src/spur64.sista/cogit.h M src/spur64.sista/cogitARMv8.c M src/spur64.sista/cogitX64SysV.c M src/spur64.sista/cogitX64WIN64.c M src/spur64.sista/cointerp.c M src/spur64.sista/cointerp.h M src/spur64.sista/gcc3x-cointerp.c M src/spur64.stack.lowcode/gcc3x-interp.c M src/spur64.stack.lowcode/interp.c M src/spur64.stack/gcc3x-interp.c M src/spur64.stack/interp.c M src/spur64.stack/validImage.c M src/v3.cog/cogit.h M src/v3.cog/cogitARMv5.c M src/v3.cog/cogitIA32.c M src/v3.cog/cointerp.c M src/v3.cog/cointerp.h M src/v3.cog/gcc3x-cointerp.c M src/v3.stack/gcc3x-interp.c M src/v3.stack/interp.c
Log Message: ----------- CogVM source as per VMMaker.oscog-eem.3339
Now the MT vm is using C intrinsics there are no trampolines for the COGMTVM configuration.
First mostly stable version of the Threaded FFI.
Most important changes are: 1. Use C11 atomic instructions for the vmOwner. This simplifies the CPXCHG instruction and should make this a lot more resistant to breaking due to compiler optimizations.
2. Fix a critical bug when reentering the threadSchedulingLoop Previously this used the wrong jmp_buf, therefore a thread that tried to return to its threadSchedulingLoop might end up in the threadSchedulingLoop of ANOTHER thread!
With these two changes in place, the VM runs mostly stable whilst switching between two threads in the spurreader image. There are still some bugs to fix, especially in the scheduler, as well as synchronizing access to the threads variable. But this is good progress for now.
Rename CoInterpreterMT's processHasThreadId inst var to processHasThreadAffinity in the wake of Kernel-eem.1523.
First commit of Leon Matthes' work to revive the threaded FFI (committed by eem on behalf of LM cuz of Monticello permissions on source.squeak.org).
Fix simulation so that the current processor register state reflects the current Smalltalk process. Eliot's first attempt was a bit broken. This approach of manually switching register states in tryLockVMOwnerTo: preserves fast simulation because we're not changing register state on every send to the processor object as was the case with the original MultiProcessor wrapper. Check for a missing register state by setting the register state for stack, frame & pc pointers to zero. Label the processes spawned by the simulation so they show up nicely in the process browser.
releaseVM was used several places where disownVM: should have been used.
Simplify cedeToHigherPriorityThreads; the VM can't be unowned when invoked.
Nuke some unneeded halts.
minor clean-up/commentary.
Help myself by documenting what the snapshotPrimitive answers (false for snapshot, true for resume).
Simplify SpurMemoryManager>>#sufficientSpaceAfterGC:. Nuke an unused link reg related utility in the Cogit. Add the CogVMSimulator's fklush method to the STackInterpreterSimulator to ensure that GC progress is printed immediately while simulating.
Build: upgrade the 64=bit macos Makefilews so they can build MT VMs. mvm in squeak.*.spur dirs now takes a -T arg and builds with -DCOGMTVM=1 in build??mt to SqueakMT*.app
vm-dev@lists.squeakfoundation.org