本文整理汇总了Java中com.sun.squawk.translator.ir.instr.StackProducer.getType方法的典型用法代码示例。如果您正苦于以下问题:Java StackProducer.getType方法的具体用法?Java StackProducer.getType怎么用?Java StackProducer.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.translator.ir.instr.StackProducer
的用法示例。
在下文中一共展示了StackProducer.getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: push
import com.sun.squawk.translator.ir.instr.StackProducer; //导入方法依赖的package包/类
/**
* Pushes a value to the operand stack.
*
* @param producer the instruction producing the value being pushed
*/
public void push(StackProducer producer) {
Klass type = producer.getType();
Assert.that(type != Klass.VOID);
/*
* Check for overflow and push the producer.
*/
if (sp == maxStack) {
throw codeParser.verifyError("operand stack overflow");
}
stack[sp++] = producer;
/*
* For long and double check for overflow and then add a null word to the stack.
*/
if (type.isDoubleWord()) {
if (sp == maxStack) {
throw codeParser.verifyError("operand stack overflow");
}
stack[sp++] = null;
}
}
示例2: replaceTypeWithType
import com.sun.squawk.translator.ir.instr.StackProducer; //导入方法依赖的package包/类
/**
* Changes the type of any object in a local variable or on the operand
* stack whose current type is matches <code>fromType</code> to be
* <code>toType</code>.
*/
public void replaceTypeWithType(Klass fromType, Klass toType) {
for (int i = 0 ; i < localTypes.length ; i++) {
if (localTypes[i] == fromType) {
localTypes[i] = toType;
}
}
for (int i = 0 ; i < sp ; i++) {
StackProducer producer = stack[i];
if (producer != null && producer.getType() == fromType) {
producer.updateType(toType);
}
}
}