...at http://www.mirandabanda.org/files/Cog/VM/VM.r3029/.

I've taken down the 3021 and 3024 VMs as their LargeIntegers code was badly broken.  That's fixed now.  The major changes are that Spur now correctly handles forwarding in primitives invoked from machine code, and that sends to Characters have the expected performance.


CogVM binaries as per VMMaker.oscog-eem.797/r3029


Fix mixup of old & young spaces in primitiveVMParameter, and
comment some new parameters.

Fix return types for positive[64/32]BitValueOf:.
positive32BitValueOf: must answer a usqInt,
positive64BitValueOf: must answer a usqLong.

Use positiveMachineIntegerValueOf: to decode arg in primitiveNewWithArg
and ensure positiveMachineIntegerValueOf: is inlined there-in.


Spur:
Fix inline cache for Characters in Spur. Existing code failed all machine code
sends to characters, creating PICs at those send sites which failed back to the
interpreter.

Implement forwarder following on primitive failure for all primitive calls from
machine code.  Allow the JIT to not compile primitiveDoNamedPrimitiveWithArgs
to avoid any potential complications.

Have spur's fetchClassOfNonImm: answer nilObj for forwarders to avoid assert
fails.  Fix assert fails in updateStateOfSpouseContextForFrame:WithSP:
and elsewhere with forwarders.

Add read barriers to primitiveSuspend and synchronousSignal:'s myList
access, because the process list manipulation routines do no checking.  Add
assert checks for forwarders in the process list manipulation routines.

Fix StackInterpreter>>actuallyFollowNecessaryForwardingInMethod:literalCount:
so that it no longer corrupts the methodClassAssociation.

Rewrite all the semaphore installing primitives to fail if the semaphore arg is
neither a semaphore or nil instead of assuming if its not a semaphore it must be
nil, so as to fail and retry when semaphores are forwarded (as they are when
Semaphore is redefined).

Implement isSemaphoreOop:/Obj: in the object memories to abstract away the code.
Base Spur's on the class index of splObj: ClassSemaphore, avoiding the table
lookup to derive the class.  Make checkForEventsMayContextSwitch: treat all its
semaphores consistently.

These changes allow Cog Spur to redefine Process and/or Semaphore and not hang.

Fix sign and overflow issues in instantiating larger objects
and determining the size of large instances.

Fix some freeChunk accesses that used fetchPointer:ofObject:.

Make sure forwarders have accurate slot counts, bumping it to 1 if it was zero.


Plugins:
Fix LargeIntegersPlugin>>isNormalized: for forwarders, no longer assuming that
if its arg isn't a SmallInteger it must be a large integer.  Squash an assert
fail in lengthOf:format: on forwarders by using numSlotsOfAny:.

Fix the shift for divide issues in the LargeIntegersPlugin.

Change the SmartSyntaxPluginCodeGenerator to generate
code that ifdefs out the remapOop:in: rigmarole on Spur.


Windows:
Set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header of the Windows
executables to allow e.g. Spur to allocate more than 2Gb.


Slang:
Rip out the UseRightShiftForDivide optimization.  It gets unsigned division
wrong, and C compilers can and will optimize this correctly themselves.

--
best,
Eliot