Package ch.epfl.labos.iu.orm.queryll2.path

Examples of ch.epfl.labos.iu.orm.queryll2.path.MethodSideEffectCall


         db = new DBManager(true);
      else
         db = new DBManager(out);

      // Perform bytecode analysis on the classfiles at path "."
      QueryllAnalyzer queryll2 = new QueryllAnalyzer();
      queryll2.useRuntimeAnalysis(db);
     
      // Now do some queries!
      //   Note: all queries are evaluated lazily, so at the end of each
      //         query, the size() method is called on the query to
      //         force the query to be evaluated.
View Full Code Here


   MethodAnalysisResults symbolicAnalysis;

   public static LambdaAnalysis fullyAnalyzeClassAsLambda(LambdaInfo lambdaInfo, LambdaAsClassAnalysisConfig lambdaAsClassConfig, int numLambdaArgs, MetamodelUtil metamodel, ClassLoader alternateClassLoader, boolean isObjectEqualsSafe, boolean throwExceptionOnFailure)
   {
      try {
         MethodAnalysisResults analysis = analyzeLambdaClass(lambdaInfo.Lambda.getClass(), metamodel, lambdaAsClassConfig, lambdaInfo.Lambda.getClass().getClassLoader(), isObjectEqualsSafe);
         if (analysis == null)
         {
            if (throwExceptionOnFailure) throw new IllegalArgumentException("Could not analyze lambda code");
            return null;
         }
View Full Code Here

    */
   public static LambdaAnalysis analyzeClassAsLambda(MetamodelUtil metamodel, ClassLoader alternateClassLoader, boolean isObjectEqualsSafe, LambdaAsClassAnalysisConfig lambdaAsClassConfig, String className, Map<String, TypedValue> indirectParamMapping, boolean throwExceptionOnFailure)
   {
      try {
         Class<?> c = Class.forName(className);
         MethodAnalysisResults analysis = analyzeLambdaClass(c, metamodel, lambdaAsClassConfig, alternateClassLoader, isObjectEqualsSafe);
         if (analysis == null)
         {
            if (throwExceptionOnFailure) throw new IllegalArgumentException("Could not analyze lambda code");
            return null;
         }
View Full Code Here

      //   we've cached the results of this analysis already without needing
      //   to redo all this analysis.
      SerializedLambda s = lambdaInfo.serializedLambda;
      try {
         if (s == null) return null;
         MethodAnalysisResults analysis = analyzeLambda(metamodel, alternateClassLoader, isObjectEqualsSafe, s.implClass, s.implMethodName, s.implMethodSignature);
         if (analysis == null)
         {
            if (throwExceptionOnFailure) throw new IllegalArgumentException("Could not analyze lambda code");
            return null;
         }
View Full Code Here

      // TODO: The part below will need to be moved to a separate method.
      //   That way, we can used the serialized lambda info to check if
      //   we've cached the results of this analysis already without needing
      //   to redo all this analysis.
      try {
         MethodAnalysisResults analysis = analyzeLambda(metamodel, alternateClassLoader, isObjectEqualsSafe, lambdaHandle.getOwner(), lambdaHandle.getName(), lambdaHandle.getDesc());
         if (analysis == null)
         {
            if (throwExceptionOnFailure) throw new IllegalArgumentException("Could not analyze lambda code");
            return null;
         }
View Full Code Here

      // Open up the corresponding class to analyze
      PathAnalysisFactory pathAnalysisFactory = new PathAnalysisFactory(
            metamodel.getMethodChecker(isObjectEqualsSafe));
      TransformationClassAnalyzer classAnalyzer =
            new TransformationClassAnalyzer(className, alternateClassLoader);
      MethodAnalysisResults analysis = classAnalyzer.analyzeLambdaMethod(methodName, methodSignature, pathAnalysisFactory);
      PathAnalysisSimplifier.cleanAndSimplify(analysis, metamodel.getComparisonMethods(isObjectEqualsSafe));
      return analysis;
   }
View Full Code Here

      Method matchingMethod = lambdaAsClass.findLambdaMethod(lambdaClass);
      if (matchingMethod == null)
         throw new AnalyzerException(null, "Could not find a lambda method with the expected name in the class");
      PathAnalysisFactory pathAnalysisFactory = new PathAnalysisFactory(
            metamodel.getMethodChecker(isObjectEqualsSafe));
      MethodAnalysisResults analysis = classAnalyzer.analyzeLambdaMethod(matchingMethod.getName(), Type.getMethodDescriptor(matchingMethod), pathAnalysisFactory);
      PathAnalysisSimplifier.cleanAndSimplify(analysis, metamodel.getComparisonMethods(isObjectEqualsSafe));
      return analysis;
   }
View Full Code Here

      if (s == null) return null;
      // TODO: The part below will need to be moved to a separate method.
      //   That way, we can used the serialized lambda info to check if
      //   we've cached the results of this analysis already without needing
      //   to redo all this analysis.
      MethodAnalysisResults analysis = analyzeLambda(metamodel, s);
      if (analysis == null) return null;
      return new LambdaInfo(lambda, s, analysis);
   }
View Full Code Here

         // Open up the corresponding class to analyze
         PathAnalysisFactory pathAnalysisFactory = new PathAnalysisFactory(
               new MethodChecker(metamodel));
         TransformationClassAnalyzer classAnalyzer =
               new TransformationClassAnalyzer(className);
         MethodAnalysisResults analysis = classAnalyzer.analyzeLambdaMethod(methodName, methodSignature, pathAnalysisFactory);
         PathAnalysisSimplifier.cleanAndSimplify(analysis, Collections.emptyMap());
         return analysis;
      } catch (IOException e)
      {
         e.printStackTrace();
View Full Code Here

               {
                  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:
View Full Code Here

TOP

Related Classes of ch.epfl.labos.iu.orm.queryll2.path.MethodSideEffectCall

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.