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


Java FLOAD类代码示例

本文整理汇总了Java中org.apache.bcel.generic.FLOAD的典型用法代码示例。如果您正苦于以下问题:Java FLOAD类的具体用法?Java FLOAD怎么用?Java FLOAD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: pushParams

import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
InstructionHandle pushParams(InstructionList il, Method m) {
    Type[] params = mtab.typesOfParams(m);
    InstructionHandle pos = il.getStart();

    for (int i = 0, param = 0; i < params.length; i++, param++) {
        if (params[i].equals(Type.BOOLEAN) || params[i].equals(Type.BYTE)
            || params[i].equals(Type.SHORT) || params[i].equals(Type.CHAR)
            || params[i].equals(Type.INT)) {
            il.insert(pos, new ILOAD(param));
        } else if (params[i].equals(Type.FLOAT)) {
            il.insert(pos, new FLOAD(param));
        } else if (params[i].equals(Type.LONG)) {
            il.insert(pos, new LLOAD(param));
            param++;
        } else if (params[i].equals(Type.DOUBLE)) {
            il.insert(pos, new DLOAD(param));
            param++;
        } else {
            il.insert(pos, new ALOAD(param));
        }
    }

    return pos;
}
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:25,代码来源:Cashmerec.java

示例2: removeUnusedLocals

import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
void removeUnusedLocals(Method mOrig, MethodGen m) {
    InstructionList il = m.getInstructionList();
    InstructionHandle[] ins = il.getInstructionHandles();
    for (int i = 0; i < ins.length; i++) {
        Instruction in = ins[i].getInstruction();

        if (in instanceof LocalVariableInstruction) {
            LocalVariableInstruction curr = (LocalVariableInstruction) in;
            if (mtab.getLocal(m, curr, ins[i].getPosition()) != null
                && curr.getIndex() < m.getMaxLocals() - 5
                && !mtab.isLocalUsedInInlet(mOrig, curr.getIndex())) {
                if (curr instanceof IINC) {
                    ins[i].setInstruction(new NOP());
                } else if (curr instanceof LSTORE || curr instanceof DSTORE) {
                    ins[i].setInstruction(new POP2());
                } else if (curr instanceof StoreInstruction) {
                    ins[i].setInstruction(new POP());
                } else if (curr instanceof ALOAD) {
                    ins[i].setInstruction(new ACONST_NULL());
                } else if (curr instanceof FLOAD) {
                    ins[i].setInstruction(new FCONST((float) 0.0));
                } else if (curr instanceof ILOAD) {
                    ins[i].setInstruction(new ICONST(0));
                } else if (curr instanceof DLOAD) {
                    ins[i].setInstruction(new DCONST(0.0));
                } else if (curr instanceof LLOAD) {
                    ins[i].setInstruction(new LCONST(0L));
                } else {
                    System.out.println("unhandled ins in "
                        + "removeUnusedLocals: " + curr);
                    System.exit(1);
                }
            }
        }
    }
}
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:37,代码来源:Cashmerec.java

示例3: visitFLOAD

import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
public void visitFLOAD(FLOAD o){
	int idx = o.getIndex();
	if (idx < 0){
		constraintViolated(o, "Index '"+idx+"' must be non-negative.");
	}
	else{
		int maxminus1 =  max_locals()-1;
		if (idx > maxminus1){
			constraintViolated(o, "Index '"+idx+"' must not be greater than max_locals-1 '"+maxminus1+"'.");
		}
	}
}
 
开发者ID:Hu6,项目名称:VestaClient,代码行数:14,代码来源:Pass3aVerifier.java

示例4: createInstructionFload

import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionFload(Element inst) throws IllegalXMLVMException {
    int idx = Integer.parseInt(inst.getAttributeValue("index"));
    return new FLOAD(idx);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:JavaByteCodeOutputProcess.java


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