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