Commit notice blocked due to size, forwarding trimmed version:
Delivered-To: list-vm-dev(a)lists.squeakfoundation.org
Date: Mon, 19 Nov 2012 00:56:42.496 0000
From: commits(a)source.squeak.org
To: vm-dev(a)lists.squeakfoundation.org
Reply-To: vm-dev(a)lists.squeakfoundation.org
Subject: VM Maker: VMMaker.oscog-eem.212.mcz
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.212.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.212
Author: eem
Time: 18 November 2012, 4:52:01.673 pm
UUID: 845ad894-9bd6-460c-a858-0aaf8f01f4a4
Ancestors: VMMaker.oscog-lw.211
Complete multiple bytecode set support plus NewsqueakV4 bytecode set.
Main change apart from bytecode set is to move the primitive index from a CompiledMethod's header into a callPrimitive: bytecode, and use the bits to expand the num literals field to 16 bits, adding a "has primitive" field to the header.
VMClass:
Change generateNewspeakCogVM & generateNewspeakStackVM to generate VMs with MUTLIPLEBYTECODESETS.
StackInterpreter/CoInterpreter
Add bytecode table for NewspeakV4. Rename shortConditionalJump to shortConditionalJumpFalse. Rename bytecodePrimBlockCopy to bytecodePrimSpecialSelector24. Make sure non-inlined special selector bytecodes (e.g. bytecodePrimDo) no longer assume argumentCount.
Refactor primitiveIndexOfMethodHeader: to primitiveIndexOfMethod:header: to allow extraction of prim index from callBrimitve: bytecode. Likewise callers of primitiveIndexOfMethodHeader:, e.g. canContextSwitchIfActivating: => canContextSwitchIfActivating:header:.
Move fetchNextBytecode after setMethod: in commonCallerReturn so that bytecodeSetSelector is correct on fetch.
Abstract out block creation from block creation bytecodes
Abstract out detecting the prim err code store in method activation routines.
Abstract out backwards branch event checking from backward branch bytecodes
Consolidate the simulated bytecode implementations that override out-of-order fetchNextBytecode using cCode:inSmalltalk: and delete the simulated ones.
Add process switched from to process switch trace.
Add bytecode address and header print to longPrintOop: (and bytecopde address to printOop:) for compiled method.
Fix printing oop twice for invalid oops in printOop:.
Change a few ~~'s to ~='s.
Fix some receivers self => objectMemory.
Change some users of BytesPerWord to BytesPerOop (e.g. internalPop:).
Use Objectmemory>>booleanObjectOf: where aprpopriate.
Add ImmediateTagMask & SmallIntegerShift and initialize them in initializeImmediates. Use for testing the V4 "has primitive" header flag.
Implement Newsqueak/Newspeak absent receiver sends in the StackInterpreter (but not yet in the KIT) in terms of shuffleArgumentsAndStoreAbsentReceiver:.
Add index 65 to primitiveVMParameter to answer a boolean indicating if the VM supports MUTLIPLEBYTECODESETS and hence understands the new alternative CompiledMethod header format. If the VM answers nil it does not understand the new format. If i answers false it does, but does not implement an alternate bytecode set.
Simulator
Provide startInContextSuchThat: to allow avoidance of as-yet-untimulateable Newspeak image startup.
Junk old symbolic method printing and use VMCompiledMethodProxy to defer on image's symbolic printing.
Add RelativeDetailedInstructionPrinter to allow comparing stack depths in methods with different bytecode sets.
Refactor stack depth checking and add it to ceCheckForInterrupts
Fix allObjectsDo: to use freeStart as limit, not endOfMemory.
Move promptHex: up to VMClass and fix it for negative numbers.
Provide a set break block... dialog.
Fix couldBeFramePointer: for StackInterpreter (negative stack pointers).
Add ioLocalMicroseconds for Newspeak simulation.
Cogit:
Add NewsqueakV4 bytecode generators.
Add extension bytecode handling to all relevant scan, compilation and map traversal routines. Change signature of span and branch distance routines to take number of extensions. Make byte0 include bytecodeSetOffset.
Make genSpecialSelectorComparison cope with extensions on following conditional branch.
Change block descriptor format (ceClosureCopyDescriptor: argument) to increase range of num args and numCopied with V4 bytecode.
Eliminate generation of unnecessary long store code for prim err code, given that prologue already stores it.
Abstract out block creation bytecode size, push nil detection and push nil bytecode size, and firstSpecialSelectorBytecodeOffset.
Add the bytecode table initializers for NewsqueakV4 and clean-up all bytecode table initializers and generatorTableFrom:.
Eliminate isBackwardBranch and isBranch from CogBytecodeDescriptor and use spanFunction instead.
Move initializations in initializeMiscConstantsWith: around so that MULTIPLEBYTECODESETS et al are not zeroed when initializing the JIT after initializing the CoInterpreter.
Fix pc mapping tests so they're more efficient for in-image methods. Fix several bugs, add new methods and simplify CurrentImageCoInterpreterFacade for multiple bytecode sets. Make tests check bc & mc selectors match.
Rename traceLinkedSends to more general traceFlags.
Add options: to in-image cog:selector: to allow testing MULTIPLEBYTECODESETS jitting.
In disassembly, print bytecode pc next to annotation, and include selector in map
RePlugin
Eliminate some iuses of cCode: inSmalltalk: which were disabling inlining.
Slang:
Change sharedCodeNamed:inCase: so that one can supply a bytecode rouitne name instead of a case index, e.g. sharedCodeNamed: 'commonReturn' inCase: 120 => sharedCodeNamed: 'commonReturn' inCase: #returnReceiver.
Make bytecode switch generation scan for duplicate cases to avoid duplication in MULTIPLEBYTECODESET form. Do so by refactoring bindVariableUsesIn: to bindVariableUsesIn:andConstantFoldIf:in:. Constant-fold so that currentBytecode bitAnd: mask looks the same even if currentBytecode differers by multiples of mask + 1.
Emit code at end of case as an expression. Include goto nodes in this.
Make gnuifier insert an assert at start of interpret that checks that the breakTable is the rigth size for MULTIPLEBYTECODESETS.
Improve formatting of comments in TParseNode, etc.
Fix bug with while creation that changed code generated if generated a second time. This made it easier for switch generation to detect shared cases.
Fix inlining of pointerForOop: et al by adding them to kernel: selectors. Eliminate warning in allocateMemory:minimum:imageFile:headerSize: using pointerForOop:. Use allocateMemory:minimum:imageFile:headerSize: in StackInterpreter>readImageFromFile:HeapSize:StartingAt:.
Add breakSrc/DestInlineSelector for better inlining debugging.
=============== Diff against VMMaker.oscog-lw.211 ===============
<snip>
It is great to see a new experimental 4.10 series squeak-vm RPM
package for Fedora, thanks to Jaroslav Škarvada. He posted it at
http://fedorapeople.org/~jskarvad/squeak/squeak-vm-4.10.2.2614-1.fc19.src.r…
It is for Fedora rawhide, but it builds on our Fedora 16 x86_64
box. It is the first time I have used a working x86_64 VM with a full
complement of
plugins, so I am delighted.
I used a couple of kludgy workarounds to get these launcher scripts working
/usr/bin/squeak
/usr/bin/etoys
Firstly, ckformat seems to be in the wrong place, so I symlinked it:
cd /usr/bin/
sudo ln -s /usr/lib64/squeak/4.10.2-2614/ckformat
Secondly, /usr/bin/squeak looks in the wrong place for squeakvm, so I
swapped lib/ for lib64, which breaks the script for other
architectures :(
--- /usr/bin/squeak.~1~ 2012-11-18 12:32:17.000000000 +0000
+++ /usr/bin/squeak 2012-11-18 18:06:37.612949407 +0000
@@ -30,7 +30,7 @@
bindir=`realpath "${0}"`
bindir=`dirname "${bindir}"`
prefix=`dirname "${bindir}"`
-libdir="${prefix}/lib/squeak"
+libdir="${prefix}/lib64/squeak"
plgdir="${libdir}/4.10.2-2614"
useoss="true"
ck="ckformat"
Only a couple of unsolved problems so far, though I look forward to
exercising the new VM more thoroughly, as time on this box permits.
Firstly, the display would sometimes freeze when using full screen
squeak. (I am using the X.Org Intel Pineview GM driver, in case that
is relevant.)
Secondly, the sugarized Etoys activity (etoys-sugar) pops up a debug
window on launch, because it got a timeout from this DBus message:
DBusMessageMethodCall(3)[/org/laptop/Sugar/Presence
org.laptop.Sugar.Presence.GetOwner()]
I hope my comments help. This all looks very promising for the next
generation of Fedora Squeak, Scratch and Etoys users. Have fun! David
p.s. bugzilla link for the feature request
https://bugzilla.redhat.com/show_bug.cgi?id=861633
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be
placed in build dir
URL=`git config --get remote.origin.url`
COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" | head
-n 1`
echo -n "#define REVISION_STRING \"$URL $COMMIT " > vmVersionInfo.h
test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >>
vmVersionInfo.h || echo
echo "\"" >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.git Commit:
e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11 +0100
By: Esteban Lorenzano <estebanlm(a)gmail.com>
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define
REVISION_STRING \"$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
--
Mariano
http://marianopeck.wordpress.com
Lars Wassermann uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-lw.210.mcz
==================== Summary ====================
Name: VMMaker.oscog-lw.210
Author: lw
Time: 17 November 2012, 10:09:25.206 pm
UUID: 825aedb9-4486-c84d-bedd-87b09fa9fb62
Ancestors: VMMaker.oscog-lw.209
because of the new call implementation, adapt #isCallPreceedingReturnPC
=============== Diff against VMMaker.oscog-lw.209 ===============
Item was changed:
----- Method: CogARMCompiler>>isCallPreceedingReturnPC: (in category 'testing') -----
isCallPreceedingReturnPC: mcpc
"Assuming mcpc is a return pc answer if the instruction before it is a call."
+ "There are two types of calls: PUSH, BL and (MOV, ORR, ORR, ADD, PUSH, ADD)"
+ "PUSH {pc} is not sufficient as a test, because pc may be pushed using the PushR opcode"
+ ^(objectMemory longAt: mcpc - 8) = (self t: 4 o: 9 s: 0 rn: SP rd: 8 shifterOperand: 0)
+ and: [(objectMemory byteAt: mcpc - 3) >> 4 = 16rB "BL"
+ or: [ (objectMemory longAt: mcpc - 12) = 16rE1A0E00F "MOV pc, lr" ]]!
- "There are two types of calls: BL and (MOV, ORR, ORR, MOV, ADD)"
- ^(objectMemory byteAt: mcpc - 3) >> 4 = 16rB
- or: [ (objectMemory longAt: mcpc - 8) = 16rE1A0E00F "MOV pc, lr" ]
- "MOV pc, lr is sufficient as a test, because call instructions are the only insturctions, during which lr is loaded from pc."!
Lars Wassermann uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-lw.209.mcz
==================== Summary ====================
Name: VMMaker.oscog-lw.209
Author: lw
Time: 17 November 2012, 7:16:57.599 pm
UUID: f46008f0-431e-8b4d-8d3e-5a4d7a1e5089
Ancestors: VMMaker.oscog-lw.210
included the changed call implementation:
instead of using BL directly, push the jump back address first, to comply with CoInterpreter expectations
=============== Diff against VMMaker.oscog-lw.209 ===============
Hi guys. I have the following scenario. I have a buffer (ByteArray)
that I pass by FFI to a function of size N. This function puts data in
the array and answers me the M number of bytes that it put. M <= N.
Finally, I need to copy the array of size N to the accuare size M.
To do that, I am using #copyFrom:to:. If the ByteArray is large (which
could be the case), this function takes significant time because it
needs to allocate space for the new large resulting array. So...is
there a destructive primitive where I can "crop" the existing array,
modify its size field and mark the remaining bytes as "free space for
the heap".
Do we have a primitive for that?
Thanks,
--
Mariano
http://marianopeck.wordpress.com
Hi:
I have two more problems with the simulator (there are more, but those here are 'trivial').
In InterpreterSimulator the method #ioUTCMicrosecondsNow is missing.
I just added this:
ioUTCMicrosecondsNow
"STEFAN: not entierly sure what to do with this... but the method is missing."
^ Time millisecondClockValue
In the NewObjectMemorySimulator>>#sqGrowMemory:By:, there is a reference to coInterpreter which receives are #memory: message. However in the new hierarchy, where the interpreter is not an ObjectMemory anymore, that message is not implemented.
So, I removed it...
Not sure whether either of these solutions is appropriate, but would be good to get the problems fixed and have the simulators usable.
Thanks a lot
Stefan
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: +32 2 629 3525