2008-04-19 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Sat, 19 Apr 2008 15:41:47 +0000 (15:41 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Sat, 19 Apr 2008 15:41:47 +0000 (15:41 -0000)
* Mono.Cecil.Mdb/MdbReader.cs: Update wrt interface change (i.e.
Read now provide a Dictionary to reuse the existing Hashtable
between offsets and instructions).

svn path=/trunk/mcs/; revision=101216

mcs/class/Mono.Cecil.Mdb/ChangeLog
mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb/MdbReader.cs

index 56b35d91eac0dd67ff8b96241017ce0a12a88af9..d40038879d2b2ee8ba713141b8778866bbd0249f 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-19  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * Mono.Cecil.Mdb/MdbReader.cs: Update wrt interface change (i.e. 
+       Read now provide a Dictionary to reuse the existing Hashtable 
+       between offsets and instructions).
+
 2008-04-08  Sebastien Pouliot  <sebastien@ximian.com>
 
        * Mono.Cecil.Mdb/MdbReader.cs:
index d2716ced93a493d2677ef10840c10d7ef2f8567b..9dc3e19906845100b49c030ea6d904cb8a2bed0a 100644 (file)
@@ -47,16 +47,7 @@ namespace Mono.Cecil.Mdb {
                        m_scopes = new Hashtable ();
                }
 
-               Hashtable GetInstructions (MethodBody body)
-               {
-                       Hashtable instructions = new Hashtable (body.Instructions.Count);
-                       foreach (Instruction i in body.Instructions)
-                               instructions.Add (i.Offset, i);
-
-                       return instructions;
-               }
-
-               Instruction GetInstruction (MethodBody body, Hashtable instructions, int offset)
+               Instruction GetInstruction (MethodBody body, IDictionary instructions, int offset)
                {
                        Instruction instr = (Instruction) instructions [offset];
                        if (instr != null)
@@ -65,13 +56,12 @@ namespace Mono.Cecil.Mdb {
                        return body.Instructions.Outside;
                }
 
-               public void Read (MethodBody body)
+               public void Read (MethodBody body, IDictionary instructions)
                {
                        MethodEntry entry = m_symFile.GetMethodByToken ((int) body.Method.MetadataToken.ToUInt ());
                        if (entry == null)
                                return;
 
-                       Hashtable instructions = GetInstructions(body);
                        ReadScopes (entry, body, instructions);
                        ReadLineNumbers (entry, instructions);
                        ReadLocalVariables (entry, body);
@@ -90,7 +80,7 @@ namespace Mono.Cecil.Mdb {
                        }
                }
 
-               void ReadLineNumbers (MethodEntry entry, Hashtable instructions)
+               void ReadLineNumbers (MethodEntry entry, IDictionary instructions)
                {
                        foreach (LineNumberEntry line in entry.LineNumbers) {
                                Instruction instr = instructions [line.Offset] as Instruction;
@@ -116,7 +106,7 @@ namespace Mono.Cecil.Mdb {
                        return doc;
                }
 
-               void ReadScopes (MethodEntry entry, MethodBody body, Hashtable instructions)
+               void ReadScopes (MethodEntry entry, MethodBody body, IDictionary instructions)
                {
                        foreach (LexicalBlockEntry scope in entry.LexicalBlocks) {
                                Scope s = new Scope ();