[Vm-dev] [commit][2836] CogVM source as per VMMaker.oscog-eem.569
commits at squeakvm.org
commits at squeakvm.org
Wed Dec 25 04:06:59 UTC 2013
Revision: 2836
Author: eliot
Date: 2013-12-24 20:06:57 -0800 (Tue, 24 Dec 2013)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.569
Fix Spur's machine-code identityHash primitive for Character
receivers. Refactor into the conventional cogit/objRep split
genPrimitiveFoo/genInnerPrimitiveFoo. Nuke the now-unused
isHashSetOnInstanceCreation.
Fix Spur's machine-code == & ~~ primitives for potentially
forwarded arguments.
Implement machine-code primitives for Character>>value and
SmallInteger>>asCharacter/Character class>>value:.
Check for valid bitmap in primitivePixelValueAt aka BitBltSimulation>>
primitivePixelValueAtX:y: Fix provided by Nicolas Cellier. Reference Mantis 7799
Revert/change Spur entry-code:
a) 4 byte entry-point alignment is as good as 8-byte on Core i7
b) the older backward-branching for immediates entry-point code
is significantly faster for non-immediates and because we expect
most SmallInteger code to be performed in-line it is better to prefer
non-immediate send performance.
Modified Paths:
--------------
branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
branches/Cog/nscogsrc/vm/cogit.c
branches/Cog/nscogsrc/vm/cogit.h
branches/Cog/nscogsrc/vm/cogmethod.h
branches/Cog/nscogsrc/vm/cointerp.c
branches/Cog/nscogsrc/vm/cointerp.h
branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
branches/Cog/nscogsrc/vm/interp.h
branches/Cog/nscogsrc/vm/vmCallback.h
branches/Cog/spursrc/vm/cogit.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cogmethod.h
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/interp.h
branches/Cog/spursrc/vm/vmCallback.h
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/spurstacksrc/vm/interp.h
branches/Cog/spurstacksrc/vm/vmCallback.h
branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c
branches/Cog/src/vm/cogit.c
branches/Cog/src/vm/cogit.h
branches/Cog/src/vm/cogmethod.h
branches/Cog/src/vm/cointerp.c
branches/Cog/src/vm/cointerp.h
branches/Cog/src/vm/cointerpmt.c
branches/Cog/src/vm/cointerpmt.h
branches/Cog/src/vm/gcc3x-cointerp.c
branches/Cog/src/vm/gcc3x-cointerpmt.c
branches/Cog/src/vm/interp.h
branches/Cog/src/vm/vmCallback.h
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.555 uuid: 9b99d897-eecb-4b11-97c9-7f7a75c7d8b0
+ SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- BitBltSimulation VMMaker.oscog-eem.555 uuid: 9b99d897-eecb-4b11-97c9-7f7a75c7d8b0
+ BitBltSimulation VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.555 uuid: 9b99d897-eecb-4b11-97c9-7f7a75c7d8b0 " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
@@ -344,9 +344,9 @@
};
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "BitBltPlugin VMMaker.oscog-eem.555 (i)"
+ "BitBltPlugin VMMaker.oscog-eem.569 (i)"
#else
- "BitBltPlugin VMMaker.oscog-eem.555 (e)"
+ "BitBltPlugin VMMaker.oscog-eem.569 (e)"
#endif
;
static sqInt noHalftone;
@@ -5424,6 +5424,7 @@
primitivePixelValueAt(void)
{
sqInt bitmap;
+ sqInt bitsSize;
sqInt depth;
sqInt mask;
sqInt pixel;
@@ -5458,6 +5459,10 @@
return null;
}
bitmap = fetchPointerofObject(FormBitsIndex, rcvr);
+ if (!(isWordsOrBytes(bitmap))) {
+ primitiveFail();
+ return null;
+ }
width = fetchIntegerofObject(FormWidthIndex, rcvr);
height = fetchIntegerofObject(FormHeightIndex, rcvr);
@@ -5485,10 +5490,18 @@
ppW = 32 / depth;
- /* how many words per rox of pixels */
+ /* how many words per row of pixels */
stride = (width + (ppW - 1)) / ppW;
+ bitsSize = byteSizeOf(bitmap);
+ if (!(bitsSize == ((stride * height) * 4))) {
+ /* bytes per word */
+
+ primitiveFail();
+ return null;
+ }
+
/* load the word that contains our target */
word = fetchLong32ofObject((yVal * stride) + (xVal / ppW), bitmap);
Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/cogit.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ StackToRegisterMappingCogit VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -646,8 +646,12 @@
static sqInt genGetLeafCallStackPointer(void);
static AbstractInstruction * genGetLeafCallStackPointerFunction(AbstractInstruction * self_in_genGetLeafCallStackPointerFunction);
static sqInt genInnerPICAbortTrampoline(char *name);
+static sqInt genInnerPrimitiveAsCharacterinReg(sqInt retNOffset, sqInt reg);
static sqInt genInnerPrimitiveAtPut(sqInt retNoffset);
static sqInt genInnerPrimitiveAt(sqInt retNoffset);
+static sqInt genInnerPrimitiveCharacterValue(sqInt retNOffset);
+static sqInt genInnerPrimitiveIdenticalorNotIf(sqInt retNoffset, sqInt orNot);
+static sqInt genInnerPrimitiveIdentityHash(sqInt retNOffset);
static sqInt genInnerPrimitiveNewMethod(sqInt retNoffset);
static sqInt genInnerPrimitiveNewWithArg(sqInt retNoffset);
static sqInt genInnerPrimitiveNew(sqInt retNoffset);
@@ -690,6 +694,7 @@
static sqInt genPICMissTrampolineFor(sqInt numArgs);
static sqInt genPopStackBytecode(void);
static sqInt genPrimitiveAdd(void);
+static sqInt genPrimitiveAsCharacter(void);
static sqInt genPrimitiveAsFloat(void);
static sqInt genPrimitiveAt(void);
static sqInt genPrimitiveAtPut(void);
@@ -697,6 +702,7 @@
static sqInt genPrimitiveBitOr(void);
static sqInt genPrimitiveBitShift(void);
static sqInt genPrimitiveBitXor(void);
+static sqInt genPrimitiveCharacterValue(void);
static sqInt genPrimitiveClass(void);
static sqInt genPrimitiveClosureValue(void);
static sqInt genPrimitiveDiv(void);
@@ -856,7 +862,6 @@
static sqInt isBigEndian(AbstractInstruction * self_in_isBigEndian);
static sqInt isBranch(BytecodeDescriptor * self_in_isBranch);
static sqInt isCallPreceedingReturnPC(AbstractInstruction * self_in_isCallPreceedingReturnPC, sqInt mcpc);
-static sqInt isHashSetOnInstanceCreation(void);
static sqInt isJump(AbstractInstruction * self_in_isJump);
static sqInt isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc);
static sqInt isLongJump(AbstractInstruction * self_in_isLongJump);
@@ -1901,9 +1906,12 @@
{ 0, -1, 0 },
{ 0, -1, 0 },
{ genPrimitiveNotIdentical, 1, 0 },
+ { genPrimitiveAsCharacter, -1, 0 },
+ { genPrimitiveCharacterValue, 0, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
+ { genPrimitiveIdentityHash, 0, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
@@ -1926,9 +1934,6 @@
{ 0, -1, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
- { 0, -1, 0 },
- { 0, -1, 0 },
- { 0, -1, 0 },
{ genFastPrimFail, -1, 0 },
{ genFastPrimFail, -1, 0 },
{ 0, -1, 0 },
@@ -12281,6 +12286,15 @@
/* subclasses override if they can */
static sqInt
+genInnerPrimitiveAsCharacterinReg(sqInt retNOffset, sqInt reg)
+{
+ return unimplementedPrimitive();
+}
+
+
+/* subclasses override if they can */
+
+static sqInt
genInnerPrimitiveAtPut(sqInt retNoffset)
{
return unimplementedPrimitive();
@@ -12487,6 +12501,53 @@
/* subclasses override if they can */
static sqInt
+genInnerPrimitiveCharacterValue(sqInt retNOffset)
+{
+ return unimplementedPrimitive();
+}
+
+static sqInt
+genInnerPrimitiveIdenticalorNotIf(sqInt retNoffset, sqInt orNot)
+{
+ AbstractInstruction *jumpCmp;
+
+ /* begin CmpR:R: */
+ genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
+ jumpCmp = (orNot
+ ? (/* begin JumpZero: */
+ genoperand(JumpZero, ((sqInt)0)))
+ : (/* begin JumpNonZero: */
+ genoperand(JumpNonZero, ((sqInt)0))));
+ annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject());
+ /* begin RetN: */
+ genoperand(RetN, retNoffset);
+ jmpTarget(jumpCmp, annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject()));
+ /* begin RetN: */
+ genoperand(RetN, retNoffset);
+ return 0;
+}
+
+static sqInt
+genInnerPrimitiveIdentityHash(sqInt retNOffset)
+{
+ AbstractInstruction *jumpSI;
+
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, ReceiverResultReg, ClassReg);
+ jumpSI = genJumpSmallIntegerInScratchReg(ClassReg);
+ genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg);
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
+ /* begin RetN: */
+ genoperand(RetN, retNOffset);
+ jmpTarget(jumpSI, gLabel());
+ return 0;
+}
+
+
+/* subclasses override if they can */
+
+static sqInt
genInnerPrimitiveNewMethod(sqInt retNoffset)
{
return unimplementedPrimitive();
@@ -13257,6 +13318,23 @@
}
static sqInt
+genPrimitiveAsCharacter(void)
+{
+ sqInt na;
+ sqInt r;
+
+ na = argumentCountOf(methodObj);
+ if (na <= 1) {
+ if (((r = genInnerPrimitiveAsCharacterinReg(0, (na == 0
+ ? ReceiverResultReg
+ : Arg0Reg)))) < 0) {
+ return r;
+ }
+ }
+ return compileFallbackToInterpreterPrimitive();
+}
+
+static sqInt
genPrimitiveAsFloat(void)
{
AbstractInstruction *jumpFailAlloc;
@@ -13458,7 +13536,18 @@
return 0;
}
+static sqInt
+genPrimitiveCharacterValue(void)
+{
+ sqInt r;
+ if (((r = genInnerPrimitiveCharacterValue(0))) < 0) {
+ return r;
+ }
+ return compileFallbackToInterpreterPrimitive();
+}
+
+
/* Depending on argument count the argument is either
0 args: ReceiverResultReg
1 args: Arg0Reg
@@ -13752,39 +13841,18 @@
static sqInt
genPrimitiveIdentical(void)
{
- AbstractInstruction *jumpFalse;
-
- /* begin CmpR:R: */
- genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
- /* begin JumpNonZero: */
- jumpFalse = genoperand(JumpNonZero, ((sqInt)0));
- annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject());
- /* begin RetN: */
- genoperand(RetN, 0);
- jmpTarget(jumpFalse, annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject()));
- /* begin RetN: */
- genoperand(RetN, 0);
- return 0;
+ return genInnerPrimitiveIdenticalorNotIf(0, 0);
}
static sqInt
genPrimitiveIdentityHash(void)
{
- AbstractInstruction *jumpNotSet;
- AbstractInstruction *jumpSI;
+ sqInt r;
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, ReceiverResultReg, ClassReg);
- jumpSI = genJumpSmallIntegerInScratchReg(ClassReg);
- genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg);
-
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
- /* begin RetN: */
- genoperand(RetN, 0);
-
- jmpTarget(jumpSI, gLabel());
- return 0;
+ if (((r = genInnerPrimitiveIdentityHash(0))) < 0) {
+ return r;
+ }
+ return compileFallbackToInterpreterPrimitive();
}
static sqInt
@@ -13924,19 +13992,7 @@
static sqInt
genPrimitiveNotIdentical(void)
{
- AbstractInstruction *jumpFalse;
-
- /* begin CmpR:R: */
- genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
- /* begin JumpZero: */
- jumpFalse = genoperand(JumpZero, ((sqInt)0));
- annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject());
- /* begin RetN: */
- genoperand(RetN, 0);
- jmpTarget(jumpFalse, annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject()));
- /* begin RetN: */
- genoperand(RetN, 0);
- return 0;
+ return genInnerPrimitiveIdenticalorNotIf(0, 1);
}
static sqInt
@@ -16547,12 +16603,6 @@
}
static sqInt
-isHashSetOnInstanceCreation(void)
-{
- return 1;
-}
-
-static sqInt
isJump(AbstractInstruction * self_in_isJump)
{
return ((((self_in_isJump->opcode)) >= FirstJump) && (((self_in_isJump->opcode)) <= LastJump));
Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/cogit.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/cogmethod.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
typedef struct {
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -2030,7 +2030,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.565";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.569";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -4824,6 +4824,7 @@
GIV(framePointer) = localFP;
ceEnterCogCodePopReceiverReg();
+ null;
goto l307;
}
localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4841,7 +4842,7 @@
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- /* return self */
+ null;
l307: /* end baseFrameReturn */;
goto l304;
}
@@ -5666,7 +5667,6 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
}
- null;
goto l4;
}
if (opType == 3) {
@@ -5676,7 +5676,6 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object);
- null;
goto l4;
}
if (opType == 4) {
@@ -5690,7 +5689,6 @@
object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object2);
- null;
goto l4;
}
top = longAtPointer(localSP);
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -2033,7 +2033,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.565";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.569";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -4833,6 +4833,7 @@
GIV(framePointer) = localFP;
ceEnterCogCodePopReceiverReg();
+ null;
goto l307;
}
localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4850,7 +4851,7 @@
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- /* return self */
+ null;
l307: /* end baseFrameReturn */;
goto l304;
}
@@ -5675,7 +5676,6 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
}
- null;
goto l4;
}
if (opType == 3) {
@@ -5685,7 +5685,6 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object);
- null;
goto l4;
}
if (opType == 4) {
@@ -5699,7 +5698,6 @@
object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object2);
- null;
goto l4;
}
top = longAtPointer(localSP);
Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/interp.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/nscogsrc/vm/vmCallback.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
#define VM_CALLBACK_INC 1
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
- Fri Dec 20 11:19:05 PST 2013
+ Tue Dec 24 20:04:40 PST 2013
Modified: branches/Cog/spursrc/vm/cogit.c
===================================================================
--- branches/Cog/spursrc/vm/cogit.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/cogit.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ StackToRegisterMappingCogit VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -560,9 +560,11 @@
static AbstractInstruction * genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt scratch1, sqInt scratch2);
static sqInt genCheckForInterruptsTrampoline(void);
static sqInt genConvertCharacterToCodeInReg(sqInt reg);
+static void genConvertCharacterToSmallIntegerInReg(sqInt reg);
static sqInt genConvertIntegerToCharacterInReg(sqInt reg);
static sqInt genConvertIntegerToSmallIntegerInReg(sqInt reg);
static sqInt genConvertIntegerToSmallIntegerInScratchReg(sqInt scratchReg);
+static void genConvertSmallIntegerToCharacterInReg(sqInt reg);
static sqInt genConvertSmallIntegerToIntegerInReg(sqInt reg);
static AbstractInstruction * genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder);
static sqInt genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg));
@@ -610,8 +612,12 @@
static sqInt genGetLeafCallStackPointer(void);
static AbstractInstruction * genGetLeafCallStackPointerFunction(AbstractInstruction * self_in_genGetLeafCallStackPointerFunction);
static sqInt genInnerPICAbortTrampoline(char *name);
+static sqInt genInnerPrimitiveAsCharacterinReg(sqInt retNOffset, sqInt reg);
static sqInt genInnerPrimitiveAtPut(sqInt retNoffset);
static sqInt genInnerPrimitiveAt(sqInt retNoffset);
+static sqInt genInnerPrimitiveCharacterValue(sqInt retNOffset);
+static sqInt genInnerPrimitiveIdenticalorNotIf(sqInt retNoffset, sqInt orNot);
+static sqInt genInnerPrimitiveIdentityHash(sqInt retNoffset);
static sqInt genInnerPrimitiveNewMethod(sqInt retNoffset);
static sqInt genInnerPrimitiveNewWithArg(sqInt retNoffset);
static sqInt genInnerPrimitiveNew(sqInt retNoffset);
@@ -651,6 +657,7 @@
static sqInt genPICMissTrampolineFor(sqInt numArgs);
static sqInt genPopStackBytecode(void);
static sqInt genPrimitiveAdd(void);
+static sqInt genPrimitiveAsCharacter(void);
static sqInt genPrimitiveAsFloat(void);
static sqInt genPrimitiveAt(void);
static sqInt genPrimitiveAtPut(void);
@@ -658,6 +665,7 @@
static sqInt genPrimitiveBitOr(void);
static sqInt genPrimitiveBitShift(void);
static sqInt genPrimitiveBitXor(void);
+static sqInt genPrimitiveCharacterValue(void);
static sqInt genPrimitiveClass(void);
static sqInt genPrimitiveClosureValue(void);
static sqInt genPrimitiveDiv(void);
@@ -740,6 +748,7 @@
static sqInt genSendTrampolineFornumArgscalledargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2);
static sqInt genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3);
static sqInt genSendnumArgs(sqInt selector, sqInt numArgs);
+static void genSetCharacterTagsIn(sqInt reg);
static sqInt genSetSmallIntegerTagsIn(sqInt scratchReg);
static sqInt genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg);
static sqInt genShortJumpIfFalse(void);
@@ -807,7 +816,6 @@
static sqInt isBigEndian(AbstractInstruction * self_in_isBigEndian);
static sqInt isBranch(BytecodeDescriptor * self_in_isBranch);
static sqInt isCallPreceedingReturnPC(AbstractInstruction * self_in_isCallPreceedingReturnPC, sqInt mcpc);
-static sqInt isHashSetOnInstanceCreation(void);
static sqInt isJump(AbstractInstruction * self_in_isJump);
static sqInt isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc);
static sqInt isLongJump(AbstractInstruction * self_in_isLongJump);
@@ -897,6 +905,7 @@
static AbstractInstruction * nopsFromto(AbstractInstruction * self_in_nopsFromto, sqInt startAddr, sqInt endAddr);
static sqInt noTargetsFreeInClosedPIC(CogMethod *cPIC);
static sqInt numberOfSpillsInTopNItems(sqInt n);
+static sqInt numCharacterBits(void);
static sqInt numCheckFeaturesOpcodes(AbstractInstruction * self_in_numCheckFeaturesOpcodes);
static sqInt numICacheFlushOpcodes(AbstractInstruction * self_in_numICacheFlushOpcodes);
static sqInt numLowLevelLockOpcodes(AbstractInstruction * self_in_numLowLevelLockOpcodes);
@@ -1586,9 +1595,12 @@
{ 0, -1, 0 },
{ 0, -1, 0 },
{ genPrimitiveNotIdentical, 1, 0 },
+ { genPrimitiveAsCharacter, -1, 0 },
+ { genPrimitiveCharacterValue, 0, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
+ { genPrimitiveIdentityHash, 0, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
@@ -1611,9 +1623,6 @@
{ 0, -1, 0 },
{ 0, -1, 0 },
{ 0, -1, 0 },
- { 0, -1, 0 },
- { 0, -1, 0 },
- { 0, -1, 0 },
{ genFastPrimFail, -1, 0 },
{ genFastPrimFail, -1, 0 },
{ 0, -1, 0 },
@@ -9938,6 +9947,20 @@
return 0;
}
+
+/* Convert the SmallInteger in reg to a Character, assuming
+ the SmallInteger's value is a valid character. */
+/* self assume: objectMemory smallIntegerTag = 1 */
+
+static void
+genConvertCharacterToSmallIntegerInReg(sqInt reg)
+{
+ assert(((characterTag()) == 2)
+ && (((numCharacterBits()) + 1) == (numSmallIntegerBits())));
+ /* begin LogicalShiftRightCq:R: */
+ genoperandoperand(LogicalShiftRightCqR, 1, reg);
+}
+
static sqInt
genConvertIntegerToCharacterInReg(sqInt reg)
{
@@ -9973,6 +9996,20 @@
return 0;
}
+
+/* Convert the SmallInteger in reg to a Character, assuming
+ the SmallInteger's value is a valid character. */
+/* self assume: objectMemory smallIntegerTag = 1 */
+
+static void
+genConvertSmallIntegerToCharacterInReg(sqInt reg)
+{
+ assert(((characterTag()) == 2)
+ && (((numCharacterBits()) + 1) == (numSmallIntegerBits())));
+ /* begin LogicalShiftLeftCq:R: */
+ genoperandoperand(LogicalShiftLeftCqR, 1, reg);
+}
+
static sqInt
genConvertSmallIntegerToIntegerInReg(sqInt reg)
{
@@ -11351,7 +11388,39 @@
return genTrampolineForcalledcallJumpBarnumArgsargargargargsaveRegsresultRegappendOpcodes(ceMNUFromPICMNUMethodreceiver, name, 1, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, null, 1);
}
+static sqInt
+genInnerPrimitiveAsCharacterinReg(sqInt retNOffset, sqInt reg)
+{
+ AbstractInstruction *jumpNotInt;
+ AbstractInstruction *jumpOutOfRange;
+ if (reg != ReceiverResultReg) {
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, reg, TempReg);
+ jumpNotInt = genJumpNotSmallIntegerInScratchReg(TempReg);
+ }
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, reg, TempReg);
+ genConvertSmallIntegerToIntegerInReg(TempReg);
+ /* begin CmpCq:R: */
+ genoperandoperand(CmpCqR, (1 << 30) - 1, TempReg);
+ /* begin JumpAbove: */
+ jumpOutOfRange = genoperand(JumpAbove, ((sqInt)0));
+ genConvertSmallIntegerToCharacterInReg(reg);
+ if (reg != ReceiverResultReg) {
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, reg, ReceiverResultReg);
+ }
+ /* begin RetN: */
+ genoperand(RetN, retNOffset);
+ jmpTarget(jumpOutOfRange, gLabel());
+ if (reg != ReceiverResultReg) {
+ jmpTarget(jumpNotInt, getJmpTarget(jumpOutOfRange));
+ }
+ return 0;
+}
+
+
/* Implement the guts of primitiveAtPut */
static sqInt
@@ -11751,7 +11820,74 @@
return 0;
}
+static sqInt
+genInnerPrimitiveCharacterValue(sqInt retNOffset)
+{
+ genConvertCharacterToSmallIntegerInReg(ReceiverResultReg);
+ /* begin RetN: */
+ genoperand(RetN, retNOffset);
+ return 0;
+}
+static sqInt
+genInnerPrimitiveIdenticalorNotIf(sqInt retNoffset, sqInt orNot)
+{
+ AbstractInstruction *jumpCmp;
+ AbstractInstruction *jumpImmediate;
+
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, Arg0Reg, TempReg);
+ jumpImmediate = genJumpImmediateInScratchReg(TempReg);
+ genEnsureObjInRegRegNotForwardedscratchReg(Arg0Reg, TempReg);
+ jmpTarget(jumpImmediate, gCmpRR(Arg0Reg, ReceiverResultReg));
+ jumpCmp = (orNot
+ ? (/* begin JumpZero: */
+ genoperand(JumpZero, ((sqInt)0)))
+ : (/* begin JumpNonZero: */
+ genoperand(JumpNonZero, ((sqInt)0))));
+ annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject());
+ /* begin RetN: */
+ genoperand(RetN, retNoffset);
+ jmpTarget(jumpCmp, annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject()));
+ /* begin RetN: */
+ genoperand(RetN, retNoffset);
+ return 0;
+}
+
+static sqInt
+genInnerPrimitiveIdentityHash(sqInt retNoffset)
+{
+ AbstractInstruction *jumpImm;
+ AbstractInstruction *jumpNotSet;
+ AbstractInstruction *jumpSI;
+ AbstractInstruction * ret;
+
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, ReceiverResultReg, ClassReg);
+ jumpImm = genJumpImmediateInScratchReg(ClassReg);
+ genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg);
+ /* begin CmpCq:R: */
+ genoperandoperand(CmpCqR, ConstZero, TempReg);
+ /* begin JumpZero: */
+ jumpNotSet = genoperand(JumpZero, ((sqInt)0));
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
+ /* begin RetN: */
+ ret = genoperand(RetN, 0);
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, ReceiverResultReg, ClassReg);
+ jumpSI = genJumpSmallIntegerInScratchReg(ClassReg);
+ jmpTarget(jumpSI, ret);
+ jmpTarget(jumpImm, gLabel());
+ genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg);
+ genSetCharacterTagsIn(ReceiverResultReg);
+ /* begin Jump: */
+ genoperand(Jump, ((sqInt)ret));
+ jmpTarget(jumpNotSet, gLabel());
+ return 0;
+}
+
+
/* subclasses override if they can */
static sqInt
@@ -13028,6 +13164,23 @@
}
static sqInt
+genPrimitiveAsCharacter(void)
+{
+ sqInt na;
+ sqInt r;
+
+ na = argumentCountOf(methodObj);
+ if (na <= 1) {
+ if (((r = genInnerPrimitiveAsCharacterinReg(0, (na == 0
+ ? ReceiverResultReg
+ : Arg0Reg)))) < 0) {
+ return r;
+ }
+ }
+ return compileFallbackToInterpreterPrimitive();
+}
+
+static sqInt
genPrimitiveAsFloat(void)
{
AbstractInstruction *jumpFailAlloc;
@@ -13229,7 +13382,18 @@
return 0;
}
+static sqInt
+genPrimitiveCharacterValue(void)
+{
+ sqInt r;
+ if (((r = genInnerPrimitiveCharacterValue(0))) < 0) {
+ return r;
+ }
+ return compileFallbackToInterpreterPrimitive();
+}
+
+
/* Depending on argument count the argument is either
0 args: ReceiverResultReg
1 args: Arg0Reg
@@ -13523,45 +13687,18 @@
static sqInt
genPrimitiveIdentical(void)
{
- AbstractInstruction *jumpFalse;
-
- /* begin CmpR:R: */
- genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
- /* begin JumpNonZero: */
- jumpFalse = genoperand(JumpNonZero, ((sqInt)0));
- annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject());
- /* begin RetN: */
- genoperand(RetN, 0);
- jmpTarget(jumpFalse, annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject()));
- /* begin RetN: */
- genoperand(RetN, 0);
- return 0;
+ return genInnerPrimitiveIdenticalorNotIf(0, 0);
}
static sqInt
genPrimitiveIdentityHash(void)
{
- AbstractInstruction *jumpNotSet;
- AbstractInstruction *jumpSI;
+ sqInt r;
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, ReceiverResultReg, ClassReg);
- jumpSI = genJumpSmallIntegerInScratchReg(ClassReg);
- genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg);
- /* begin CmpCq:R: */
- genoperandoperand(CmpCqR, ConstZero, TempReg);
- /* begin JumpZero: */
- jumpNotSet = genoperand(JumpZero, ((sqInt)0));
-
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
- /* begin RetN: */
- genoperand(RetN, 0);
- jmpTarget(jumpNotSet, gLabel());
- compileFallbackToInterpreterPrimitive();
-
- jmpTarget(jumpSI, gLabel());
- return 0;
+ if (((r = genInnerPrimitiveIdentityHash(0))) < 0) {
+ return r;
+ }
+ return compileFallbackToInterpreterPrimitive();
}
static sqInt
@@ -13701,19 +13838,7 @@
static sqInt
genPrimitiveNotIdentical(void)
{
- AbstractInstruction *jumpFalse;
-
- /* begin CmpR:R: */
- genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
- /* begin JumpZero: */
- jumpFalse = genoperand(JumpZero, ((sqInt)0));
- annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject());
- /* begin RetN: */
- genoperand(RetN, 0);
- jmpTarget(jumpFalse, annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject()));
- /* begin RetN: */
- genoperand(RetN, 0);
- return 0;
+ return genInnerPrimitiveIdenticalorNotIf(0, 1);
}
static sqInt
@@ -14565,6 +14690,16 @@
return genMarshalledSendnumArgs(selector, numArgs);
}
+static void
+genSetCharacterTagsIn(sqInt reg)
+{
+ sqInt quickConstant;
+
+ /* begin OrCq:R: */
+ quickConstant = characterTag();
+ genoperandoperand(OrCqR, quickConstant, reg);
+}
+
static sqInt
genSetSmallIntegerTagsIn(sqInt scratchReg)
{
@@ -15633,29 +15768,33 @@
1 & 3 collapsed to 1 for SmallIntegers, and 2 collapsed to 0 for
Characters), or
the receiver's classIndex. Generate something like this:
+ Limm:
+ andl $0x1, rDest
+ j Lcmp
Lentry:
movl rSource, rDest
andl $0x3, rDest
- jz LnotImm
- andl $1, rDest
- j Lcmp
- LnotImm:
+ jnz Limm
movl 0(%edx), rDest
andl $0x3fffff, rDest
Lcmp:
- At least on a 2.2GHz Intel Core i7 it is slightly faster,
- 136m sends/sec vs 130m sends/sec for nfib in tinyBenchmarks, than
- Limm:
- andl $0x1, rDest
- j Lcmp
+ At least on a 2.2GHz Intel Core i7 the following is slightly faster than
+ the above,
+ 136m sends/sec vs 130m sends/sec for nfib in tinyBenchmarks
Lentry:
movl rSource, rDest
andl $0x3, rDest
- jnz Limm
+ jz LnotImm
+ andl $1, rDest
+ j Lcmp
+ LnotImm:
movl 0(%edx), rDest
andl $0x3fffff, rDest
Lcmp:
- */
+ But we expect most SMallInteger arithmetic to be performwd in-line and so
+ prefer the
+ version that is faster for non-immediates (because it branches for
+ immediates only). */
static AbstractInstruction *
getInlineCacheClassTagFrominto(sqInt sourceReg, sqInt destReg)
@@ -15669,23 +15808,31 @@
sqInt quickConstant2;
/* begin AlignmentNops: */
- genoperand(AlignmentNops, ((BytesPerWord < 8) ? 8 : BytesPerWord));
+ genoperand(AlignmentNops, BytesPerWord);
/* begin Label */
+ immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ /* begin AndCq:R: */
+ genoperandoperand(AndCqR, 1, destReg);
+ /* begin Jump: */
+ jumpCompare = genoperand(Jump, ((sqInt)0));
+ /* begin AlignmentNops: */
+ genoperand(AlignmentNops, BytesPerWord);
+ /* begin Label */
entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
/* begin MoveR:R: */
genoperandoperand(MoveRR, sourceReg, destReg);
/* begin AndCq:R: */
- quickConstant = tagMask();
- genoperandoperand(AndCqR, quickConstant, destReg);
- /* begin JumpZero: */
- jumpNotImm = genoperand(JumpZero, ((sqInt)0));
+ quickConstant1 = tagMask();
+ genoperandoperand(AndCqR, quickConstant1, destReg);
+ /* begin JumpNonZero: */
+ genoperand(JumpNonZero, ((sqInt)immLabel));
+ flag("endianness");
+ /* begin MoveMw:r:R: */
+ genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg);
/* begin AndCq:R: */
- genoperandoperand(AndCqR, 1, destReg);
- /* begin Jump: */
- jumpCompare = genoperand(Jump, ((sqInt)0));
- flag("endianness");
- jmpTarget(jumpNotImm, gMoveMwrR(0, sourceReg, destReg));
- jmpTarget(jumpCompare, gAndCqR(classIndexMask(), destReg));
+ quickConstant2 = classIndexMask();
+ genoperandoperand(AndCqR, quickConstant2, destReg);
+ jmpTarget(jumpCompare, gLabel());
return entryLabel;
}
@@ -16214,12 +16361,6 @@
}
static sqInt
-isHashSetOnInstanceCreation(void)
-{
- return 0;
-}
-
-static sqInt
isJump(AbstractInstruction * self_in_isJump)
{
return ((((self_in_isJump->opcode)) >= FirstJump) && (((self_in_isJump->opcode)) <= LastJump));
@@ -17915,7 +18056,13 @@
return 0;
}
+static sqInt
+numCharacterBits(void)
+{
+ return 30;
+}
+
/* Answer the number of opcodes required to compile the CPUID call to extract
the extended features information.
*/
Modified: branches/Cog/spursrc/vm/cogit.h
===================================================================
--- branches/Cog/spursrc/vm/cogit.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/cogit.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
Modified: branches/Cog/spursrc/vm/cogmethod.h
===================================================================
--- branches/Cog/spursrc/vm/cogmethod.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/cogmethod.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
typedef struct {
Modified: branches/Cog/spursrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/cointerp.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/cointerp.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -2162,7 +2162,7 @@
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.565]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.569]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -6363,6 +6363,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -6372,6 +6373,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -6399,6 +6401,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -26020,8 +26023,7 @@
sqInt
isCharacterValue(sqInt anInteger)
{
- return (anInteger >= 0)
- && (anInteger < (pow(2,30)));
+ return ((anInteger >= 0) && (anInteger <= ((1 << 30) - 1)));
}
sqInt
@@ -32348,8 +32350,7 @@
characterCode = longAt(GIV(stackPointer));
if (!(((characterCode & 1))
&& (((characterCode = (characterCode >> 1)),
- (characterCode >= 0)
- && (characterCode < (pow(2,30))))))) {
+ ((characterCode >= 0) && (characterCode <= ((1 << 30) - 1))))))) {
/* begin primitiveFailFor: */
reasonCode = (GIV(argumentCount) == 0
? PrimErrBadReceiver
Modified: branches/Cog/spursrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursrc/vm/cointerp.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/cointerp.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
Modified: branches/Cog/spursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/gcc3x-cointerp.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/gcc3x-cointerp.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -2165,7 +2165,7 @@
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.565]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.569]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -6372,6 +6372,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -6381,6 +6382,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -6408,6 +6410,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -26029,8 +26032,7 @@
sqInt
isCharacterValue(sqInt anInteger)
{
- return (anInteger >= 0)
- && (anInteger < (pow(2,30)));
+ return ((anInteger >= 0) && (anInteger <= ((1 << 30) - 1)));
}
sqInt
@@ -32357,8 +32359,7 @@
characterCode = longAt(GIV(stackPointer));
if (!(((characterCode & 1))
&& (((characterCode = (characterCode >> 1)),
- (characterCode >= 0)
- && (characterCode < (pow(2,30))))))) {
+ ((characterCode >= 0) && (characterCode <= ((1 << 30) - 1))))))) {
/* begin primitiveFailFor: */
reasonCode = (GIV(argumentCount) == 0
? PrimErrBadReceiver
Modified: branches/Cog/spursrc/vm/interp.h
===================================================================
--- branches/Cog/spursrc/vm/interp.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/interp.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/spursrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spursrc/vm/vmCallback.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spursrc/vm/vmCallback.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
#define VM_CALLBACK_INC 1
Modified: branches/Cog/spurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/spurstacksrc/vm/gcc3x-interp.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spurstacksrc/vm/gcc3x-interp.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- StackInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ StackInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1955,7 +1955,7 @@
0 };
char * breakSelector;
sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.565]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.569]";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -23370,8 +23370,7 @@
sqInt
isCharacterValue(sqInt anInteger)
{
- return (anInteger >= 0)
- && (anInteger < (pow(2,30)));
+ return ((anInteger >= 0) && (anInteger <= ((1 << 30) - 1)));
}
@@ -28857,8 +28856,7 @@
characterCode = longAt(GIV(stackPointer));
if (!(((characterCode & 1))
&& (((characterCode = (characterCode >> 1)),
- (characterCode >= 0)
- && (characterCode < (pow(2,30))))))) {
+ ((characterCode >= 0) && (characterCode <= ((1 << 30) - 1))))))) {
/* begin primitiveFailFor: */
reasonCode = (GIV(argumentCount) == 0
? PrimErrBadReceiver
Modified: branches/Cog/spurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/spurstacksrc/vm/interp.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spurstacksrc/vm/interp.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- StackInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ StackInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1952,7 +1952,7 @@
0 };
char * breakSelector;
sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.565]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.569]";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -23361,8 +23361,7 @@
sqInt
isCharacterValue(sqInt anInteger)
{
- return (anInteger >= 0)
- && (anInteger < (pow(2,30)));
+ return ((anInteger >= 0) && (anInteger <= ((1 << 30) - 1)));
}
@@ -28848,8 +28847,7 @@
characterCode = longAt(GIV(stackPointer));
if (!(((characterCode & 1))
&& (((characterCode = (characterCode >> 1)),
- (characterCode >= 0)
- && (characterCode < (pow(2,30))))))) {
+ ((characterCode >= 0) && (characterCode <= ((1 << 30) - 1))))))) {
/* begin primitiveFailFor: */
reasonCode = (GIV(argumentCount) == 0
? PrimErrBadReceiver
Modified: branches/Cog/spurstacksrc/vm/interp.h
===================================================================
--- branches/Cog/spurstacksrc/vm/interp.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spurstacksrc/vm/interp.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/spurstacksrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spurstacksrc/vm/vmCallback.h 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/spurstacksrc/vm/vmCallback.h 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
#define VM_CALLBACK_INC 1
Modified: branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+ SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- BitBltSimulation VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+ BitBltSimulation VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47 " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
@@ -344,9 +344,9 @@
};
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "BitBltPlugin VMMaker.oscog-eem.554 (i)"
+ "BitBltPlugin VMMaker.oscog-eem.569 (i)"
#else
- "BitBltPlugin VMMaker.oscog-eem.554 (e)"
+ "BitBltPlugin VMMaker.oscog-eem.569 (e)"
#endif
;
static sqInt noHalftone;
@@ -5424,6 +5424,7 @@
primitivePixelValueAt(void)
{
sqInt bitmap;
+ sqInt bitsSize;
sqInt depth;
sqInt mask;
sqInt pixel;
@@ -5458,6 +5459,10 @@
return null;
}
bitmap = fetchPointerofObject(FormBitsIndex, rcvr);
+ if (!(isWordsOrBytes(bitmap))) {
+ primitiveFail();
+ return null;
+ }
width = fetchIntegerofObject(FormWidthIndex, rcvr);
height = fetchIntegerofObject(FormHeightIndex, rcvr);
@@ -5485,10 +5490,18 @@
ppW = 32 / depth;
- /* how many words per rox of pixels */
+ /* how many words per row of pixels */
stride = (width + (ppW - 1)) / ppW;
+ bitsSize = byteSizeOf(bitmap);
+ if (!(bitsSize == ((stride * height) * 4))) {
+ /* bytes per word */
+
+ primitiveFail();
+ return null;
+ }
+
/* load the word that contains our target */
word = fetchLong32ofObject((yVal * stride) + (xVal / ppW), bitmap);
Modified: branches/Cog/src/vm/cogit.c
===================================================================
--- branches/Cog/src/vm/cogit.c 2013-12-21 17:06:08 UTC (rev 2835)
+++ branches/Cog/src/vm/cogit.c 2013-12-25 04:06:57 UTC (rev 2836)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ CCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379
+ StackToRegisterMappingCogit VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.565 uuid: aa89a317-26e5-404d-aaff-e2433a344379 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -617,8 +617,12 @@
static sqInt genGetLeafCallStackPointer(void);
static AbstractInstruction * genGetLeafCallStackPointerFunction(AbstractInstruction * self_in_genGetLeafCallStackPointerFunction);
static sqInt genInnerPICAbortTrampoline(char *name);
+static sqInt genInnerPrimitiveAsCharacterinReg(sqInt retNOffset, sqInt reg);
static sqInt genInnerPrimitiveAtPut(sqInt retNoffset);
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list