Package javassist.bytecode

Examples of javassist.bytecode.CodeIterator.byteAt()


                    }
                    CodeIterator it = m.getCodeAttribute().iterator();
                    while (it.hasNext()) {
                        // loop through the bytecode
                        int index = it.next();
                        int op = it.byteAt(index);
                        // if the bytecode is a method invocation
                        if (op == CodeIterator.INVOKESPECIAL) {
                            int val = it.s16bitAt(index + 1);
                            // if the method call is one of the methods we are
                            // replacing
View Full Code Here


                        continue;
                    }
                    CodeIterator it = m.getCodeAttribute().iterator();
                    while (it.hasNext()) {
                        int index = it.next();
                        int op = it.byteAt(index);
                        if (op == CodeIterator.GETSTATIC || op == CodeIterator.PUTSTATIC) {
                            int val = it.s16bitAt(index + 1);
                            if (fieldAccessLocations.containsKey(val)) {
                                StaticFieldAccessRewriteData data = fieldAccessLocations.get(val);
                                it.write16bit(newFieldAccessLocations.get(data), index + 1);
View Full Code Here

                    }
                    CodeIterator it = m.getCodeAttribute().iterator();
                    while (it.hasNext()) {
                        // loop through the bytecode
                        int index = it.next();
                        int op = it.byteAt(index);
                        // if the bytecode is a method invocation
                        if (op == CodeIterator.INVOKEVIRTUAL) {
                            int val = it.s16bitAt(index + 1);
                            // if the method call is one of the methods we are
                            // replacing
View Full Code Here

                    }
                    CodeIterator it = m.getCodeAttribute().iterator();
                    while (it.hasNext()) {
                        // loop through the bytecode
                        int index = it.next();
                        int op = it.byteAt(index);
                        // if the bytecode is a method invocation
                        if (op == CodeIterator.INVOKEVIRTUAL || op == CodeIterator.INVOKESTATIC || op == CodeIterator.INVOKEINTERFACE || op == CodeIterator.INVOKESPECIAL) {
                            int val = it.s16bitAt(index + 1);
                            // if the method call is one of the methods we are
                            // replacing
View Full Code Here

                    }
                    CodeIterator it = m.getCodeAttribute().iterator();
                    while (it.hasNext()) {
                        // loop through the bytecode
                        int index = it.next();
                        int op = it.byteAt(index);
                        // if the bytecode is a field access
                        if (op == Opcode.PUTFIELD || op == Opcode.GETFIELD) {
                            int val = it.s16bitAt(index + 1);
                            // if the field access is for an added field
                            if (fieldAccessLocations.containsKey(val)) {
View Full Code Here

      try {
        final CodeIterator itr = codeAttr.iterator();
        while ( itr.hasNext() ) {
          final int index = itr.next();
          final int op = itr.byteAt( index );
          if ( op != Opcode.PUTFIELD && op != Opcode.GETFIELD ) {
            continue;
          }

          final int constIndex = itr.u16bitAt( index+1 );
View Full Code Here

                    CodeIterator codeIterator = codeAttribute.iterator();

                    // Bon chaque instruction de cette méthode
                    while (codeIterator.hasNext()) {
                        int index = codeIterator.next();
                        int op = codeIterator.byteAt(index);

                        // DEBUG
                        // printOp(op);

                        int varNumber = -1;
View Full Code Here

                        int varNumber = -1;
                        // The variable changes
                        if (storeByCode.containsKey(op)) {
                            varNumber = storeByCode.get(op);
                            if (varNumber == -2) {
                                varNumber = codeIterator.byteAt(index + 1);
                            }
                        }

                        // Si c'est un store de la variable en cours d'examination
                        // et que c'est dans la frame d'utilisation de cette variable on trace l'affectation.
View Full Code Here

      try {
        CodeIterator itr = codeAttr.iterator();
        while ( itr.hasNext() ) {
          int index = itr.next();
          int op = itr.byteAt( index );
          if ( op != Opcode.PUTFIELD && op != Opcode.GETFIELD ) {
            continue;
          }

          int constIndex = itr.u16bitAt( index+1 );
View Full Code Here

                        annotationsChecked = true;
                        firstLine = line;
                        checkAnnotations(className, m.getName(), maa, line - 2); // -2 to get the line above the method
                    }

                    int op = it.byteAt(index);
                    // if the bytecode is a method invocation
                    if (op == CodeIterator.INVOKEVIRTUAL || op == CodeIterator.INVOKESTATIC || op == CodeIterator.INVOKEINTERFACE || op == CodeIterator.INVOKESPECIAL) {
                        int val = it.s16bitAt(index + 1);
                        Triple triple = calls.get(val);
                        if (triple != null) {
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.