[Vm-dev] [commit][3558] CogVM source as per VMMaker.oscog-eem.1642
commits at squeakvm.org
commits at squeakvm.org
Sat Jan 16 15:53:06 UTC 2016
Revision: 3558
Author: eliot
Date: 2016-01-16 07:53:04 -0800 (Sat, 16 Jan 2016)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1642
x64 Cogit:
Fix at least some of the bounds checking issues in Spur's
genPrimitiveStringAt[Put].
Modified Paths:
--------------
branches/Cog/nsspursrc/vm/cogit.h
branches/Cog/nsspursrc/vm/cogitARMv5.c
branches/Cog/nsspursrc/vm/cogitIA32.c
branches/Cog/nsspursrc/vm/cogitMIPSEL.c
branches/Cog/nsspursrc/vm/cointerp.c
branches/Cog/nsspursrc/vm/cointerp.h
branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
branches/Cog/nsspurstack64src/vm/interp.c
branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
branches/Cog/nsspurstacksrc/vm/interp.c
branches/Cog/spur64src/vm/cogit.h
branches/Cog/spur64src/vm/cogitX64.c
branches/Cog/spur64src/vm/cointerp.c
branches/Cog/spur64src/vm/cointerp.h
branches/Cog/spur64src/vm/gcc3x-cointerp.c
branches/Cog/spursistasrc/vm/cogit.h
branches/Cog/spursistasrc/vm/cogitARMv5.c
branches/Cog/spursistasrc/vm/cogitIA32.c
branches/Cog/spursistasrc/vm/cogitMIPSEL.c
branches/Cog/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cogitARMv5.c
branches/Cog/spursrc/vm/cogitIA32.c
branches/Cog/spursrc/vm/cogitMIPSEL.c
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spurstack64src/vm/gcc3x-interp.c
branches/Cog/spurstack64src/vm/interp.c
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/src/vm/cogit.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/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h 2016-01-16 05:33:04 UTC (rev 3557)
+++ branches/Cog/nsspursrc/vm/cogit.h 2016-01-16 15:53:04 UTC (rev 3558)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1641 uuid: a1fef138-fa26-4a09-b0c1-1e7be82e14a8
+ CCodeGenerator VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
*/
Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c 2016-01-16 05:33:04 UTC (rev 3557)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c 2016-01-16 15:53:04 UTC (rev 3558)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9
+ CCodeGenerator VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -1005,7 +1005,6 @@
static sqInt genLongUnconditionalForwardJump(void);
static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
-static AbstractInstruction * NoDbgRegParms genMoveFalseR(sqInt reg);
static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
@@ -1104,7 +1103,6 @@
static sqInt genPopStackBytecode(void);
static sqInt genPrimitiveClosureValue(void);
static sqInt genPrimitivePerform(void);
-static AbstractInstruction * genPrimReturn(void);
static sqInt genPushActiveContextBytecode(void);
static sqInt genPushClosureCopyCopiedValuesBytecode(void);
static sqInt NoDbgRegParms genPushEnclosingObjectAt(sqInt level);
@@ -10447,12 +10445,12 @@
generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
{
unsigned char annotation;
- sqInt delta;
+ usqInt delta;
sqInt i;
AbstractInstruction *instruction;
sqInt length;
- sqInt location;
- sqInt mapEntry;
+ usqInt location;
+ usqInt mapEntry;
sqInt maxDelta;
usqInt mcpc;
@@ -15516,7 +15514,7 @@
/* FP jumps are a little weird */
jumpCond = jumpOpcodeGenerator(0);
- /* begin genMoveFalseR: */
+ /* begin genMoveConstant:R: */
constant = falseObject();
if (shouldAnnotateObjectReference(constant)) {
annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -16342,7 +16340,7 @@
/* begin CmpR:R: */
genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
jumpTrue = genConditionalBranchoperand(jumpOpcode, 0);
- /* begin genMoveFalseR: */
+ /* begin genMoveConstant:R: */
constant = falseObject();
if (shouldAnnotateObjectReference(constant)) {
annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -16413,7 +16411,7 @@
/* FP jumps are a little weird */
jumpCond = jumpFPOpcodeGenerator(0);
- /* begin genMoveFalseR: */
+ /* begin genMoveConstant:R: */
constant = falseObject();
if (shouldAnnotateObjectReference(constant)) {
annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -18542,7 +18540,6 @@
{
AbstractInstruction *anInstruction;
AbstractInstruction *anInstruction1;
- AbstractInstruction *anInstruction10;
AbstractInstruction *anInstruction2;
AbstractInstruction *anInstruction3;
AbstractInstruction *anInstruction4;
@@ -18557,9 +18554,9 @@
AbstractInstruction *jumpBytesOutOfBounds;
AbstractInstruction *jumpIsBytes;
AbstractInstruction *jumpIsShorts;
- AbstractInstruction *jumpIsWords;
AbstractInstruction *jumpNotIndexable;
AbstractInstruction *jumpShortsOutOfBounds;
+ AbstractInstruction *jumpWordsDone;
AbstractInstruction *jumpWordsOutOfBounds;
AbstractInstruction *jumpWordTooBig;
sqInt quickConstant;
@@ -18607,15 +18604,31 @@
if (usesOutOfLineLiteral(anInstruction4)) {
(anInstruction4->dependent = locateLiteral(quickConstant2));
}
- /* begin JumpGreaterOrEqual: */
- jumpIsWords = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpLess: */
+ jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0));
+ /* begin CmpR:R: */
+ genoperandoperand(CmpRR, Arg1Reg, ClassReg);
+ /* begin JumpBelowOrEqual: */
+ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
+ /* begin AddCq:R: */
+ quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
+ /* begin gen:quickConstant:operand: */
+ anInstruction5 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg);
+ if (usesOutOfLineLiteral(anInstruction5)) {
+ (anInstruction5->dependent = locateLiteral(quickConstant3));
+ }
+ /* begin MoveXwr:R:R: */
+ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg);
+ jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg);
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
/* begin Jump: */
- jumpNotIndexable = genoperand(Jump, ((sqInt)0));
+ jumpWordsDone = genoperand(Jump, ((sqInt)0));
jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg));
/* begin AndCq:R: */
- anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg);
- if (usesOutOfLineLiteral(anInstruction5)) {
- (anInstruction5->dependent = locateLiteral(BytesPerWord - 1));
+ anInstruction6 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg);
+ if (usesOutOfLineLiteral(anInstruction6)) {
+ (anInstruction6->dependent = locateLiteral(BytesPerWord - 1));
}
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
@@ -18624,14 +18637,13 @@
/* begin JumpBelowOrEqual: */
jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
/* begin AddCq:R: */
- anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg);
- if (usesOutOfLineLiteral(anInstruction6)) {
- (anInstruction6->dependent = locateLiteral(BaseHeaderSize));
+ anInstruction7 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg);
+ if (usesOutOfLineLiteral(anInstruction7)) {
+ (anInstruction7->dependent = locateLiteral(BaseHeaderSize));
}
/* begin MoveXbr:R:R: */
genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg);
- /* begin Label */
- done = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ jmpTarget(jumpWordsDone, (done = gLabel()));
genConvertIntegerToCharacterInReg(ReceiverResultReg);
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
@@ -18639,9 +18651,11 @@
genoperand(RetN, 0);
jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg));
/* begin AndCq:R: */
- anInstruction7 = genoperandoperand(AndCqR, 1, formatReg);
- if (usesOutOfLineLiteral(anInstruction7)) {
- (anInstruction7->dependent = locateLiteral(1));
+ quickConstant4 = (BytesPerWord / 1) - 1;
+ /* begin gen:quickConstant:operand: */
+ anInstruction8 = genoperandoperand(AndCqR, quickConstant4, formatReg);
+ if (usesOutOfLineLiteral(anInstruction8)) {
+ (anInstruction8->dependent = locateLiteral(quickConstant4));
}
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
@@ -18652,37 +18666,13 @@
/* begin AddR:R: */
genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg);
/* begin MoveM16:r:R: */
- anInstruction8 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg);
- if (usesOutOfLineLiteral(anInstruction8)) {
- (anInstruction8->dependent = locateLiteral(BaseHeaderSize));
- }
- /* begin Jump: */
- genoperand(Jump, ((sqInt)done));
- jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, ClassReg));
- /* begin JumpBelowOrEqual: */
- jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
- /* begin AddCq:R: */
- quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
- /* begin gen:quickConstant:operand: */
- anInstruction9 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg);
+ anInstruction9 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg);
if (usesOutOfLineLiteral(anInstruction9)) {
- (anInstruction9->dependent = locateLiteral(quickConstant3));
+ (anInstruction9->dependent = locateLiteral(BaseHeaderSize));
}
- /* begin MoveXwr:R:R: */
- genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg);
- /* begin SubCq:R: */
- quickConstant4 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
- /* begin gen:quickConstant:operand: */
- anInstruction10 = genoperandoperand(SubCqR, quickConstant4, Arg1Reg);
- if (usesOutOfLineLiteral(anInstruction10)) {
- (anInstruction10->dependent = locateLiteral(quickConstant4));
- }
- jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg);
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
/* begin Jump: */
genoperand(Jump, ((sqInt)done));
- jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpWordTooBig, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel()))))));
+ jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel()))))));
return CompletePrimitive;
}
@@ -18716,13 +18706,12 @@
AbstractInstruction * jumpIsCompiledMethod;
AbstractInstruction *jumpIsShorts;
AbstractInstruction * jumpNotString;
- AbstractInstruction *jumpShortsDone;
AbstractInstruction *jumpShortsOutOfBounds;
AbstractInstruction *jumpShortsOutOfRange;
- AbstractInstruction *jumpWordsDone;
AbstractInstruction *jumpWordsOutOfBounds;
AbstractInstruction *jumpWordsOutOfRange;
sqInt operandOne;
+ sqInt operandOne1;
sqInt quickConstant;
sqInt quickConstant1;
sqInt quickConstant2;
@@ -18752,8 +18741,8 @@
if (usesOutOfLineLiteral(anInstruction)) {
(anInstruction->dependent = locateLiteral(quickConstant));
}
- /* begin JumpBelowOrEqual: */
- jumpNotString = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
+ /* begin JumpBelow: */
+ jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0));
/* begin CmpCq:R: */
quickConstant1 = firstCompiledMethodFormat();
/* begin gen:quickConstant:operand: */
@@ -18770,8 +18759,8 @@
if (usesOutOfLineLiteral(anInstruction2)) {
(anInstruction2->dependent = locateLiteral(quickConstant2));
}
- /* begin JumpGreaterOrEqual: */
- jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpAboveOrEqual: */
+ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0));
/* begin CmpCq:R: */
quickConstant3 = firstShortFormat();
/* begin gen:quickConstant:operand: */
@@ -18779,8 +18768,8 @@
if (usesOutOfLineLiteral(anInstruction3)) {
(anInstruction3->dependent = locateLiteral(quickConstant3));
}
- /* begin JumpGreaterOrEqual: */
- jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpAboveOrEqual: */
+ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0));
/* begin CmpCq:R: */
anInstruction4 = genoperandoperand(CmpCqR, 0, Arg1Reg);
if (usesOutOfLineLiteral(anInstruction4)) {
@@ -18806,17 +18795,21 @@
genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- /* begin Jump: */
- jumpWordsDone = genoperand(Jump, ((sqInt)0));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpIsShorts, gCmpCqR(characterObjectOf(0xFFFF), Arg1Reg));
/* begin JumpAbove: */
jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0));
/* begin LogicalShiftLeftCq:R: */
genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg);
/* begin AndCq:R: */
- anInstruction6 = genoperandoperand(AndCqR, 1, formatReg);
+ operandOne1 = (BytesPerWord / 2) - 1;
+ /* begin checkQuickConstant:forInstruction: */
+ anInstruction6 = genoperandoperand(AndCqR, operandOne1, formatReg);
if (usesOutOfLineLiteral(anInstruction6)) {
- (anInstruction6->dependent = locateLiteral(1));
+ (anInstruction6->dependent = locateLiteral(operandOne1));
}
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
@@ -18836,8 +18829,10 @@
}
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- /* begin Jump: */
- jumpShortsDone = genoperand(Jump, ((sqInt)0));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpIsBytes, gCmpCqR(characterObjectOf(0xFF), Arg1Reg));
/* begin JumpAbove: */
jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0));
@@ -18866,7 +18861,10 @@
genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- jmpTarget(jumpShortsDone, jmpTarget(jumpWordsDone, genPrimReturn()));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel()))))))));
/* begin AddCq:R: */
anInstruction9 = genoperandoperand(AddCqR, 1, Arg0Reg);
@@ -20506,7 +20504,7 @@
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpCmp, genMoveFalseR(ReceiverResultReg));
+ jmpTarget(jumpCmp, genMoveConstantR(falseObject(), ReceiverResultReg));
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
@@ -23471,25 +23469,6 @@
anInstruction));
}
- /* SimpleStackBasedCogit>>#genMoveFalseR: */
-static AbstractInstruction * NoDbgRegParms
-genMoveFalseR(sqInt reg)
-{
- AbstractInstruction *anInstruction;
- sqInt constant;
-
- /* begin genMoveConstant:R: */
- constant = falseObject();
- return (shouldAnnotateObjectReference(constant)
- ? annotateobjRef(gMoveCwR(constant, reg), constant)
- : (/* begin MoveCq:R: */
- (anInstruction = genoperandoperand(MoveCqR, constant, reg)),
- (usesOutOfLineLiteral(anInstruction)
- ? (anInstruction->dependent = locateLiteral(constant))
- : 0),
- anInstruction));
-}
-
/* SimpleStackBasedCogit>>#genMoveTrueR: */
static sqInt NoDbgRegParms
genMoveTrueR(sqInt reg)
@@ -26331,22 +26310,6 @@
return genLookupForPerformNumArgs(methodOrBlockNumArgs);
}
-
-/* Generate a return that cuts back the stack to remove the receiver
- and arguments after an invocation of a primitive with nargs arguments.
- Since all primitives that succeed in the normal way (i.e. don't execute a
- method as do genPrimitiveClosureValue and genPrimitivePerform) take only
- register arguments, there is nothing to do. */
-
- /* StackToRegisterMappingCogit>>#genPrimReturn */
-static AbstractInstruction *
-genPrimReturn(void)
-{
- assert(methodOrBlockNumArgs <= (numRegArgs()));
- /* begin RetN: */
- return genoperand(RetN, 0);
-}
-
/* StackToRegisterMappingCogit>>#genPushActiveContextBytecode */
static sqInt
genPushActiveContextBytecode(void)
Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c 2016-01-16 05:33:04 UTC (rev 3557)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c 2016-01-16 15:53:04 UTC (rev 3558)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9
+ CCodeGenerator VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -843,7 +843,7 @@
static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg);
static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver);
-static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
+static sqInt NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg);
static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg);
static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg);
@@ -1028,7 +1028,6 @@
static sqInt genPopStackBytecode(void);
static sqInt genPrimitiveClosureValue(void);
static sqInt genPrimitivePerform(void);
-static AbstractInstruction * genPrimReturn(void);
static sqInt genPushActiveContextBytecode(void);
static sqInt genPushClosureCopyCopiedValuesBytecode(void);
static sqInt NoDbgRegParms genPushEnclosingObjectAt(sqInt level);
@@ -10958,7 +10957,8 @@
literal = literalBeforeFollowingAddress(backEnd, mcpc);
mappedLiteral = remapObject(literal);
if (mappedLiteral != literal) {
- storeLiteralbeforeFollowingAddress(backEnd, mappedLiteral, mcpc);
+ /* begin storeLiteral:atAnnotatedAddress:using: */
+ storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), mappedLiteral, mcpc);
codeModified = 1;
}
}
@@ -12670,7 +12670,8 @@
if (couldBeObject(literal)) {
mappedLiteral = remapObject(literal);
if (literal != mappedLiteral) {
- storeLiteralbeforeFollowingAddress(backEnd, mappedLiteral, ((usqInt)mcpc));
+ /* begin storeLiteral:atAnnotatedAddress:using: */
+ storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), mappedLiteral, ((usqInt)mcpc));
codeModified = 1;
}
if ((hasYoungPtr != 0)
@@ -17240,7 +17241,6 @@
{
AbstractInstruction *anInstruction;
AbstractInstruction *anInstruction1;
- AbstractInstruction *anInstruction10;
AbstractInstruction *anInstruction2;
AbstractInstruction *anInstruction3;
AbstractInstruction *anInstruction4;
@@ -17255,9 +17255,9 @@
AbstractInstruction *jumpBytesOutOfBounds;
AbstractInstruction *jumpIsBytes;
AbstractInstruction *jumpIsShorts;
- AbstractInstruction *jumpIsWords;
AbstractInstruction *jumpNotIndexable;
AbstractInstruction *jumpShortsOutOfBounds;
+ AbstractInstruction *jumpWordsDone;
AbstractInstruction *jumpWordsOutOfBounds;
AbstractInstruction *jumpWordTooBig;
sqInt literal;
@@ -17266,6 +17266,7 @@
sqInt quickConstant1;
sqInt quickConstant2;
sqInt quickConstant3;
+ sqInt quickConstant4;
/* begin genLoadArgAtDepth:into: */
assert(0 < (numRegArgs()));
@@ -17294,14 +17295,27 @@
quickConstant2 = firstLongFormat();
/* begin gen:quickConstant:operand: */
anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg);
- /* begin JumpGreaterOrEqual: */
- jumpIsWords = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpLess: */
+ jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0));
+ /* begin CmpR:R: */
+ genoperandoperand(CmpRR, Arg1Reg, ClassReg);
+ /* begin JumpBelowOrEqual: */
+ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
+ /* begin AddCq:R: */
+ quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
+ /* begin gen:quickConstant:operand: */
+ anInstruction5 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg);
+ /* begin MoveXwr:R:R: */
+ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg);
+ jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg);
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
/* begin Jump: */
- jumpNotIndexable = genoperand(Jump, ((sqInt)0));
+ jumpWordsDone = genoperand(Jump, ((sqInt)0));
jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg));
/* begin AndCq:R: */
literal = BytesPerWord - 1;
- anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg);
+ anInstruction6 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg);
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
/* begin CmpR:R: */
@@ -17310,11 +17324,10 @@
jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
/* begin AddCq:R: */
literal1 = BaseHeaderSize;
- anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg);
+ anInstruction7 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg);
/* begin MoveXbr:R:R: */
genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg);
- /* begin Label */
- done = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ jmpTarget(jumpWordsDone, (done = gLabel()));
genConvertIntegerToCharacterInReg(ReceiverResultReg);
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
@@ -17322,7 +17335,9 @@
genoperand(RetN, 0);
jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg));
/* begin AndCq:R: */
- anInstruction7 = genoperandoperand(AndCqR, 1, formatReg);
+ quickConstant4 = (BytesPerWord / 1) - 1;
+ /* begin gen:quickConstant:operand: */
+ anInstruction8 = genoperandoperand(AndCqR, quickConstant4, formatReg);
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
/* begin CmpR:R: */
@@ -17332,26 +17347,10 @@
/* begin AddR:R: */
genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg);
/* begin MoveM16:r:R: */
- anInstruction8 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg);
+ anInstruction9 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg);
/* begin Jump: */
genoperand(Jump, ((sqInt)done));
- jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, ClassReg));
- /* begin JumpBelowOrEqual: */
- jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
- /* begin AddCq:R: */
- quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
- /* begin gen:quickConstant:operand: */
- anInstruction9 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg);
- /* begin MoveXwr:R:R: */
- genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg);
- /* begin SubCq:R: */
- anInstruction10 = genoperandoperand(SubCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg);
- jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg);
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
- /* begin Jump: */
- genoperand(Jump, ((sqInt)done));
- jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpWordTooBig, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel()))))));
+ jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel()))))));
return CompletePrimitive;
}
@@ -17385,10 +17384,8 @@
AbstractInstruction * jumpIsCompiledMethod;
AbstractInstruction *jumpIsShorts;
AbstractInstruction * jumpNotString;
- AbstractInstruction *jumpShortsDone;
AbstractInstruction *jumpShortsOutOfBounds;
AbstractInstruction *jumpShortsOutOfRange;
- AbstractInstruction *jumpWordsDone;
AbstractInstruction *jumpWordsOutOfBounds;
AbstractInstruction *jumpWordsOutOfRange;
sqInt quickConstant;
@@ -17414,8 +17411,8 @@
quickConstant = firstLongFormat();
/* begin gen:quickConstant:operand: */
anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg);
- /* begin JumpBelowOrEqual: */
- jumpNotString = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
+ /* begin JumpBelow: */
+ jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0));
/* begin CmpCq:R: */
quickConstant1 = firstCompiledMethodFormat();
/* begin gen:quickConstant:operand: */
@@ -17426,14 +17423,14 @@
quickConstant2 = firstByteFormat();
/* begin gen:quickConstant:operand: */
anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg);
- /* begin JumpGreaterOrEqual: */
- jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpAboveOrEqual: */
+ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0));
/* begin CmpCq:R: */
quickConstant3 = firstShortFormat();
/* begin gen:quickConstant:operand: */
anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg);
- /* begin JumpGreaterOrEqual: */
- jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpAboveOrEqual: */
+ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0));
/* begin CmpCq:R: */
anInstruction4 = genoperandoperand(CmpCqR, 0, Arg1Reg);
/* begin JumpLess: */
@@ -17451,15 +17448,17 @@
genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- /* begin Jump: */
- jumpWordsDone = genoperand(Jump, ((sqInt)0));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpIsShorts, gCmpCqR(characterObjectOf(0xFFFF), Arg1Reg));
/* begin JumpAbove: */
jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0));
/* begin LogicalShiftLeftCq:R: */
genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg);
/* begin AndCq:R: */
- anInstruction6 = genoperandoperand(AndCqR, 1, formatReg);
+ anInstruction6 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg);
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
/* begin CmpR:R: */
@@ -17475,8 +17474,10 @@
anInstruction11 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- /* begin Jump: */
- jumpShortsDone = genoperand(Jump, ((sqInt)0));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpIsBytes, gCmpCqR(characterObjectOf(0xFF), Arg1Reg));
/* begin JumpAbove: */
jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0));
@@ -17499,7 +17500,10 @@
genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- jmpTarget(jumpShortsDone, jmpTarget(jumpWordsDone, genPrimReturn()));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel()))))))));
/* begin AddCq:R: */
anInstruction9 = genoperandoperand(AddCqR, 1, Arg0Reg);
@@ -18380,7 +18384,7 @@
}
/* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */
-static AbstractInstruction * NoDbgRegParms
+static sqInt NoDbgRegParms
genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg)
{
return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1);
@@ -23641,22 +23645,6 @@
return genLookupForPerformNumArgs(methodOrBlockNumArgs);
}
-
-/* Generate a return that cuts back the stack to remove the receiver
- and arguments after an invocation of a primitive with nargs arguments.
- Since all primitives that succeed in the normal way (i.e. don't execute a
- method as do genPrimitiveClosureValue and genPrimitivePerform) take only
- register arguments, there is nothing to do. */
-
- /* StackToRegisterMappingCogit>>#genPrimReturn */
-static AbstractInstruction *
-genPrimReturn(void)
-{
- assert(methodOrBlockNumArgs <= (numRegArgs()));
- /* begin RetN: */
- return genoperand(RetN, 0);
-}
-
/* StackToRegisterMappingCogit>>#genPushActiveContextBytecode */
static sqInt
genPushActiveContextBytecode(void)
Modified: branches/Cog/nsspursrc/vm/cogitMIPSEL.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitMIPSEL.c 2016-01-16 05:33:04 UTC (rev 3557)
+++ branches/Cog/nsspursrc/vm/cogitMIPSEL.c 2016-01-16 15:53:04 UTC (rev 3558)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9
+ CCodeGenerator VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1639 uuid: 0607da54-875d-4632-95f3-ce5b0d6d3bf9 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -761,7 +761,7 @@
static usqInt NoDbgRegParms concretizeAddCwR(AbstractInstruction * self_in_concretizeAddCwR);
static usqInt NoDbgRegParms concretizeAddRR(AbstractInstruction * self_in_concretizeAddRR);
static AbstractInstruction * NoDbgRegParms concretizeAlignmentNops(AbstractInstruction * self_in_concretizeAlignmentNops);
-static usqInt NoDbgRegParms concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR);
+static sqInt NoDbgRegParms concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR);
static usqInt NoDbgRegParms concretizeAndCqRR(AbstractInstruction * self_in_concretizeAndCqRR);
static usqInt NoDbgRegParms concretizeAndCwR(AbstractInstruction * self_in_concretizeAndCwR);
static usqInt NoDbgRegParms concretizeAndRR(AbstractInstruction * self_in_concretizeAndRR);
@@ -780,7 +780,7 @@
static usqInt NoDbgRegParms concretizeBrUnsignedGreaterRR(AbstractInstruction * self_in_concretizeBrUnsignedGreaterRR);
static usqInt NoDbgRegParms concretizeBrUnsignedLessEqualRR(AbstractInstruction * self_in_concretizeBrUnsignedLessEqualRR);
static usqInt NoDbgRegParms concretizeBrUnsignedLessRR(AbstractInstruction * self_in_concretizeBrUnsignedLessRR);
-static sqInt NoDbgRegParms concretizeCall(AbstractInstruction * self_in_concretizeCall);
+static usqInt NoDbgRegParms concretizeCall(AbstractInstruction * self_in_concretizeCall);
static usqInt NoDbgRegParms concretizeCallFull(AbstractInstruction * self_in_concretizeCallFull);
static sqInt NoDbgRegParms concretizeCmpCqR(AbstractInstruction * self_in_concretizeCmpCqR);
static sqInt NoDbgRegParms concretizeCmpCwR(AbstractInstruction * self_in_concretizeCmpCwR);
@@ -789,7 +789,7 @@
static usqInt NoDbgRegParms concretizeFill32(AbstractInstruction * self_in_concretizeFill32);
static usqInt NoDbgRegParms concretizeJump(AbstractInstruction * self_in_concretizeJump);
static usqInt NoDbgRegParms concretizeJumpFull(AbstractInstruction * self_in_concretizeJumpFull);
-static sqInt NoDbgRegParms concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong);
+static usqInt NoDbgRegParms concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong);
static sqInt NoDbgRegParms concretizeJumpLongNonZero(AbstractInstruction * self_in_concretizeJumpLongNonZero);
static sqInt NoDbgRegParms concretizeJumpLongZero(AbstractInstruction * self_in_concretizeJumpLongZero);
static sqInt NoDbgRegParms concretizeJumpNonZero(AbstractInstruction * self_in_concretizeJumpNonZero);
@@ -837,14 +837,14 @@
static usqInt NoDbgRegParms concretizeOrRR(AbstractInstruction * self_in_concretizeOrRR);
static usqInt NoDbgRegParms concretizePopR(AbstractInstruction * self_in_concretizePopR);
static usqInt NoDbgRegParms concretizePrefetchAw(AbstractInstruction * self_in_concretizePrefetchAw);
-static sqInt NoDbgRegParms concretizePushCq(AbstractInstruction * self_in_concretizePushCq);
+static usqInt NoDbgRegParms concretizePushCq(AbstractInstruction * self_in_concretizePushCq);
static usqInt NoDbgRegParms concretizePushCw(AbstractInstruction * self_in_concretizePushCw);
static usqInt NoDbgRegParms concretizePushR(AbstractInstruction * self_in_concretizePushR);
static usqInt NoDbgRegParms concretizeRetN(AbstractInstruction * self_in_concretizeRetN);
static usqInt NoDbgRegParms concretizeStop(AbstractInstruction * self_in_concretizeStop);
static usqInt NoDbgRegParms concretizeSubCheckOverflowCqR(AbstractInstruction * self_in_concretizeSubCheckOverflowCqR);
static usqInt NoDbgRegParms concretizeSubCheckOverflowRR(AbstractInstruction * self_in_concretizeSubCheckOverflowRR);
-static usqInt NoDbgRegParms concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR);
+static sqInt NoDbgRegParms concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR);
static usqInt NoDbgRegParms concretizeSubCwR(AbstractInstruction * self_in_concretizeSubCwR);
static usqInt NoDbgRegParms concretizeSubRR(AbstractInstruction * self_in_concretizeSubRR);
static usqInt NoDbgRegParms concretizeTstCqR(AbstractInstruction * self_in_concretizeTstCqR);
@@ -1040,7 +1040,7 @@
static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg);
static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver);
-static sqInt NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
+static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg);
static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg);
static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg);
@@ -1125,8 +1125,9 @@
static sqInt genLongUnconditionalBackwardJump(void);
static sqInt genLongUnconditionalForwardJump(void);
static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
+static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
static AbstractInstruction * NoDbgRegParms genMoveFalseR(sqInt reg);
-static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg);
+static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
static sqInt genPushClosureTempsBytecode(void);
@@ -1224,7 +1225,6 @@
static sqInt genPopStackBytecode(void);
static sqInt genPrimitiveClosureValue(void);
static sqInt genPrimitivePerform(void);
-static AbstractInstruction * genPrimReturn(void);
static sqInt genPushActiveContextBytecode(void);
static sqInt genPushClosureCopyCopiedValuesBytecode(void);
static sqInt NoDbgRegParms genPushEnclosingObjectAt(sqInt level);
@@ -5712,12 +5712,12 @@
generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
{
unsigned char annotation;
- usqInt delta;
+ sqInt delta;
sqInt i;
AbstractInstruction *instruction;
sqInt length;
- usqInt location;
- usqInt mapEntry;
+ sqInt location;
+ sqInt mapEntry;
sqInt maxDelta;
usqInt mcpc;
@@ -11045,7 +11045,7 @@
}
/* CogMIPSELCompiler>>#concretizeAndCqR */
-static usqInt NoDbgRegParms
+static sqInt NoDbgRegParms
concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR)
{
sqInt aWord;
@@ -11623,7 +11623,7 @@
the method zone. */
/* CogMIPSELCompiler>>#concretizeCall */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
concretizeCall(AbstractInstruction * self_in_concretizeCall)
{
return concretizeCallFull(self_in_concretizeCall);
@@ -11787,7 +11787,7 @@
}
/* CogMIPSELCompiler>>#concretizeJumpLong */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong)
{
return concretizeJumpFull(self_in_concretizeJumpLong);
@@ -12630,7 +12630,7 @@
}
/* CogMIPSELCompiler>>#concretizePushCq */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
concretizePushCq(AbstractInstruction * self_in_concretizePushCq)
{
return concretizePushCw(self_in_concretizePushCq);
@@ -12793,7 +12793,7 @@
}
/* CogMIPSELCompiler>>#concretizeSubCqR */
-static usqInt NoDbgRegParms
+static sqInt NoDbgRegParms
concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR)
{
sqInt aWord;
@@ -15718,7 +15718,7 @@
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg));
+ jmpTarget(jumpTrue, genMoveConstantR(trueObject(), ReceiverResultReg));
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
@@ -15786,7 +15786,7 @@
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg));
+ jmpTarget(jumpCond, genMoveConstantR(trueObject(), ReceiverResultReg));
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
@@ -17513,7 +17513,6 @@
{
AbstractInstruction *anInstruction;
AbstractInstruction *anInstruction1;
- AbstractInstruction *anInstruction10;
AbstractInstruction *anInstruction2;
AbstractInstruction *anInstruction3;
AbstractInstruction *anInstruction4;
@@ -17528,9 +17527,9 @@
AbstractInstruction *jumpBytesOutOfBounds;
AbstractInstruction *jumpIsBytes;
AbstractInstruction *jumpIsShorts;
- AbstractInstruction *jumpIsWords;
AbstractInstruction *jumpNotIndexable;
AbstractInstruction *jumpShortsOutOfBounds;
+ AbstractInstruction *jumpWordsDone;
AbstractInstruction *jumpWordsOutOfBounds;
AbstractInstruction *jumpWordTooBig;
sqInt literal;
@@ -17539,6 +17538,7 @@
sqInt quickConstant1;
sqInt quickConstant2;
sqInt quickConstant3;
+ sqInt quickConstant4;
/* begin genLoadArgAtDepth:into: */
assert(0 < (numRegArgs()));
@@ -17567,14 +17567,27 @@
quickConstant2 = firstLongFormat();
/* begin gen:quickConstant:operand: */
anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg);
- /* begin JumpGreaterOrEqual: */
- jumpIsWords = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpLess: */
+ jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0));
+ /* begin CmpR:R: */
+ genoperandoperand(CmpRR, Arg1Reg, ClassReg);
+ /* begin JumpBelowOrEqual: */
+ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
+ /* begin AddCq:R: */
+ quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
+ /* begin gen:quickConstant:operand: */
+ anInstruction5 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg);
+ /* begin MoveXwr:R:R: */
+ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg);
+ jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg);
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
/* begin Jump: */
- jumpNotIndexable = genoperand(Jump, ((sqInt)0));
+ jumpWordsDone = genoperand(Jump, ((sqInt)0));
jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg));
/* begin AndCq:R: */
literal = BytesPerWord - 1;
- anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg);
+ anInstruction6 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg);
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
/* begin CmpR:R: */
@@ -17583,14 +17596,13 @@
jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
/* begin AddCq:R: */
literal1 = BaseHeaderSize;
- anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg);
+ anInstruction7 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg);
/* begin MoveXbr:R:R: */
genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg);
/* begin AndCq:R: */
anInstruction = genoperandoperand(AndCqR, 0xFF, ReceiverResultReg);
- /* begin Label */
- done = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ jmpTarget(jumpWordsDone, (done = gLabel()));
genConvertIntegerToCharacterInReg(ReceiverResultReg);
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
@@ -17598,7 +17610,9 @@
genoperand(RetN, 0);
jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg));
/* begin AndCq:R: */
- anInstruction7 = genoperandoperand(AndCqR, 1, formatReg);
+ quickConstant4 = (BytesPerWord / 1) - 1;
+ /* begin gen:quickConstant:operand: */
+ anInstruction8 = genoperandoperand(AndCqR, quickConstant4, formatReg);
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
/* begin CmpR:R: */
@@ -17608,26 +17622,10 @@
/* begin AddR:R: */
genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg);
/* begin MoveM16:r:R: */
- anInstruction8 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg);
+ anInstruction9 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg);
/* begin Jump: */
genoperand(Jump, ((sqInt)done));
- jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, ClassReg));
- /* begin JumpBelowOrEqual: */
- jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
- /* begin AddCq:R: */
- quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord());
- /* begin gen:quickConstant:operand: */
- anInstruction9 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg);
- /* begin MoveXwr:R:R: */
- genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg);
- /* begin SubCq:R: */
- anInstruction10 = genoperandoperand(SubCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg);
- jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg);
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
- /* begin Jump: */
- genoperand(Jump, ((sqInt)done));
- jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpWordTooBig, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel()))))));
+ jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel()))))));
return CompletePrimitive;
}
@@ -17661,10 +17659,8 @@
AbstractInstruction * jumpIsCompiledMethod;
AbstractInstruction *jumpIsShorts;
AbstractInstruction * jumpNotString;
- AbstractInstruction *jumpShortsDone;
AbstractInstruction *jumpShortsOutOfBounds;
AbstractInstruction *jumpShortsOutOfRange;
- AbstractInstruction *jumpWordsDone;
AbstractInstruction *jumpWordsOutOfBounds;
AbstractInstruction *jumpWordsOutOfRange;
sqInt quickConstant;
@@ -17690,8 +17686,8 @@
quickConstant = firstLongFormat();
/* begin gen:quickConstant:operand: */
anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg);
- /* begin JumpBelowOrEqual: */
- jumpNotString = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0));
+ /* begin JumpBelow: */
+ jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0));
/* begin CmpCq:R: */
quickConstant1 = firstCompiledMethodFormat();
/* begin gen:quickConstant:operand: */
@@ -17702,14 +17698,14 @@
quickConstant2 = firstByteFormat();
/* begin gen:quickConstant:operand: */
anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg);
- /* begin JumpGreaterOrEqual: */
- jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpAboveOrEqual: */
+ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0));
/* begin CmpCq:R: */
quickConstant3 = firstShortFormat();
/* begin gen:quickConstant:operand: */
anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg);
- /* begin JumpGreaterOrEqual: */
- jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0));
+ /* begin JumpAboveOrEqual: */
+ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0));
/* begin CmpCq:R: */
anInstruction4 = genoperandoperand(CmpCqR, 0, Arg1Reg);
/* begin JumpLess: */
@@ -17727,15 +17723,17 @@
genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- /* begin Jump: */
- jumpWordsDone = genoperand(Jump, ((sqInt)0));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpIsShorts, gCmpCqR(characterObjectOf(0xFFFF), Arg1Reg));
/* begin JumpAbove: */
jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0));
/* begin LogicalShiftLeftCq:R: */
genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg);
/* begin AndCq:R: */
- anInstruction6 = genoperandoperand(AndCqR, 1, formatReg);
+ anInstruction6 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg);
/* begin SubR:R: */
genoperandoperand(SubRR, formatReg, ClassReg);
/* begin CmpR:R: */
@@ -17751,8 +17749,10 @@
anInstruction11 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- /* begin Jump: */
- jumpShortsDone = genoperand(Jump, ((sqInt)0));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpIsBytes, gCmpCqR(characterObjectOf(0xFF), Arg1Reg));
/* begin JumpAbove: */
jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0));
@@ -17775,7 +17775,10 @@
genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg);
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg);
- jmpTarget(jumpShortsDone, jmpTarget(jumpWordsDone, genPrimReturn()));
+ /* begin genPrimReturn */
+ assert(methodOrBlockNumArgs <= (numRegArgs()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel()))))))));
/* begin AddCq:R: */
anInstruction9 = genoperandoperand(AddCqR, 1, Arg0Reg);
@@ -18608,7 +18611,7 @@
}
/* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */
-static sqInt NoDbgRegParms
+static AbstractInstruction * NoDbgRegParms
genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg)
{
return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1);
@@ -19012,7 +19015,7 @@
/* begin JumpNonZero: */
jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0));
}
- /* begin genMoveTrueR: */
+ /* begin genMoveConstant:R: */
constant = trueObject();
if (shouldAnnotateObjectReference(constant)) {
annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -21080,6 +21083,19 @@
return 0;
}
+ /* SimpleStackBasedCogit>>#genMoveConstant:R: */
+static AbstractInstruction * NoDbgRegParms
+genMoveConstantR(sqInt constant, sqInt reg)
+{
+ AbstractInstruction *anInstruction;
+
+ return (shouldAnnotateObjectReference(constant)
+ ? annotateobjRef(gMoveCwR(constant, reg), constant)
+ : (/* begin MoveCq:R: */
+ (anInstruction = genoperandoperand(MoveCqR, constant, reg)),
+ anInstruction));
+}
+
/* SimpleStackBasedCogit>>#genMoveFalseR: */
static AbstractInstruction * NoDbgRegParms
genMoveFalseR(sqInt reg)
@@ -21097,7 +21113,7 @@
}
/* SimpleStackBasedCogit>>#genMoveTrueR: */
-static AbstractInstruction * NoDbgRegParms
+static sqInt NoDbgRegParms
genMoveTrueR(sqInt reg)
{
AbstractInstruction *anInstruction;
@@ -23867,22 +23883,6 @@
return genLookupForPerformNumArgs(methodOrBlockNumArgs);
}
-
-/* Generate a return that cuts back the stack to remove the receiver
- and arguments after an invocation of a primitive with nargs arguments.
- Since all primitives that succeed in the normal way (i.e. don't execute a
- method as do genPrimitiveClosureValue and genPrimitivePerform) take only
- register arguments, there is nothing to do. */
-
- /* StackToRegisterMappingCogit>>#genPrimReturn */
-static AbstractInstruction *
-genPrimReturn(void)
-{
- assert(methodOrBlockNumArgs <= (numRegArgs()));
- /* begin RetN: */
- return genoperand(RetN, 0);
-}
-
/* StackToRegisterMappingCogit>>#genPushActiveContextBytecode */
static sqInt
genPushActiveContextBytecode(void)
Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c 2016-01-16 05:33:04 UTC (rev 3557)
+++ branches/Cog/nsspursrc/vm/cointerp.c 2016-01-16 15:53:04 UTC (rev 3558)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1641 uuid: a1fef138-fa26-4a09-b0c1-1e7be82e14a8
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
from
- CoInterpreter VMMaker.oscog-eem.1641 uuid: a1fef138-fa26-4a09-b0c1-1e7be82e14a8
+ CoInterpreter VMMaker.oscog-eem.1642 uuid: 32f50135-e850-42ef-af03-cf236135405b
*/
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list