[Vm-dev] Something wrong in latest code generation

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Nov 24 13:13:04 UTC 2017


Hi Eliot,
if i look at spur64src/vm/cointerp.c generated from VMMaker.oscog-eem.2277
i see something wrong in primitiveAdd:

static void
primitiveAdd(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerResult;
    char *sp;

    /* begin pop2AndPushIntegerIfOK: */
======================================
See below: we test if primitive failed before we tried...
======================================
    if (!GIV(primFailCode)) {
        integerResult = (stackIntegerValue(1)) + (stackIntegerValue(0));
        if ((((((usqInt) integerResult) >> 60) + 1) & 15) <= 1) {
            /* begin pop:thenPush: */
            longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)),
(((usqInt)integerResult << 3) | 1));
            GIV(stackPointer) = sp;
        }
        else {
            /* begin success: */

            /* Don't overwrite an error code that has already been set. */
            if (!GIV(primFailCode)) {
                GIV(primFailCode) = 1;
            }

        }
    }
}


Note that I could comment the commit in github API.
Unfortunately, diff are too big, and comments uneasy to find/view/scan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20171124/430d2c6b/attachment.html>


More information about the Vm-dev mailing list