本文整理匯總了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);
}
}