[Vm-dev] New Cog VMs available as per VMMaker.oscog-eem.1679/r3602

Eliot Miranda eliot.miranda at gmail.com
Mon Feb 15 19:39:29 UTC 2016

Hi All,

    first of all, apologies for the long wait for new VMs.  I know there
are bugs that these VMs address and that it's been 5 months since VMs were
last made is something I regret.  The wait was due to my developing the
64-bit Spur Cog JIT VM which required surgery not just to the Cogit but
also to Slang.  I beg your forgiveness.

   Secondly, the Mac VMs are much changed, using John McIntosh's Cocoa
support libraries.  The old Carbon UI VMs are history.  That means that Cog
supports building on contemporary Mac OS releases.  These VMs were built on
10.9; I like the 3D look much more than the 10.10 one ;-).  The VMs are
also signed, so installing them should be easier.

  Thirdly, these VMs include 64-bit JIT support.  There is an updated
squeak trunk image at http://www.mirandabanda.org/files/Cog/SpurImages for
you to try.  As yet the 64-bit Vms do not include an FFI plugin.  I hope to
rectify this soon.

   Finally I have included Pharo Mac VMs, not to displace the official
Pharo VMs, but to test my build process.  I hope that in very few months
the svn repository will be moed to githup and that Esteban and I will build
official VMs from the same repository.

The VMs are here: http://www.mirandabanda.org/files/Cog/VM/VM.r3602

CogVM binaries as per VMMaker.oscog-eem.1679/r3602

Include 64-bit Spur VMs for Mac OS X x64 and Linux x64. N.B. As yet these
lack FFI support.

Move all Mac OS X VMs to the Cocoa libraries.  Minimum supported version
be 10.6.x.  The Mac OS X VMs are signed and so should install properly
having to disable the launch security checks.

Bug Fixes and Improvements:

Add vmParameter 20 to answer the utc microseconds at startup.

Remove the atCache from the CoInterpreter.  It's of little benefit given the

ceSend: et al need to add looked up methods to the method cache, otherwise
methods only found through machine code sends will not be jitted.

Fix slip in maybeSelectorOfMethod: which will improve back traces
including methods containing pragmas (including primitives).

Modify secret primtiive 161, primitiveSetIdentityHash so that with 0 args it
answers whether an object has an identity hash.  This is vacuously true for
but is meaningful in Spur.

Fix /horrible/ bug with primitive error codes and fixups.  The adjustment
of the
initialPC to skip the primitive and error code, if any, was done after
generating fixups for backward branches, and hence these branches were
Object>>shallowCopy in Spur is subject to this, but amazingly enough it has
surfaced before now.  Fix this by adjusting the initialPC before scanMethod
scans for fixups.

Fix bug in Spur machine-code at:put: on 32-bit bits objects; method failed
fail for negative values.

Fill unused portions of methods with the stop instruction, not nop.

Explicitly initialize the code zone with stops. Explicitly clear the
reclaimed portion of the method zone after a compaction.

Include the reclaimed portion of the method zone in the I-cache flush
after a compaction: no point in leaving it in cache since it isn't a
valid call/jump target.

Maintain the survivor count on scavenge.

Fix start up of images containing >= 16 segments.  The old code assumed
numSegments < 16 and failed to grow the segment records, resulting in
in segments greater than 15 to not be swizzled, and a resulting crash.

Spur Cogit: Support CompiledMethod indexing in genPrimitiveAt[Put].  Hence
the regression in at:[put:] whereby in Spur one could access the literals
of a method as bytes.
Add a machine-code primitive for objectAt: to provide fast literal and
access on Spur.

Add 16-bit indexability to Spur.  Generate slimmer code for
positive32BitValueOf: on 64-bit Spur.

Fix a bug with out-of-place two-way become, which got the hash copy the
way round.  By default, the hash stays with the reference in two-way become.

Fix what appears to be a compiler bug with in-place two-way-become by
the headers to be swapped so that remembered flags are swapped and hash bits
are swapped if required. This fixes a bug with in-place two-way become of
objects that are the same size on the heap.  One object's contents would not
be updated correctly.

Implement ephemeron queue primitive.  Add an image flag that controls the
finalization support (StackInterpreter instVar newFinalization).  If unset,
finalization is as currently expected; WeakArray finalizes all WeakArrays in
its registries on each finalization (which does not scale!).  If set, then
fired ephemerons and bereaved weak arrays are added to the finalization
and the finalization semaphore is signalled.  In this regime the image is
expected to send mourn to each element of the queue, and weak arrays will
themselves finalize in mourn, side-stepping the finalizeValues steps and
rendering WeakArray's FinalizationDependents and WeakRegistry obsolete.
The bit is set via
    Smalltalk vmParameterAt: 48
              put: ((Smalltalk vmParameterAt: 48) bitOr: 64).

Fix bad regression in type inference from VMMaker.oscog-eem.1587.
returnTypeForSend:in: can only default return types to sqInt for unknown
selectors.  The rewrite in VMMaker.oscog-eem.1587 inadvertently defaulted
return type of known methods whose return type was yet to be determined to
sqInt.  The fix is to only default to sqInt if there is no known method for
given selector.  This fixes, for instance, the weird flipping of the type of
32-bit Spur's headerWhileForwardingOf:,which should always be #sqLong.

Fix bad bug in type inferrence.  Avoid computing variable and return types
prematurely i.e. don't derive types from as-yet-untyped methods.

Fix baaaad bug in node:typeCompatibleWith:inliningInto:in: which was looking
up the type of the formal parameter in inlining in the target method, not
method being inlined!

Fix bug in MNU for cogged dynamic super sends - should start looking for
#doesNotUnderstand: in the superclass not the receiver class. Unify MNU
lookup between absent and present receiver sends as a result.

Further fix outer send MNU by not confusing lkupClass and lkupClassTag.
Push setting lkupClassTag down to clarify it is for new cache entries.

Fix the FilePlugin's unnecessary fullGC on Spur.
Include the file sync prim in the FilePrims plugin.

- ExternalAddress now are taken correctly (nor as ByteArray or Alien,
  they are different beasts).
- allow pushing of pointers to any type (into a ByteArray, an
  or an Alien), to allow passing parameters style int*, float*, etc.
- allow reading in memory to allow read chunks of ByteArray

Added ThreadedFFIPlugin>>#primitiveLoadSymbolFromModule (copy and adapt from

Fix coercion problems on FFI plugin (IA32 & ARM)
- character were not correctly mapped back
- floats were not being well checked
- external addressed needs to be treated as aliens for the purpose of
  them as pointers (bad regression by Eliot)

Alien Plugins:
Fix missing primitive failure for Alien typeAt: 0 [put:].
Add word accessors to Alien.

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160215/1a2d4589/attachment-0001.htm

More information about the Vm-dev mailing list