Package org.objectweb.asm.tree.analysis

Examples of org.objectweb.asm.tree.analysis.AnalyzerException


            this.lvarResumed = mn.maxLocals + 1;
            this.lvarInvocationReturnValue = mn.maxLocals + 2;
            // this.lvarSuspendableCalled = (verifyInstrumentation ? mn.maxLocals + 3 : -1);
            this.firstLocal = ((mn.access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC) ? 0 : 1;
        } catch (UnsupportedOperationException ex) {
            throw new AnalyzerException(null, ex.getMessage(), ex);
        }
    }
View Full Code Here


            else if (val instanceof Double)
               return new ConstantValue.DoubleConstant(((Double)val).doubleValue());
            else if (val instanceof Type)
               return new ConstantValue.ClassConstant((Type)val);
            else
               throw new AnalyzerException(insn, "Unhandled bytecode instruction");
         }
         case NEW:
         {
            assert(insn instanceof TypeInsnNode);
            TypeInsnNode typeInsn = (TypeInsnNode)insn;
            String className = typeInsn.desc;
            return new TypedValue.NewValue(className);
         }
         case BIPUSH:
         case SIPUSH:
         {
            assert(insn instanceof IntInsnNode);
            IntInsnNode intInsn = (IntInsnNode)insn;
            return new ConstantValue.IntegerConstant(intInsn.operand);
         }
         case GETSTATIC:
         {
            assert(insn instanceof FieldInsnNode);
            FieldInsnNode fieldInsn = (FieldInsnNode)insn;
            return new TypedValue.GetStaticFieldValue(fieldInsn.owner, fieldInsn.name, fieldInsn.desc);
         }
         case JSR:
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
      }
   }
View Full Code Here

         case ATHROW:
         case INSTANCEOF:
         case MONITORENTER:
         case MONITOREXIT:
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
      }
   }
View Full Code Here

         case LOR:
         case IXOR:
         case LXOR:
         case PUTFIELD:
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
      }
   }
View Full Code Here

         case AASTORE:
         case BASTORE:
         case CASTORE:
         case SASTORE:
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
      }
   }
View Full Code Here

               TypedValue base = (TypedValue)values.get(0);
               if (methodChecker != null)
               {
                  OperationSideEffect sideEffect = methodChecker.isMethodSafe(sig, base, args);
                  if (sideEffect == OperationSideEffect.UNSAFE)
                     throw new AnalyzerException(insn, "Unknown method " + sig + " encountered");
                  else if (sideEffect == OperationSideEffect.SAFE)
                     sideEffects.add(new MethodSideEffectCall(sig, base, args));
               }
               MethodCallValue.VirtualMethodCallValue toReturn;
               toReturn = new MethodCallValue.VirtualMethodCallValue(methodInsn.owner, methodInsn.name, methodInsn.desc, args, base);
               if (toReturn.isConstructor() && linkedFrame != null)
                  linkedFrame.replaceValues(base, toReturn);
               else if (methodChecker != null && methodChecker.isFluentChaining(sig))
                  linkedFrame.replaceValues(base, toReturn);
               return toReturn;
            }
            else
            {
               if (methodChecker != null)
               {
                  OperationSideEffect sideEffect = methodChecker.isStaticMethodSafe(sig);
                  if (sideEffect == OperationSideEffect.UNSAFE)
                     throw new AnalyzerException(insn, "Unknown method " + sig + " encountered");
                  else if (sideEffect == OperationSideEffect.SAFE)
                     sideEffects.add(new MethodSideEffectCall(sig, null, args));
               }
               return new MethodCallValue.StaticMethodCallValue(methodInsn.owner, methodInsn.name, methodInsn.desc, args);
            }
         }
         case INVOKEDYNAMIC:
         {
            assert(insn instanceof InvokeDynamicInsnNode);
            InvokeDynamicInsnNode invokeInsn = (InvokeDynamicInsnNode)insn;
            if (!"java/lang/invoke/LambdaMetafactory".equals(invokeInsn.bsm.getOwner())
                  || !"altMetafactory".equals(invokeInsn.bsm.getName())
                  || !"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;".equals(invokeInsn.bsm.getDesc()))
               throw new AnalyzerException(insn, "Unknown invokedynamic " + invokeInsn.bsm + " encountered");
            // Return the Lambda creation result
            Handle lambdaMethod = (Handle)invokeInsn.bsmArgs[1];
            Type functionalInterface = Type.getReturnType(invokeInsn.desc);
            return new LambdaFactory(functionalInterface, lambdaMethod, new ArrayList<>((List<TypedValue>)values));
         }
         case MULTIANEWARRAY:
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
      }
   }
View Full Code Here

         case IFNONNULL:
         case IF_ACMPNE:
            op = TypedValue.ComparisonValue.ComparisonOp.ne;
            break;
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
      }
      TypedValue.ComparisonValue toReturn =
         new TypedValue.ComparisonValue(op, (TypedValue)value1, (TypedValue)value2);
     
      if (branchHandler != null)
View Full Code Here

            while (baseVal instanceof TypedValue.GetFieldValue)
               baseVal = ((TypedValue.GetFieldValue)baseVal).operand;
            if (baseVal instanceof  TypedValue.ThisValue)
               return createGetFieldTypedValue(insn, value);
         }
         throw new AnalyzerException(insn, "Unhandled field access");
      }
      else
         return super.unaryOperation(insn, value);
   }
View Full Code Here

            this.lvarStack = mn.maxLocals;
            this.lvarResumed = mn.maxLocals + 1;
            this.lvarInvocationReturnValue = mn.maxLocals + 2;
            this.firstLocal = ((mn.access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC) ? 0 : 1;
        } catch (UnsupportedOperationException ex) {
            throw new AnalyzerException(null, ex.getMessage(), ex);
        }
    }
View Full Code Here

            this.lvarResumed = mn.maxLocals + 1;
            this.lvarInvocationReturnValue = mn.maxLocals + 2;
            // this.lvarSuspendableCalled = (verifyInstrumentation ? mn.maxLocals + 3 : -1);
            this.firstLocal = ((mn.access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC) ? 0 : 1;
        } catch (UnsupportedOperationException ex) {
            throw new AnalyzerException(null, ex.getMessage(), ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.analysis.AnalyzerException

Copyright © 2018 www.massapicom. 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.