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