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