【问题标题】:In android dalvik invoke-xxx opcode, what if the argument size is more than 5android dalvik invoke-xxx opcode中,参数大小大于5怎么办
【发布时间】:2013-05-08 12:48:37
【问题描述】:

在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的情况呢?

【问题讨论】:

    标签: android dalvik


    【解决方案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);
    
            ....
    

    所以在这里处理!

    【讨论】:

    猜你喜欢
    • 2012-09-28
    • 2019-04-26
    • 2013-08-30
    • 2013-11-12
    • 1970-01-01
    • 2014-05-18
    • 1970-01-01
    • 1970-01-01
    • 2021-10-15
    相关资源
    最近更新 更多