當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。