当前位置: 首页>>代码示例>>Java>>正文


Java Translator.REVERSE_PARAMETERS属性代码示例

本文整理汇总了Java中com.sun.squawk.translator.Translator.REVERSE_PARAMETERS属性的典型用法代码示例。如果您正苦于以下问题:Java Translator.REVERSE_PARAMETERS属性的具体用法?Java Translator.REVERSE_PARAMETERS怎么用?Java Translator.REVERSE_PARAMETERS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.squawk.translator.Translator的用法示例。


在下文中一共展示了Translator.REVERSE_PARAMETERS属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: do_invoke

private void do_invoke(Method m, Klass t, Klass rtype) {
    frame.mayCauseGC();
    Klass params[] = m.getParameterTypes();
    if (Translator.REVERSE_PARAMETERS) {
        for (int i = 0; i < params.length; i++) {
            frame.pop(grow(params[i]));
        }
    } else {
        for (int i = params.length - 1; i >= 0; i--) {
            frame.pop(grow(params[i]));
        }
    }
    check(frame.isStackEmpty(), "stack not empty after popping parameters to callee");
    checkGeneralType(t, rtype);
    if (t != VOID) {
        frame.push(rtype);
    }
    frame.fallthrough();
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:19,代码来源:VerifierBase.java

示例2: do_invokesuper

protected void do_invokesuper(Klass t) {
    Klass superklass = (Klass)frame.popObject();
    Klass fklass = null;
    if (Translator.REVERSE_PARAMETERS) {
        fklass = frame.pop();
    } else {
        Vector stack = new Vector();
        while (!frame.isStackEmpty()) {
            fklass = frame.pop();
            stack.addElement(fklass);
        }
        for (int i = stack.size() - 2; i >= 0; i--) {
            frame.push((Klass)stack.elementAt(i));
        }
    }
    check(Frame.isAssignable(superklass, fklass), "invalid superclass");
    Method m = getVirtualMethod(superklass, iparm);
    do_invoke(m, t);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:19,代码来源:VerifierBase.java

示例3: do_invokeslot

protected void do_invokeslot(Klass t) {
    frame.mayCauseGC();
    Method m = frame.popMethodSlot();
    if (Translator.REVERSE_PARAMETERS) {
        frame.pop(m.getDefiningClass());
    } else {
        Vector stack = new Vector();
        Klass fklass = null;
        while (!frame.isStackEmpty()) {
            fklass = frame.pop();
            stack.addElement(fklass);
        }
        check(Frame.isAssignable(m.getDefiningClass(), fklass), "input to invokeslot does not match input to findslot");
        for (int i = stack.size() - 2; i >= 0; i--) {
            frame.push((Klass)stack.elementAt(i));
        }
    }
    do_invoke(m, t);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:19,代码来源:VerifierBase.java

示例4: do_invokevirtual

protected void do_invokevirtual(Klass t) {
    Klass fklass = null;
    if (Translator.REVERSE_PARAMETERS) {
        fklass = frame.pop();
    } else {
        Vector stack = new Vector();
        while (!frame.isStackEmpty()) {
            fklass = frame.pop();
            stack.addElement(fklass);
        }
        for (int i = stack.size() - 2; i >= 0; i--) {
            frame.push((Klass)stack.elementAt(i));
        }
    }
    if (fklass == NULL) {
        while (!frame.isStackEmpty()) {
            frame.pop();
        }
        if (t != VOID) {
            frame.push((t == OOP) ? NULL : t);
        }
        frame.fallthrough();
    } else {
        if (fklass.isInterface()) {
            fklass = Klass.OBJECT;
        }
        Method m = getVirtualMethod(fklass, iparm);
        check(m != null, "could not find virtual method of index " + iparm + " in " + fklass);
        do_invoke(m, t);
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:31,代码来源:VerifierBase.java

示例5: instructionNeedParametersReversed

/**
 * Check to see if the parameters of an instruction should be reversed.
 *
 * @param   instruction  the instruction to be tested
 * @return  true if the parameters should be reversed
 */
boolean instructionNeedParametersReversed(Instruction instruction) {
     if (Translator.REVERSE_PARAMETERS && instruction instanceof Invoke) {
          Invoke invoke = (Invoke)instruction;
          if (DO_NOT_REVERSE_NATIVE_CALLS && invoke.getMethod().isNative()) {
               return false;
          }
          return true;
     }
     return false;
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:16,代码来源:IRTransformer.java

示例6: do_invokestatic

protected void do_invokestatic(Klass t) {
    Klass fklass = (Klass)frame.popObject();
    Method m = getStaticMethod(fklass, iparm);
    check(m.getDefiningClass() == fklass, "method " + m + " is not defined in " + fklass);
    check(m != null, "could not find static method of index " + iparm + " in " + fklass);
    if (m.isConstructor()) {
        boolean isChainedConstructor = false;
        Method caller = this.body.getDefiningMethod();
        Klass params[] = m.getParameterTypes();
        frame.mayCauseGC();
        
        if (!Translator.REVERSE_PARAMETERS) {
            for (int i = params.length - 1; i >= 0; i--) {
                frame.pop(grow(params[i]));
            }
        }
        
        if (m.isReplacementConstructor()) {
            frame.pop(m.getDefiningClass());
        } else {
            isChainedConstructor = caller.isConstructor()
            && (caller.getDefiningClass() == m.getDefiningClass() ||
                    caller.getDefiningClass().getSuperclass() == m.getDefiningClass())
                    && frame.isParmUninitialized(0);
            frame.popForInitialization(m.getDefiningClass());
        }
        
        if (Translator.REVERSE_PARAMETERS) {
            for (int i = 0; i < params.length; i++) {
                frame.pop(grow(params[i]));
            }
        }
        
        if (!frame.isStackEmpty()) {
            frame.printStack();
        }
        check(frame.isStackEmpty(), "stack not empty after popping parameters to callee");
        Klass rtype = m.getReturnType();
        if (isChainedConstructor) {
            rtype = caller.getDefiningClass();
        }
        checkGeneralType(t, rtype);
        if (t != VOID) {
            frame.push(rtype);
        }
        frame.fallthrough();
    } else {
        do_invoke(m, t);
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:50,代码来源:VerifierBase.java


注:本文中的com.sun.squawk.translator.Translator.REVERSE_PARAMETERS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。