New Cog VMs available

22 views
Skip to first unread message

Eliot Miranda

unread,
Apr 9, 2015, 5:28:51 PM4/9/15
to Squeak Virtual Machine Development Discussion, The general-purpose Squeak developers list, Discusses Development of Pharo, newspeak...@googlegroups.com
... at http://www.mirandabanda.org/files/Cog/VM/VM.r3308/.

CogVM binaries as per VMMaker.oscog-eem.1178/r3308

Plugins:
Integrate Nicolas' fixes that use positiveMachineIntegerFor: for pointers.

Newspeak:
Print a warning in the method shared under multiple selectors scenario.

Implement outer sends as clean sends just like implicit receiver sends. Add
ObjectRepresentation>>illegalClassTag and use it for initializing and unlinking
implicit and outer sends.

Newspeak & Sista:
The multiple bytecode set block initial nil counters need
to be specific to the bytecode set in effect.

Spur:
Implement Clement's much better solution for the stale supersend problem.
Place code at the send site for super sends to follow stale forwarded
receivers.  This parallels the interpreter implementation.

Beef up the post-become scan of send sites to
unlink all send sites that link to an invalid class tag.

Cogit:
Optimize StackToRegisterMappingCogit>>genReturnReceiver
to not load ReceiverResultReg if it already contains self.

Revise method map generation to provide multiple send type annotations.  Add
an IsAnnotationExtension annotation type that implicitly has a zero displacement
and uses its displacement bits to extend the preceeding IsSendCall annotation.
This allows us to eliminate all the exotic entry-points and keep only the
checked and unchecked entries.

Change IA32's genPushRegisterArgsForNumArgs: to not smash TempReg now that it
is used in directed super send trampolines.

Use PushCq to pass small integer constants in the trampolines instead of
smashing TempReg, which is now used to hold the directed supersend argument.
Add support for PushCq.  Could use PushCw but on x86 PushCq is a lot shorter.

Mac builds: Use UTC as the timezone for the build timestamp.  Using the local
timezone doesn't work :(.
-- 
best,
Eliot

Eliot Miranda

unread,
Apr 16, 2015, 11:44:26 PM4/16/15
to Squeak Virtual Machine Development Discussion, The general-purpose Squeak developers list, Pharo Development List, newspeak...@googlegroups.com
... at http://www.mirandabanda.org/files/Cog/VM/VM.r3311/.

These should fix the regression introduced by the map changes in 3308.  They certainly fix the two crashes I've looked at, one an update of a squeak trunk image and the other the startup of recent Newspeak images.  Apologies for the inconvenience.


CogVM binaries as per VMMaker.oscog-eem.1204/r3311

Cogits:

Fix regression in map machinery due to adding AnnotationExtension scheme.
findMapLocationForMcpc:inMethod: must not be confused by IsDisplacementX2N
bytes.  This is likely the cause of the recent crashes with r3308 and earlier.

Introduce marryFrameCopiesTemps and use it to
not copy temps in Spur context creation trampolines.

Change initial usage counts to keep more recently jitted methods around for
longer, and do *not* throw away PICs in freeOlderMethodsForCompaction, so that
there's a better chance of Sista finding send and branch data for the tripping
method.

extendedPushBytecode /does/ need a frame.

Don't save the header in a scratch register unless
it is useful to do so in the Spur at:[put:] primitives.

Fix slip in genGetNumBytesOf:into:.  And notice that
genGetFormatOf:into:baseHeaderIntoScratch: et al can use byte access
to get at format, as intended in the Spur header design.

Fix unlinking dynamic super sends.

Reduce false positives in access control violation reporting by marking the
super send we actually use as privileged. Remove unused Newspeak bytecodes.

Internal:

Fix code generation bug surfaced by inline primitives.  On x86 movb N(%reg),%rl
can only store into al, bl, cl & dl, whereas movzbl can store into any reg.  On
ARM move byte also zero-extends.  So change definition of MoveMbrR to always
zero-extend, use movzbl on x86 and remove all the MoveCq: 0 R: used to zero the
bits of the target of a MoveMb:r:R:.  And now that we have
genGetNumSlotsOf:into:, use it.

Fix a slip in genTrinaryInlinePrimitive:, meet constraint that the target must
be in ReceiverResultReg, and do a better job of register allocation there-in.

Do dead code elimination for the branch following an inlined comparison (this
is done in genBinaryInlineComparison:opFalse:destReg: copying the scheme in
genSpecialSelectorEqualsEquals).

