Examples of Ldc


Examples of com.sun.org.apache.bcel.internal.generic.LDC

    }
  }
  private static final class GetClassConverter implements InstConverter<GetClass> {
    public void convertInst(GetClass t, InstructionListContext ilc) {
      int index = ilc.getInstructionFactory().getClassGen().getConstantPool().addClass(t.className.toString());
      ilc.add(new LDC(index)) ;
    }
View Full Code Here

Examples of jbe.micro.Ldc

    LowLevel.msg("Micro Benchmarks:");
    LowLevel.lf();

    Execute.perform(new Add());
    Execute.perform(new Iinc());
    Execute.perform(new Ldc());
    Execute.perform(new BranchTaken());
    Execute.perform(new BranchNotTaken());
    Execute.perform(new GetField());
    Execute.perform(new GetStatic());
    Execute.perform(new Array());
View Full Code Here

Examples of org.apache.bcel.generic.LDC

        }
    }

    private void registerLDCValueSource(Location location) throws DataflowAnalysisException {

        LDC instruction = (LDC) location.getHandle().getInstruction();
        Object constantValue = instruction.getValue(cpg);
        registerConstantSource(location, constantValue);
    }
View Full Code Here

Examples of org.apache.bcel.generic.LDC

                    }
                }

            }
            if (ins instanceof LDC) {
                LDC ldc = (LDC) ins;
                Object value = ldc.getValue(cpg);
                if (value instanceof ConstantClass) {
                    ConstantClass cc = (ConstantClass) value;
                    constantClass = cc.getBytes(classContext.getJavaClass().getConstantPool());
                    pcForConstantClass = pc;
                }
View Full Code Here

Examples of org.apache.bcel.generic.LDC

                                }
                            }
                        }

                    } else if (prevIns instanceof LDC) {
                        LDC ldc = (LDC) prevIns;
                        Type t = ldc.getType(methodGen.getConstantPool());
                        if (t.getSignature().equals("Ljava/lang/Class;")) {
                            Object value = ldc.getValue(methodGen.getConstantPool());
                            if (value instanceof ConstantClass) {
                                ConstantClass v = (ConstantClass) value;
                                initializationOf = ClassName.toSignature(v.getBytes(javaClass.getConstantPool()));
                                foundDeadClassInitialization = true;
                            } else if (value instanceof ObjectType) {
View Full Code Here

Examples of org.apache.bcel.generic.LDC

    }

    private boolean isConstantStringLoad(Location location, ConstantPoolGen cpg)  {
        Instruction ins = location.getHandle().getInstruction();
        if (ins instanceof LDC) {
            LDC load = (LDC) ins;
            Object value = load.getValue(cpg);
            if (value instanceof String) {
                return true;
            }
        }
View Full Code Here

Examples of org.apache.bcel.generic.LDC

        Instruction ins = handle.getInstruction();
        if (!isConstantStringLoad(location, cpg)) {
            throw new IllegalArgumentException("instruction must be LDC");
        }

        LDC load = (LDC) ins;
        Object value = load.getValue(cpg);
        String stringValue = ((String) value).trim();
        if (stringValue.startsWith(",") || stringValue.endsWith(",")) {
            stringAppendState.setSawComma(handle);
        }
        if (isCloseQuote(stringValue) && stringAppendState.getSawOpenQuote(handle)) {
View Full Code Here

Examples of org.apache.bcel.generic.LDC

        /*
         * JDOImplHelper.registerClass( ___jdo$loadClass("fullclassname"),
         * ___jdo$fieldNames, ___jdo$fieldTypes, ___jdo$FieldFlags,
         * ___jdo$PersistenceCapableSuperclass, new ClassConstrutor());
         */
        il.append(new LDC(constantPoolGen.addString(className)));
        il.append(factory.createInvoke(className, MN_jdoLoadClass, OT_CLASS, new Type[]{Type.STRING}, Constants.INVOKESTATIC));
        il.append(factory.createGetStatic(className, FN_FieldNames, new ArrayType(Type.STRING, 1)));
        il.append(factory.createGetStatic(className, FN_FieldTypes, new ArrayType(OT_CLASS, 1)));
        il.append(factory.createGetStatic(className, FN_FieldFlags, new ArrayType(Type.BYTE, 1)));
        il.append(factory.createGetStatic(className, FN_PersistenceCapableSuperclass, OT_CLASS));
View Full Code Here

Examples of org.apache.bcel.generic.LDC

        InstructionHandle result;
        result = il.append(factory.createNew(newException));
        il.append(InstructionConstants.DUP);
        il.append(factory.createNew(Type.STRINGBUFFER));
        il.append(InstructionConstants.DUP);
        il.append(new LDC(classGen.getConstantPool().addString(message)));
        il.append(
            factory.createInvoke(
                Type.STRINGBUFFER.getClassName(),
                Constants.CONSTRUCTOR_NAME,
                Type.VOID,
View Full Code Here

Examples of org.apache.bcel.generic.LDC

    protected InstructionHandle createThrowException(String newException, String message)
    {
        InstructionHandle result;
        result = il.append(factory.createNew(newException));
        il.append(InstructionConstants.DUP);
        il.append(new LDC(classGen.getConstantPool().addString(message)));
        il.append(
            factory.createInvoke(
                newException,
                Constants.CONSTRUCTOR_NAME,
                Type.VOID,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.