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