Do register allocation in the right place in genUnaryInlinePrimitive:.

Fix overflow slot access in genGetNumSlotsOf:into: et al.

Fix several slips in inline primitive generation: Object>>at:put: needs to
include a store check.  Some register allocation code was wrong.  Some results
needed converting to SmallIntegers and recording results as pushed on the sim
stack.

Change callPrimitiveBytecode to genCallPrimitiveBytecode in the Cogit.
remove the misnomer genConvertIntegerToSmallIntegerInScratchReg:

Type of AbstractInstruction opcode must be unsigned now that we have
more than 128 opcodes (XCHGRR pushed things over the top).

Lay the groundwork for 32-bit intra-zone jumps and calls on ARM by introducing
CallFull and JumpFull (and rewrites thereof) that are expected to span the full
address space, leaving Call/JumpLong to span merely the 16mb code zone.  On x86
CallFull and JumpFull simply default to Call/JumpLong.

Replace bytecode trapIfNotInstanceOf by jumpIfNotInstanceOfOrPop.

Rewrote the JIT logic for traps to be able to write trap trampolines calls at
the end of the cogMethod.

Refactor the slot store and store check machinery to take an inFrame: argument
and hence deal with the store check in genInnerPrimitiveAtPut: on ARM.

Fix limitation with MoveRXbrR; can only do movb from
%al through %dl, so swap with %eax around movb.

Fix mistake with genGetNumBytesOf:into: by refactoring
genGetFormatOf:into:baseHeaderIntoScratch: into
genGetBits:ofFormatByteOf:into:baseHeaderIntoScratch:
and hence fetching and subtracting only odd bits of format.

Correct the in-line primitive SmallInteger comparisons; CmpXR is confusing ;-)

Fix var op var unsafe byte at:.  Result must be converted to SmallInteger.

Correct the generated Slang for the new register allocation code by adding a
read-before-written pass to C generation that initializes variables
read-before-written with 0 (the C equivalent of nil).

fix a bug where sometimes register allocation was marking ReceiverResultReg as
dead whereas it was still alive.

Added some abstraction over register allocation. This is now used in inline
primitives.

Eliot Miranda

unread,
Apr 16, 2015, 11:44:26 PM4/16/15
to Squeak Virtual Machine Development Discussion, The general-purpose Squeak developers list, Pharo Development List, newspeak...@googlegroups.com
On 16 Apr 2015, at 16:50, Eliot Miranda wrote:

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

These should fix the regression introduced by the map changes in 3308.  They certainly fix the two crashes I've looked at, one an update of a squeak trunk image and the other the startup of recent Newspeak images.  Apologies for the inconvenience.

Well, this is embarrassing as usual but I'm still seeing crashes in the image update.  So I'll have to look deeper.  At least the Newspeak fix was real, but it didn't fix everything.

Eliot Miranda

unread,
Apr 17, 2015, 4:42:04 PM4/17/15
to Squeak Virtual Machine Development Discussion, The general-purpose Squeak developers list, Discusses Development of Pharo, newspeak...@googlegroups.com
... at http://www.mirandabanda.org/files/Cog/VM/VM.r3312.

These VMs /do/ fix the regression introduced in r3308.  Again apologies.

CogVM binaries as per VMMaker.oscog-eem.1207/r3312

Head slap!  Fix the copy-paste error that caused
the regression in VMMaker.oscog-eem.1160/3308.
--
best,
Eliot

Eliot Miranda

unread,
Apr 20, 2015, 11:54:48 PM4/20/15
to Squeak Virtual Machine Development Discussion, The general-purpose Squeak developers list, Pharo Development List, newspeak...@googlegroups.com
On 16 Apr 2015, at 17:39, Eliot Miranda wrote:


On 16 Apr 2015, at 16:50, Eliot Miranda wrote:

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

These should fix the regression introduced by the map changes in 3308.  They certainly fix the two crashes I've looked at, one an update of a squeak trunk image and the other the startup of recent Newspeak images.  Apologies for the inconvenience.

Well, this is embarrassing as usual but I'm still seeing crashes in the image update.  So I'll have to look deeper.  At least the Newspeak fix was real, but it didn't fix everything.

And I have finally found it.  A stupid copy paste error which caused the failure to mark references to classes in linked sends.  Fixed VMs should be available in an hour or two.  Again apologies.
Reply all
Reply to author
Forward
0 new messages