Examples of LocalVariableTable


Examples of org.apache.bcel.classfile.LocalVariableTable

                }
            }

            // Append the local variables table.
            if (printLocalVariables) {
                LocalVariableTable vt = m.getLocalVariableTable();
                if (vt != null) {
                    LocalVariable vars[] = vt.getLocalVariableTable();
                    if (vars.length > 0) {
                        String indentStr3 = indentString(indent * 3);
                        result.append(indentString(
                                indent * 2, "LocalVariableTable:"));
                        result.append(n);
View Full Code Here

Examples of org.apache.bcel.classfile.LocalVariableTable

                }
            }

            // Append the local variables table.
            if (printLocalVariables) {
                LocalVariableTable vt = m.getLocalVariableTable();
                if (vt != null) {
                    LocalVariable vars[] = vt.getLocalVariableTable();
                    if (vars.length > 0) {
                        String indentStr3 = indentString(indent * 3);
                        result.append(indentString(
                                indent * 2, "LocalVariableTable:"));
                        result.append(n);
View Full Code Here

Examples of org.apache.bcel.classfile.LocalVariableTable

        int size = lg.length;
        LocalVariable[] lv = new LocalVariable[size];
        for (int i = 0; i < size; i++) {
            lv[i] = lg[i].getLocalVariable(cp);
        }
        return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp
                .getConstantPool());
    }
View Full Code Here

Examples of org.apache.bcel.classfile.LocalVariableTable

        byte[] byte_code = null;
        if (il != null) {
            byte_code = il.getByteCode();
        }
        LineNumberTable lnt = null;
        LocalVariableTable lvt = null;
        /* Create LocalVariableTable and LineNumberTable attributes (for debuggers, e.g.)
         */
        if ((variable_vec.size() > 0) && !strip_attributes) {
            addCodeAttribute(lvt = getLocalVariableTable(cp));
        }
View Full Code Here

Examples of org.apache.bcel.classfile.LocalVariableTable

        //Here because its easier to collect the information of the
        //(possibly more than one) LocalVariableTables belonging to
        //one certain Code attribute.
        if (atts[a] instanceof LocalVariableTable){ // checks conforming to vmspec2 4.7.9

          LocalVariableTable lvt = (LocalVariableTable) atts[a];

          checkIndex(lvt, lvt.getNameIndex(), CONST_Utf8);

          String lvtname = ((ConstantUtf8) cp.getConstant(lvt.getNameIndex())).getBytes();
          if (! lvtname.equals("LocalVariableTable")){
            throw new ClassConstraintException("The LocalVariableTable attribute '"+tostring(lvt)+"' is not correctly named 'LocalVariableTable' but '"+lvtname+"'.");
          }

          Code code = obj;

          //In JustIce, the check for correct offsets into the code array is delayed to Pass 3a.
          LocalVariable[] localvariables = lvt.getLocalVariableTable();

          for (int i=0; i<localvariables.length; i++){
            checkIndex(lvt, localvariables[i].getNameIndex(), CONST_Utf8);
            String localname = ((ConstantUtf8) cp.getConstant(localvariables[i].getNameIndex())).getBytes();
            if (!validJavaIdentifier(localname)){
View Full Code Here

Examples of org.apache.bcel.classfile.LocalVariableTable

    /* We cannot use code.getLocalVariableTable() because there could be more
       than only one. This is a bug in BCEL. */
    Attribute[] atts = code.getAttributes();
    for (int a=0; a<atts.length; a++){
      if (atts[a] instanceof LocalVariableTable){
        LocalVariableTable lvt = (LocalVariableTable) atts[a];
        if (lvt != null){
          LocalVariable[] localVariables = lvt.getLocalVariableTable();
          for (int i=0; i<localVariables.length; i++){
            int startpc = localVariables[i].getStartPC();
            int length  = localVariables[i].getLength();
       
            if (!contains(instructionPositions, startpc)){
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.LocalVariableTable

    for (int i = 0; i < size; i++) {
      lv[i] = lg[i].getLocalVariable(cp);
    }

    return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp);
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.LocalVariableTable

    if (il != null) {
      byte_code = il.getByteCode();
    }

    LineNumberTable lnt = null;
    LocalVariableTable lvt = null;
    // J5TODO: LocalVariableTypeTable support!

    /*
     * Create LocalVariableTable and LineNumberTable attributes (for debuggers, e.g.)
     */
 
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.LocalVariableTable

      InstructionHandle start = il.getStart();
      if (lineNumber > 0) {
        start.addTargeter(new LineNumberTag(lineNumber));
      }
      // Fix up the local variables: find any that have a startPC of 0 and ensure they target the new start of the method
      LocalVariableTable lvt = shadow.getEnclosingMethod().getMemberView().getMethod().getLocalVariableTable();
      if (lvt != null) {
        LocalVariable[] lvTable = lvt.getLocalVariableTable();
        for (int i = 0; i < lvTable.length; i++) {
          LocalVariable lv = lvTable[i];
          if (lv.getStartPC() == 0) {
            start.addTargeter(new LocalVariableTag(lv.getSignature(), lv.getName(), lv.getIndex(), 0));
          }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.LocalVariableTable

      return EMPTY_STRINGS;
    }

    final int startAtStackIndex = method.isStatic() ? 0 : 1;
    final List<MethodArgument> arguments = new ArrayList<MethodArgument>();
    LocalVariableTable lt = method.getLocalVariableTable();
    if (lt != null) {
      LocalVariable[] lvt = lt.getLocalVariableTable();
      for (int j = 0; j < lvt.length; j++) {
        LocalVariable localVariable = lvt[j];
        if (localVariable.getStartPC() == 0) {
          if (localVariable.getIndex() >= startAtStackIndex) {
            arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex()));
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.