Author: jbevain
Date: 2007-10-18 16:49:00 -0400 (Thu, 18 Oct 2007)
New Revision: 87798

Modified:
   trunk/mcs/class/Mono.Cecil/ChangeLog
   trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeWriter.cs
   trunk/mcs/class/Mono.Cecil/Mono.Cecil/AssemblyInfo.cs
Log:
2007-10-18  Jb Evain  <[EMAIL PROTECTED]>

        * Mono.Cecil.Cil/CodeWriter.cs: don't care about reducing MaxStack.


Modified: trunk/mcs/class/Mono.Cecil/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Cecil/ChangeLog        2007-10-18 19:59:27 UTC (rev 
87797)
+++ trunk/mcs/class/Mono.Cecil/ChangeLog        2007-10-18 20:49:00 UTC (rev 
87798)
@@ -1,3 +1,7 @@
+2007-10-18  Jb Evain  <[EMAIL PROTECTED]>
+
+       * Mono.Cecil.Cil/CodeWriter.cs: don't care about reducing MaxStack.
+
 2007-10-11  Jb Evain  <[EMAIL PROTECTED]>
 
        * Mono.Cecil/TypeReference.cs: add a IsNested helper property.

Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/AssemblyInfo.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil/AssemblyInfo.cs       2007-10-18 
19:59:27 UTC (rev 87797)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/AssemblyInfo.cs       2007-10-18 
20:49:00 UTC (rev 87798)
@@ -43,7 +43,7 @@
 [assembly: CLSCompliant (false)]
 [assembly: ComVisible (false)]
 
-[assembly: AssemblyVersion ("0.6.8.7193")]
+[assembly: AssemblyVersion ("0.6.8.7798")]
 
 #if KEYFILE
 [assembly: AssemblyKeyFile("../../mono.snk")]

Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeWriter.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeWriter.cs     2007-10-18 
19:59:27 UTC (rev 87797)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeWriter.cs     2007-10-18 
20:49:00 UTC (rev 87798)
@@ -429,11 +429,10 @@
                                }
                        }
 
-                       int max = 0, current = 0;
+                       int max = 0;
                        foreach (Instruction instr in instructions) {
-
                                if (ehs.Contains (instr))
-                                       current++;
+                                       max++;
 
                                switch (instr.OpCode.StackBehaviourPush) {
                                case StackBehaviour.Push1:
@@ -443,46 +442,18 @@
                                case StackBehaviour.Pushr8:
                                case StackBehaviour.Pushref:
                                case StackBehaviour.Varpush:
-                                       current++;
+                                       max++;
                                        break;
                                case StackBehaviour.Push1_push1:
-                                       current += 2;
+                                       max += 2;
                                        break;
                                }
 
-                               if (max < current)
-                                       max = current;
-
-                               switch (instr.OpCode.StackBehaviourPop) {
-                               case StackBehaviour.Varpop:
-                                       break;
-                               case StackBehaviour.Pop1:
-                               case StackBehaviour.Popi:
-                               case StackBehaviour.Popref:
-                                       current--;
-                                       break;
-                               case StackBehaviour.Pop1_pop1:
-                               case StackBehaviour.Popi_pop1:
-                               case StackBehaviour.Popi_popi:
-                               case StackBehaviour.Popi_popi8:
-                               case StackBehaviour.Popi_popr4:
-                               case StackBehaviour.Popi_popr8:
-                               case StackBehaviour.Popref_pop1:
-                               case StackBehaviour.Popref_popi:
-                                       current -= 2;
-                                       break;
-                               case StackBehaviour.Popi_popi_popi:
-                               case StackBehaviour.Popref_popi_popi:
-                               case StackBehaviour.Popref_popi_popi8:
-                               case StackBehaviour.Popref_popi_popr4:
-                               case StackBehaviour.Popref_popi_popr8:
-                               case StackBehaviour.Popref_popi_popref:
-                                       current -= 3;
-                                       break;
+                               if (instr.OpCode.OperandType == 
OperandType.InlineMethod) {
+                                       IMethodSignature signature = 
instr.Operand as IMethodSignature;
+                                       if (signature != null && 
signature.ReturnType.ReturnType.FullName != Constants.Void)
+                                               max++;
                                }
-
-                               if (current < 0)
-                                       current = 0;
                        }
 
                        instructions.Container.MaxStack = max;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to