From 95dbe9db478408d6de1396068b081dd900e79e97 Mon Sep 17 00:00:00 2001 From: Marcel Taeumel Date: Wed, 11 May 2022 09:11:21 +0200 Subject: [PATCH] Newspeak source as per VMMaker.oscog-mt.3184 [ci skip] --- src/spur32.cog.newspeak/cointerp.c | 272 +++-------------------- src/spur32.cog.newspeak/cointerp.h | 4 +- src/spur32.cog.newspeak/gcc3x-cointerp.c | 272 +++-------------------- src/spur32.stack.newspeak/gcc3x-interp.c | 182 ++------------- src/spur32.stack.newspeak/interp.c | 182 ++------------- src/spur64.cog.newspeak/cointerp.c | 264 ++-------------------- src/spur64.cog.newspeak/cointerp.h | 4 +- src/spur64.cog.newspeak/gcc3x-cointerp.c | 264 ++-------------------- src/spur64.stack.newspeak/gcc3x-interp.c | 180 ++------------- src/spur64.stack.newspeak/interp.c | 180 ++------------- 10 files changed, 184 insertions(+), 1620 deletions(-) diff --git a/src/spur32.cog.newspeak/cointerp.c b/src/spur32.cog.newspeak/cointerp.c index ff0bf078be..d6fd6b3cf5 100644 --- a/src/spur32.cog.newspeak/cointerp.c +++ b/src/spur32.cog.newspeak/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -601,7 +601,6 @@ static sqInt NoDbgRegParms returnToExecutivepostContextSwitch(sqInt inInterprete static sqInt NoDbgRegParms returntoExecutive(sqInt returnValue, sqInt inInterpreter); static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); static sqInt NoDbgRegParms shortPrintFrame(char *theFP); extern sqInt signed32BitIntegerFor(sqInt integerValue); extern int signed32BitValueOf(sqInt oop); @@ -1310,6 +1309,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -1769,8 +1769,8 @@ _iss sqInt argumentCount; _iss sqLong nextProfileTick; _iss sqInt primTraceLog[256]; _iss usqInt method; -_iss sqInt nilObj; _iss FILE * transcript; +_iss sqInt nilObj; _iss StackPage * stackPage; _iss usqInt oldSpaceStart; _iss sqInt bytecodeSetSelector; @@ -2007,7 +2007,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 581 */] = { /*78*/ 0, 0, /*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256,-256, /*97*/ -256, 0, 0, -/*100*/ 260, 0x200, 0x200, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256, +/*100*/ 260, 0x200, 0x100, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256, /*115*/ 0x100, 0, 12, 260, 0, /*120*/ 524, 0x100,-256,-256, 1, 0, 0, 0, 0,-255,-256,-256, 0, 0, 0,-256, 0,-256,-256, /*139*/ 0, @@ -2674,8 +2674,9 @@ sqInt sendWheelEvents; sqInt suppressHeartbeatFlag; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -24386,240 +24387,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) return 1; } - -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ -/* Override to log and check stack alignment. Since this is an implicit send - we need to - log it explicitly. The return side is done via a primitive so that gets - logged normally. */ - - /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - usqInt aMethodObj; - sqInt aMethodSelectorOrImmediate; - sqInt classTag; - CogMethod *cogMethod; - CogMethod *cogMethod1; - sqInt i; - usqInt initialIP; - sqInt methodHeader; - sqInt methodHeader1; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - sqInt selector; - char *sp; - char *sp1; - char *sp10; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - char *sp8; - char *sp9; - - assertCStackWellAligned(); - if (recordPrimTrace()) { - /* begin fastLogPrim: */ - aMethodSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(primTraceLog)[GIV(primTraceLogIndex)] = aMethodSelectorOrImmediate; - primTraceLogIndex(GIV(primTraceLogIndex) + 1); - } - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin fetchPointer:ofObject: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin ifAppropriateCompileToNativeCode:selector: */ - aMethodObj = GIV(newMethod); - selector = GIV(messageSelector); - /* begin fetchPointer:ofObject: */ - methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader1 & 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (methodHeader1 & 1) == 0)) { - - /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader1); - if (((cogMethod1->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod1, selector); - } - } - else { - if (((assert((methodHeader1 & 1)), - ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { - cogselector(aMethodObj, selector); - } - else { - maybeFlagMethodAsInterpreted(aMethodObj); - } - } - /* begin justActivateNewMethod: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - cogMethod = null; - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { - cogMethod = ((CogMethod *) methodHeader); - methodHeader = (cogMethod->methodHeader); - } - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - if ((cogMethod != null) - && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))) { - if (GIV(instructionPointer) >= (startOfMemory())) { - /* begin iframeSavedIP:put: */ - assert(!(isMachineCodeFrame(GIV(framePointer)))); - longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); - } - GIV(instructionPointer) = ceReturnToInterpreterPC(); - } - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp7; - /* begin push: */ - longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp8; - GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; - if (cogMethod == null) { - /* begin push: */ - longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp10; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp11; - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp21; - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), 0); - GIV(stackPointer) = sp31; - GIV(instructionPointer) = initialIP - 1; - } - else { - /* begin push: */ - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod)); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); - } - /* begin push: */ - longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp9; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp6; - } - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - if (!cogMethod) { - GIV(instructionPointer) += 3; - } - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { - maybeFlagMethodAsInterpreted(GIV(newMethod)); - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - /* CoInterpreter>>#shortPrintFrame: */ static sqInt NoDbgRegParms shortPrintFrame(char *theFP) @@ -35329,7 +35096,7 @@ primitiveInvokeObjectAsMethod(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt i; sqInt lookupClassTag; - sqInt runArgs; + usqInt runArgs; sqInt runReceiver; char *sp; char *sp1; @@ -59500,6 +59267,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -62092,7 +61866,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(obj))); contextSize = (sp >> 1); l6: /* end fetchStackPointerOf: */; - numPointerSlots = CtxtTempFrameStart + contextSize; + numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); goto l10; } /* begin numSlotsOf: */ @@ -62122,7 +61896,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = numLiterals + LiteralStart; + numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -62673,7 +62447,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -78444,6 +78218,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -82295,7 +82076,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur32.cog.newspeak/cointerp.h b/src/spur32.cog.newspeak/cointerp.h index 1ba42d8828..2ecdd1b191 100644 --- a/src/spur32.cog.newspeak/cointerp.h +++ b/src/spur32.cog.newspeak/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3175 uuid: c104df7c-e900-5145-9ec3-3164112c3841 + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ @@ -264,6 +264,7 @@ extern sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize); extern sqInt shouldRemapOop(sqInt oop); extern sqInt splObj(sqInt index); extern usqInt storeCheckBoundary(void); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); extern void tenuringIncrementalGC(void); @@ -335,6 +336,7 @@ extern sqInt ultimateLiteralOf(sqInt aMethodOop); extern sqInt breakLookupClassTag; extern char * breakSelector; extern sqInt breakSelectorLength ; +extern sqInt cannotDeferDisplayUpdates; extern sqInt checkedPluginName; extern sqInt checkForLeaks; extern sqInt debugCallbackInvokes; diff --git a/src/spur32.cog.newspeak/gcc3x-cointerp.c b/src/spur32.cog.newspeak/gcc3x-cointerp.c index 5966e4bbf8..0274261333 100644 --- a/src/spur32.cog.newspeak/gcc3x-cointerp.c +++ b/src/spur32.cog.newspeak/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -604,7 +604,6 @@ static sqInt NoDbgRegParms returnToExecutivepostContextSwitch(sqInt inInterprete static sqInt NoDbgRegParms returntoExecutive(sqInt returnValue, sqInt inInterpreter); static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); static sqInt NoDbgRegParms shortPrintFrame(char *theFP); extern sqInt signed32BitIntegerFor(sqInt integerValue); extern int signed32BitValueOf(sqInt oop); @@ -1313,6 +1312,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -1772,8 +1772,8 @@ _iss sqInt argumentCount; _iss sqLong nextProfileTick; _iss sqInt primTraceLog[256]; _iss usqInt method; -_iss sqInt nilObj; _iss FILE * transcript; +_iss sqInt nilObj; _iss StackPage * stackPage; _iss usqInt oldSpaceStart; _iss sqInt bytecodeSetSelector; @@ -2010,7 +2010,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 581 */] = { /*78*/ 0, 0, /*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256,-256, /*97*/ -256, 0, 0, -/*100*/ 260, 0x200, 0x200, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256, +/*100*/ 260, 0x200, 0x100, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256, /*115*/ 0x100, 0, 12, 260, 0, /*120*/ 524, 0x100,-256,-256, 1, 0, 0, 0, 0,-255,-256,-256, 0, 0, 0,-256, 0,-256,-256, /*139*/ 0, @@ -2677,8 +2677,9 @@ sqInt sendWheelEvents; sqInt suppressHeartbeatFlag; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -24395,240 +24396,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) return 1; } - -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ -/* Override to log and check stack alignment. Since this is an implicit send - we need to - log it explicitly. The return side is done via a primitive so that gets - logged normally. */ - - /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - usqInt aMethodObj; - sqInt aMethodSelectorOrImmediate; - sqInt classTag; - CogMethod *cogMethod; - CogMethod *cogMethod1; - sqInt i; - usqInt initialIP; - sqInt methodHeader; - sqInt methodHeader1; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - sqInt selector; - char *sp; - char *sp1; - char *sp10; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - char *sp8; - char *sp9; - - assertCStackWellAligned(); - if (recordPrimTrace()) { - /* begin fastLogPrim: */ - aMethodSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(primTraceLog)[GIV(primTraceLogIndex)] = aMethodSelectorOrImmediate; - primTraceLogIndex(GIV(primTraceLogIndex) + 1); - } - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin fetchPointer:ofObject: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin ifAppropriateCompileToNativeCode:selector: */ - aMethodObj = GIV(newMethod); - selector = GIV(messageSelector); - /* begin fetchPointer:ofObject: */ - methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader1 & 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (methodHeader1 & 1) == 0)) { - - /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader1); - if (((cogMethod1->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod1, selector); - } - } - else { - if (((assert((methodHeader1 & 1)), - ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { - cogselector(aMethodObj, selector); - } - else { - maybeFlagMethodAsInterpreted(aMethodObj); - } - } - /* begin justActivateNewMethod: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - cogMethod = null; - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { - cogMethod = ((CogMethod *) methodHeader); - methodHeader = (cogMethod->methodHeader); - } - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - if ((cogMethod != null) - && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))) { - if (GIV(instructionPointer) >= (startOfMemory())) { - /* begin iframeSavedIP:put: */ - assert(!(isMachineCodeFrame(GIV(framePointer)))); - longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); - } - GIV(instructionPointer) = ceReturnToInterpreterPC(); - } - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp7; - /* begin push: */ - longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp8; - GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; - if (cogMethod == null) { - /* begin push: */ - longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp10; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp11; - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp21; - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), 0); - GIV(stackPointer) = sp31; - GIV(instructionPointer) = initialIP - 1; - } - else { - /* begin push: */ - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod)); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); - } - /* begin push: */ - longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp9; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp6; - } - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - if (!cogMethod) { - GIV(instructionPointer) += 3; - } - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { - maybeFlagMethodAsInterpreted(GIV(newMethod)); - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - /* CoInterpreter>>#shortPrintFrame: */ static sqInt NoDbgRegParms shortPrintFrame(char *theFP) @@ -35338,7 +35105,7 @@ primitiveInvokeObjectAsMethod(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt i; sqInt lookupClassTag; - sqInt runArgs; + usqInt runArgs; sqInt runReceiver; char *sp; char *sp1; @@ -59509,6 +59276,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -62101,7 +61875,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(obj))); contextSize = (sp >> 1); l6: /* end fetchStackPointerOf: */; - numPointerSlots = CtxtTempFrameStart + contextSize; + numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); goto l10; } /* begin numSlotsOf: */ @@ -62131,7 +61905,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = numLiterals + LiteralStart; + numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -62682,7 +62456,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -78453,6 +78227,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -82304,7 +82085,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur32.stack.newspeak/gcc3x-interp.c b/src/spur32.stack.newspeak/gcc3x-interp.c index 8990e913ba..8191baba50 100644 --- a/src/spur32.stack.newspeak/gcc3x-interp.c +++ b/src/spur32.stack.newspeak/gcc3x-interp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1020,6 +1020,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -1386,7 +1387,6 @@ static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); static sqInt NoDbgRegParms safeMethodClassOf(sqInt methodPointer); static sqInt NoDbgRegParms saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); EXPORT(void) setBreakMNUSelector(char *aString); EXPORT(void) setBreakSelector(char *aString); extern void setFullScreenFlag(sqInt value); @@ -1753,7 +1753,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 581 */] /*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*60*/ 0, 0, 0, 0, 0,-1,-1,-1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, /*80*/ -1,-1,-1, 0, 0, 0, 1, 0, 2,-1,-1, 0, 0, 0, 1,-1,-1,-1, 0, 0, -/*100*/ 1, 2, 1, 2,-1, 2,-1,-1,-1,-1, 0, 1, 0, 0,-1, 1, 0, 0, 1, 0, +/*100*/ 1, 2, 2, 2,-1, 2,-1,-1,-1,-1, 0, 1, 0, 0,-1, 1, 0, 0, 1, 0, /*120*/ 2, 1,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 0, 0, 0,-1, 0,-1,-1, 0, /*140*/ -1, 1,-1, 1, 1, 1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 1, 1, /*160*/ 0, 0,-1, 0, 0, 1, 1,-1, 1, 0, 0, 0,-1, 1, 1, 0,-1, 0,-1,-1, @@ -2387,8 +2387,9 @@ sqInt sendWheelEvents; char * breakSelector; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt suppressHeartbeatFlag; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -46406,6 +46407,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -63087,160 +63095,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) } -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ - - /* StackInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classTag; - sqInt i; - sqInt methodHeader; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - char *sp; - char *sp1; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin splObj: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOf(GIV(newMethod))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin justActivateNewMethod: */ - assert(isCompiledMethod(GIV(newMethod))); - /* begin fetchPointer:ofObject: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp11; - /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp21; - GIV(framePointer) = GIV(stackPointer); - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp31; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp6; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp7; - } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - GIV(instructionPointer) += 3; - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - - /* useful for VM debugging; use export: not api, so it will be accessible on win32 and won't be written to cointerp.h */ @@ -67533,6 +67387,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -72530,7 +72391,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur32.stack.newspeak/interp.c b/src/spur32.stack.newspeak/interp.c index 2da806da27..dc69dc8351 100644 --- a/src/spur32.stack.newspeak/interp.c +++ b/src/spur32.stack.newspeak/interp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1017,6 +1017,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -1383,7 +1384,6 @@ static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); static sqInt NoDbgRegParms safeMethodClassOf(sqInt methodPointer); static sqInt NoDbgRegParms saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); EXPORT(void) setBreakMNUSelector(char *aString); EXPORT(void) setBreakSelector(char *aString); extern void setFullScreenFlag(sqInt value); @@ -1750,7 +1750,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 581 */] /*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*60*/ 0, 0, 0, 0, 0,-1,-1,-1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, /*80*/ -1,-1,-1, 0, 0, 0, 1, 0, 2,-1,-1, 0, 0, 0, 1,-1,-1,-1, 0, 0, -/*100*/ 1, 2, 1, 2,-1, 2,-1,-1,-1,-1, 0, 1, 0, 0,-1, 1, 0, 0, 1, 0, +/*100*/ 1, 2, 2, 2,-1, 2,-1,-1,-1,-1, 0, 1, 0, 0,-1, 1, 0, 0, 1, 0, /*120*/ 2, 1,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 0, 0, 0,-1, 0,-1,-1, 0, /*140*/ -1, 1,-1, 1, 1, 1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 1, 1, /*160*/ 0, 0,-1, 0, 0, 1, 1,-1, 1, 0, 0, 0,-1, 1, 1, 0,-1, 0,-1,-1, @@ -2384,8 +2384,9 @@ sqInt sendWheelEvents; char * breakSelector; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt suppressHeartbeatFlag; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -46397,6 +46398,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -63078,160 +63086,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) } -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ - - /* StackInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classTag; - sqInt i; - sqInt methodHeader; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - char *sp; - char *sp1; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin splObj: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOf(GIV(newMethod))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin justActivateNewMethod: */ - assert(isCompiledMethod(GIV(newMethod))); - /* begin fetchPointer:ofObject: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp11; - /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp21; - GIV(framePointer) = GIV(stackPointer); - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp31; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp6; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp7; - } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - GIV(instructionPointer) += 3; - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - - /* useful for VM debugging; use export: not api, so it will be accessible on win32 and won't be written to cointerp.h */ @@ -67524,6 +67378,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -72521,7 +72382,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur64.cog.newspeak/cointerp.c b/src/spur64.cog.newspeak/cointerp.c index 93d6bca341..2d79283749 100644 --- a/src/spur64.cog.newspeak/cointerp.c +++ b/src/spur64.cog.newspeak/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -602,7 +602,6 @@ static sqInt NoDbgRegParms returnToExecutivepostContextSwitch(sqInt inInterprete static sqInt NoDbgRegParms returntoExecutive(sqInt returnValue, sqInt inInterpreter); static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); static sqInt NoDbgRegParms shortPrintFrame(char *theFP); extern sqInt signed32BitIntegerFor(sqInt integerValue); extern int signed32BitValueOf(sqInt oop); @@ -1334,6 +1333,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -2693,8 +2693,9 @@ sqInt sendWheelEvents; sqInt suppressHeartbeatFlag; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -24442,240 +24443,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) return 1; } - -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ -/* Override to log and check stack alignment. Since this is an implicit send - we need to - log it explicitly. The return side is done via a primitive so that gets - logged normally. */ - - /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - usqInt aMethodObj; - sqInt aMethodSelectorOrImmediate; - sqInt classTag; - CogMethod *cogMethod; - CogMethod *cogMethod1; - sqInt i; - usqInt initialIP; - sqInt methodHeader; - sqInt methodHeader1; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - sqInt selector; - char *sp; - char *sp1; - char *sp10; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - char *sp8; - char *sp9; - - assertCStackWellAligned(); - if (recordPrimTrace()) { - /* begin fastLogPrim: */ - aMethodSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(primTraceLog)[GIV(primTraceLogIndex)] = aMethodSelectorOrImmediate; - primTraceLogIndex(GIV(primTraceLogIndex) + 1); - } - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin fetchPointer:ofObject: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin ifAppropriateCompileToNativeCode:selector: */ - aMethodObj = GIV(newMethod); - selector = GIV(messageSelector); - /* begin fetchPointer:ofObject: */ - methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((((methodHeader1) & 7) == 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (!(methodHeader1 & (smallIntegerTag()))))) { - - /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader1); - if (((cogMethod1->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod1, selector); - } - } - else { - if (((assert((((methodHeader1) & 7) == 1)), - ((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { - cogselector(aMethodObj, selector); - } - else { - maybeFlagMethodAsInterpreted(aMethodObj); - } - } - /* begin justActivateNewMethod: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))); - cogMethod = null; - if ((assert(((((methodHeader) & 7) == 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (!(methodHeader & (smallIntegerTag()))))) { - cogMethod = ((CogMethod *) methodHeader); - methodHeader = (cogMethod->methodHeader); - } - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - if ((cogMethod != null) - && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))) { - if (GIV(instructionPointer) >= (startOfMemory())) { - /* begin iframeSavedIP:put: */ - assert(!(isMachineCodeFrame(GIV(framePointer)))); - longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); - } - GIV(instructionPointer) = ceReturnToInterpreterPC(); - } - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp7; - /* begin push: */ - longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp8; - GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)), -((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; - if (cogMethod == null) { - /* begin push: */ - longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp10; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp11; - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp21; - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), 0); - GIV(stackPointer) = sp31; - GIV(instructionPointer) = initialIP - 1; - } - else { - /* begin push: */ - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod)); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); - } - /* begin push: */ - longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp9; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp6; - } - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - if (!cogMethod) { - GIV(instructionPointer) += 3; - } - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { - maybeFlagMethodAsInterpreted(GIV(newMethod)); - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - /* CoInterpreter>>#shortPrintFrame: */ static sqInt NoDbgRegParms shortPrintFrame(char *theFP) @@ -60494,6 +60261,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -63122,7 +62896,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj))); contextSize = (sp >> 3); l6: /* end fetchStackPointerOf: */; - numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); + numPointerSlots = CtxtTempFrameStart + contextSize; goto l10; } /* begin numSlotsOf: */ @@ -63152,7 +62926,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((((header) & 7) == 1)); numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); + numPointerSlots = numLiterals + LiteralStart; l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -79465,6 +79239,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -83252,7 +83033,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur64.cog.newspeak/cointerp.h b/src/spur64.cog.newspeak/cointerp.h index 0a904128a7..8d3d5e2c7c 100644 --- a/src/spur64.cog.newspeak/cointerp.h +++ b/src/spur64.cog.newspeak/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3175 uuid: c104df7c-e900-5145-9ec3-3164112c3841 + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ @@ -266,6 +266,7 @@ extern sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize); extern sqInt shouldRemapOop(sqInt oop); extern sqInt splObj(sqInt index); extern usqInt storeCheckBoundary(void); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); extern void tenuringIncrementalGC(void); @@ -337,6 +338,7 @@ extern sqInt ultimateLiteralOf(sqInt aMethodOop); extern sqInt breakLookupClassTag; extern char * breakSelector; extern sqInt breakSelectorLength ; +extern sqInt cannotDeferDisplayUpdates; extern sqInt checkedPluginName; extern sqInt checkForLeaks; extern sqInt debugCallbackInvokes; diff --git a/src/spur64.cog.newspeak/gcc3x-cointerp.c b/src/spur64.cog.newspeak/gcc3x-cointerp.c index dec0c1bf79..39d4ab8083 100644 --- a/src/spur64.cog.newspeak/gcc3x-cointerp.c +++ b/src/spur64.cog.newspeak/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -605,7 +605,6 @@ static sqInt NoDbgRegParms returnToExecutivepostContextSwitch(sqInt inInterprete static sqInt NoDbgRegParms returntoExecutive(sqInt returnValue, sqInt inInterpreter); static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); static sqInt NoDbgRegParms shortPrintFrame(char *theFP); extern sqInt signed32BitIntegerFor(sqInt integerValue); extern int signed32BitValueOf(sqInt oop); @@ -1337,6 +1336,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -2696,8 +2696,9 @@ sqInt sendWheelEvents; sqInt suppressHeartbeatFlag; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -24451,240 +24452,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) return 1; } - -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ -/* Override to log and check stack alignment. Since this is an implicit send - we need to - log it explicitly. The return side is done via a primitive so that gets - logged normally. */ - - /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - usqInt aMethodObj; - sqInt aMethodSelectorOrImmediate; - sqInt classTag; - CogMethod *cogMethod; - CogMethod *cogMethod1; - sqInt i; - usqInt initialIP; - sqInt methodHeader; - sqInt methodHeader1; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - sqInt selector; - char *sp; - char *sp1; - char *sp10; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - char *sp8; - char *sp9; - - assertCStackWellAligned(); - if (recordPrimTrace()) { - /* begin fastLogPrim: */ - aMethodSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(primTraceLog)[GIV(primTraceLogIndex)] = aMethodSelectorOrImmediate; - primTraceLogIndex(GIV(primTraceLogIndex) + 1); - } - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin fetchPointer:ofObject: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin ifAppropriateCompileToNativeCode:selector: */ - aMethodObj = GIV(newMethod); - selector = GIV(messageSelector); - /* begin fetchPointer:ofObject: */ - methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((((methodHeader1) & 7) == 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (!(methodHeader1 & (smallIntegerTag()))))) { - - /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader1); - if (((cogMethod1->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod1, selector); - } - } - else { - if (((assert((((methodHeader1) & 7) == 1)), - ((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { - cogselector(aMethodObj, selector); - } - else { - maybeFlagMethodAsInterpreted(aMethodObj); - } - } - /* begin justActivateNewMethod: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))); - cogMethod = null; - if ((assert(((((methodHeader) & 7) == 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (!(methodHeader & (smallIntegerTag()))))) { - cogMethod = ((CogMethod *) methodHeader); - methodHeader = (cogMethod->methodHeader); - } - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - if ((cogMethod != null) - && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))) { - if (GIV(instructionPointer) >= (startOfMemory())) { - /* begin iframeSavedIP:put: */ - assert(!(isMachineCodeFrame(GIV(framePointer)))); - longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); - } - GIV(instructionPointer) = ceReturnToInterpreterPC(); - } - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp7; - /* begin push: */ - longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp8; - GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)), -((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; - if (cogMethod == null) { - /* begin push: */ - longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp10; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp11; - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp21; - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), 0); - GIV(stackPointer) = sp31; - GIV(instructionPointer) = initialIP - 1; - } - else { - /* begin push: */ - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod)); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); - } - /* begin push: */ - longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp9; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp6; - } - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - if (!cogMethod) { - GIV(instructionPointer) += 3; - } - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { - maybeFlagMethodAsInterpreted(GIV(newMethod)); - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - /* CoInterpreter>>#shortPrintFrame: */ static sqInt NoDbgRegParms shortPrintFrame(char *theFP) @@ -60503,6 +60270,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -63131,7 +62905,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj))); contextSize = (sp >> 3); l6: /* end fetchStackPointerOf: */; - numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); + numPointerSlots = CtxtTempFrameStart + contextSize; goto l10; } /* begin numSlotsOf: */ @@ -63161,7 +62935,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((((header) & 7) == 1)); numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); + numPointerSlots = numLiterals + LiteralStart; l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -79474,6 +79248,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -83261,7 +83042,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur64.stack.newspeak/gcc3x-interp.c b/src/spur64.stack.newspeak/gcc3x-interp.c index ec7182d53e..c98f8e404a 100644 --- a/src/spur64.stack.newspeak/gcc3x-interp.c +++ b/src/spur64.stack.newspeak/gcc3x-interp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1042,6 +1042,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -1407,7 +1408,6 @@ static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); static sqInt NoDbgRegParms safeMethodClassOf(sqInt methodPointer); static sqInt NoDbgRegParms saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); EXPORT(void) setBreakMNUSelector(char *aString); EXPORT(void) setBreakSelector(char *aString); extern void setFullScreenFlag(sqInt value); @@ -2405,8 +2405,9 @@ sqInt sendWheelEvents; char * breakSelector; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt suppressHeartbeatFlag; int displayWidth; int displayDepth; @@ -47440,6 +47441,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -64178,160 +64186,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) } -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ - - /* StackInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classTag; - sqInt i; - sqInt methodHeader; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - char *sp; - char *sp1; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin splObj: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOf(GIV(newMethod))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin justActivateNewMethod: */ - assert(isCompiledMethod(GIV(newMethod))); - /* begin fetchPointer:ofObject: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp11; - /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp21; - GIV(framePointer) = GIV(stackPointer); - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp31; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp6; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp7; - } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)), -((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - GIV(instructionPointer) += 3; - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - - /* useful for VM debugging; use export: not api, so it will be accessible on win32 and won't be written to cointerp.h */ @@ -68478,6 +68332,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -73411,7 +73272,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain}, diff --git a/src/spur64.stack.newspeak/interp.c b/src/spur64.stack.newspeak/interp.c index d130cf461a..94cb71d6f7 100644 --- a/src/spur64.stack.newspeak/interp.c +++ b/src/spur64.stack.newspeak/interp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 from - StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a + StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3179 uuid: c6fbcb07-2a19-ed4f-8b40-9c119a70882a " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1039,6 +1039,7 @@ static usqInt NoDbgRegParms startOfObject(sqInt objOop); EXPORT(sqInt) statNumGCs(void); extern usqInt storeCheckBoundary(void); static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg); +extern sqInt storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt stringForCString(const char *aCString); @@ -1404,7 +1405,6 @@ static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); static sqInt NoDbgRegParms safeMethodClassOf(sqInt methodPointer); static sqInt NoDbgRegParms saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex); EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); -EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); EXPORT(void) setBreakMNUSelector(char *aString); EXPORT(void) setBreakSelector(char *aString); extern void setFullScreenFlag(sqInt value); @@ -2402,8 +2402,9 @@ sqInt sendWheelEvents; char * breakSelector; sqInt debugCallbackInvokes; sqInt debugCallbackReturns; +sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3179"; +const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] StackInterpreterPrimitives_VMMaker.oscog-mt.3184"; sqInt suppressHeartbeatFlag; int displayWidth; int displayDepth; @@ -47431,6 +47432,13 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointe return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes); } + /* SpurMemoryManager>>#storeLong32:ofObject:withValue: */ +sqInt +storeLong32ofObjectwithValue(sqInt fieldIndex, sqInt obj, sqInt valueWord) +{ + return long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueWord); +} + /* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */ sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer) @@ -64169,160 +64177,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) } -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ - - /* StackInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classTag; - sqInt i; - sqInt methodHeader; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - char *sp; - char *sp1; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin splObj: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOf(GIV(newMethod))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin justActivateNewMethod: */ - assert(isCompiledMethod(GIV(newMethod))); - /* begin fetchPointer:ofObject: */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt)(methodHeader)) >> MethodHeaderTempCountShift) & 0x3F; - /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt)(methodHeader)) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp11; - /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp21; - GIV(framePointer) = GIV(stackPointer); - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp31; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); -# if MULTIPLEBYTECODESETS - GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0 - ? 0x100 - : 0); -# else - assert(!((headerIndicatesAlternateBytecodeSet(methodHeader)))); -# endif - /* begin push: */ - object5 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp5; - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp6; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp7; - } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)), -((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - ((methodHeader & AlternateHeaderHasPrimFlag) != 0))) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - GIV(instructionPointer) += 3; - if (GIV(primFailCode) != 0) { - reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader); - } - } - /* begin checkForStackOverflow */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - assert(!((isFree(GIV(stackPage))))); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - - /* useful for VM debugging; use export: not api, so it will be accessible on win32 and won't be written to cointerp.h */ @@ -68469,6 +68323,13 @@ primitiveDeferDisplayUpdates(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt flag; + if (cannotDeferDisplayUpdates) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } /* begin stackTop */ flag = longAt(GIV(stackPointer)); if (flag == GIV(trueObj)) { @@ -73402,7 +73263,6 @@ void* vm_exports[][3] = { {(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext}, {(void*)_m, "segmentContainingObj", (void*)segmentContainingObj}, {(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext}, - {(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf}, {(void*)_m, "setBreakMNUSelector", (void*)setBreakMNUSelector}, {(void*)_m, "setBreakSelector", (void*)setBreakSelector}, {(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain},