Example #1
0
 private BlockStatement DecompileMethodPartially(MethodBody body, out DecompilationContext context, bool needDecompiledMember = false)
 {
     context = null;
     if (this.get_IsCachingEnabled() && this.cacheService.IsDecompiledMemberInCache(body.get_Method(), this.language, this.renameInvalidMembers))
     {
         return(this.cacheService.GetDecompiledMemberFromCache(body.get_Method(), this.language, this.renameInvalidMembers).get_Member().get_Statement() as BlockStatement);
     }
     if ((int)(new ControlFlowGraphBuilder(body.get_Method())).CreateGraph().get_Blocks().Length > 2)
     {
         return(null);
     }
     try
     {
         stackVariable13 = new MethodSpecificContext(body);
         stackVariable15 = this.typeContext;
         if (stackVariable15 == null)
         {
             dummyVar0       = stackVariable15;
             stackVariable15 = new TypeSpecificContext(body.get_Method().get_DeclaringType());
         }
         V_2 = new DecompilationContext(stackVariable13, stackVariable15, this.language);
         if (!needDecompiledMember)
         {
             V_2.get_MethodContext().set_EnableEventAnalysis(false);
         }
         V_1     = new DecompilationPipeline(BaseLanguage.get_IntermediateRepresenationPipeline().get_Steps(), V_2);
         context = V_1.Run(body, this.language);
         V_0     = V_1.get_Body();
     }
     catch (Exception exception_0)
     {
         V_3 = exception_0;
         this.get_ExceptionsWhileDecompiling().Add(body.get_Method());
         V_0 = new BlockStatement();
         V_0.AddStatement(new ExceptionStatement(V_3, body.get_Method()));
         this.OnExceptionThrown(V_3);
     }
     return(V_0);
 }
Example #2
0
 private static BlockStatement RunPipeline(DecompilationPipeline pipeline, ILanguage language, MethodBody body, out DecompilationContext context)
 {
     context = pipeline.Run(body, language);
     return(pipeline.get_Body());
 }