在android dalvik invoke-xxx操作码中,如果参数大小超过5,该怎么办?

时间:2013-05-08 03:37:47

标签: android dalvik

在davik vm / mterp / out / InterpC-portable.cpp代码中,当解释invokeMethod时,我发现它只能处理count小于或等于5的情况:

        switch (count) {
        case 5:
            outs[4] = GET_REGISTER(vsrc1 & 0x0f);
        case 4:
            outs[3] = GET_REGISTER(vdst >> 12);
        case 3:
            outs[2] = GET_REGISTER((vdst & 0x0f00) >> 8);
        case 2:
            outs[1] = GET_REGISTER((vdst & 0x00f0) >> 4);
        case 1:
            outs[0] = GET_REGISTER(vdst & 0x0f);
        default:
            ;
        }

那么当参数大小超过5时呢?

1 个答案:

答案 0 :(得分:1)

对不起,我想念一些事情,我提到的参议员是非远程通话的情况,我错过了一个范围通话:

     */
    if (methodCallRange) {
        // could use memcpy or a "Duff's device"; most functions have
        // so few args it won't matter much
        assert(vsrc1 <= curMethod->outsSize);
        assert(vsrc1 == methodToCall->insSize);
        outs = OUTS_FROM_FP(fp, vsrc1);

        for (i = 0; i < vsrc1; i++)
            outs[i] = GET_REGISTER(vdst+i);

        ....

所以它在这里处理!