2002-06-26 Martin Baulig <martin@gnome.org>
[mono.git] / mono / jit / ChangeLog
1 2002-06-26  Martin Baulig  <martin@gnome.org>
2
3         * debug.c (mono_debug_source_location_from_address): Added
4         `guint32 *line_number' argument.  If it's not NULL, store the line number
5         there and return the file name without the line number.
6
7         * exception.c (ves_icall_get_trace): Fill in `sf->filename' and `sf->line'.
8         (ves_icall_get_frame_info): Likewise.
9
10 2002-06-25  Dick Porter  <dick@ximian.com>
11
12         * jit.c (mono_jit_exec): Pass the assembly to mono_runtime_run_main
13
14 2002-06-22  Martin Baulig  <martin@gnome.org>
15
16         * debug.c (mono_debug_source_location_from_address): Small fix, an
17         unsigned number can never be smaller than zero, make that check
18         actually work.
19
20 2002-06-19  Dietmar Maurer  <dietmar@ximian.com>
21
22         * exception.c (ves_icall_get_trace): new method to get the stack
23         trace from a Exception.
24
25 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
26
27         * jit.c (check_inlining): do not inline functions containing 
28         calls to stack query functions
29
30         * exception.c (ves_icall_get_frame_info): impl.
31
32 Tue Jun 18 10:21:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33
34         * invoke.c: marshal simple arrays correctly.
35
36 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
37
38         * x86.brg: added inlined versions of Math.Sin, Math.Cos, Math.Sqrt
39
40         * jit.c (mono_analyze_stack): impl. STARG
41         (mono_analyze_stack): impl. LDARGA
42
43         * exception.c (arch_handle_exception): correctly restore register
44         values when unwinding the stack (fixes bug 25698)
45
46 2002-06-09  Martin Baulig  <martin@gnome.org>
47
48         * debug.c (mono_debug_open_image): For MONO_DEBUG_FORMAT_DWARF2_PLUS,
49         the `%s-debug.s' file is in the same directory than its assembly.
50
51 Sat Jun 1 13:24:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
52
53         * message.c, emit-x86.c: kill warnings.
54
55 2002-05-31  Dietmar Maurer  <dietmar@ximian.com>
56
57         * x86.brg: buf fix in REMOTE_STIND_OBJ
58         (mono_ldvirtftn): impl.
59         (mono_ldintftn): impl.
60         (mono_ldftn): impl.
61
62 Fri May 31 13:26:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
63
64         * mono.c: added --config command line option.
65
66 Fri May 31 12:34:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
67
68         * jit.c, jit.h: collect statistics about the number of basic blocks.
69
70 2002-05-31  Martin Baulig  <martin@gnome.org>
71
72         * debug.c (mono_debug_address_from_il_offset): New public function.
73         (mono_debug_add_method): Improved local variable info: correctly handle
74         variables in registers and their start/end scopes.
75
76 2002-05-30  Martin Baulig  <martin@gnome.org>
77
78         * debug-dwarf2.c (dwarf2_write_string): Use "0x%lx" as fprintf() format,
79         not "%p" which seems to be broken on Windows/mingw32.
80
81 2002-05-30  Dietmar Maurer  <dietmar@ximian.com>
82
83         * x86.brg (reg): bug fix in LOCALLOC
84
85         * mono.c (main): new switch --nointrinsic to disable memcpy opt.
86
87         * x86.brg: added block copy/init optimizations from 
88         Serge (serge@wildwestsoftware.com)
89  
90 Thu May 30 14:13:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
91
92         * invoke.cs: lookup P/Invoke method address only when needed.
93
94 2002-05-29  Dietmar Maurer  <dietmar@ximian.com>
95
96         * x86.brg: bug fix in REMOTE_STIND_OBJ
97
98         * invoke.c (arch_create_native_wrapper): handle pointers to value types
99
100         * helpers.h: use mono_ prefix for all functions
101
102         * jit.c (mono_analyze_stack): fixed SIZEOF
103
104         * x86.brg: impl. LOCALLOC, INITBLK
105
106 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
107
108         * x86.brg: impl. CKFINITE 
109
110         * jit.c (mono_analyze_stack): impl. CEE_CALLI
111
112         * x86.brg (JMP): impl. JMP opcode
113
114 2002-05-27  Dietmar Maurer  <dietmar@ximian.com>
115
116         * jit.c (mono_cfg_new): reserve additional space to store ESP when
117         calling finally handlers.
118
119         * exception.c (arch_get_call_finally): save ESP before calling
120         finally handler.
121
122         * helpers.c (map_arg_type): move some generic helper function into
123         this file.
124
125         * mono.c (usage): new option --breakonex 
126
127         * exception.c (arch_exc_is_caught): only return FALSE if really
128         unhandled.
129
130         * jit.c (mono_thread_abort): free jit_tls
131
132 2002-05-24  Dietmar Maurer  <dietmar@ximian.com>
133
134         * x86.brg (stmt): use memmove to cope with overlapping
135         blocks. This is not required by the specs, so we can remove it
136         later if it turns out to be too slow (and use memcpy).
137
138         * jit.c (mono_analyze_stack): moved const. folding from x86.brg
139
140         * x86.brg: CPBLK impl.
141
142         * emit-x86.c (tree_emit): modified to support 3 nonterminals per
143         rule (used for CPBLK).
144
145 Thu May 23 18:43:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
146
147         * mono.c: remove generated code from hash when benchmarking/testing
148         method compilation.
149         * invoke.cs: special case string ctors.
150
151 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
152
153         * *.c: code cleanups - tried to separate architecture dependent things. 
154
155 2002-05-23  Martin Baulig  <martin@gnome.org>
156
157         * debug.c (mono_debug_open): Don't call mono_debug_add_image().
158         (mono_debug_write_symbols): Only recreate the symbol file if
159         necessary.
160
161         * debug-private.h (MonoDebugHandle): Added `dirty' flag.
162
163         * mono.c (main): Call mono_debug_add_image() here.
164
165         * jit.c (mono_thread_abort): If we have debugging support, call
166         mono_debug_make_symbols() and G_BREAKPOINT().
167
168         * exception.c (arch_handle_exception): Don't G_BREAKPOINT() if we get
169         an unhandled exception.
170
171 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
172
173         * delegate.c: move the thread pool to metadata/threadpool.c, code
174         cleanup.
175
176 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
177
178         * exception.c (arch_exc_is_catched): impl. MS like exception
179         handling (added a check for unhandled exceptions)
180
181 2002-05-22  Martin Baulig  <martin@gnome.org>
182
183         * debug-dwarf2-plus.c (mono_debug_open_assembly_dwarf2_plus): Only run
184         the assembler if necessary, ie. the assembler file is newer than the
185         symbol file or the symbol file does not exist.
186
187         * debug.c: Added "update_on_exit" argument to recreate the symbol file
188         when the JIT exists.
189
190         * debug-dwarf2.c: Produce assembler code which is free of comments and
191         extra whitespaces so that it's suitable for `as -f'.
192
193 2002-05-22  Martin Baulig  <martin@gnome.org>
194
195         * debug-dwarf2.c (dwarf2_write_section_end): Removed.  This is not needed
196         and not supported by all assemblers.
197         (dwarf2_write_2byte): Use ".word" instead of ".2byte" since ".2byte" is a
198         GNU extension.
199
200         * mono.c (--debug): Small fix in the argument parsing.
201
202 2002-05-22  Martin Baulig  <martin@gnome.org>
203
204         * debug.c: Added "dont_assemble" and "dont_precompile" argument for dwarf-plus.
205
206         * mono.c: Applied patch from Miguel:
207         (--debug): This is now a `--debug=[FORMAT]' argument where FORMAT defaults
208         to dwarf-plus.
209
210 2002-05-21  Martin Baulig  <martin@gnome.org>
211
212         * debug.c (mono_debug_source_location_from_address): Added support for the
213         dwarf2-plus format.
214
215 2002-05-21  Martin Baulig  <martin@gnome.org>
216
217         * debug.c (mono_debug_source_location_from_address): New function.
218         (mono_debug_il_offset_from_address): New function.
219
220         * exception.c (arch_handle_exception): If we have debugging support, include
221         information about the source location and IL offset in the stack trace.
222
223 2002-05-21  Dietmar Maurer  <dietmar@ximian.com>
224
225         * jit.c (mono_analyze_stack): LDARG uses 16bit argument (fix bug
226         #25058)  
227
228         * x86.brg (stmt): removed unnecessary assertion
229
230         * jit.c (check_inlining):  we cant inline throw instructions
231         (because it breaks some basic block requirements)
232
233 2002-05-21  Martin Baulig  <martin@gnome.org>
234
235         * debug-private.h (MonoDebugFlags): New enum typedef.
236
237         * debug.c (mono_debug_open): Added a few useful arguments.  See the manpage
238         for details.
239
240 2002-05-21  Martin Baulig  <martin@gnome.org>
241
242         * debug.c (mono_debug_open_file): Renamed to mono_debug_open(), now takes
243         a `MonoAssembly *' argument instead of a `char *filename' one.  Also added
244         `const char **args' argument.
245
246         * mono.c (mono_jit_assembly): Renamed to mono_jit_compile_image(), added
247         `int verbose' argument and made it public.
248         (mono_jit_compile_class): New public function,  moved the code to compile
249         all methods in a class here from main().
250         (--compile): The argument can now also be an image (in `@imagename' format).
251         Updated documentation for this command line argument.
252         (--precompile): New command line argument to precompile an image/class/method
253         before executing the main app.  This argument can be given multiple times.
254         (--break): Renamed the "--debug" command line argument to "--break".
255         (--debug): New command line argument to specify the debugging format.
256         (--stabs, --dwarf, --dwarf-plus): Removed, obsoleted by "--debug".
257         (--debug-args): New command line argument.  This is a comma-separated list of
258         additional arguments for the symbol writer.
259         (usage): Beautified the help text a bit.
260
261         * debug-dwarf2-plus.c (mono_debug_open_assembly_dwarf2_plus): Use the new
262         public mono_jit_compile_image() function rather than duplication this
263         functionality here.
264
265 2002-05-21  Martin Baulig  <martin@gnome.org>
266
267         * debug-dwarf2-plus.c: This is now working again :-)
268
269         * debug.c (mono_debug_open_file): When using MONO_DEBUG_FORMAT_DWARF2_PLUS,
270         we create two MonoDebugHandles: one for MONO_DEBUG_FORMAT_DWARF2_PLUS and
271         one for the fallback MONO_DEBUG_FORMAT_DWARF2.
272
273 2002-05-21  Martin Baulig  <martin@gnome.org>
274
275         * jit.c (mono_debug_handle): Removed this global variable.
276
277         * debug.c (mono_debug_close): Removed.
278         (mono_debug_cleanup): New global function.
279         (mono_debug_add_image): New global function.
280         (mono_debug_handle_from_class): New global function.
281         (mono_debug_write_symbols): New global function.
282         (mono_debug_add_type): Removed `MonoDebugHandle *' argument.
283         (mono_debug_add_method): Likewise.
284
285 2002-05-21  Martin Baulig  <martin@gnome.org>
286
287         Work around a hard-to-fix bug in GDB and create a single dwarf/stabs
288         file for all assemblies.  Currently, the JIT doesn't put all methods
289         from a single assembly into a continuous region of memory.  We were
290         previously creating valid DWARF 2 files for this, but unfortunately
291         GDB's symbol tables get messed up when it reads more than one such file.
292
293         * debug-private.h (AssemblyDebugInfo): Moved `f', `producer_name',
294         `next_idx', `methods', `type_hash', `source_files' and `format'
295         into the MonoDebugHandle.
296
297         * debug.c (mono_debug_get_type): This now operates on the MonoDebugHandle,
298         not on the AssemblyDebugInfo.
299         (mono_debug_open_file): Moved some stuff here from mono_debug_open_assembly().
300
301         * debug-dwarf2.c (mono_debug_write_assembly_dwarf2): Renamed into
302         mono_debug_write_dwarf2().
303         (mono_debug_open_assembly_dwarf2): Removed.
304         (mono_debug_close_assembly_dwarf2): Removed.
305
306         * debug-stabs.c (mono_debug_write_assembly_stabs): Renamed into
307         mono_debug_write_stabs().
308         (mono_debug_open_assembly_stabs): Removed.
309         (mono_debug_close_assembly_stabs).
310
311         * debug-dwarf2-plus.c: This is currently broken. :-(
312
313 2002-05-20  Martin Baulig  <martin@gnome.org>
314
315         * debug.h (mono_debug_format): New global variable.
316         (MonoDebugFormat): Added MONO_DEBUG_FORMAT_NONE.
317
318         * debug-private.h (MonoDebugHandle): Added `objfiles' field which is
319         a whitespace separated list of symbol files.
320         (AssemblyDebugInfo): Added `objfile' filed which is the name of the
321         symbol file.
322
323         * mono.c (main): Pass the assembly file name to mono_debug_open_file().
324
325         * debug.c (mono_debug_make_symbols): Link all symbol files into a big
326         `<assemblyname>.o' symbol file.
327
328 2002-05-20  Martin Baulig  <martin@gnome.org>
329
330         * debug.c (debug_load_method_lines): Check whether the assembly file
331         is newer than the IL file and recreate the IL file if necessary.
332
333 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
334
335         * mono.c Updated copyright years. 
336
337 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
338
339         * mono.c (usage): Relayout command line options.
340
341 2002-05-17  Dietmar Maurer  <dietmar@ximian.com>
342
343         * x86.brg (reg): fixed array bound check
344
345         * emit-x86.c (enter_method): print method signature
346
347         * exception.c (arch_handle_exception): set trace info before we
348         call handlers.
349
350 2002-05-16  Dietmar Maurer  <dietmar@ximian.com>
351
352         * jit.c (mono_find_final_block): make it work with mcs
353
354         * x86.brg: buf fix. if exception variable is allocated to a register. 
355
356         * jit.c (mono_find_final_block): bug fix.
357
358 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
359
360         * delegate.c (arch_end_invoke): fix bug #24653, simplified the
361         code using new runtime_invoke feature.
362
363         * jit.c (mono_analyze_flow): try blocks are followed by handler
364         blocks, so we need to add all handler blocks as succesors.
365         (mono_thread_start_cb): set end_of_stack
366
367         * exception.c (arch_handle_exception): correctly save/restore caller
368         saved regs.
369
370         * emit-x86.c (arch_emit_prologue): correctly save/restore caller
371         saved regs.
372
373         * jit.c (mono_cfg_new): allocate space for caller saved registers.
374
375 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
376
377         * jit.c: only use one TLS slot to store jit data
378
379         * exception.c (arch_handle_exception): print function signature,
380         use thread relative end_of_stack
381
382 2002-05-13  Dietmar Maurer  <dietmar@ximian.com>
383
384         * jit.c (OPT_BOOL): new. opt. for boolean variables - we simply
385         store them as 32 bit integers.
386         (mono_analyze_stack): we need to generate a temporary var for
387         SHL/SHR because the tree allocator can fail otherwise 
388
389         * exception.c (arch_handle_exception): EIP now points to the call
390         instruction, not to the instruction after the call. This fixes the
391         bug reported by Linus Upson (tests/exception8.cs)
392
393 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
394
395         * jit.c (mono_analyze_flow): always allocate the forest array
396         (mono_stack_duplicate_used_var): impl.
397         (mono_copy_used_var): impl.
398
399         * x86.brg: bug fix in SHR/SHL
400
401         * emit-x86.c (arch_emit_prologue): check if live_in_set != NULL
402
403 2002-05-11  Sergey Chaban <serge@wildwestsoftware.com>
404
405         * mono.c: new --fast-iconv command line option
406         to enable fast FP-to-integer conversion code.
407         * jit.c, jit.h: added global variable to store state
408         for the above option. This optimization is disabled
409         by default.
410         * x86.brg: added code to emit fast FP-to-integer
411         conversion sequences.
412
413 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
414
415         * emit-x86.c: simple definite assignment analysis optimization for
416         uninitialized locals.
417
418 Fri May 10 15:43:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
419
420         * x86.brg, emit-x86.c: patch the branch targets with x86_patch().
421
422 2002-05-10  Dietmar Maurer  <dietmar@ximian.com>
423
424         * linear-scan.c (mono_update_gen_set): improvement/bug fix
425
426         * x86.brg: added additional rules to handle global allocated registers
427
428         * mono.c (usage): the option is called --nols, and it dissables
429         linear scan.
430
431         * x86.brg: better LDIND_R4, LDIND_R8, STIND_R4, STIND_R8
432
433 2002-05-09  Dietmar Maurer  <dietmar@ximian.com>
434
435         * linear-scan.c: linear scan reg. allocation and data flow analysis
436         use Paolo's great bitset implementation.
437
438         * jit.c (arch_allocate_var): add live range info
439         (mono_cfg_add_successor): create list of successors for basic
440         blocks.
441
442         * mono.c (main): new option --ls to enable linear scan
443
444         * exception.c (arch_handle_exception): print instruction pointer
445         relative to method start address.
446
447         * jit.c (mono_print_ctree): print register number if locals are
448         allocate in registers.
449
450         * emit-x86.c (arch_emit_prologue): initialize reg. allocated locals
451         (arch_emit_epilogue): take care when restoring save registers,
452         because the stack pointer may has changed.
453
454         * x86.brg: s/VAROFFSET/VARINFO/
455         modified to support global register allocation
456
457 Mon May 6 15:38:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
458
459         * jit.h, jit.c, emit-x86.c: x86 cpu detection code from Sergey.
460
461 2002-05-03  Sergey Chaban <serge@wildwestsoftware.com>
462
463         * x86.brg: more coni4 optimizations
464         MUL: generate optimized code for some consts other
465         than powers of 2 (hardcoded impl. for 3, 5, 10 etc.);
466         DIV_UN: multiply with reciprocal instead of dividing;
467
468 2002-05-03  Dietmar Maurer  <dietmar@ximian.com>
469
470         * x86.brg: use VAROFFSET macro
471
472         * emit-x86.c (tree_emit): allocate space for spilled regs in
473         activation frame instead of pushing them to the stack.
474
475         * x86.brg: replace BXX with CBRANCH/COMPARE
476         replaced CXX CSET/COMPARE
477
478         * emit-x86.c (arch_allocate_regs): improved register allocation
479
480 2002-05-02  Dietmar Maurer  <dietmar@ximian.com>
481
482         * delegate.c (mono_delegate_cleanup): signal semaphore in order to
483         exit threads.
484
485 2002-04-30  Dick Porter  <dick@ximian.com>
486
487         * mono.c (main): Tell glib to not abort when g_log() etc print
488         recursively
489
490 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
491
492         * x86.brg: opt. LDELEMA impl.
493         (MUL) use shift when possible.
494         (DIV) use shift when possible.
495         impl. various opt. with coni4
496
497         * exception.c (arch_handle_exception): use ctx->SC_EBP in
498         end_of_stack check as suggested by Linus Upson <linus@linus.com>
499
500 2002-04-29  Dietmar Maurer  <dietmar@ximian.com>
501
502         * x86.brg (LDLEN, UNBOX): removed unnecessary NULL check.  
503
504         * exception.c: included the Freebsd patch from Sandro Tolaini
505         <sandro@focuseek.com>
506
507 Mon Apr 29 15:18:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
508
509         * mono.c, jit.c: use mono_runtime_run_main ().
510
511 2002-04-29  Dietmar Maurer  <dietmar@ximian.com>
512
513         * jit.c (mono_analyze_stack): dont call methods on Object with
514         METHOD_ATTRIBUTE_FINAL directly because it breaks remoting.
515
516         * x86.brg: added more CONV_U rules
517
518         * jit.c (mono_analyze_stack): avoid recursive call of virtual
519         methods: fixes Bug #23778 
520         (mono_analyze_stack): emit right CONV_UX opcodes: fixes bug 23547
521
522         * exception.c (arch_handle_exception): only g_assert(cleanup) if
523         we really need it.
524
525 2002-04-27      Patrik Torstensson <patrik.torstensson@intel.com>
526
527         * x86.brg: fixed bug in CONV_I8 (invalid stack correction)
528
529 2002-04-27  Martin Baulig  <martin@gnome.org>
530
531         * jit.h (MonoFlowGrap): Renamed `epilogue_begin' to `epilogue_end',
532         there's already `epilog' so we don't need `epilogue_begin'.
533
534         * debug.c (mono_debug_add_method): Use `cfg->epilogue_end' to get the
535         size of the method's code.
536
537 2002-04-25  Martin Baulig  <martin@gnome.org>
538
539         * debug-dwarf2.c (dwarf2_write_string_type): Reflect latest MonoString
540         changes.
541
542 2002-04-25  Dietmar Maurer  <dietmar@ximian.com>
543
544         * x86.brg: enable stmt: STIND_I4 (addr, coni4) again,
545         added CONV_OVF_I4 (fix bug #23808)
546
547 2002-04-23  Dietmar Maurer  <dietmar@ximian.com>
548
549         * x86.brg: code cleanup - use x86_patch ()
550
551         * jit.c (mono_analyze_stack): only use MB_TERM_CHECKTHIS when necessary
552         (mono_analyze_stack): don't store constants in temp. variables for CEE_DUP
553
554         * x86.brg (stmt): removed stmt: STIND_I4 (addr, coni4) rule
555         because it slows down performance.
556
557 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
558
559         * emit-x86.c: enter_method handles 8-byte aligned parameters.
560
561 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
562
563         * jit,h, jit.c, x86.brg: NEWOBJ_SPEC and NEWARR_SPEC terminals for
564         non-shared code.
565
566 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
567
568         * jit.c (check_inlining): added statistics about inlineing
569
570         * mono.c (usage): new switch --noinline to disable inlining
571
572         * jit.c (mono_analyze_stack): added a check for (this!=NULL) if we
573         inline methods (to keep semantics)
574
575         * x86.brg: added constant folding for inegers 
576
577         * emit-x86.c (tree_allocate_regs): handle the special case when
578         chain rules need a register.
579
580 2002-04-19  Dietmar Maurer  <dietmar@ximian.com>
581
582         * invoke.c (arch_create_native_wrapper): do not save LMF for Strings
583
584         * jit.c (check_inlining): better inlining support
585
586 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
587         
588         * x86.brg: LDLEN uses max_length instead of bounds[0]
589         * jit.c: support for new szarray format
590
591 2002-04-18  Dietmar Maurer  <dietmar@ximian.com>
592
593         * jit.c (check_inlining): added inlining support
594
595 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
596
597         * x86.brg: optimized version of castclass and isinst
598
599 Wed Apr 17 12:34:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
600
601         * emit-x86.c, invoke.c: track time spent compiling.
602
603 Wed Apr 17 10:58:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
604
605         * emit-x86.c, invoke.c: call profile callbacks if needed.
606         * jit.c, jit.h, mono.c: add --profile command line option.
607
608 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
609
610         * jit.h: included mono/io-layer/io-layer.h to avoid breaking
611         compilation under windows when upgrading mingw and w32api to 
612         version 1.3 (thanks Dick!).
613
614 2002-04-15  Patrik Torstensson <patrik.torstensson@labs2.com>
615
616         * jit.c: changed the array icalls to use full names
617
618 2002-04-15  Dietmar Maurer  <dietmar@ximian.com>
619
620         * x86.brg: check the this pointer before calling
621         non-virtual functions
622
623         * emit-x86.c (arch_emit_prologue): initialize local vars.
624
625         * x86.brg: removed incredible clumsy code
626
627 2002-04-13  Martin Baulig  <martin@gnome.org>
628
629         * debug-dwarf2.c (dwarf2_write_variable_location): New static func to write
630         the location of a variable.
631         (dwarf2_write_variable, dwarf2_write_parameter): Take a MonoDebugVarInfo
632         instead of a stack offset and use dwarf2_write_variable_location() to write
633         the location.
634
635 2002-04-13  Martin Baulig  <martin@gnome.org>
636
637         * debug.c, debug-stabs.c, debug-dwarf2.c: Reflect latest debug-symfile.h
638         API changes.
639
640 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
641
642         * Makefile.am: use of the new '-s' option in monoburg.
643
644 2002-04-12  Martin Baulig  <martin@gnome.org>
645
646         * debug-dwarf2.c (dwarf2_write_variable): Emit info about the variable's
647         lifetime.
648
649 2002-04-10  Sergey Chaban <serge@wildwestsoftware.com>
650         * win32-exception: added Win32 SEH exception filter that translates
651         CONTEXT to sigcontext;
652
653         * jit.c: added Win32 SEH init/reset calls, compute sigcontext address
654         in a platfrom-dependent way;
655
656         * jit.h: use win32-exception instead of signal if PLATFORM_WIN32
657         and avoid io-layer includes;
658
659         * delegate.c: do not include io-layer stuff if PLATFORM_WIN32
660         is defined;
661
662 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
663
664         * delegate.c (arch_end_invoke): restore output arguments
665
666 Mon Apr 8 17:16:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
667
668         * jit.c: call mono_runtime_init ().
669
670 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
671
672         * jit.c (mono_jit_cleanup): added more statistics
673
674         * invoke.c (arch_create_native_wrapper): special case EndInvoke -
675         we need to pass the MonoMethod pointer as first argument.
676
677         * delegate.c (mono_async_invoke): notify all listeners, not only a
678         single one.
679         (arch_end_invoke): we now pass a MonoMethod as first parameter and
680         use arch_method_call_message_new() to access the stack.
681         (arch_end_invoke): wait until we really finished processing
682         (async_invoke_abort): notify all listeners, not only a
683         single one.
684
685 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
686
687         * message.c (arch_return_value): impl.
688         (arch_method_return_message_restore): consider delegate BeginInvoke
689
690         * jit.c: removed jit_exec_main()
691
692         * delegate.c (arch_begin_invoke): use the message builder to make
693         it architecture independent - still needs more cleanup.
694
695 2002-04-05  Dietmar Maurer  <dietmar@ximian.com>
696
697         * delegate.c (mono_delegate_ctor): support for transparent proxy
698
699         * x86.brg (freg): bug fix in CONV_R* opcodes
700
701 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
702
703         * message.c: added documentation
704
705 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
706
707         * mono.c (main): use --trace instead of --trace-calls
708
709         * x86.brg: impl. REMOTE_STIND_XX
710
711         * message.c (mono_store_remote_field): impl.
712
713 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
714
715         * x86.brg: impl. REMOTE_FIELD (load fields of remote objects)
716
717         * message.c (mono_load_remote_field): impl.
718
719         * jit.c (mono_analyze_stack): only call marshalbyref methods
720         through the vtable.
721         (mono_analyze_stack): consider marshalbyref objects in LDFLD
722
723 Fri Mar 29 16:00:27 CET 2002 Paolo Molaro <lupus@ximian.com>
724
725         * x86.brg: kill pointer arithmetric.
726
727 2002-03-28  Martin Baulig  <martin@gnome.org>
728
729         * jit.c (mono_debug_insert_breakpoint): New global variable.
730         (mono_debug_last_breakpoint_address): New global variable.
731
732         * emit-x86.c (arch_compile_method): If `mono_debug_insert_breakpoint' is
733         non-zero, insert a breakpoint; if it's positive, decrement it when done.
734         Set `mono_debug_last_breakpoint_address' to the address of the last inserted
735         breakpoint.
736
737         * debug.h: Provide external declaration of `mono_debug_insert_breakpoint' and
738         `mono_debug_last_breakpoint_address', also documented them here.
739
740 2002-03-28  Martin Baulig  <martin@gnome.org>
741
742         * debug-private.h (MonoDebugHandle): Renamed `format' to `default_format'.
743         (AssemblyDebugInfo): Added `format'.
744
745         * debug.c: Use the AssemblyDebugInfo's `format' field to determine the format,
746         this allows us choose the format on a per-assembly basis.
747         (mono_debug_open_assembly): When using MONO_DEBUG_FORMAT_DWARF2_PLUS, fall back
748         to MONO_DEBUG_FORMAT_DWARF2 if the symbol file does not exist, but the IL file
749         exists.
750         (debug_generate_method_lines): Generate correct IL offsets.
751
752 2002-03-28  Martin Baulig  <martin@gnome.org>
753
754         * jit.h (MonoFlowGraph): Added `prologue_end' and `epilogue_start' fields.
755
756         * emit-x86.c (arch_compile_method): Set prologue_end and epilogue_start.
757
758         * debug-private.h (DebugMethodInfo): Renamed `frame_start_offset' to
759         `prologue_end_offset', added `epilogue_begin_offset' and `last_line'.
760
761         * debug.c (debug_generate_method_lines): Don't return if we don't have line
762         numbers, we still need to generate the IL offsets here. Emit line numbers
763         for `prologue_end_offset' (the first line of actual code) and 
764         `epilogue_begin_offset' (the line of the method's closing brace).
765         Don't crash if cfg->bblocks [i].forest is NULL.
766         (mono_debug_add_method): Don't crash if we don't have line numbers.
767         Initialize the newly added fields.
768
769         * debug-stabs.c: Record first and last line, emit filename info at the
770         beginning of the stab file, gdb ignores the types otherwise.
771
772         * debug-dwarf2.c: Use the new prologue_end_offset instead of guessing it;
773         emit line number info for the first and last line.
774
775 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
776
777         * invoke.c (arch_create_delegate_trampoline): impl.
778
779 Thu Mar 28 11:58:53 CET 2002 Paolo Molaro <lupus@ximian.com>
780
781         * Makefile.am, mono.c, jit.h, jit.c: build the libmono library
782         with the jit runtime to easy embedding. main() is moved to mono.c, now.
783         * jit.c: use opcode names from libmetadata.
784         * debug.h, debug.c: constify char* argument.
785
786 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
787
788         * jit.c: catching SIGSEGV again, added proxy support
789
790 2002-03-21  Dietmar Maurer  <dietmar@ximian.com>
791
792         * delegate.c (mono_delegate_init): remove unused worker threads
793
794 2002-03-27  Mike Kestner <mkestner@speakeasy.net>
795
796         * delegate.c (arch_get_delegate_invoke): malloc a bigger area
797
798 Tue Mar 26 19:54:45 CET 2002 Paolo Molaro <lupus@ximian.com>
799
800         * jit.c: remove glib mem vtable code.
801
802 2002-03-26  Martin Baulig  <martin@gnome.org>
803
804         * debug-dwarf2.c (write_method_lines_dwarf2): Don't generate method
805         lines if we don't have line number information.
806         (write_method_dwarf2): Use `minfo->method_info.this_offset' instead
807         of hardcoding 8.
808
809         * debug-stabs.c (write_method_stabs): Don't generate method lines if
810         we don't have line number information. Use `minfo->method_info.this_offset'
811         instead of hardcoding 8.
812
813         * debug.c (debug_generate_method_lines): Don't crash if we don't have
814         line number information.
815         (mono_debug_open_assembly): Don't generate line numbers for
816         MONO_DEBUG_FORMAT_DWARF2_PLUS.
817         (mono_debug_add_method): Don't store the 'this' offset in `param_offsets',
818         but it in the new `this_offset' field.
819         
820 Mon Mar 25 13:03:35 CET 2002 Paolo Molaro <lupus@ximian.com>
821
822         * debug.c (debug_generate_method_lines): Use correct addresses for
823         record_il_offset().
824
825 Mon Mar 25 13:03:35 CET 2002 Paolo Molaro <lupus@ximian.com>
826
827         * jit.c: do not set the glib mem vtable anymore.
828         * Makefile.am: link to libmonoutils.
829
830 2002-03-25  Martin Baulig  <martin@gnome.org>
831
832         * debug.h (mono_debug_make_symbols): Documented this function.
833
834 2002-03-24  Martin Baulig  <martin@gnome.org>
835
836         * debug.c (mono_debug_add_method): Include the `this' offset in
837         the `minfo->method_info.param_offsets' array.
838
839 2002-03-23  Martin Baulig  <martin@gnome.org>
840
841         * x86.brg (lreg: CONV_I8 (reg)): X86_XOR modifies the flags, so we need
842         to do it before the X86_CMP.
843         (reg: CLT (lreg, lreg)): Use correct x86_branch8() targets.
844         (reg: CLT (lreg, lreg)): Likewise.
845         (reg: CLT_UN (lreg, lreg)): Likewise.
846         (reg: CLT_UN (lreg, lreg)): Likewise.
847         (reg: CGT (lreg, lreg)): Likewise.
848         (reg: CGT (lreg, lreg)): Likewise.
849         (reg: CGT_UN (lreg, lreg)): Likewise.
850         (reg: CGT_UN (lreg, lreg)): Likewise.
851
852 2002-03-23  Martin Baulig  <martin@gnome.org>
853
854         * debug-private.h (AssemblyDebugInfo): Added `_priv'.
855
856         * debug-dwarf2-plus.c
857         (mono_debug_open_assembly_dwarf2_plus): Open the symbol file here.
858         (mono_debug_close_assembly_dwarf2_plus): Close the symbol file here.
859         (mono_debug_write_assembly_dwarf2_plus): Only call
860         mono_debug_update_symbol_file() here.
861
862 Thu Mar 21 17:35:48 CET 2002 Paolo Molaro <lupus@ximian.com>
863
864         * jit.c: inter strings before executing a method.
865         Do not intern command line arguments anymore.
866
867 2002-03-21  Martin Baulig  <martin@gnome.org>
868
869         * debug.h (MonoDebugFormat): Added MONO_DEBUG_FORMAT_DWARF2_PLUS.
870
871         * debug-dwarf2-plus.c: This debugging format reads a symbol file which has
872         been created by MCS and fills in all machine dependent stuff.
873
874         * debug-private.h (DebugMethodInfo): Added `MonoDebugMethodInfo method_info',
875         removed everything which is already in MonoDebugMethodInfo.
876
877         * debug.c (debug_generate_method_lines): Generate the MonoILOffsetInfo array.
878         (mono_debug_make_symbols): Don't open the file or call as, this is done in the
879         backend code.
880
881         * jit.c (main): Added "--dwarf-plus" command line option to use the new
882         MONO_DEBUG_FORMAT_DWARF2_PLUS debugging format.
883
884 2002-03-21  Dietmar Maurer  <dietmar@ximian.com>
885
886         * jit.c (usage): new option to specify maximum number of worker threads
887         (mono_analyze_stack): avoid cyclic dependency in CEE_LDFTN
888
889         * delegate.c (async_invoke_abort): added support for asynchronous exceptions
890         (arch_get_async_invoke): notify listeners before we call the
891         asynchronous callback
892
893 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
894
895         * delegate.c (async_invoke_thread): support for domains
896         (async_invoke_thread): create workers only when needed
897
898 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
899
900         * delegate.c (async_invoke_thread): initial support for BeginInvoke/EndInvoke
901
902 2002-03-18  Dietmar Maurer  <dietmar@ximian.com>
903
904         * x86.brg: impl. lreg: XOR (lreg, lreg)
905         impl. REM (freg, freg)
906
907 2002-03-17  Martin Baulig  <martin@gnome.org>
908
909         * debug.c (mono_debug_open_assembly): Call mono_debug_get_type() on all
910         base types.
911
912         * debug-dwarf2.c: Added support for strings and arrays.
913
914 2002-03-17  Martin Baulig  <martin@gnome.org>
915
916         * debug.c (mono_debug_get_type): Recursively call this for all function members
917         of a class type.
918         (mono_debug_add_method): Don't mangle function names, this must be done by the
919         debugger backend if the debugging format needs mangled names.
920
921         * debug-dwarf2.c: Improved support for classes, added member functions.
922
923 2002-03-16  Martin Baulig  <martin@gnome.org>
924
925         * debug.c (mono_debug_get_type): Recursively call this for all members and
926         parent classes of a class type.
927
928         * debug-dwarf2.c: Added basic support for classes. Set source language to C++
929         since GDB doesn't like Java very much.
930
931 2002-03-16  Martin Baulig  <martin@gnome.org>
932
933         * debug-dwarf2.c: Added support for enums.
934
935 2002-03-15  Martin Baulig  <martin@gnome.org>
936
937         * debug.c (mono_debug_get_type): Recursively call this for all members
938         of a struct type.
939
940         * debug-dwarf2.c: Added support for structs.
941
942 2002-03-15  Dietmar Maurer  <dietmar@ximian.com>
943
944         * emit-x86.c (arch_create_jit_trampoline): adapt save/restore LMF
945         to new MonoLMF layout
946
947 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
948
949         * emit-x86.c (arch_create_native_wrapper): new code to generate
950         wrappers for calling native functions.
951         (arch_create_native_wrapper): free allocated strings
952         (arch_handle_exception): made mono_jit_info_table domain dependent
953
954 2002-03-14  Martin Baulig  <martin@gnome.org>
955
956         * debug.c (MonoDebugFormat): New public enums specifying which debugging
957         format to use.
958         (mono_debug_open_file): Added MonoDebugFormat argument.
959         (mono_debug_make_symbols): Don't take an argument to make it easier to call
960         this function from GDB. It's now safe to call this function multiple times;
961         it'll always write a complete debugging file.
962
963         * debug.c: Splitted this file into a general part which remains in this file
964         and the debugging format specific parts debug-stabs.c and debug-dwarf2.c.
965         All public functions now call a corresponding format specific function.
966
967         * debug.c: The following changes are private to debug.c:
968         (AssemblyDebugInfo, MonoDebugHandle): Moved declarations to debug-private.h.
969         (record_line_number, debug_generate_method_lines): New private functions.
970         (mono_debug_open_ass): Renamed to mono_debug_open_assembly; this function now
971         calls a debugging-format-specific function (mono_debug_open_assembly_stabs or
972         mono_debug_open_assembly_dwarf2).
973         (mono_debug_make_symbols): Calls mono_debug_write_assembly_stabs/dwarf2(). It's
974         now safe to call this function multiple times.
975         (mono_debug_get_type): New public function. This takes a `MonoClass *' and
976         returns an unique index for this type. It's used to ensure that we only write
977         each class once to the debugging file.
978         (mono_debug_add_method, mono_debug_add_type): Store all the data in an internal
979         data structure, but don't directly write to the debugging file. This is done
980         later from mono_debug_write_assembly().
981
982         * jit.c (main): Added "--dwarf" command line argument to generate DWARF 2
983         debugging output. Call mono_debug_close() on cleanup if necessary.
984
985 2002-03-14  Martin Baulig  <martin@gnome.org>
986
987         * debug-private.h: New private header file.
988
989         * debug-stabs.c: Added the stabs type generation stuff which was
990         previously in debug.c.
991
992         * debug-dwarf.c: Started to implement type support. We're currently
993         only writing this most basic types to the dwarf file, but this will
994         change soon.
995
996 2002-03-13  Martin Baulig  <martin@gnome.org>
997
998         * debug-stabs.c, debug-dwarf2.c: New files containing my new
999         debugging code. They're now in CVS, but not yet used anywhere.
1000
1001 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
1002
1003         * emit-x86.c (mono_delegate_ctor): use C impl. instead of x86_*
1004         macros, included new delegate code from Daniel Stodden. 
1005         
1006         
1007 Mon Mar 11 14:47:21 CET 2002 Paolo Molaro <lupus@ximian.com>
1008
1009         * jit.c: verify that corlib and runtime are in sync.
1010
1011 Mon Mar 11 11:30:56 CET 2002 Paolo Molaro <lupus@ximian.com>
1012
1013         * emit-x86.c, jit.c: use the debug-helpers facilities to
1014         describe and match a method when debugging.
1015
1016 2002-03-10  Martin Baulig  <martin@gnome.org>
1017
1018         * emit-x86.c (arch_compile_method): When emitting stabs debugging
1019         output, put a nop instruction at the start of all functions so that
1020         the adresses won't change when using --debug.
1021
1022         * debug.c (mono_debug_add_method): `tree->cli_addr' is an offset into
1023         the bytecode area, stabs needs a line number in the .il file. Use the
1024         new info->moffsets to get the line number.
1025         (AssemblyDebugInfo): Added `total_lines' and `moffsets' fields.
1026         `moffsets' is an array of `total_lines' fields (total number of lines
1027         in the .il file); for each line in the .il field, this array contains
1028         the bytecode offset if it's an "IL_xxxx" line, -1 if it's the last line
1029         of a method and 0 otherwise.
1030         (debug_load_method_lines): Read the whole .il file and initialize the
1031         info->moffsets field.
1032
1033 2002-03-09  Martin Baulig  <martin@gnome.org>
1034
1035         * x86.brg (DIV_UN): Clear EDX before performing the division and remove
1036         the unnecessary CDQ instruction.
1037
1038 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
1039
1040         * jit.c (mono_analyze_stack): only load addresses of value types
1041         on the runtime stack.
1042
1043 2002-03-07  Duncan Mak  <duncan@ximian.com>
1044
1045         * Makefile.am: A small patch fixing errors in vpath-based builds
1046         (make clean failing to rerun monoburg due to BUILT_SOURCES usage),
1047         committed for Daniel Stodden <stodden@in.tum.de>. 
1048
1049 Thu Mar 7 17:22:52 CET 2002 Paolo Molaro <lupus@ximian.com>
1050
1051         * jit.c: Boehm-GC enable.
1052
1053 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
1054
1055         * x86.brg (SAVE_LFM): bug fix: patch the saved IP because we
1056         realloc that code sometimes!
1057
1058         * emit-x86.c (mono_compute_branches): support several types of
1059         jump infos
1060
1061 2002-03-06  Dietmar Maurer  <dietmar@ximian.com>
1062
1063         * x86.brg: impl. MUL_OVF_UN (reg, reg)
1064
1065         * jit.c (mono_find_final_block): find correct finally handler.
1066
1067         * emit-x86.c (arch_create_jit_trampoline): bug fix: preserve
1068         caller saved registers.  
1069
1070 2002-03-05  Dietmar Maurer  <dietmar@ximian.com>
1071
1072         * x86.brg: use x86_widen_reg for CONV opcodes
1073
1074 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
1075
1076         * jit.c (MAKE_SPILLED_BI_ALU): remove unnecessary assertions
1077
1078         * emit-x86.c (arch_handle_exception): big fix - dont use
1079         uninitialized next_bp
1080         (arch_compile_method): make the jit thread save
1081         (x86_magic_trampoline): moved lock/unlock to x86_magic_trampoline
1082         to avoid need of recursive mutexes
1083
1084         * x86.brg: use new mono_assert macros
1085
1086 2002-02-28  Dietmar Maurer  <dietmar@ximian.com>
1087
1088         * emit-x86.c (arch_create_jit_trampoline): save/restore LMF before
1089         calling into unmanaged code (arch_compile_method).
1090
1091         * x86.brg: impl. CONV_I4 (freg) with correct rounding
1092         (lreg): impl CALL_I8(INTF_ADDR)
1093         impl. CONV_R_UN (reg)
1094         bug fix im REM_UN
1095
1096 2002-02-27  Dietmar Maurer  <dietmar@ximian.com>
1097
1098         * emit-x86.c (arch_runtime_invoke): impl. runtime invoke for the jit.
1099
1100 2002-02-26  Dietmar Maurer  <dietmar@ximian.com>
1101
1102         * x86.brg: bug fix in CLT(lreg,lreg)
1103         (reg): bug fix in CONV_OVF_I4(lreg)
1104         (lreg): replaced x86_call_reg with x86_call_code
1105
1106         * emit-x86.c (mono_add_jump_info): impl.
1107         (mono_compute_branches): patch real jump address (instead of
1108         emitting code twice)
1109
1110 Tue Feb 26 11:56:03 CET 2002 Paolo Molaro <lupus@ximian.com>
1111
1112         * x86.brg: optimize cmp reg,0 -> test reg.
1113
1114 Sun Feb 24 13:58:34 CET 2002 Paolo Molaro <lupus@ximian.com>
1115
1116         * jit.h, jit.c, emit-x86.c: Added a few statistics counters
1117         and the --stats command line option to print them.
1118         Fixed memory leak in arch_compile_method () when a method's code is
1119         found in the cache. Fix magic trampoline to deal with static calls.
1120
1121 2002-02-21  Dietmar Maurer  <dietmar@ximian.com>
1122
1123         * x86.brg: impl. SHR_UN for lreg, added new test, bug fix for BNE_UN 
1124
1125 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
1126
1127         * emit-x86.c (arch_compile_method): add shared code to mono_root_domain
1128         (arch_create_jit_trampoline): cache trampoline code
1129
1130 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
1131
1132         * jit.c (mono_analyze_stack): optimize LDSFLD/STSFLD for domain
1133         specific code.
1134         (mono_analyze_stack): use MB_TERM_LDELEMA to perform bound check
1135
1136         * x86.brg: do not encode exception objects into the instruction
1137         stream, because they are domain dependend. Use
1138         arch_get_throw_exception_by_name() instead;
1139
1140 Mon Feb 18 15:51:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1141
1142         * jit.c: intern command line arguments.
1143
1144 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
1145
1146         * jit.c (mono_analyze_stack): use the magic trampoline for all
1147         calls (since we cant store the address of compiled code in
1148         method->addr).
1149         (mono_analyze_stack): imp. LDSTR for shared code
1150
1151         * emit-x86.c (x86_magic_trampoline): handle x86_call_code().
1152         (arch_compile_method): add a cache for compiled methods to avoid
1153         recompilation. dont use method->addr to store domain dependent
1154         code address.
1155
1156 2002-02-15  Dietmar Maurer  <dietmar@ximian.com>
1157
1158         * x86.brg: impl. BLE,BGT for freg
1159
1160 Sat Feb 16 16:27:42 CET 2002 Paolo Molaro <lupus@ximian.com>
1161
1162         * emit-x86.c: handle unreachable code. Eliminate some unneeded
1163         malloc() calls.
1164         * jit.c: handle unreachable code. Move setting of mono_end_of_stack to
1165         main(). Add --compile classname and --ncompile num command line
1166         options to do performance evaluation of the jitter (and help
1167         debugging).
1168
1169 2002-02-15  Dietmar Maurer  <dietmar@ximian.com>
1170
1171         * emit-x86.c (arch_compile_method): bug fix in static delegate
1172         Invoke code.
1173
1174 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
1175
1176         * jit.c (mono_analyze_stack): do a LDIND after NEWOBJ for value types.
1177
1178 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
1179
1180         * jit.c (mono_analyze_stack): impl. CEE_SIZEOF
1181
1182 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
1183
1184         * jit.c (arch_allocate_var): Only assert that the alignment is
1185         at least 32-bits aligned, not always 32-bits aligned (for I8 for example).
1186
1187 Mon Feb 11 11:20:57 CET 2002 Paolo Molaro <lupus@ximian.com>
1188
1189         * x86.brg: fix invalid cast check in unbox. Pack MBTree structure.
1190
1191 Sun Feb 10 12:54:05 CET 2002 Paolo Molaro <lupus@ximian.com>
1192
1193         * emit-x86.c: make x86_magic_trampoline() handle call instructions
1194         with an imm8 displacement. x86.brg not yet changed to take advantage
1195         of it.
1196
1197 Sun Feb 10 11:47:30 CET 2002 Paolo Molaro <lupus@ximian.com>
1198
1199         * jit.c: use opcode info from libmetadata to do flow analysis
1200         and simplify code.
1201
1202 2002-02-06  Dietmar Maurer  <dietmar@ximian.com>
1203
1204         * jit.c (MAKE_LDELEM, MAKE_STELEM): added bound checking 
1205
1206 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
1207
1208         * x86.brg: use element_class for type check
1209
1210 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
1211
1212         * jit.c (main): impl. __array_Address icall
1213
1214         * mempool.c (mono_mempool_alloc): handle large block allocation
1215
1216 2002-02-01  Dietmar Maurer  <dietmar@ximian.com>
1217
1218         * x86.brg: impl. SHL/SHR/CLT for 64 bit values
1219
1220 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
1221
1222         * x86.brg: impl. CEQ(lreg,lreg)
1223
1224         * jit.c (mono_analyze_stack): impl. LDVIRTFTN
1225         (mono_analyze_stack): handle MONO_TABLE_MEMBERREF in LDSFLD/STSFLD
1226
1227         * x86.brg: removed some dead code.
1228
1229 2002-01-18  Dietmar Maurer  <dietmar@ximian.com>
1230
1231         * jit.c (arch_allocate_var): fixed alignment bugs
1232
1233 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
1234
1235         * jit.c (mono_analyze_stack): use LDIND_REF/STIND_REF
1236
1237 2002-01-16  Dietmar Maurer  <dietmar@ximian.com>
1238
1239         * jit.c (main): install the trampoline before we start to create
1240         objects.
1241
1242         * x86.brg: impl. CLT_UN, CGT_UN
1243
1244         * emit-x86.c (leave_method): added check for null object
1245         (enter_method): consider byref arguments
1246
1247 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
1248
1249         * x86.brg: bug fix in CONV_OVF_I1_UN
1250         impl. ADD_OVF, MUL_OVF
1251         impl. ADD_OVF_UN, SUB_OVF, SUB_OVF_UN
1252         (SUB (lreg, lreg)): bug fix - use SBB instead of SUB
1253         (EMIT_COND_EXCEPTION): added signed flag
1254
1255 Fri Jan 11 20:06:22 CET 2002 Paolo Molaro <lupus@ximian.com>
1256
1257         * jit.c: implement stloc, ldloc, ldloca.
1258
1259 2002-01-11  Dietmar Maurer  <dietmar@ximian.com>
1260
1261         * jit.c (mono_analyze_stack): fixed calculation of last_instr
1262
1263         * x86.brg (LDLEN): emit null_reference exception
1264         (BLE_UN): bug fix. 
1265         (RET, RET_VOID, RET_OBJ, ...) fixed jump to epilog
1266
1267 2002-01-04  Dietmar Maurer  <dietmar@ximian.com>
1268
1269         * x86.brg: bug fix in CASTCLASS
1270
1271 2001-12-21  Dietmar Maurer  <dietmar@ximian.com>
1272
1273         * jit.c (mono_analyze_stack): spill MUL to avoid problem with
1274         register allocation.
1275
1276         * emit-x86.c (arch_compile_method): fixed static delegate bug
1277
1278 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
1279
1280         * x86.brg, jit.c: Split up the nodes that we used to share on
1281         CONV_OVF.  They were sharing the nodes because they are the same
1282         on 32-bit machines, but on 64-bit machines you need different
1283         code for them.
1284
1285 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
1286
1287         * x86.brg: removed prerequisite that (tree->left->reg1 <
1288         tree->right->reg1) to make register allocation easier.
1289
1290 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
1291
1292         * emit-x86.c (arch_handle_exception): new code to handle
1293         exceptions inside unmanaged code.
1294
1295         * x86.brg: impl. SAVE_LMF, RESTORE_LMF, pass implizit valuetype
1296         address as first argument.
1297
1298 2001-12-15  Dietmar Maurer  <dietmar@ximian.com>
1299
1300         * x86.brg: pass exceptions on the stack
1301
1302         * jit.h (ISSTRUCT): new macro to check for real value types
1303         (return false for enum types). 
1304
1305 2001-12-11  Dietmar Maurer  <dietmar@ximian.com>
1306
1307         * x86.brg: use position indepentent code if possible. 
1308
1309         * x86.brg (EMIT_COND_EXCEPTION): new macro.
1310
1311         * emit-x86.c (mono_emit_cfg): impl. variable code buffer size
1312
1313 2001-12-10  Dietmar Maurer  <dietmar@ximian.com>
1314
1315         * jit.c (mono_analyze_flow): use g_malloc0 o allocate large bcinfo
1316         blocks.
1317         (mono_analyze_flow): use g_malloc0 o allocate large bblocks array.
1318
1319         * x86.brg (stmt): added opt. for STIND_R4/STIND_R8
1320
1321 2001-12-07  Dietmar Maurer  <dietmar@ximian.com>
1322
1323         * jit.c (mono_allocate_intvar): bug fix.
1324
1325         * emit-x86.c (get_unbox_trampoline): impl.
1326
1327         * jit.c (mono_analyze_stack): impl STOBJ, LEAVE
1328
1329 2001-12-06  Dietmar Maurer  <dietmar@ximian.com>
1330
1331         * x86.brg: raise exceptions.
1332
1333 2001-12-05  Dietmar Maurer  <dietmar@ximian.com>
1334
1335         * x86.brg: impl. CEQ for freg, NEWSTRUCT now allocates valuetypes on
1336         the stack. 
1337
1338 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
1339
1340         * jit.c (mono_analyze_stack), x86.brg: Implement CONV.OVF.I1,
1341         CONV.OVF.I4, CONV.OVF.I1.UN, CONV.OVF.U1, CONV.OVF.U1.UN,
1342         CONV.OVF.I2.UN, CONV.OVF.I8.UN
1343
1344 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
1345
1346         * x86.brg: impl. UNBOX, NEWSTRUCT, removed VTYPE, bug fixes,
1347         removed the locaddr nonterminal, reimplemented value types
1348         
1349         * jit.c: reimplemented value type support, better support for
1350         enumeration types. 
1351
1352 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
1353
1354         * x86.brg, jit.c: Implement conv.ovf.u4, conv.ovf.u2, conv.ovf.i2,
1355         conv.ovf.u8 
1356
1357 Mon Dec 3 17:16:36 CET 2001 Paolo Molaro <lupus@ximian.com>
1358
1359         * jit.c: call mono_init() after registering internal calls.
1360
1361 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
1362
1363         * emit-x86.c (tree_preallocate_regs): improved register allocation
1364
1365         * x86.brg: impl. ISINST, CASTCLASS
1366
1367 Fri Nov 30 12:02:24 CET 2001 Paolo Molaro <lupus@ximian.com>
1368
1369         * x86.brg: rearrange fields to reduce struct size.
1370         * jit.c: use signature->param_count, not signature->params_size.
1371         * debug.c: off-by-one error fix.
1372
1373 2001-11-29  Radek Doulik  <rodo@ximian.com>
1374
1375         * Makefile.am: build mono only for X86 architecture, compilation
1376         fails for ppc now because of accessing registers in sigcontext
1377         structure
1378
1379 2001-11-29  Dietmar Maurer  <dietmar@ximian.com>
1380
1381         * jit.c (mono_analyze_stack): bug fix in DUP
1382
1383 Thu Nov 29 12:32:01 CET 2001 Paolo Molaro <lupus@ximian.com>
1384
1385         * debug.c: fix type handling. Position function position at start of
1386         IL code. Output more fine-grained stepping information.
1387
1388 2001-11-28  Dietmar Maurer  <dietmar@ximian.com>
1389
1390         * x86.brg (LDIND_I1, LDIND_I2): use x86_widen_ instead of x86_mov_
1391
1392         * jit.c (mono_analyze_stack): record the cli_address for later use
1393         with gdb.
1394         (sigsegv_signal_handler): translate sigsegv into "Internal error"
1395         exception.
1396
1397 Tue Nov 27 16:32:41 CET 2001 Paolo Molaro <lupus@ximian.com>
1398
1399         * debug.c, debug.h: added support for generating stabs.
1400         Stabs can be compiled with as and the resulting object file can be
1401         loaded in a gdb session with add-symbol-file object.o.
1402         * jit.c, jit.h: add --stabs and --debug command line arguments. Keep track
1403         where locals and arguments are stored in the stack. Add support for
1404         passing command line arguments to CLR programs.
1405         * emit-x86.c: insert a breakpoint at method invocation if needed.
1406
1407 2001-11-27  Dietmar Maurer  <dietmar@ximian.com>
1408
1409         * jit.c: exception support
1410
1411         * emit-x86.c (arch_emit_epilogue): bug fix: restore the regs in
1412         the right order.
1413
1414 2001-11-26  Dick Porter  <dick@ximian.com>
1415
1416         * Makefile.am (mono_LDADD): Add io-layer library
1417
1418 2001-11-19  Dietmar Maurer  <dietmar@ximian.com>
1419
1420         * jit.c (mono_analyze_stack): impl. LDFTN
1421         (MAKE_SPILLED_BI_ALU): always spill DIV/REM results to memory to
1422         make register allocation easier on x86
1423
1424         * emit-x86.c (enter_method): more debugging output for Strings
1425         (arch_compile_method): added delegate support
1426         (arch_compile_method): align EBP to 8 byte boundary
1427
1428 Mon Nov 19 11:36:22 CET 2001 Paolo Molaro <lupus@ximian.com>
1429
1430         * jit.c: use mono_install_trampoline (), instead of exporting
1431         a function to a lower-level library.
1432
1433 2001-11-16  Dietmar Maurer  <dietmar@ximian.com>
1434
1435         * x86.brg (STRING_ARG): impl. a way to marshal strings. This
1436         will be extensible to handle all possible kinds of marshalling
1437         requirements. 
1438
1439         * jit.c (map_call_type): added MB_TERM_CALL_VOID
1440         (mono_analyze_stack): impl. LDELEMA, reimplemented CALL
1441         instructions to handle this arguments more effectively.
1442
1443 2001-11-15  Dietmar Maurer  <dietmar@ximian.com>
1444
1445         * Makefile.am (mono_SOURCES): renamed testjit to mono
1446
1447         * x86.brg: added debugging support 
1448
1449         * testjit.c: added support for value types, CFG improvements
1450
1451         * emit-x86.c (enter_method): handle value types
1452         (tree_allocate_regs): impl. a better way to handle chain rules
1453
1454 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
1455
1456         * x86.brg (INITOBJ): bug fix: initialize data before use,
1457         simplified the code.
1458
1459 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
1460
1461         * testjit.c (mono_analyze_stack): Remove compiler warning by
1462         testing against NULL.
1463
1464 2001-11-09  Dick Porter  <dick@ximian.com>
1465
1466         * Makefile.am (testjit_LDADD): Don't need THREAD_LIBS any more
1467
1468 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
1469
1470         * testjit.c (mono_analyze_stack): new BOX impl.
1471
1472         * x86.brg: implemented INITOBJ
1473
1474         * testjit.c (mono_analyze_stack): finished array support
1475         (mono_analyze_stack): reimplemented DUP instruction
1476
1477 2001-11-08  Dietmar Maurer  <dietmar@ximian.com>
1478
1479         * testjit.c (MAKE_STELEM, MAKE_LDELEM): we build a tree which
1480         represents the address of the element. This way we can emit highly
1481         optimized x86 instructions to access elements (using base+index+offset
1482         adressing mode)
1483
1484 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
1485
1486         * mempool.c: Include string.h to kill warning.
1487
1488         * testjit.c: Add typecast to kill warning.
1489
1490         * x86.brg: Include string.h to eliminate warning.
1491
1492         * emit-x86.c (tree_allocate_regs): Fix arguments to g_warning to
1493         kill warning.
1494
1495 2001-11-07  Dietmar Maurer  <dietmar@ximian.com>
1496
1497         * emit-x86.c (enter_method): print out all method arguments
1498         (x86_magic_trampoline): impl.
1499         (arch_create_simple_jit_trampoline): we use different trampolines
1500         for static methods (no need to write the address back into to
1501         vtable).
1502
1503 2001-11-06  Dietmar Maurer  <dietmar@ximian.com>
1504
1505         * emit-x86.c (arch_create_jit_trampoline): optimised trampoline to
1506         use less the 16 bytes.
1507
1508         * x86.brg: code cleanup
1509
1510 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
1511
1512         * testjit.c: bug fixes.
1513
1514         * emit-x86.c (leave_method): print result values
1515
1516 2001-11-03  Dietmar Maurer  <dietmar@ximian.com>
1517
1518         * emit-x86.c (enter_method): new debugging code
1519         (leave_method): new debbuging code, this functions are called
1520         when you use the new option --trace-calls
1521
1522 2001-11-02  Dietmar Maurer  <dietmar@ximian.com>
1523
1524         * testjit.c: impl. STELEM_XX, STELEM_XX
1525
1526         * x86.brg: impl. LDLEN, LDELEMA
1527         
1528
1529 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
1530
1531         * x86.brg: added some experimental code for CALL
1532         instructions - still not found the optimal way to do it.
1533
1534         * testjit.c (map_stind_type): add support for value types with
1535         a size of 1, 2 or 4 bytes, implemented CEE_UNBOX, CEE_LDOBJ,
1536         CEE_LDSTR, CEE_LDFLD, CEE_LDFLDA, CEE_STFLD, CEE_NEWOBJ, CEE_CEQ
1537         (ctree_create_newobj): impl.
1538         
1539
1540         * emit-x86.c (tree_allocate_regs): removed allocation code for
1541         addr nonterminal.
1542         (get_address): use a simple, but bug free search instead of the
1543         buggy binary search.
1544
1545 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
1546
1547         * testjit.c: support virtual functions
1548
1549         * x86.brg: support different addressing modes for calls
1550
1551 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
1552
1553         * testjit.c: impl. STFLD
1554
1555 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
1556
1557         * x86.brg: impl. CEQ
1558
1559 2001-10-04  Dick Porter  <dick@ximian.com>
1560
1561         * testjit.c:
1562         * emit-x86.c: include mono-endian.h not endian.h
1563
1564 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
1565
1566         * testjit.c (ctree_create_dup): really duplicate the tree.
1567         attach the arguments to the CALL node. Added a new macro to
1568         make argument order configurable (ARCH_ARGS_RIGHT_TO_LEFT).
1569
1570 2001-10-01  Dietmar Maurer  <dietmar@ximian.com>
1571
1572         * interp.brg: the burm based interpreter: added the file as example.
1573
1574 2001-09-27  Dietmar Maurer  <dietmar@ximian.com>
1575
1576         * x86.brg: cleanup
1577
1578         * testjit.c: impl. LDIND/STIND/LDLOCA, use g_malloc to alloc static
1579         data.
1580         (map_stind_type): support enum types
1581         (map_ldind_type): support enum types
1582
1583         * emit-x86.c (tree_allocate_regs): added code to support
1584         register allocation for addressing modes trees.
1585         (tree_emit): bug fix: we have to emit all mono_burg_functins. The
1586         previous impl. did not work for chain rules.
1587         (compute_branches): support for SWITCH statements
1588
1589         * x86.brg: added rules to model x86 addressing modes
1590
1591 2001-09-26  Dietmar Maurer  <dietmar@ximian.com>
1592
1593         * emit-x86.c (compute_branches): implemented SWITCH
1594
1595         * testjit.c (mono_create_forest): implemented LDIND/STIND opcodes
1596         (map_ldind_type): add enumeration types.
1597         (map_stind_type): add enumeration types.
1598
1599         * emit-x86.c (arch_compile_method): more documentation.
1600
1601         * testjit.c: moved the architecture specific things to emit-x86.c
1602         and x86.brg. Added more documentation. code cleanup.
1603
1604 2001-09-25  Dietmar Maurer  <dietmar@ximian.com>
1605
1606         * x86.brg: we now have different types of addresses: ADDR_L for local
1607         values, ADDR_A for arguments and ADDR_G for global addresses. We
1608         also use LDIND_XX token to load values from a specific address
1609         instead of LDLOC/STLOC. 
1610
1611         * testjit.c: use the new adressing scheme everywhere:
1612         LDIND _XX (ADDR_X), and STIND_XX (ADDR_X, tree)  
1613
1614 2001-09-24  Dietmar Maurer  <dietmar@ximian.com>
1615
1616         * testjit.c (main): fix bug in parameter parsing
1617
1618         * x86.brg: impl. more opcodes
1619
1620 2001-09-23  Dick Porter  <dick@ximian.com>
1621
1622         * Makefile.am (testjit_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
1623
1624 2001-09-23  Dietmar Maurer  <dietmar@ximian.com>
1625
1626         * testjit.c: use the memory pool to avoid memory leaks
1627
1628 2001-09-22  Dietmar Maurer  <dietmar@ximian.com>
1629
1630         * x86.brg: increment the stack pointer after function calls
1631
1632 2001-09-21  Dick Porter  <dick@ximian.com>
1633
1634         * Makefile.am (testjit_LDADD): Added PTHREAD_LIBS to the link line
1635
1636 2001-09-21  Dietmar Maurer  <dietmar@ximian.com>
1637
1638         * x86.brg: implemented long MUL/DIV
1639         (MB_OPT_LEVEL): define optimisation level macro
1640
1641         * testjit.c (tree_allocate_regs): added a way to prevent EDX usage
1642         for operations like idiv. it is also possible to assign specific registers.
1643
1644 2001-09-20  Dietmar Maurer  <dietmar@ximian.com>
1645
1646         * x86.brg: added basic support for long
1647
1648         * testjit.c (mono_compile_method): implemented POP
1649
1650 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
1651
1652         * testjit.c (usage): Added a couple of more usage options.
1653
1654 2001-09-19  Dietmar Maurer  <dietmar@ximian.com>
1655
1656         * x86.brg: added more floating point grammar 
1657
1658         * testjit.c (mono_compile_method): make local offsets negative
1659
1660         * x86.brg: added some floating point trees
1661
1662         * testjit.c (mono_compile_method): arguments on the runtime 
1663         stack are at least 4 bytes
1664
1665         * x86.brg: partly implemented 8,16 bit integers
1666
1667         * testjit.c (get_address): mark basic blocks
1668
1669 2001-09-18  Dietmar Maurer  <dietmar@ximian.com>
1670
1671         * x86.brg: added some rules to optimize code
1672
1673         * testjit.c (get_address): use a binary search to get the address
1674         (main): added an option to debug the jit (-d)
1675
1676 Tue Sep 18 13:19:16 CEST 2001 Paolo Molaro <lupus@ximian.com>
1677
1678         * testjit.c: better/faster align code. Handle ldloc.s and stloc.s.
1679
1680 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
1681
1682         * testjit.c (mono_compile_method): Provide better error reporting.
1683
1684 2001-09-17  Dietmar Maurer  <dietmar@ximian.com>
1685
1686         * testjit.c (tree_get_address): impl. to fix address bug
1687         (tree_get_address): make sure that we can only jump to the first
1688         instruction of a tree.
1689
1690         * x86.brg: emit real code for calls
1691
1692         * testjit.c (create_jit_trampoline): creates a function to trigger jit
1693         compilation.
1694         (mono_compile_method): reversed argument order
1695
1696 2001-09-15  Dietmar Maurer  <dietmar@ximian.com>
1697
1698         * x86.brg (stmt): don't emit unnecessary register moves
1699
1700         * testjit.c (tree_allocate_regs): free registers earlier
1701
1702 2001-09-14  Dietmar Maurer  <dietmar@ximian.com>
1703
1704         * x86.brg: branch addresses are now resolved
1705
1706         * testjit.c (compute_branches): compute address of branches
1707
1708         * x86.brg: emit real x86 instructions
1709
1710         * testjit.c: call objdump to disassemble the output
1711
1712 2001-09-13  Dietmar Maurer  <dietmar@ximian.com>
1713
1714         * x86.brg: use the right offsets to access local variables
1715         and arguments.
1716
1717         * emit-x86.c: only save/restore callee saved registers if they are
1718         really modified.
1719
1720         * testjit.c (tree_allocate_regs): use the new MonoRegSet to
1721         allocate registers.
1722         (mono_compile_method): changed the tree for mothod calls
1723
1724         * regset.h: impl.
1725         
1726         * regset.c: impl.
1727         
1728
1729 2001-09-10  Miguel de Icaza  <miguel@ximian.com>
1730
1731         * x86.brg: Use Unix assembly syntax.
1732
1733         * emit-x86.c: support code, should be moved
1734
1735         * testjit.c: Use GPtrArrays instead of GLists, as those are very
1736         inefficient at appends.
1737
1738         * Renamed `create_new_leave' to `create_new_leaf'
1739
1740         
1741