2003-02-09 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sun, 9 Feb 2003 20:09:05 +0000 (20:09 -0000)
committerMartin Baulig <martin@novell.com>
Sun, 9 Feb 2003 20:09:05 +0000 (20:09 -0000)
* IMonoSymbolWriter.cs (MarkSequencePoint): New method which takes
just the required arguments as scalars, not arrays.

* ILGenerator.cs (ILGenerator.MarkSequencePoint): Use that new
interface method; unnecessarily creating such a large number of
arrays is both slow and too memory consuming.

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

mcs/class/corlib/System.Reflection.Emit/ChangeLog
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
mcs/class/corlib/System.Reflection.Emit/IMonoSymbolWriter.cs

index c03ada8c555858bb8649a953482c9def84057939..0bee80b151aed6507f4de58a7403ff075f998aa9 100644 (file)
@@ -1,3 +1,12 @@
+2003-02-09  Martin Baulig  <martin@ximian.com>
+
+       * IMonoSymbolWriter.cs (MarkSequencePoint): New method which takes
+       just the required arguments as scalars, not arrays.
+
+       * ILGenerator.cs (ILGenerator.MarkSequencePoint): Use that new
+       interface method; unnecessarily creating such a large number of
+       arrays is both slow and too memory consuming.   
+
 2003-02-08  Zoltan Varga  <vargaz@freemail.hu>
 
        * MethodBuilder.cs: Added error checking to methods so they conform to
index f8d893b083bb8fb89d36bebd43a6098f2c6a35f6..8377a6da820d9c56049791411316642b99e37afa 100644 (file)
@@ -12,6 +12,7 @@ using System;
 using System.Collections;
 using System.Diagnostics.SymbolStore;
 using System.Runtime.InteropServices;
+using Mono.CSharp.Debugger;
 
 namespace System.Reflection.Emit {
 
@@ -132,7 +133,7 @@ namespace System.Reflection.Emit {
                private int num_fixups;
                private ModuleBuilder module;
                private AssemblyBuilder abuilder;
-               private ISymbolWriter sym_writer;
+               private IMonoSymbolWriter sym_writer;
                private Stack scopes;
                private int cur_block;
                private Stack open_blocks;
@@ -155,7 +156,7 @@ namespace System.Reflection.Emit {
                                module = (ModuleBuilder)((ConstructorBuilder)mb).TypeBuilder.Module;
                        }
                        abuilder = (AssemblyBuilder)module.Assembly;
-                       sym_writer = module.GetSymWriter ();
+                       sym_writer = module.symbol_writer;
                        open_blocks = new Stack ();
                }
 
@@ -626,14 +627,7 @@ namespace System.Reflection.Emit {
                        if (sym_writer == null)
                                return;
 
-                       int[] offsets = { code_len };
-                       int[] startLines = { startLine };
-                       int[] startColumns = { startColumn };
-                       int[] endLines = { endLine };
-                       int[] endColumns = { endColumn };
-
-                       sym_writer.DefineSequencePoints (document, offsets, startLines, startColumns,
-                                                        endLines, endColumns);
+                       sym_writer.MarkSequencePoint (code_len, startLine, startColumn);
                }
                public virtual void ThrowException (Type exceptionType) {
                        throw new NotImplementedException ();
index ebeae693b40c0ab72c6d4cea344d596dab04c8a9..20177b3b27a400a8f89bfb360b52e4fed18ad5e1 100644 (file)
@@ -14,5 +14,7 @@ using System.Reflection.Emit;
 namespace Mono.CSharp.Debugger {
        public interface IMonoSymbolWriter : ISymbolWriter {
                byte[] CreateSymbolFile (AssemblyBuilder assembly_builder);
+
+               void MarkSequencePoint (int offset, int line, int column);
        }
 }