本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
}