CodeBody.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace CLRSharp
  5. {
  6. public class CodeBody
  7. {
  8. //以后准备用自定义Body采集一遍,可以先过滤处理掉Mono.Cecil的代码中的指向,执行会更快
  9. public CodeBody(CLRSharp.ICLRSharp_Environment env, Mono.Cecil.MethodDefinition _def)
  10. {
  11. this.method = _def;
  12. Init(env);
  13. }
  14. public MethodParamList typelistForLoc = null;
  15. Mono.Cecil.MethodDefinition method;
  16. public Mono.Cecil.Cil.MethodBody bodyNative
  17. {
  18. get
  19. {
  20. return method.Body;
  21. }
  22. }
  23. bool bInited = false;
  24. public void Init(CLRSharp.ICLRSharp_Environment env)
  25. {
  26. if (bInited) return;
  27. if(bodyNative.HasVariables)
  28. {
  29. typelistForLoc = new MethodParamList(env, bodyNative.Variables);
  30. }
  31. }
  32. /// <summary>
  33. /// 预约的优化项目,暂不进行
  34. /// </summary>
  35. public void cacheBody()
  36. {
  37. }
  38. }
  39. }