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