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