1 2003-01-22 Martin Baulig <martin@ximian.com>
3 * debug.c: Reverted Gonzalo's last change since it is wrong.
4 We're also using the debugging code on Windows, for instance the
5 stabs stuff when running in gdb. I hope this code still builds on
6 Windows; if not, we need to fix this.
7 Moved all the mono debugger support code into the debugger itself;
8 when debugging a managed application, the debugger new launches a
9 small unmanaged wrapper application which contains this stuff.
11 * debug.h (MonoDebuggerIOLayer): New public typedef; this is just
12 initialized to an array of function pointers to the io-layer
13 function; they don't seem to be public in the `libmono' library.
14 (mono_debugger_event): New public function. Sends the debugger an
15 event if we're running in the Mono Debugger and does nothing otherwise.
17 * mono.c: Don't initialize the Mono Debugger here.
19 * jit.c (mono_debug_insert_breakpoint): Removed, this isn't used anymore.
20 (mono_thread_start_cb, mono_thread_attach_cb): Call
21 mono_debugger_event() to send the debugger a callback.
23 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25 * debug.c: make all public symbols just dummy for windows.
27 2003-01-20 Miguel de Icaza <miguel@ximian.com>
29 * debug.c (initialize_debugger_support): ifdef out the call to
30 mono_debugger_init_thread_debug for the release.
32 Someone should look into why its not defined. I think the problem
33 is what Dick pointed out somewhere: code in io-layer is not
34 supposed to ever be used in Windows, so code for the debugger that
35 lives there must be moved elsewhere.
37 2003-01-19 Martin Baulig <martin@ximian.com>
39 * debug.c: Ok, this should now finally be working this time ....
41 2003-01-18 Martin Baulig <martin@ximian.com>
43 * debug.c (mono_debugger_jit_exec): Send the background thread a
44 SIGKILL before returning.
46 2003-01-17 Dietmar Maurer <dietmar@ximian.com>
48 * x86.brg: removed duplicated CONV_OVF_I4
50 2003-01-17 Martin Baulig <martin@ximian.com>
52 * debug.c: Don't use mono_once here. Reworked the API a bit to
53 use `mono_debug_' and `debug_' for the general debugging API and
54 `mono_debugger_' and `debugger_' for the Mono Debugger stuff.
56 2003-01-16 Martin Baulig <martin@ximian.com>
58 * debug.c (debugger_thread_func): We don't need to `raise
59 (SIGSTOP)' anymore; the thread manager already takes care of this.
61 2003-01-16 Dietmar Maurer <dietmar@ximian.com>
63 * exception.c (arch_handle_exception): exclude runtime invoke
64 wrapper from the stack trace
66 * jit.c (mono_cfg_new): allocate extra space to store esp (used by exceptions)
67 (mono_thread_start_cb): save an additional LMF at thread start
69 2003-01-16 Martin Baulig <martin@ximian.com>
71 * jit.c (mono_runtime_install_handlers): Use SYS_sigaction() for
72 the mono_thread_get_abort_signal () - this is SIGUSR1 on FreeBSD
73 and the LinuxThreads port doesn't allow you to override the handler.
74 [FIXME: This avoids an assertion failure on startup, but there's
75 still an issue with thread termination.]
77 2003-01-16 Martin Baulig <martin@ximian.com>
79 * debug.c (debugger_thread_func): We don't need to `raise
80 (SIGSTOP)' anymore; the thread manager already takes care of this.
82 2003-01-16 Martin Baulig <martin@ximian.com>
84 * debug.c: Use the mono/io-layer functions here instead of gthread.
86 2003-01-14 Dietmar Maurer <dietmar@ximian.com>
88 * jit.c (mono_jit_compile_method): make sure runtime_init is called
89 (mono_analyze_stack): make sure runtime_init is called
91 2003-01-14 Martin Baulig <martin@ximian.com>
93 * debug.c (debugger_update_symbol_file_table): Moved all the
94 functionality into debugger_update_symbol_file_table_internal();
95 the latter one will be called from the background thread while
96 already owning the lock. This'll allow us to step into
97 debugger_update_symbol_file_table() in the debugger and debug it.
99 2003-01-14 Martin Baulig <martin@ximian.com>
101 * Makefile.am: Link against gthread.
103 * jit.c: After realizing that mono-mutex doesn't work either
104 because it doesn't support recursive mutexes on FreeBSD, rewrote
105 the whole thread stuff to use gthread. This seems to fix this
106 weird deadlock in the debugger as well.
108 2003-01-12 Alp Toker <alp@atoker.com>
110 * exception.c: Typo fix: insinde -> inside
112 2003-01-08 Dietmar Maurer <dietmar@ximian.com>
114 * exception.c (ves_icall_get_frame_info): skip one more frame and also
115 MONO_WRAPPER_RUNTIME_INVOKE wrappers
116 (x86_unwind_native_frame): disable unnecessary assertion
118 2003-01-07 Dietmar Maurer <dietmar@ximian.com>
120 * exception.c (ves_icall_get_frame_info): fix bug 36382
122 Tue Jan 7 15:15:41 CET 2003 Paolo Molaro <lupus@ximian.com>
124 * jit.c: handle wrapper_data in NEWOBJ/CALL.
126 2003-01-07 Dietmar Maurer <dietmar@ximian.com>
128 * jit.c (mono_analyze_stack): add check for NULL target in STFLD
130 2003-01-06 Martin Baulig <martin@ximian.com>
132 * debug.c (debugger_finished_mutex): Use a recursive mutex here.
134 * debug.c: Correctly handle the `debugger_finished_mutex'; it is
135 only unlocked by the pthread_cond_wait() in mono_debugger_wait().
137 2003-01-04 Jackson Harper <jackson@latitudegeo.com>
139 * debug.c: Move must_send_finished var declaration out of #if win32
140 block (this fixes the build on win32)
142 2003-01-05 Martin Baulig <martin@ximian.com>
144 * debug.c (mono_debugger_jit_exec): Custom version of mono_jit_exec();
145 this is used when we're running inside the Mono Debugger
146 (mono_debugger_wait): Put the waiting code into a function of its own.
148 * mono.c (main): Call mono_debugger_jit_exec() instead of
149 mono_jit_exec() if we're running inside the Mono Debugger.
151 2003-01-05 Martin Baulig <martin@ximian.com>
153 * debug.h (MonoDebugFormat): Added
154 `MONO_DEBUG_FORMAT_MONO_DEBUGGER'; this allows us to check whether
155 we're running inside the Mono Debugger prior to the args parsing.
157 2003-01-04 Martin Baulig <martin@ximian.com>
159 * debug.c (release_symbol_file_table): Only call this if we're
160 actually modifying the symbol tables.
161 (mono_debug_open): Always set the `mono_debugger_class_init_func'
162 for MONO_DEBUG_FORMAT_MONO; this stuff should also go into core dumps.
164 2003-01-03 Martin Baulig <martin@ximian.com>
166 * debug.c: Disable the mono debugger stuff on Windows.
168 2003-01-03 Martin Baulig <martin@ximian.com>
170 * debug.c (mono_debugger_trampoline_breakpoint_callback): New
171 function. This is called from the breakpoint trampoline to signal
172 the debugger and wait until it has reload the symbol tables.
174 * trampoline.c (get_breakpoint_trampoline): Call the new
175 mono_debugger_trampoline_breakpoint_callback() in the breakpoint
176 trampoline just before the breakpoint.
178 2002-12-31 Martin Baulig <martin@ximian.com>
180 * debug.c (MonoDebuggerSymbolFileTable): Added `global_symfile'
181 field to point to the MonoGlobalSymbolTable.
183 2002-12-30 Martin Baulig <martin@ximian.com>
185 * debug.c (MonoDebuggerInfo): Put back `symbol_file_modified'.
186 This variable now specifies that the symbol tables have been
187 modified after the last notification has been send. The debugger
188 uses this flag to check whether it needs to reload the symbol
190 (debugger_compile_method): Just send a notification to the
191 debugger, but don't set the modified flag. It may or may not be
192 set when the debugger gets the notification - depending on whether
193 the JIT compilation added a new method to the symbol tables.
195 2002-12-30 Martin Baulig <martin@ximian.com>
197 * debug.c (debugger_compile_method): This is a wrapper around
198 mono_compile_method() which always sends a notification to the
201 2002-12-30 Martin Baulig <martin@ximian.com>
203 * debug.c: Reload the symbol file table before sending the
204 notification event to the debugger.
205 (MonoDebuggerInfo): Removed `update_symbol_file_table'.
207 2002-12-31 Martin Baulig <martin@ximian.com>
209 * debug.c: Propertly lock everything and avoid race conditions.
210 (MonoDebuggerInfo): Removed the `symbol_file_modified' again.
212 2002-12-31 Duncan Mak <duncan@ximian.com>
214 * debug.c (initialize_debugger_support): Fix build error by
215 declaring ret at the top of the function.
217 2002-12-30 Martin Baulig <martin@ximian.com>
219 * debug.c: When running under the mono debugger, create a special
220 debugger thread; always protect the symbol tables with a mutex.
222 2002-12-28 Martin Baulig <martin@ximian.com>
224 * debug.c (MonoDebuggerInfo): Added `symbol_file_modified'; it's
225 incremented each time one of the symbol tables is modified.
227 Thu Dec 19 18:31:54 CET 2002 Paolo Molaro <lupus@ximian.com>
229 * jit.c: fix LDELEMA implementation here as well.
231 Wed Dec 18 11:42:58 CET 2002 Paolo Molaro <lupus@ximian.com>
233 * jit.c: handle CEE_CONV_OVF_U8_UN like CEE_CONV_OVF_I8_UN.
235 Wed Dec 18 11:36:04 CET 2002 Paolo Molaro <lupus@ximian.com>
237 * jit.c: query the thread abort signal from the runtime.
239 2002-12-12 Juli Mallett <jmallett@FreeBSD.org>
241 * jit.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
243 2002-12-11 Zoltan Varga <vargaz@freemail.hu>
245 * jit.c (mono_analyze_stack): call the utility function
246 mono_field_from_token to avoid code duplication.
248 2002-12-02 Dietmar Maurer <dietmar@ximian.com>
250 * jit.c (mono_analyze_stack): added some additinal checks to verify IL code
252 * x86.brg (stmt): POP floating point stack correctly
254 2002-11-28 Dietmar Maurer <dietmar@ximian.com>
256 * emit-x86.c (arch_emit_prologue): don't save caller saved
259 * exception.c (x86_unwind_native_frame): support exceptions inside
260 native code using gcc generated exception tables (-fexception).
262 2002-11-19 Dietmar Maurer <dietmar@ximian.com>
264 * exception.c: include some code from Zoltan Varga, but modified
267 2002-11-27 Dietmar Maurer <dietmar@ximian.com>
269 * exception.c: massive code cleanups. The code is still
270 architecture dependent, but it should be now possible to reuse the
271 complex parts for other architecture.
273 2002-11-15 Dick Porter <dick@ximian.com>
275 * jit.c: Pass the attach callback to mono_runtime_init().
277 2002-11-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
279 * jit.c: display the domain name in trace output.
281 2002-11-08 Dietmar Maurer <dietmar@ximian.com>
283 * x86.brg (reg): fix bug #2721
285 * jit.c (mono_runtime_install_handlers): impl.
287 2002-10-17 Martin Baulig <martin@gnome.org>
289 * debug.c (mono_debug_add_method): Make this actually work if we don't
290 have any lifetime information.
292 2002-10-15 Martin Baulig <martin@gnome.org>
294 * jit.cs (PUSH_TREE): Always set t->cli_addr here.
296 * debug.c (generate_line_number): Small fix to make this actually
297 work for more complex things.
299 2002-10-11 Dietmar Maurer <dietmar@ximian.com>
301 * x86.brg (freg): use fprem instead of fprem1
303 2002-10-03 Dietmar Maurer <dietmar@ximian.com>
305 * jit.c (ves_array_element_address): added check for out of range index
306 (mono_analyze_stack): added fix for bug #31654
308 2002-10-01 Martin Baulig <martin@gnome.org>
310 * debug.c: Don't create an .il file for the dynamic symbol file.
312 2002-10-01 Martin Baulig <martin@gnome.org>
314 * debug.c (MonoDebuggerInfo): Added mono_runtime_invoke().
316 2002-09-27 Martin Baulig <martin@gnome.org>
318 * debug.c (debug_load_method_lines): Don't use sigaction() on win32.
320 2002-09-27 Dick Porter <dick@ximian.com>
322 * mono.c: Tell glib what the program name is, by passing it the
323 name of the managed file we're executing
325 2002-09-26 Martin Baulig <martin@gnome.org>
327 * trampoline.c (x86_magic_trampoline): Don't insert the breakpoint
328 trampoline into the vtable, also use it for non-virtual methods,
329 remove the breakpoint when done.
331 2002-09-26 Martin Baulig <martin@gnome.org>
333 * debug.c (debug_load_method_lines): Block SIGCHLD while running
336 2002-09-26 Martin Baulig <martin@gnome.org>
338 * debug.c: Reworked the whole debugging stuff. We have now one
339 single `mono_debug_handle' which keeps a hashtable of
340 `AssemblyDebugInfo's (which may have different debugging formats).
341 The AssemblyDebugInfo is now created when the assembly is loaded,
342 but never when adding a class/type.
344 * mono.c: Initialize debugging stuff after corlib and the assembly
347 2002-09-25 Martin Baulig <martin@gnome.org>
349 * debug-private.h (DebugLineNumberInfo): Removed. There's now a
350 MonoDebugLineNumberEntry type in debug-mono-symfile.h which we're
352 (DebugMethodInfo): Removed `line_numbers'.
354 * debug.c: Reworked the line number generation; we're now using
355 the MonoDebugLineNumberEntry try for all debugging formats. This
356 type also includes the line number and IL offset, this allows the
357 JIT to produce better line number info: we only emit line number
358 information for source lines which actually have code.
360 2002-09-25 Martin Baulig <martin@gnome.org>
362 * debug.h: Removed external declaration of all functions which
363 should only be called from the Mono Debugger and also made them
364 static. Since the debugger gets their address from the
365 `MONO_DEBUGGER__debugger_info' vtable, there's no need to export
368 2002-09-25 Martin Baulig <martin@gnome.org>
370 Improved breakpoint support, we can now dynamically insert and
371 remove breakpoints at runtime and when called from withing the
372 Mono Debugger, we're using a special breakpoint trampoline.
374 * debug.h (mono_method_has_breakpoint): New method to check
375 whether to insert a breakpoint for a method.
376 (mono_insert_breakpoint): New method to insert a breakpoint.
377 (mono_insert_breakpoint_full): New method to insert a breakpoint,
378 takes a MonoMethodDesc.
379 (mono_remove_breakpoint): New method to remove a breakpoint.
381 * debug.c (mono_debugger_insert_breakpoint): New function for the
382 debugger. Should only be called from the debugger.
383 (mono_debugger_remove_breakpoint): Likewise.
385 * mono.c (main): Use mono_insert_breakpoint() to insert breakpoints.
387 * trampoline.c (get_breakpoint_trampoline): New static function to
388 create a special breakpoint trampoline for the debugger.
389 (x86_magic_trampoline): If we're running inside the Mono Debugger
390 and a breakpoint was requested for the method, generate a special
391 breakpoint trampoline.
393 * jit.c (mono_debug_methods): Removed, use mono_insert_breakpoint()
394 to insert a breakpoint.
395 (mono_debug_last_breakpoint_address): Removed.
396 (match_debug_method): Removed, use mono_method_has_breakpoint().
398 Wed Sep 25 12:04:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
400 * jit.c: reorder mono_runtime_cleanup () call since it needs the
401 engine still fully working.
403 2002-09-24 Martin Baulig <martin@gnome.org>
405 * debug.c (mono_debug_open): When we're invoked from inside the
406 Mono Debugger, set mono_debugger_class_init_func (exported in
407 metadata/class.c) to mono_add_type().
408 (mono_add_type): Call mono_debug_symfile_add_type().
410 Tue Sep 24 11:34:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
412 * jit.c: avoid including cil-coff.h (again). Optimize typeof (type).
413 Run finalize on domain cleanup.
414 * mono.c: call setlocale ().
415 * trampoline.c: clearer error message for invalid trampoline.
417 2002-09-21 Martin Baulig <martin@gnome.org>
419 * debug.c (MonoDebuggerSymbolFileTable): Use an actual typedef for this
420 instead of writing a byte blob.
421 (mono_debug_make_symbols): This doesn't touch the symbol tables anymore.
422 (mono_debug_add_method): Incrementally add the new method to the symbol
425 * exception.c (arch_handle_exception): If we have debugging support,
426 call mono_debugger_update_symbol_file_table () as well.
428 2002-09-20 Martin Baulig <martin@gnome.org>
430 * debug.c (mono_debug_add_method): The `MonoDebugVarInfo' now includes
431 the size of the variable.
433 2002-09-18 Dietmar Maurer <dietmar@ximian.com>
435 * linear-scan.c (mono_analyze_liveness): we can save 30% of needed
436 iterations if we visit blocks in reverse order.
438 2002-09-12 Dietmar Maurer <dietmar@ximian.com>
440 * jit.c (mono_analyze_stack): cleaup of the array code
442 * exception.c: added patch from Julio Merno to fix bug #30048
444 * jit.c (mono_analyze_stack): code cleanup, fix bug #29365
446 2002-09-09 Dietmar Maurer <dietmar@ximian.com>
448 * x86.brg (LDELEMA): use x86_lea
450 2002-09-06 Martin Baulig <martin@gnome.org>
452 * debug.c (debug_update_il_offsets): Fixed a memory corruption bug.
453 If you were getting random crashes when using the JIT with debugging
454 turned on, this fixes it.
456 2002-09-06 Dietmar Maurer <dietmar@ximian.com>
458 * emit-x86.c (arch_emit_epilogue): use pop instead of mov
460 2002-09-05 Martin Baulig <martin@gnome.org>
462 * debug.c (MONO_DEBUGGER__debugger_info): New global data symbol
463 which is read by the debugger.
465 Wed Sep 4 14:06:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
467 * Makefile.am: link libmono directly into mono. Use a ld script
468 to reduce exported symbols.
470 2002-09-03 Martin Baulig <martin@gnome.org>
472 * debug.c (free_method_info): Make this actually work.
474 2002-09-03 Martin Baulig <martin@gnome.org>
476 * debug.h (MonoDebugFormat): Killed MONO_DEBUG_FORMAT_DWARF2_PLUS.
477 * debug-dwarf2-plus.c: Removed.
479 * debug-private.h (DebugMethodInfo): Removed the `method_info' field.
480 (AssemblyDebugInfo): Removed the old `symfile' field and renamed
481 `mono_symfile' to `symfile'.
483 * debug.c (mono_debug_open): Replaced the assembly argument with a
484 file name argument; you can now call this before loading the assembly.
485 (debug_generate_method_lines): The MonoDebugILOffsetInfo struct is gone,
486 we now use MonoSymbolFileLineNumberEntry's and a separate address array
487 instead; splitted out all MonoSymbolFileLineNumberEntry code into
488 debug_generate_il_offsets() and debug_update_il_offsets().
489 (mono_debug_add_method): Don't create the MonoDebugMethodInfo here; it's
490 created when reading the symbol file or from debug_load_method_lines().
491 (debug_load_method_lines): Create the MonoDebugMethodInfo for all methods.
493 * exception.c (arch_handle_exception): Call mono_debug_make_symbols() before
494 looking up an address.
496 * debug.c: Don't create the .il files for MONO_DEBUG_FORMAT_MONO.
498 * mono.c (main): Initialize debugging before loading the first assembly.
500 2002-08-28 Dick Porter <dick@ximian.com>
502 * mono.c: mono_set_rootdir() doesnt take any args now
504 * Makefile.am: Export HOST_CC for w32 builds
506 2002-08-28 Dietmar Maurer <dietmar@ximian.com>
508 * jit.c (mono_store_tree): only allocate vars if really necessary
510 2002-08-27 Martin Baulig <martin@gnome.org>
512 * debug.c: The mono symbol file is installed together with the assembly
513 it belongs to and it's used on a per-image basis.
515 Tue Aug 27 19:44:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
517 * mono.c: don't use the cil-coff header outside of the loader.
519 2002-08-27 Martin Baulig <martin@gnome.org>
521 * debug.c (mono_debugger_internal_get_symbol_files): Removed, we need
522 to use global variables for this since they're stored in a core file.
523 (mono_debugger_symbol_file_table_generation): New global variable.
524 (mono_debugger_symbol_file_table): New global variable.
525 (mono_debugger_update_symbol_file_table): New global function to update
526 the symbol file table.
528 2002-08-27 Martin Baulig <martin@gnome.org>
530 * trampoline.c (mono_generic_trampoline_code): New global variable.
531 (arch_create_jit_trampoline): Use the new global variable to store the
532 generic trampoline code instead of using a static one. This allows the
533 debugger to access this variable to check whether a method is a trampoline.
535 * debug.h (mono_generic_trampoline_code): Added external declaration.
537 2002-08-27 Martin Baulig <martin@gnome.org>
539 * debug.c (MonoDebugHandle): Moved the method hash into the
540 AssemblyDebugInfo struct since we need to use a separate hash for each
543 * debug.c: Added special undocumented command line argument to create a
544 symbol file for IL files on-the-fly. In this case, we also need to create
545 the IL files and parse them.
546 (mono_debugger_internal_get_symbol_files): Return something more reasonable.
548 2002-08-26 Martin Baulig <martin@gnome.org>
550 * debug.c (mono_debugger_internal_free_symbol_files): New function.
551 (mono_debugger_internal_symbol_files_changed): New global variable.
553 2002-08-24 Martin Baulig <martin@gnome.org>
555 * debug.c (mono_debugger_internal_get_symbol_files): New function.
557 2002-08-24 Martin Baulig <martin@gnome.org>
559 * debug.c (mono_debug_write_symbols): Added support for the new
562 * mono.c (main): The `--debug' argument now knows about a new
563 debugging format `mono' which will be used to display source lines
566 * debug.h (MonoDebugFormat): Added a new MONO_DEBUG_FORMAT_MONO
567 which will be used when displaying backtraces. It reads a new
570 2002-08-23 Martin Baulig <martin@gnome.org>
572 * jit.c (match_debug_method): Don't include runtime invoke methods
575 * mono.c (main): Accept `Main' as argument to --break to insert a
576 breakpoint on the application's main method.
578 2002-08-23 Martin Baulig <martin@gnome.org>
580 * debug-dwarf2.c (dwarf2_write_class_field): Don't include any static fields.
582 2002-08-21 Dietmar Maurer <dietmar@ximian.com>
584 * exception.c (arch_handle_exception): don't set stack_trace to
585 null (so that it contains the full trace even when we rethrow the
588 2002-08-19 Nick Drochak <ndrochak@gol.com>
590 * x86.brg (mono_llmult_ovf): Simplified the code greatly by refactoring
591 the algebraic form we are using. This also eliminated a silly overflow
592 of the intermediate result that was causing troubles.
594 2002-08-16 Nick Drochak <ndrochak@gol.com>
596 * x86.brg (mono_llmult_ovf): Flip ALL the bits, dummy. Now negative numbers
599 2002-08-15 Nick Drochak <ndrochak@gol.com>
601 * x86.brg (mono_llmult_ovf): Fix so it throws an overflow when result
602 will not fit in 64 bits. Fixes bug #27375.
604 Wed Aug 14 17:31:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
606 * exception.c: updates for API changes in metadata/.
608 2002-08-13 Dietmar Maurer <dietmar@ximian.com>
610 * jit.c (mono_jit_init): use ((gpointer)-1) as end_of_stack
611 address for the main thread.
613 2002-08-12 Dietmar Maurer <dietmar@ximian.com>
615 * jit.c (mono_analyze_stack): added support for Thread::Abort ()
617 2002-08-08 Dietmar Maurer <dietmar@ximian.com>
619 * exception.c (arch_handle_exception): simply return and let the
620 libpthread/kernel restore the context. This should work on recent
621 versions of linuxthreads.
623 * jit.c (mono_runtime_install_handlers): switch back to use
624 sigaction from libpthreads. As long as this does not make problems
625 we should use this instead of syscall.
627 2002-08-07 Dietmar Maurer <dietmar@ximian.com>
629 * jit.c: removed the createdelegate icall
630 (mono_analyze_stack): special case Array::Address()
632 2002-08-06 Dietmar Maurer <dietmar@ximian.com>
634 * emit-x86.c (arch_emit_prologue): make the call to
635 mono_get_lmf_addr relocatable.
636 (arch_jit_compile_cfg): do not waste memory
637 (arch_jit_compile_cfg): use a mempool to store native code. This
638 improves locality of code.
640 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
642 * jit.c (mono_analyze_stack): impl. CEE_MONO_RETOBJ
644 2002-07-30 Sergey Chaban <serge@wildwestsoftware.com>
646 * x86.brg (LOCALLOC): under Windows, if allocation size is bigger
647 than one page, it's necessary to allocate memory incrementally,
648 in page-size steps, performing stack-touch every time.
649 Also added LOCALLOC(CONST_I4) implementation.
651 2002-07-27 Dietmar Maurer <dietmar@ximian.com>
653 * jit.c (mono_get_runtime_method): code cleanup
655 * x86.brg: we do not need to save EAX/ECX/EDX in stmt:
657 2002-07-24 Dietmar Maurer <dietmar@ximian.com>
659 * jit.c (mono_analyze_stack): added CEE_TAIL (but it is ignored)
661 Wed Jul 24 13:02:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
663 * jit.c, jit.h, exception.c: implemented stack walking function.
665 2002-07-24 Dietmar Maurer <dietmar@ximian.com>
667 * x86.brg (ARG_OBJ): removed zero sized object warning
669 2002-07-23 Dietmar Maurer <dietmar@ximian.com>
671 * jit.c (mono_allocate_excvar): mark excvar as volatile
673 * emit-x86.c (enter_method): use arch_get_argument_info to get
676 * jit.c (mono_analyze_stack): use arch_get_argument_info to get
678 (mono_analyze_stack): removed unused code
680 * emit-x86.c (arch_allocate_arg): impl.
682 2002-07-22 Dietmar Maurer <dietmar@ximian.com>
684 * emit-x86.c (arch_allocate_var): fix alignment bug
686 * x86.brg (X86_CALL_BEGIN): add argument padding before emitting a call
688 * jit.c (mono_analyze_stack): s/k/k + 1/
690 * x86.brg (LOCALLOC): align to MONO_FRAME_ALIGNMENT
692 * emit-x86.c (arch_get_argument_info): impl.
694 2002-07-21 Miguel de Icaza <miguel@ximian.com>
696 * exception.c (arch_handle_exception): Memory leak fix.
698 2002-07-19 Dietmar Maurer <dietmar@ximian.com>
700 * jit.c (mono_analyze_stack): avoid recursive inlining
702 Fri Jul 19 18:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
704 * emit-x86.c: temporary workaround for gcc bug.
705 * jit.h, jit.c, mono.c: move mono_jit_image to jit.c.
706 Don't include config.h in headers.
708 2002-07-19 Dietmar Maurer <dietmar@ximian.com>
710 * x86.brg: correctly align valuetype arguments on the stack
712 * jit.c (mono_analyze_stack): do not compute frame size here.
714 * x86.brg: use macros to avoid code duplication for CALL opcodes,
715 compute frame size in x86.brg
717 2002-07-18 Dietmar Maurer <dietmar@ximian.com>
719 * x86.brg (ARG_OBJ): allow zero sized ARG_OBJ
721 * exception.c (arch_handle_exception): removed duplicated code,
722 added support for exception filters
724 * jit.c (mono_jit_compile_method): support exception filters
726 2002-07-17 Dietmar Maurer <dietmar@ximian.com>
728 * jit.c (mono_analyze_stack CEE_DIV): added fix from Zoltan Varga
730 * jit.c: s/ISSTRUCT/MONO_TYPE_ISSTRUCT/
732 * helpers.c (mono_map_ldind_type): added suggested changes from
733 Zoltan Varga (support MONO_TYPE_U), variou 64bit fixes
735 * jit.c (mono_analyze_stack): remove the vtype pointer from the
736 stack (fix bug #27420)
738 2002-07-16 Dietmar Maurer <dietmar@ximian.com>
740 * x86.brg (CALL_VOID): fix bug #27751
741 (CONV_R_UN) use reg2 instead of reg1 for the negative check /fix bug 27849.
743 * jit.c (mono_analyze_stack): adjust valuetype size for pinvoke calls
745 i2002-07-11 Dietmar Maurer <dietmar@ximian.com>
747 * x86.brg (freg): new rule freg: CALL_R8 (this, reg)
749 2002-07-10 Dietmar Maurer <dietmar@ximian.com>
751 * emit-x86.c (arch_emit_prologue): added code to save LMF
753 2002-07-04 Dietmar Maurer <dietmar@ximian.com>
755 * x86.brg (LOCALLOC): added fix from Zoltan Varga (for bug #27396)
757 2002-07-05 Martin Baulig <martin@gnome.org>
759 * debug.c (mono_debug_add_method): Fix a bug in the `begin_scope' and
760 `end_scope' calculations when linear scan register allocation is disabled.
762 2002-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
764 * mono.c: removed the "RESULT: X" message.
766 2002-07-01 Dietmar Maurer <dietmar@ximian.com>
768 * exception.c (arch_get_call_finally): restore caller saved
769 register used by global reg. allocation when calling finally
770 handlers (fixes bug #24943).
772 2002-07-01 Dick Porter <dick@ximian.com>
774 * jit.c (mono_jit_exec): Removed unneeded argument to
775 mono_runtime_run_main()
777 2002-06-28 Martin Baulig <martin@gnome.org>
779 * debug.c (debug_generate_method_lines, mono_debug_add_method): Make methods
780 start on the nop instruction to make single-stepping into an already-JITed
783 2002-06-26 Martin Baulig <martin@gnome.org>
785 * debug.c (mono_debug_source_location_from_address): Added
786 `guint32 *line_number' argument. If it's not NULL, store the line number
787 there and return the file name without the line number.
789 * exception.c (ves_icall_get_trace): Fill in `sf->filename' and `sf->line'.
790 (ves_icall_get_frame_info): Likewise.
792 2002-06-25 Dick Porter <dick@ximian.com>
794 * jit.c (mono_jit_exec): Pass the assembly to mono_runtime_run_main
796 2002-06-22 Martin Baulig <martin@gnome.org>
798 * debug.c (mono_debug_source_location_from_address): Small fix, an
799 unsigned number can never be smaller than zero, make that check
802 2002-06-19 Dietmar Maurer <dietmar@ximian.com>
804 * exception.c (ves_icall_get_trace): new method to get the stack
805 trace from a Exception.
807 2002-06-18 Dietmar Maurer <dietmar@ximian.com>
809 * jit.c (check_inlining): do not inline functions containing
810 calls to stack query functions
812 * exception.c (ves_icall_get_frame_info): impl.
814 Tue Jun 18 10:21:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
816 * invoke.c: marshal simple arrays correctly.
818 2002-06-17 Dietmar Maurer <dietmar@ximian.com>
820 * x86.brg: added inlined versions of Math.Sin, Math.Cos, Math.Sqrt
822 * jit.c (mono_analyze_stack): impl. STARG
823 (mono_analyze_stack): impl. LDARGA
825 * exception.c (arch_handle_exception): correctly restore register
826 values when unwinding the stack (fixes bug 25698)
828 2002-06-09 Martin Baulig <martin@gnome.org>
830 * debug.c (mono_debug_open_image): For MONO_DEBUG_FORMAT_DWARF2_PLUS,
831 the `%s-debug.s' file is in the same directory than its assembly.
833 Sat Jun 1 13:24:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
835 * message.c, emit-x86.c: kill warnings.
837 2002-05-31 Dietmar Maurer <dietmar@ximian.com>
839 * x86.brg: buf fix in REMOTE_STIND_OBJ
840 (mono_ldvirtftn): impl.
841 (mono_ldintftn): impl.
844 Fri May 31 13:26:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
846 * mono.c: added --config command line option.
848 Fri May 31 12:34:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
850 * jit.c, jit.h: collect statistics about the number of basic blocks.
852 2002-05-31 Martin Baulig <martin@gnome.org>
854 * debug.c (mono_debug_address_from_il_offset): New public function.
855 (mono_debug_add_method): Improved local variable info: correctly handle
856 variables in registers and their start/end scopes.
858 2002-05-30 Martin Baulig <martin@gnome.org>
860 * debug-dwarf2.c (dwarf2_write_string): Use "0x%lx" as fprintf() format,
861 not "%p" which seems to be broken on Windows/mingw32.
863 2002-05-30 Dietmar Maurer <dietmar@ximian.com>
865 * x86.brg (reg): bug fix in LOCALLOC
867 * mono.c (main): new switch --nointrinsic to disable memcpy opt.
869 * x86.brg: added block copy/init optimizations from
870 Serge (serge@wildwestsoftware.com)
872 Thu May 30 14:13:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
874 * invoke.cs: lookup P/Invoke method address only when needed.
876 2002-05-29 Dietmar Maurer <dietmar@ximian.com>
878 * x86.brg: bug fix in REMOTE_STIND_OBJ
880 * invoke.c (arch_create_native_wrapper): handle pointers to value types
882 * helpers.h: use mono_ prefix for all functions
884 * jit.c (mono_analyze_stack): fixed SIZEOF
886 * x86.brg: impl. LOCALLOC, INITBLK
888 2002-05-28 Dietmar Maurer <dietmar@ximian.com>
890 * x86.brg: impl. CKFINITE
892 * jit.c (mono_analyze_stack): impl. CEE_CALLI
894 * x86.brg (JMP): impl. JMP opcode
896 2002-05-27 Dietmar Maurer <dietmar@ximian.com>
898 * jit.c (mono_cfg_new): reserve additional space to store ESP when
899 calling finally handlers.
901 * exception.c (arch_get_call_finally): save ESP before calling
904 * helpers.c (map_arg_type): move some generic helper function into
907 * mono.c (usage): new option --breakonex
909 * exception.c (arch_exc_is_caught): only return FALSE if really
912 * jit.c (mono_thread_abort): free jit_tls
914 2002-05-24 Dietmar Maurer <dietmar@ximian.com>
916 * x86.brg (stmt): use memmove to cope with overlapping
917 blocks. This is not required by the specs, so we can remove it
918 later if it turns out to be too slow (and use memcpy).
920 * jit.c (mono_analyze_stack): moved const. folding from x86.brg
922 * x86.brg: CPBLK impl.
924 * emit-x86.c (tree_emit): modified to support 3 nonterminals per
925 rule (used for CPBLK).
927 Thu May 23 18:43:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
929 * mono.c: remove generated code from hash when benchmarking/testing
931 * invoke.cs: special case string ctors.
933 2002-05-23 Dietmar Maurer <dietmar@ximian.com>
935 * *.c: code cleanups - tried to separate architecture dependent things.
937 2002-05-23 Martin Baulig <martin@gnome.org>
939 * debug.c (mono_debug_open): Don't call mono_debug_add_image().
940 (mono_debug_write_symbols): Only recreate the symbol file if
943 * debug-private.h (MonoDebugHandle): Added `dirty' flag.
945 * mono.c (main): Call mono_debug_add_image() here.
947 * jit.c (mono_thread_abort): If we have debugging support, call
948 mono_debug_make_symbols() and G_BREAKPOINT().
950 * exception.c (arch_handle_exception): Don't G_BREAKPOINT() if we get
951 an unhandled exception.
953 2002-05-23 Dietmar Maurer <dietmar@ximian.com>
955 * delegate.c: move the thread pool to metadata/threadpool.c, code
958 2002-05-22 Dietmar Maurer <dietmar@ximian.com>
960 * exception.c (arch_exc_is_catched): impl. MS like exception
961 handling (added a check for unhandled exceptions)
963 2002-05-22 Martin Baulig <martin@gnome.org>
965 * debug-dwarf2-plus.c (mono_debug_open_assembly_dwarf2_plus): Only run
966 the assembler if necessary, ie. the assembler file is newer than the
967 symbol file or the symbol file does not exist.
969 * debug.c: Added "update_on_exit" argument to recreate the symbol file
972 * debug-dwarf2.c: Produce assembler code which is free of comments and
973 extra whitespaces so that it's suitable for `as -f'.
975 2002-05-22 Martin Baulig <martin@gnome.org>
977 * debug-dwarf2.c (dwarf2_write_section_end): Removed. This is not needed
978 and not supported by all assemblers.
979 (dwarf2_write_2byte): Use ".word" instead of ".2byte" since ".2byte" is a
982 * mono.c (--debug): Small fix in the argument parsing.
984 2002-05-22 Martin Baulig <martin@gnome.org>
986 * debug.c: Added "dont_assemble" and "dont_precompile" argument for dwarf-plus.
988 * mono.c: Applied patch from Miguel:
989 (--debug): This is now a `--debug=[FORMAT]' argument where FORMAT defaults
992 2002-05-21 Martin Baulig <martin@gnome.org>
994 * debug.c (mono_debug_source_location_from_address): Added support for the
997 2002-05-21 Martin Baulig <martin@gnome.org>
999 * debug.c (mono_debug_source_location_from_address): New function.
1000 (mono_debug_il_offset_from_address): New function.
1002 * exception.c (arch_handle_exception): If we have debugging support, include
1003 information about the source location and IL offset in the stack trace.
1005 2002-05-21 Dietmar Maurer <dietmar@ximian.com>
1007 * jit.c (mono_analyze_stack): LDARG uses 16bit argument (fix bug
1010 * x86.brg (stmt): removed unnecessary assertion
1012 * jit.c (check_inlining): we cant inline throw instructions
1013 (because it breaks some basic block requirements)
1015 2002-05-21 Martin Baulig <martin@gnome.org>
1017 * debug-private.h (MonoDebugFlags): New enum typedef.
1019 * debug.c (mono_debug_open): Added a few useful arguments. See the manpage
1022 2002-05-21 Martin Baulig <martin@gnome.org>
1024 * debug.c (mono_debug_open_file): Renamed to mono_debug_open(), now takes
1025 a `MonoAssembly *' argument instead of a `char *filename' one. Also added
1026 `const char **args' argument.
1028 * mono.c (mono_jit_assembly): Renamed to mono_jit_compile_image(), added
1029 `int verbose' argument and made it public.
1030 (mono_jit_compile_class): New public function, moved the code to compile
1031 all methods in a class here from main().
1032 (--compile): The argument can now also be an image (in `@imagename' format).
1033 Updated documentation for this command line argument.
1034 (--precompile): New command line argument to precompile an image/class/method
1035 before executing the main app. This argument can be given multiple times.
1036 (--break): Renamed the "--debug" command line argument to "--break".
1037 (--debug): New command line argument to specify the debugging format.
1038 (--stabs, --dwarf, --dwarf-plus): Removed, obsoleted by "--debug".
1039 (--debug-args): New command line argument. This is a comma-separated list of
1040 additional arguments for the symbol writer.
1041 (usage): Beautified the help text a bit.
1043 * debug-dwarf2-plus.c (mono_debug_open_assembly_dwarf2_plus): Use the new
1044 public mono_jit_compile_image() function rather than duplication this
1047 2002-05-21 Martin Baulig <martin@gnome.org>
1049 * debug-dwarf2-plus.c: This is now working again :-)
1051 * debug.c (mono_debug_open_file): When using MONO_DEBUG_FORMAT_DWARF2_PLUS,
1052 we create two MonoDebugHandles: one for MONO_DEBUG_FORMAT_DWARF2_PLUS and
1053 one for the fallback MONO_DEBUG_FORMAT_DWARF2.
1055 2002-05-21 Martin Baulig <martin@gnome.org>
1057 * jit.c (mono_debug_handle): Removed this global variable.
1059 * debug.c (mono_debug_close): Removed.
1060 (mono_debug_cleanup): New global function.
1061 (mono_debug_add_image): New global function.
1062 (mono_debug_handle_from_class): New global function.
1063 (mono_debug_write_symbols): New global function.
1064 (mono_debug_add_type): Removed `MonoDebugHandle *' argument.
1065 (mono_debug_add_method): Likewise.
1067 2002-05-21 Martin Baulig <martin@gnome.org>
1069 Work around a hard-to-fix bug in GDB and create a single dwarf/stabs
1070 file for all assemblies. Currently, the JIT doesn't put all methods
1071 from a single assembly into a continuous region of memory. We were
1072 previously creating valid DWARF 2 files for this, but unfortunately
1073 GDB's symbol tables get messed up when it reads more than one such file.
1075 * debug-private.h (AssemblyDebugInfo): Moved `f', `producer_name',
1076 `next_idx', `methods', `type_hash', `source_files' and `format'
1077 into the MonoDebugHandle.
1079 * debug.c (mono_debug_get_type): This now operates on the MonoDebugHandle,
1080 not on the AssemblyDebugInfo.
1081 (mono_debug_open_file): Moved some stuff here from mono_debug_open_assembly().
1083 * debug-dwarf2.c (mono_debug_write_assembly_dwarf2): Renamed into
1084 mono_debug_write_dwarf2().
1085 (mono_debug_open_assembly_dwarf2): Removed.
1086 (mono_debug_close_assembly_dwarf2): Removed.
1088 * debug-stabs.c (mono_debug_write_assembly_stabs): Renamed into
1089 mono_debug_write_stabs().
1090 (mono_debug_open_assembly_stabs): Removed.
1091 (mono_debug_close_assembly_stabs).
1093 * debug-dwarf2-plus.c: This is currently broken. :-(
1095 2002-05-20 Martin Baulig <martin@gnome.org>
1097 * debug.h (mono_debug_format): New global variable.
1098 (MonoDebugFormat): Added MONO_DEBUG_FORMAT_NONE.
1100 * debug-private.h (MonoDebugHandle): Added `objfiles' field which is
1101 a whitespace separated list of symbol files.
1102 (AssemblyDebugInfo): Added `objfile' filed which is the name of the
1105 * mono.c (main): Pass the assembly file name to mono_debug_open_file().
1107 * debug.c (mono_debug_make_symbols): Link all symbol files into a big
1108 `<assemblyname>.o' symbol file.
1110 2002-05-20 Martin Baulig <martin@gnome.org>
1112 * debug.c (debug_load_method_lines): Check whether the assembly file
1113 is newer than the IL file and recreate the IL file if necessary.
1115 2002-05-20 Miguel de Icaza <miguel@ximian.com>
1117 * mono.c Updated copyright years.
1119 2002-05-18 Miguel de Icaza <miguel@ximian.com>
1121 * mono.c (usage): Relayout command line options.
1123 2002-05-17 Dietmar Maurer <dietmar@ximian.com>
1125 * x86.brg (reg): fixed array bound check
1127 * emit-x86.c (enter_method): print method signature
1129 * exception.c (arch_handle_exception): set trace info before we
1132 2002-05-16 Dietmar Maurer <dietmar@ximian.com>
1134 * jit.c (mono_find_final_block): make it work with mcs
1136 * x86.brg: buf fix. if exception variable is allocated to a register.
1138 * jit.c (mono_find_final_block): bug fix.
1140 2002-05-15 Dietmar Maurer <dietmar@ximian.com>
1142 * delegate.c (arch_end_invoke): fix bug #24653, simplified the
1143 code using new runtime_invoke feature.
1145 * jit.c (mono_analyze_flow): try blocks are followed by handler
1146 blocks, so we need to add all handler blocks as succesors.
1147 (mono_thread_start_cb): set end_of_stack
1149 * exception.c (arch_handle_exception): correctly save/restore caller
1152 * emit-x86.c (arch_emit_prologue): correctly save/restore caller
1155 * jit.c (mono_cfg_new): allocate space for caller saved registers.
1157 2002-05-14 Dietmar Maurer <dietmar@ximian.com>
1159 * jit.c: only use one TLS slot to store jit data
1161 * exception.c (arch_handle_exception): print function signature,
1162 use thread relative end_of_stack
1164 2002-05-13 Dietmar Maurer <dietmar@ximian.com>
1166 * jit.c (OPT_BOOL): new. opt. for boolean variables - we simply
1167 store them as 32 bit integers.
1168 (mono_analyze_stack): we need to generate a temporary var for
1169 SHL/SHR because the tree allocator can fail otherwise
1171 * exception.c (arch_handle_exception): EIP now points to the call
1172 instruction, not to the instruction after the call. This fixes the
1173 bug reported by Linus Upson (tests/exception8.cs)
1175 2002-05-11 Dietmar Maurer <dietmar@ximian.com>
1177 * jit.c (mono_analyze_flow): always allocate the forest array
1178 (mono_stack_duplicate_used_var): impl.
1179 (mono_copy_used_var): impl.
1181 * x86.brg: bug fix in SHR/SHL
1183 * emit-x86.c (arch_emit_prologue): check if live_in_set != NULL
1185 2002-05-11 Sergey Chaban <serge@wildwestsoftware.com>
1187 * mono.c: new --fast-iconv command line option
1188 to enable fast FP-to-integer conversion code.
1189 * jit.c, jit.h: added global variable to store state
1190 for the above option. This optimization is disabled
1192 * x86.brg: added code to emit fast FP-to-integer
1193 conversion sequences.
1195 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
1197 * emit-x86.c: simple definite assignment analysis optimization for
1198 uninitialized locals.
1200 Fri May 10 15:43:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
1202 * x86.brg, emit-x86.c: patch the branch targets with x86_patch().
1204 2002-05-10 Dietmar Maurer <dietmar@ximian.com>
1206 * linear-scan.c (mono_update_gen_set): improvement/bug fix
1208 * x86.brg: added additional rules to handle global allocated registers
1210 * mono.c (usage): the option is called --nols, and it dissables
1213 * x86.brg: better LDIND_R4, LDIND_R8, STIND_R4, STIND_R8
1215 2002-05-09 Dietmar Maurer <dietmar@ximian.com>
1217 * linear-scan.c: linear scan reg. allocation and data flow analysis
1218 use Paolo's great bitset implementation.
1220 * jit.c (arch_allocate_var): add live range info
1221 (mono_cfg_add_successor): create list of successors for basic
1224 * mono.c (main): new option --ls to enable linear scan
1226 * exception.c (arch_handle_exception): print instruction pointer
1227 relative to method start address.
1229 * jit.c (mono_print_ctree): print register number if locals are
1230 allocate in registers.
1232 * emit-x86.c (arch_emit_prologue): initialize reg. allocated locals
1233 (arch_emit_epilogue): take care when restoring save registers,
1234 because the stack pointer may has changed.
1236 * x86.brg: s/VAROFFSET/VARINFO/
1237 modified to support global register allocation
1239 Mon May 6 15:38:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
1241 * jit.h, jit.c, emit-x86.c: x86 cpu detection code from Sergey.
1243 2002-05-03 Sergey Chaban <serge@wildwestsoftware.com>
1245 * x86.brg: more coni4 optimizations
1246 MUL: generate optimized code for some consts other
1247 than powers of 2 (hardcoded impl. for 3, 5, 10 etc.);
1248 DIV_UN: multiply with reciprocal instead of dividing;
1250 2002-05-03 Dietmar Maurer <dietmar@ximian.com>
1252 * x86.brg: use VAROFFSET macro
1254 * emit-x86.c (tree_emit): allocate space for spilled regs in
1255 activation frame instead of pushing them to the stack.
1257 * x86.brg: replace BXX with CBRANCH/COMPARE
1258 replaced CXX CSET/COMPARE
1260 * emit-x86.c (arch_allocate_regs): improved register allocation
1262 2002-05-02 Dietmar Maurer <dietmar@ximian.com>
1264 * delegate.c (mono_delegate_cleanup): signal semaphore in order to
1267 2002-04-30 Dick Porter <dick@ximian.com>
1269 * mono.c (main): Tell glib to not abort when g_log() etc print
1272 2002-04-30 Dietmar Maurer <dietmar@ximian.com>
1274 * x86.brg: opt. LDELEMA impl.
1275 (MUL) use shift when possible.
1276 (DIV) use shift when possible.
1277 impl. various opt. with coni4
1279 * exception.c (arch_handle_exception): use ctx->SC_EBP in
1280 end_of_stack check as suggested by Linus Upson <linus@linus.com>
1282 2002-04-29 Dietmar Maurer <dietmar@ximian.com>
1284 * x86.brg (LDLEN, UNBOX): removed unnecessary NULL check.
1286 * exception.c: included the Freebsd patch from Sandro Tolaini
1287 <sandro@focuseek.com>
1289 Mon Apr 29 15:18:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
1291 * mono.c, jit.c: use mono_runtime_run_main ().
1293 2002-04-29 Dietmar Maurer <dietmar@ximian.com>
1295 * jit.c (mono_analyze_stack): dont call methods on Object with
1296 METHOD_ATTRIBUTE_FINAL directly because it breaks remoting.
1298 * x86.brg: added more CONV_U rules
1300 * jit.c (mono_analyze_stack): avoid recursive call of virtual
1301 methods: fixes Bug #23778
1302 (mono_analyze_stack): emit right CONV_UX opcodes: fixes bug 23547
1304 * exception.c (arch_handle_exception): only g_assert(cleanup) if
1307 2002-04-27 Patrik Torstensson <patrik.torstensson@intel.com>
1309 * x86.brg: fixed bug in CONV_I8 (invalid stack correction)
1311 2002-04-27 Martin Baulig <martin@gnome.org>
1313 * jit.h (MonoFlowGrap): Renamed `epilogue_begin' to `epilogue_end',
1314 there's already `epilog' so we don't need `epilogue_begin'.
1316 * debug.c (mono_debug_add_method): Use `cfg->epilogue_end' to get the
1317 size of the method's code.
1319 2002-04-25 Martin Baulig <martin@gnome.org>
1321 * debug-dwarf2.c (dwarf2_write_string_type): Reflect latest MonoString
1324 2002-04-25 Dietmar Maurer <dietmar@ximian.com>
1326 * x86.brg: enable stmt: STIND_I4 (addr, coni4) again,
1327 added CONV_OVF_I4 (fix bug #23808)
1329 2002-04-23 Dietmar Maurer <dietmar@ximian.com>
1331 * x86.brg: code cleanup - use x86_patch ()
1333 * jit.c (mono_analyze_stack): only use MB_TERM_CHECKTHIS when necessary
1334 (mono_analyze_stack): don't store constants in temp. variables for CEE_DUP
1336 * x86.brg (stmt): removed stmt: STIND_I4 (addr, coni4) rule
1337 because it slows down performance.
1339 2002-04-21 Dan Lewis <dihlewis@yahoo.co.uk>
1341 * emit-x86.c: enter_method handles 8-byte aligned parameters.
1343 2002-04-20 Dan Lewis <dihlewis@yahoo.co.uk>
1345 * jit,h, jit.c, x86.brg: NEWOBJ_SPEC and NEWARR_SPEC terminals for
1348 2002-04-20 Dietmar Maurer <dietmar@ximian.com>
1350 * jit.c (check_inlining): added statistics about inlineing
1352 * mono.c (usage): new switch --noinline to disable inlining
1354 * jit.c (mono_analyze_stack): added a check for (this!=NULL) if we
1355 inline methods (to keep semantics)
1357 * x86.brg: added constant folding for inegers
1359 * emit-x86.c (tree_allocate_regs): handle the special case when
1360 chain rules need a register.
1362 2002-04-19 Dietmar Maurer <dietmar@ximian.com>
1364 * invoke.c (arch_create_native_wrapper): do not save LMF for Strings
1366 * jit.c (check_inlining): better inlining support
1368 2002-04-19 Dan Lewis <dihlewis@yahoo.co.uk>
1370 * x86.brg: LDLEN uses max_length instead of bounds[0]
1371 * jit.c: support for new szarray format
1373 2002-04-18 Dietmar Maurer <dietmar@ximian.com>
1375 * jit.c (check_inlining): added inlining support
1377 2002-04-17 Dietmar Maurer <dietmar@ximian.com>
1379 * x86.brg: optimized version of castclass and isinst
1381 Wed Apr 17 12:34:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
1383 * emit-x86.c, invoke.c: track time spent compiling.
1385 Wed Apr 17 10:58:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
1387 * emit-x86.c, invoke.c: call profile callbacks if needed.
1388 * jit.c, jit.h, mono.c: add --profile command line option.
1390 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1392 * jit.h: included mono/io-layer/io-layer.h to avoid breaking
1393 compilation under windows when upgrading mingw and w32api to
1394 version 1.3 (thanks Dick!).
1396 2002-04-15 Patrik Torstensson <patrik.torstensson@labs2.com>
1398 * jit.c: changed the array icalls to use full names
1400 2002-04-15 Dietmar Maurer <dietmar@ximian.com>
1402 * x86.brg: check the this pointer before calling
1403 non-virtual functions
1405 * emit-x86.c (arch_emit_prologue): initialize local vars.
1407 * x86.brg: removed incredible clumsy code
1409 2002-04-13 Martin Baulig <martin@gnome.org>
1411 * debug-dwarf2.c (dwarf2_write_variable_location): New static func to write
1412 the location of a variable.
1413 (dwarf2_write_variable, dwarf2_write_parameter): Take a MonoDebugVarInfo
1414 instead of a stack offset and use dwarf2_write_variable_location() to write
1417 2002-04-13 Martin Baulig <martin@gnome.org>
1419 * debug.c, debug-stabs.c, debug-dwarf2.c: Reflect latest debug-symfile.h
1422 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1424 * Makefile.am: use of the new '-s' option in monoburg.
1426 2002-04-12 Martin Baulig <martin@gnome.org>
1428 * debug-dwarf2.c (dwarf2_write_variable): Emit info about the variable's
1431 2002-04-10 Sergey Chaban <serge@wildwestsoftware.com>
1432 * win32-exception: added Win32 SEH exception filter that translates
1433 CONTEXT to sigcontext;
1435 * jit.c: added Win32 SEH init/reset calls, compute sigcontext address
1436 in a platfrom-dependent way;
1438 * jit.h: use win32-exception instead of signal if PLATFORM_WIN32
1439 and avoid io-layer includes;
1441 * delegate.c: do not include io-layer stuff if PLATFORM_WIN32
1444 2002-04-09 Dietmar Maurer <dietmar@ximian.com>
1446 * delegate.c (arch_end_invoke): restore output arguments
1448 Mon Apr 8 17:16:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
1450 * jit.c: call mono_runtime_init ().
1452 2002-04-08 Dietmar Maurer <dietmar@ximian.com>
1454 * jit.c (mono_jit_cleanup): added more statistics
1456 * invoke.c (arch_create_native_wrapper): special case EndInvoke -
1457 we need to pass the MonoMethod pointer as first argument.
1459 * delegate.c (mono_async_invoke): notify all listeners, not only a
1461 (arch_end_invoke): we now pass a MonoMethod as first parameter and
1462 use arch_method_call_message_new() to access the stack.
1463 (arch_end_invoke): wait until we really finished processing
1464 (async_invoke_abort): notify all listeners, not only a
1467 2002-04-06 Dietmar Maurer <dietmar@ximian.com>
1469 * message.c (arch_return_value): impl.
1470 (arch_method_return_message_restore): consider delegate BeginInvoke
1472 * jit.c: removed jit_exec_main()
1474 * delegate.c (arch_begin_invoke): use the message builder to make
1475 it architecture independent - still needs more cleanup.
1477 2002-04-05 Dietmar Maurer <dietmar@ximian.com>
1479 * delegate.c (mono_delegate_ctor): support for transparent proxy
1481 * x86.brg (freg): bug fix in CONV_R* opcodes
1483 2002-04-04 Dietmar Maurer <dietmar@ximian.com>
1485 * message.c: added documentation
1487 2002-04-03 Dietmar Maurer <dietmar@ximian.com>
1489 * mono.c (main): use --trace instead of --trace-calls
1491 * x86.brg: impl. REMOTE_STIND_XX
1493 * message.c (mono_store_remote_field): impl.
1495 2002-03-30 Dietmar Maurer <dietmar@ximian.com>
1497 * x86.brg: impl. REMOTE_FIELD (load fields of remote objects)
1499 * message.c (mono_load_remote_field): impl.
1501 * jit.c (mono_analyze_stack): only call marshalbyref methods
1503 (mono_analyze_stack): consider marshalbyref objects in LDFLD
1505 Fri Mar 29 16:00:27 CET 2002 Paolo Molaro <lupus@ximian.com>
1507 * x86.brg: kill pointer arithmetric.
1509 2002-03-28 Martin Baulig <martin@gnome.org>
1511 * jit.c (mono_debug_insert_breakpoint): New global variable.
1512 (mono_debug_last_breakpoint_address): New global variable.
1514 * emit-x86.c (arch_compile_method): If `mono_debug_insert_breakpoint' is
1515 non-zero, insert a breakpoint; if it's positive, decrement it when done.
1516 Set `mono_debug_last_breakpoint_address' to the address of the last inserted
1519 * debug.h: Provide external declaration of `mono_debug_insert_breakpoint' and
1520 `mono_debug_last_breakpoint_address', also documented them here.
1522 2002-03-28 Martin Baulig <martin@gnome.org>
1524 * debug-private.h (MonoDebugHandle): Renamed `format' to `default_format'.
1525 (AssemblyDebugInfo): Added `format'.
1527 * debug.c: Use the AssemblyDebugInfo's `format' field to determine the format,
1528 this allows us choose the format on a per-assembly basis.
1529 (mono_debug_open_assembly): When using MONO_DEBUG_FORMAT_DWARF2_PLUS, fall back
1530 to MONO_DEBUG_FORMAT_DWARF2 if the symbol file does not exist, but the IL file
1532 (debug_generate_method_lines): Generate correct IL offsets.
1534 2002-03-28 Martin Baulig <martin@gnome.org>
1536 * jit.h (MonoFlowGraph): Added `prologue_end' and `epilogue_start' fields.
1538 * emit-x86.c (arch_compile_method): Set prologue_end and epilogue_start.
1540 * debug-private.h (DebugMethodInfo): Renamed `frame_start_offset' to
1541 `prologue_end_offset', added `epilogue_begin_offset' and `last_line'.
1543 * debug.c (debug_generate_method_lines): Don't return if we don't have line
1544 numbers, we still need to generate the IL offsets here. Emit line numbers
1545 for `prologue_end_offset' (the first line of actual code) and
1546 `epilogue_begin_offset' (the line of the method's closing brace).
1547 Don't crash if cfg->bblocks [i].forest is NULL.
1548 (mono_debug_add_method): Don't crash if we don't have line numbers.
1549 Initialize the newly added fields.
1551 * debug-stabs.c: Record first and last line, emit filename info at the
1552 beginning of the stab file, gdb ignores the types otherwise.
1554 * debug-dwarf2.c: Use the new prologue_end_offset instead of guessing it;
1555 emit line number info for the first and last line.
1557 2002-03-28 Dietmar Maurer <dietmar@ximian.com>
1559 * invoke.c (arch_create_delegate_trampoline): impl.
1561 Thu Mar 28 11:58:53 CET 2002 Paolo Molaro <lupus@ximian.com>
1563 * Makefile.am, mono.c, jit.h, jit.c: build the libmono library
1564 with the jit runtime to easy embedding. main() is moved to mono.c, now.
1565 * jit.c: use opcode names from libmetadata.
1566 * debug.h, debug.c: constify char* argument.
1568 2002-03-28 Dietmar Maurer <dietmar@ximian.com>
1570 * jit.c: catching SIGSEGV again, added proxy support
1572 2002-03-21 Dietmar Maurer <dietmar@ximian.com>
1574 * delegate.c (mono_delegate_init): remove unused worker threads
1576 2002-03-27 Mike Kestner <mkestner@speakeasy.net>
1578 * delegate.c (arch_get_delegate_invoke): malloc a bigger area
1580 Tue Mar 26 19:54:45 CET 2002 Paolo Molaro <lupus@ximian.com>
1582 * jit.c: remove glib mem vtable code.
1584 2002-03-26 Martin Baulig <martin@gnome.org>
1586 * debug-dwarf2.c (write_method_lines_dwarf2): Don't generate method
1587 lines if we don't have line number information.
1588 (write_method_dwarf2): Use `minfo->method_info.this_offset' instead
1591 * debug-stabs.c (write_method_stabs): Don't generate method lines if
1592 we don't have line number information. Use `minfo->method_info.this_offset'
1593 instead of hardcoding 8.
1595 * debug.c (debug_generate_method_lines): Don't crash if we don't have
1596 line number information.
1597 (mono_debug_open_assembly): Don't generate line numbers for
1598 MONO_DEBUG_FORMAT_DWARF2_PLUS.
1599 (mono_debug_add_method): Don't store the 'this' offset in `param_offsets',
1600 but it in the new `this_offset' field.
1602 Mon Mar 25 13:03:35 CET 2002 Paolo Molaro <lupus@ximian.com>
1604 * debug.c (debug_generate_method_lines): Use correct addresses for
1607 Mon Mar 25 13:03:35 CET 2002 Paolo Molaro <lupus@ximian.com>
1609 * jit.c: do not set the glib mem vtable anymore.
1610 * Makefile.am: link to libmonoutils.
1612 2002-03-25 Martin Baulig <martin@gnome.org>
1614 * debug.h (mono_debug_make_symbols): Documented this function.
1616 2002-03-24 Martin Baulig <martin@gnome.org>
1618 * debug.c (mono_debug_add_method): Include the `this' offset in
1619 the `minfo->method_info.param_offsets' array.
1621 2002-03-23 Martin Baulig <martin@gnome.org>
1623 * x86.brg (lreg: CONV_I8 (reg)): X86_XOR modifies the flags, so we need
1624 to do it before the X86_CMP.
1625 (reg: CLT (lreg, lreg)): Use correct x86_branch8() targets.
1626 (reg: CLT (lreg, lreg)): Likewise.
1627 (reg: CLT_UN (lreg, lreg)): Likewise.
1628 (reg: CLT_UN (lreg, lreg)): Likewise.
1629 (reg: CGT (lreg, lreg)): Likewise.
1630 (reg: CGT (lreg, lreg)): Likewise.
1631 (reg: CGT_UN (lreg, lreg)): Likewise.
1632 (reg: CGT_UN (lreg, lreg)): Likewise.
1634 2002-03-23 Martin Baulig <martin@gnome.org>
1636 * debug-private.h (AssemblyDebugInfo): Added `_priv'.
1638 * debug-dwarf2-plus.c
1639 (mono_debug_open_assembly_dwarf2_plus): Open the symbol file here.
1640 (mono_debug_close_assembly_dwarf2_plus): Close the symbol file here.
1641 (mono_debug_write_assembly_dwarf2_plus): Only call
1642 mono_debug_update_symbol_file() here.
1644 Thu Mar 21 17:35:48 CET 2002 Paolo Molaro <lupus@ximian.com>
1646 * jit.c: inter strings before executing a method.
1647 Do not intern command line arguments anymore.
1649 2002-03-21 Martin Baulig <martin@gnome.org>
1651 * debug.h (MonoDebugFormat): Added MONO_DEBUG_FORMAT_DWARF2_PLUS.
1653 * debug-dwarf2-plus.c: This debugging format reads a symbol file which has
1654 been created by MCS and fills in all machine dependent stuff.
1656 * debug-private.h (DebugMethodInfo): Added `MonoDebugMethodInfo method_info',
1657 removed everything which is already in MonoDebugMethodInfo.
1659 * debug.c (debug_generate_method_lines): Generate the MonoILOffsetInfo array.
1660 (mono_debug_make_symbols): Don't open the file or call as, this is done in the
1663 * jit.c (main): Added "--dwarf-plus" command line option to use the new
1664 MONO_DEBUG_FORMAT_DWARF2_PLUS debugging format.
1666 2002-03-21 Dietmar Maurer <dietmar@ximian.com>
1668 * jit.c (usage): new option to specify maximum number of worker threads
1669 (mono_analyze_stack): avoid cyclic dependency in CEE_LDFTN
1671 * delegate.c (async_invoke_abort): added support for asynchronous exceptions
1672 (arch_get_async_invoke): notify listeners before we call the
1673 asynchronous callback
1675 2002-03-20 Dietmar Maurer <dietmar@ximian.com>
1677 * delegate.c (async_invoke_thread): support for domains
1678 (async_invoke_thread): create workers only when needed
1680 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
1682 * delegate.c (async_invoke_thread): initial support for BeginInvoke/EndInvoke
1684 2002-03-18 Dietmar Maurer <dietmar@ximian.com>
1686 * x86.brg: impl. lreg: XOR (lreg, lreg)
1687 impl. REM (freg, freg)
1689 2002-03-17 Martin Baulig <martin@gnome.org>
1691 * debug.c (mono_debug_open_assembly): Call mono_debug_get_type() on all
1694 * debug-dwarf2.c: Added support for strings and arrays.
1696 2002-03-17 Martin Baulig <martin@gnome.org>
1698 * debug.c (mono_debug_get_type): Recursively call this for all function members
1700 (mono_debug_add_method): Don't mangle function names, this must be done by the
1701 debugger backend if the debugging format needs mangled names.
1703 * debug-dwarf2.c: Improved support for classes, added member functions.
1705 2002-03-16 Martin Baulig <martin@gnome.org>
1707 * debug.c (mono_debug_get_type): Recursively call this for all members and
1708 parent classes of a class type.
1710 * debug-dwarf2.c: Added basic support for classes. Set source language to C++
1711 since GDB doesn't like Java very much.
1713 2002-03-16 Martin Baulig <martin@gnome.org>
1715 * debug-dwarf2.c: Added support for enums.
1717 2002-03-15 Martin Baulig <martin@gnome.org>
1719 * debug.c (mono_debug_get_type): Recursively call this for all members
1722 * debug-dwarf2.c: Added support for structs.
1724 2002-03-15 Dietmar Maurer <dietmar@ximian.com>
1726 * emit-x86.c (arch_create_jit_trampoline): adapt save/restore LMF
1727 to new MonoLMF layout
1729 2002-03-14 Dietmar Maurer <dietmar@ximian.com>
1731 * emit-x86.c (arch_create_native_wrapper): new code to generate
1732 wrappers for calling native functions.
1733 (arch_create_native_wrapper): free allocated strings
1734 (arch_handle_exception): made mono_jit_info_table domain dependent
1736 2002-03-14 Martin Baulig <martin@gnome.org>
1738 * debug.c (MonoDebugFormat): New public enums specifying which debugging
1740 (mono_debug_open_file): Added MonoDebugFormat argument.
1741 (mono_debug_make_symbols): Don't take an argument to make it easier to call
1742 this function from GDB. It's now safe to call this function multiple times;
1743 it'll always write a complete debugging file.
1745 * debug.c: Splitted this file into a general part which remains in this file
1746 and the debugging format specific parts debug-stabs.c and debug-dwarf2.c.
1747 All public functions now call a corresponding format specific function.
1749 * debug.c: The following changes are private to debug.c:
1750 (AssemblyDebugInfo, MonoDebugHandle): Moved declarations to debug-private.h.
1751 (record_line_number, debug_generate_method_lines): New private functions.
1752 (mono_debug_open_ass): Renamed to mono_debug_open_assembly; this function now
1753 calls a debugging-format-specific function (mono_debug_open_assembly_stabs or
1754 mono_debug_open_assembly_dwarf2).
1755 (mono_debug_make_symbols): Calls mono_debug_write_assembly_stabs/dwarf2(). It's
1756 now safe to call this function multiple times.
1757 (mono_debug_get_type): New public function. This takes a `MonoClass *' and
1758 returns an unique index for this type. It's used to ensure that we only write
1759 each class once to the debugging file.
1760 (mono_debug_add_method, mono_debug_add_type): Store all the data in an internal
1761 data structure, but don't directly write to the debugging file. This is done
1762 later from mono_debug_write_assembly().
1764 * jit.c (main): Added "--dwarf" command line argument to generate DWARF 2
1765 debugging output. Call mono_debug_close() on cleanup if necessary.
1767 2002-03-14 Martin Baulig <martin@gnome.org>
1769 * debug-private.h: New private header file.
1771 * debug-stabs.c: Added the stabs type generation stuff which was
1772 previously in debug.c.
1774 * debug-dwarf.c: Started to implement type support. We're currently
1775 only writing this most basic types to the dwarf file, but this will
1778 2002-03-13 Martin Baulig <martin@gnome.org>
1780 * debug-stabs.c, debug-dwarf2.c: New files containing my new
1781 debugging code. They're now in CVS, but not yet used anywhere.
1783 2002-03-11 Dietmar Maurer <dietmar@ximian.com>
1785 * emit-x86.c (mono_delegate_ctor): use C impl. instead of x86_*
1786 macros, included new delegate code from Daniel Stodden.
1789 Mon Mar 11 14:47:21 CET 2002 Paolo Molaro <lupus@ximian.com>
1791 * jit.c: verify that corlib and runtime are in sync.
1793 Mon Mar 11 11:30:56 CET 2002 Paolo Molaro <lupus@ximian.com>
1795 * emit-x86.c, jit.c: use the debug-helpers facilities to
1796 describe and match a method when debugging.
1798 2002-03-10 Martin Baulig <martin@gnome.org>
1800 * emit-x86.c (arch_compile_method): When emitting stabs debugging
1801 output, put a nop instruction at the start of all functions so that
1802 the adresses won't change when using --debug.
1804 * debug.c (mono_debug_add_method): `tree->cli_addr' is an offset into
1805 the bytecode area, stabs needs a line number in the .il file. Use the
1806 new info->moffsets to get the line number.
1807 (AssemblyDebugInfo): Added `total_lines' and `moffsets' fields.
1808 `moffsets' is an array of `total_lines' fields (total number of lines
1809 in the .il file); for each line in the .il field, this array contains
1810 the bytecode offset if it's an "IL_xxxx" line, -1 if it's the last line
1811 of a method and 0 otherwise.
1812 (debug_load_method_lines): Read the whole .il file and initialize the
1813 info->moffsets field.
1815 2002-03-09 Martin Baulig <martin@gnome.org>
1817 * x86.brg (DIV_UN): Clear EDX before performing the division and remove
1818 the unnecessary CDQ instruction.
1820 2002-03-07 Dietmar Maurer <dietmar@ximian.com>
1822 * jit.c (mono_analyze_stack): only load addresses of value types
1823 on the runtime stack.
1825 2002-03-07 Duncan Mak <duncan@ximian.com>
1827 * Makefile.am: A small patch fixing errors in vpath-based builds
1828 (make clean failing to rerun monoburg due to BUILT_SOURCES usage),
1829 committed for Daniel Stodden <stodden@in.tum.de>.
1831 Thu Mar 7 17:22:52 CET 2002 Paolo Molaro <lupus@ximian.com>
1833 * jit.c: Boehm-GC enable.
1835 2002-03-07 Dietmar Maurer <dietmar@ximian.com>
1837 * x86.brg (SAVE_LFM): bug fix: patch the saved IP because we
1838 realloc that code sometimes!
1840 * emit-x86.c (mono_compute_branches): support several types of
1843 2002-03-06 Dietmar Maurer <dietmar@ximian.com>
1845 * x86.brg: impl. MUL_OVF_UN (reg, reg)
1847 * jit.c (mono_find_final_block): find correct finally handler.
1849 * emit-x86.c (arch_create_jit_trampoline): bug fix: preserve
1850 caller saved registers.
1852 2002-03-05 Dietmar Maurer <dietmar@ximian.com>
1854 * x86.brg: use x86_widen_reg for CONV opcodes
1856 2002-03-01 Dietmar Maurer <dietmar@ximian.com>
1858 * jit.c (MAKE_SPILLED_BI_ALU): remove unnecessary assertions
1860 * emit-x86.c (arch_handle_exception): big fix - dont use
1861 uninitialized next_bp
1862 (arch_compile_method): make the jit thread save
1863 (x86_magic_trampoline): moved lock/unlock to x86_magic_trampoline
1864 to avoid need of recursive mutexes
1866 * x86.brg: use new mono_assert macros
1868 2002-02-28 Dietmar Maurer <dietmar@ximian.com>
1870 * emit-x86.c (arch_create_jit_trampoline): save/restore LMF before
1871 calling into unmanaged code (arch_compile_method).
1873 * x86.brg: impl. CONV_I4 (freg) with correct rounding
1874 (lreg): impl CALL_I8(INTF_ADDR)
1875 impl. CONV_R_UN (reg)
1878 2002-02-27 Dietmar Maurer <dietmar@ximian.com>
1880 * emit-x86.c (arch_runtime_invoke): impl. runtime invoke for the jit.
1882 2002-02-26 Dietmar Maurer <dietmar@ximian.com>
1884 * x86.brg: bug fix in CLT(lreg,lreg)
1885 (reg): bug fix in CONV_OVF_I4(lreg)
1886 (lreg): replaced x86_call_reg with x86_call_code
1888 * emit-x86.c (mono_add_jump_info): impl.
1889 (mono_compute_branches): patch real jump address (instead of
1890 emitting code twice)
1892 Tue Feb 26 11:56:03 CET 2002 Paolo Molaro <lupus@ximian.com>
1894 * x86.brg: optimize cmp reg,0 -> test reg.
1896 Sun Feb 24 13:58:34 CET 2002 Paolo Molaro <lupus@ximian.com>
1898 * jit.h, jit.c, emit-x86.c: Added a few statistics counters
1899 and the --stats command line option to print them.
1900 Fixed memory leak in arch_compile_method () when a method's code is
1901 found in the cache. Fix magic trampoline to deal with static calls.
1903 2002-02-21 Dietmar Maurer <dietmar@ximian.com>
1905 * x86.brg: impl. SHR_UN for lreg, added new test, bug fix for BNE_UN
1907 2002-02-19 Dietmar Maurer <dietmar@ximian.com>
1909 * emit-x86.c (arch_compile_method): add shared code to mono_root_domain
1910 (arch_create_jit_trampoline): cache trampoline code
1912 2002-02-18 Dietmar Maurer <dietmar@ximian.com>
1914 * jit.c (mono_analyze_stack): optimize LDSFLD/STSFLD for domain
1916 (mono_analyze_stack): use MB_TERM_LDELEMA to perform bound check
1918 * x86.brg: do not encode exception objects into the instruction
1919 stream, because they are domain dependend. Use
1920 arch_get_throw_exception_by_name() instead;
1922 Mon Feb 18 15:51:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1924 * jit.c: intern command line arguments.
1926 2002-02-18 Dietmar Maurer <dietmar@ximian.com>
1928 * jit.c (mono_analyze_stack): use the magic trampoline for all
1929 calls (since we cant store the address of compiled code in
1931 (mono_analyze_stack): imp. LDSTR for shared code
1933 * emit-x86.c (x86_magic_trampoline): handle x86_call_code().
1934 (arch_compile_method): add a cache for compiled methods to avoid
1935 recompilation. dont use method->addr to store domain dependent
1938 2002-02-15 Dietmar Maurer <dietmar@ximian.com>
1940 * x86.brg: impl. BLE,BGT for freg
1942 Sat Feb 16 16:27:42 CET 2002 Paolo Molaro <lupus@ximian.com>
1944 * emit-x86.c: handle unreachable code. Eliminate some unneeded
1946 * jit.c: handle unreachable code. Move setting of mono_end_of_stack to
1947 main(). Add --compile classname and --ncompile num command line
1948 options to do performance evaluation of the jitter (and help
1951 2002-02-15 Dietmar Maurer <dietmar@ximian.com>
1953 * emit-x86.c (arch_compile_method): bug fix in static delegate
1956 2002-02-14 Dietmar Maurer <dietmar@ximian.com>
1958 * jit.c (mono_analyze_stack): do a LDIND after NEWOBJ for value types.
1960 2002-02-13 Dietmar Maurer <dietmar@ximian.com>
1962 * jit.c (mono_analyze_stack): impl. CEE_SIZEOF
1964 2002-02-13 Miguel de Icaza <miguel@ximian.com>
1966 * jit.c (arch_allocate_var): Only assert that the alignment is
1967 at least 32-bits aligned, not always 32-bits aligned (for I8 for example).
1969 Mon Feb 11 11:20:57 CET 2002 Paolo Molaro <lupus@ximian.com>
1971 * x86.brg: fix invalid cast check in unbox. Pack MBTree structure.
1973 Sun Feb 10 12:54:05 CET 2002 Paolo Molaro <lupus@ximian.com>
1975 * emit-x86.c: make x86_magic_trampoline() handle call instructions
1976 with an imm8 displacement. x86.brg not yet changed to take advantage
1979 Sun Feb 10 11:47:30 CET 2002 Paolo Molaro <lupus@ximian.com>
1981 * jit.c: use opcode info from libmetadata to do flow analysis
1984 2002-02-06 Dietmar Maurer <dietmar@ximian.com>
1986 * jit.c (MAKE_LDELEM, MAKE_STELEM): added bound checking
1988 2002-02-05 Dietmar Maurer <dietmar@ximian.com>
1990 * x86.brg: use element_class for type check
1992 2002-02-04 Dietmar Maurer <dietmar@ximian.com>
1994 * jit.c (main): impl. __array_Address icall
1996 * mempool.c (mono_mempool_alloc): handle large block allocation
1998 2002-02-01 Dietmar Maurer <dietmar@ximian.com>
2000 * x86.brg: impl. SHL/SHR/CLT for 64 bit values
2002 2002-01-31 Dietmar Maurer <dietmar@ximian.com>
2004 * x86.brg: impl. CEQ(lreg,lreg)
2006 * jit.c (mono_analyze_stack): impl. LDVIRTFTN
2007 (mono_analyze_stack): handle MONO_TABLE_MEMBERREF in LDSFLD/STSFLD
2009 * x86.brg: removed some dead code.
2011 2002-01-18 Dietmar Maurer <dietmar@ximian.com>
2013 * jit.c (arch_allocate_var): fixed alignment bugs
2015 2002-01-17 Dietmar Maurer <dietmar@ximian.com>
2017 * jit.c (mono_analyze_stack): use LDIND_REF/STIND_REF
2019 2002-01-16 Dietmar Maurer <dietmar@ximian.com>
2021 * jit.c (main): install the trampoline before we start to create
2024 * x86.brg: impl. CLT_UN, CGT_UN
2026 * emit-x86.c (leave_method): added check for null object
2027 (enter_method): consider byref arguments
2029 2002-01-14 Dietmar Maurer <dietmar@ximian.com>
2031 * x86.brg: bug fix in CONV_OVF_I1_UN
2032 impl. ADD_OVF, MUL_OVF
2033 impl. ADD_OVF_UN, SUB_OVF, SUB_OVF_UN
2034 (SUB (lreg, lreg)): bug fix - use SBB instead of SUB
2035 (EMIT_COND_EXCEPTION): added signed flag
2037 Fri Jan 11 20:06:22 CET 2002 Paolo Molaro <lupus@ximian.com>
2039 * jit.c: implement stloc, ldloc, ldloca.
2041 2002-01-11 Dietmar Maurer <dietmar@ximian.com>
2043 * jit.c (mono_analyze_stack): fixed calculation of last_instr
2045 * x86.brg (LDLEN): emit null_reference exception
2047 (RET, RET_VOID, RET_OBJ, ...) fixed jump to epilog
2049 2002-01-04 Dietmar Maurer <dietmar@ximian.com>
2051 * x86.brg: bug fix in CASTCLASS
2053 2001-12-21 Dietmar Maurer <dietmar@ximian.com>
2055 * jit.c (mono_analyze_stack): spill MUL to avoid problem with
2056 register allocation.
2058 * emit-x86.c (arch_compile_method): fixed static delegate bug
2060 2001-12-16 Miguel de Icaza <miguel@ximian.com>
2062 * x86.brg, jit.c: Split up the nodes that we used to share on
2063 CONV_OVF. They were sharing the nodes because they are the same
2064 on 32-bit machines, but on 64-bit machines you need different
2067 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
2069 * x86.brg: removed prerequisite that (tree->left->reg1 <
2070 tree->right->reg1) to make register allocation easier.
2072 2001-12-16 Dietmar Maurer <dietmar@ximian.com>
2074 * emit-x86.c (arch_handle_exception): new code to handle
2075 exceptions inside unmanaged code.
2077 * x86.brg: impl. SAVE_LMF, RESTORE_LMF, pass implizit valuetype
2078 address as first argument.
2080 2001-12-15 Dietmar Maurer <dietmar@ximian.com>
2082 * x86.brg: pass exceptions on the stack
2084 * jit.h (ISSTRUCT): new macro to check for real value types
2085 (return false for enum types).
2087 2001-12-11 Dietmar Maurer <dietmar@ximian.com>
2089 * x86.brg: use position indepentent code if possible.
2091 * x86.brg (EMIT_COND_EXCEPTION): new macro.
2093 * emit-x86.c (mono_emit_cfg): impl. variable code buffer size
2095 2001-12-10 Dietmar Maurer <dietmar@ximian.com>
2097 * jit.c (mono_analyze_flow): use g_malloc0 o allocate large bcinfo
2099 (mono_analyze_flow): use g_malloc0 o allocate large bblocks array.
2101 * x86.brg (stmt): added opt. for STIND_R4/STIND_R8
2103 2001-12-07 Dietmar Maurer <dietmar@ximian.com>
2105 * jit.c (mono_allocate_intvar): bug fix.
2107 * emit-x86.c (get_unbox_trampoline): impl.
2109 * jit.c (mono_analyze_stack): impl STOBJ, LEAVE
2111 2001-12-06 Dietmar Maurer <dietmar@ximian.com>
2113 * x86.brg: raise exceptions.
2115 2001-12-05 Dietmar Maurer <dietmar@ximian.com>
2117 * x86.brg: impl. CEQ for freg, NEWSTRUCT now allocates valuetypes on
2120 2001-12-06 Miguel de Icaza <miguel@ximian.com>
2122 * jit.c (mono_analyze_stack), x86.brg: Implement CONV.OVF.I1,
2123 CONV.OVF.I4, CONV.OVF.I1.UN, CONV.OVF.U1, CONV.OVF.U1.UN,
2124 CONV.OVF.I2.UN, CONV.OVF.I8.UN
2126 2001-12-04 Dietmar Maurer <dietmar@ximian.com>
2128 * x86.brg: impl. UNBOX, NEWSTRUCT, removed VTYPE, bug fixes,
2129 removed the locaddr nonterminal, reimplemented value types
2131 * jit.c: reimplemented value type support, better support for
2134 2001-12-03 Miguel de Icaza <miguel@ximian.com>
2136 * x86.brg, jit.c: Implement conv.ovf.u4, conv.ovf.u2, conv.ovf.i2,
2139 Mon Dec 3 17:16:36 CET 2001 Paolo Molaro <lupus@ximian.com>
2141 * jit.c: call mono_init() after registering internal calls.
2143 2001-11-30 Dietmar Maurer <dietmar@ximian.com>
2145 * emit-x86.c (tree_preallocate_regs): improved register allocation
2147 * x86.brg: impl. ISINST, CASTCLASS
2149 Fri Nov 30 12:02:24 CET 2001 Paolo Molaro <lupus@ximian.com>
2151 * x86.brg: rearrange fields to reduce struct size.
2152 * jit.c: use signature->param_count, not signature->params_size.
2153 * debug.c: off-by-one error fix.
2155 2001-11-29 Radek Doulik <rodo@ximian.com>
2157 * Makefile.am: build mono only for X86 architecture, compilation
2158 fails for ppc now because of accessing registers in sigcontext
2161 2001-11-29 Dietmar Maurer <dietmar@ximian.com>
2163 * jit.c (mono_analyze_stack): bug fix in DUP
2165 Thu Nov 29 12:32:01 CET 2001 Paolo Molaro <lupus@ximian.com>
2167 * debug.c: fix type handling. Position function position at start of
2168 IL code. Output more fine-grained stepping information.
2170 2001-11-28 Dietmar Maurer <dietmar@ximian.com>
2172 * x86.brg (LDIND_I1, LDIND_I2): use x86_widen_ instead of x86_mov_
2174 * jit.c (mono_analyze_stack): record the cli_address for later use
2176 (sigsegv_signal_handler): translate sigsegv into "Internal error"
2179 Tue Nov 27 16:32:41 CET 2001 Paolo Molaro <lupus@ximian.com>
2181 * debug.c, debug.h: added support for generating stabs.
2182 Stabs can be compiled with as and the resulting object file can be
2183 loaded in a gdb session with add-symbol-file object.o.
2184 * jit.c, jit.h: add --stabs and --debug command line arguments. Keep track
2185 where locals and arguments are stored in the stack. Add support for
2186 passing command line arguments to CLR programs.
2187 * emit-x86.c: insert a breakpoint at method invocation if needed.
2189 2001-11-27 Dietmar Maurer <dietmar@ximian.com>
2191 * jit.c: exception support
2193 * emit-x86.c (arch_emit_epilogue): bug fix: restore the regs in
2196 2001-11-26 Dick Porter <dick@ximian.com>
2198 * Makefile.am (mono_LDADD): Add io-layer library
2200 2001-11-19 Dietmar Maurer <dietmar@ximian.com>
2202 * jit.c (mono_analyze_stack): impl. LDFTN
2203 (MAKE_SPILLED_BI_ALU): always spill DIV/REM results to memory to
2204 make register allocation easier on x86
2206 * emit-x86.c (enter_method): more debugging output for Strings
2207 (arch_compile_method): added delegate support
2208 (arch_compile_method): align EBP to 8 byte boundary
2210 Mon Nov 19 11:36:22 CET 2001 Paolo Molaro <lupus@ximian.com>
2212 * jit.c: use mono_install_trampoline (), instead of exporting
2213 a function to a lower-level library.
2215 2001-11-16 Dietmar Maurer <dietmar@ximian.com>
2217 * x86.brg (STRING_ARG): impl. a way to marshal strings. This
2218 will be extensible to handle all possible kinds of marshalling
2221 * jit.c (map_call_type): added MB_TERM_CALL_VOID
2222 (mono_analyze_stack): impl. LDELEMA, reimplemented CALL
2223 instructions to handle this arguments more effectively.
2225 2001-11-15 Dietmar Maurer <dietmar@ximian.com>
2227 * Makefile.am (mono_SOURCES): renamed testjit to mono
2229 * x86.brg: added debugging support
2231 * testjit.c: added support for value types, CFG improvements
2233 * emit-x86.c (enter_method): handle value types
2234 (tree_allocate_regs): impl. a better way to handle chain rules
2236 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
2238 * x86.brg (INITOBJ): bug fix: initialize data before use,
2239 simplified the code.
2241 2001-11-09 Miguel de Icaza <miguel@ximian.com>
2243 * testjit.c (mono_analyze_stack): Remove compiler warning by
2244 testing against NULL.
2246 2001-11-09 Dick Porter <dick@ximian.com>
2248 * Makefile.am (testjit_LDADD): Don't need THREAD_LIBS any more
2250 2001-11-09 Dietmar Maurer <dietmar@ximian.com>
2252 * testjit.c (mono_analyze_stack): new BOX impl.
2254 * x86.brg: implemented INITOBJ
2256 * testjit.c (mono_analyze_stack): finished array support
2257 (mono_analyze_stack): reimplemented DUP instruction
2259 2001-11-08 Dietmar Maurer <dietmar@ximian.com>
2261 * testjit.c (MAKE_STELEM, MAKE_LDELEM): we build a tree which
2262 represents the address of the element. This way we can emit highly
2263 optimized x86 instructions to access elements (using base+index+offset
2266 2001-11-07 Miguel de Icaza <miguel@ximian.com>
2268 * mempool.c: Include string.h to kill warning.
2270 * testjit.c: Add typecast to kill warning.
2272 * x86.brg: Include string.h to eliminate warning.
2274 * emit-x86.c (tree_allocate_regs): Fix arguments to g_warning to
2277 2001-11-07 Dietmar Maurer <dietmar@ximian.com>
2279 * emit-x86.c (enter_method): print out all method arguments
2280 (x86_magic_trampoline): impl.
2281 (arch_create_simple_jit_trampoline): we use different trampolines
2282 for static methods (no need to write the address back into to
2285 2001-11-06 Dietmar Maurer <dietmar@ximian.com>
2287 * emit-x86.c (arch_create_jit_trampoline): optimised trampoline to
2288 use less the 16 bytes.
2290 * x86.brg: code cleanup
2292 2001-11-05 Dietmar Maurer <dietmar@ximian.com>
2294 * testjit.c: bug fixes.
2296 * emit-x86.c (leave_method): print result values
2298 2001-11-03 Dietmar Maurer <dietmar@ximian.com>
2300 * emit-x86.c (enter_method): new debugging code
2301 (leave_method): new debbuging code, this functions are called
2302 when you use the new option --trace-calls
2304 2001-11-02 Dietmar Maurer <dietmar@ximian.com>
2306 * testjit.c: impl. STELEM_XX, STELEM_XX
2308 * x86.brg: impl. LDLEN, LDELEMA
2311 2001-10-15 Dietmar Maurer <dietmar@ximian.com>
2313 * x86.brg: added some experimental code for CALL
2314 instructions - still not found the optimal way to do it.
2316 * testjit.c (map_stind_type): add support for value types with
2317 a size of 1, 2 or 4 bytes, implemented CEE_UNBOX, CEE_LDOBJ,
2318 CEE_LDSTR, CEE_LDFLD, CEE_LDFLDA, CEE_STFLD, CEE_NEWOBJ, CEE_CEQ
2319 (ctree_create_newobj): impl.
2322 * emit-x86.c (tree_allocate_regs): removed allocation code for
2324 (get_address): use a simple, but bug free search instead of the
2325 buggy binary search.
2327 2001-10-12 Dietmar Maurer <dietmar@ximian.com>
2329 * testjit.c: support virtual functions
2331 * x86.brg: support different addressing modes for calls
2333 2001-10-11 Dietmar Maurer <dietmar@ximian.com>
2335 * testjit.c: impl. STFLD
2337 2001-10-10 Dietmar Maurer <dietmar@ximian.com>
2339 * x86.brg: impl. CEQ
2341 2001-10-04 Dick Porter <dick@ximian.com>
2344 * emit-x86.c: include mono-endian.h not endian.h
2346 2001-10-02 Dietmar Maurer <dietmar@ximian.com>
2348 * testjit.c (ctree_create_dup): really duplicate the tree.
2349 attach the arguments to the CALL node. Added a new macro to
2350 make argument order configurable (ARCH_ARGS_RIGHT_TO_LEFT).
2352 2001-10-01 Dietmar Maurer <dietmar@ximian.com>
2354 * interp.brg: the burm based interpreter: added the file as example.
2356 2001-09-27 Dietmar Maurer <dietmar@ximian.com>
2360 * testjit.c: impl. LDIND/STIND/LDLOCA, use g_malloc to alloc static
2362 (map_stind_type): support enum types
2363 (map_ldind_type): support enum types
2365 * emit-x86.c (tree_allocate_regs): added code to support
2366 register allocation for addressing modes trees.
2367 (tree_emit): bug fix: we have to emit all mono_burg_functins. The
2368 previous impl. did not work for chain rules.
2369 (compute_branches): support for SWITCH statements
2371 * x86.brg: added rules to model x86 addressing modes
2373 2001-09-26 Dietmar Maurer <dietmar@ximian.com>
2375 * emit-x86.c (compute_branches): implemented SWITCH
2377 * testjit.c (mono_create_forest): implemented LDIND/STIND opcodes
2378 (map_ldind_type): add enumeration types.
2379 (map_stind_type): add enumeration types.
2381 * emit-x86.c (arch_compile_method): more documentation.
2383 * testjit.c: moved the architecture specific things to emit-x86.c
2384 and x86.brg. Added more documentation. code cleanup.
2386 2001-09-25 Dietmar Maurer <dietmar@ximian.com>
2388 * x86.brg: we now have different types of addresses: ADDR_L for local
2389 values, ADDR_A for arguments and ADDR_G for global addresses. We
2390 also use LDIND_XX token to load values from a specific address
2391 instead of LDLOC/STLOC.
2393 * testjit.c: use the new adressing scheme everywhere:
2394 LDIND _XX (ADDR_X), and STIND_XX (ADDR_X, tree)
2396 2001-09-24 Dietmar Maurer <dietmar@ximian.com>
2398 * testjit.c (main): fix bug in parameter parsing
2400 * x86.brg: impl. more opcodes
2402 2001-09-23 Dick Porter <dick@ximian.com>
2404 * Makefile.am (testjit_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
2406 2001-09-23 Dietmar Maurer <dietmar@ximian.com>
2408 * testjit.c: use the memory pool to avoid memory leaks
2410 2001-09-22 Dietmar Maurer <dietmar@ximian.com>
2412 * x86.brg: increment the stack pointer after function calls
2414 2001-09-21 Dick Porter <dick@ximian.com>
2416 * Makefile.am (testjit_LDADD): Added PTHREAD_LIBS to the link line
2418 2001-09-21 Dietmar Maurer <dietmar@ximian.com>
2420 * x86.brg: implemented long MUL/DIV
2421 (MB_OPT_LEVEL): define optimisation level macro
2423 * testjit.c (tree_allocate_regs): added a way to prevent EDX usage
2424 for operations like idiv. it is also possible to assign specific registers.
2426 2001-09-20 Dietmar Maurer <dietmar@ximian.com>
2428 * x86.brg: added basic support for long
2430 * testjit.c (mono_compile_method): implemented POP
2432 2001-09-19 Miguel de Icaza <miguel@ximian.com>
2434 * testjit.c (usage): Added a couple of more usage options.
2436 2001-09-19 Dietmar Maurer <dietmar@ximian.com>
2438 * x86.brg: added more floating point grammar
2440 * testjit.c (mono_compile_method): make local offsets negative
2442 * x86.brg: added some floating point trees
2444 * testjit.c (mono_compile_method): arguments on the runtime
2445 stack are at least 4 bytes
2447 * x86.brg: partly implemented 8,16 bit integers
2449 * testjit.c (get_address): mark basic blocks
2451 2001-09-18 Dietmar Maurer <dietmar@ximian.com>
2453 * x86.brg: added some rules to optimize code
2455 * testjit.c (get_address): use a binary search to get the address
2456 (main): added an option to debug the jit (-d)
2458 Tue Sep 18 13:19:16 CEST 2001 Paolo Molaro <lupus@ximian.com>
2460 * testjit.c: better/faster align code. Handle ldloc.s and stloc.s.
2462 2001-09-17 Miguel de Icaza <miguel@ximian.com>
2464 * testjit.c (mono_compile_method): Provide better error reporting.
2466 2001-09-17 Dietmar Maurer <dietmar@ximian.com>
2468 * testjit.c (tree_get_address): impl. to fix address bug
2469 (tree_get_address): make sure that we can only jump to the first
2470 instruction of a tree.
2472 * x86.brg: emit real code for calls
2474 * testjit.c (create_jit_trampoline): creates a function to trigger jit
2476 (mono_compile_method): reversed argument order
2478 2001-09-15 Dietmar Maurer <dietmar@ximian.com>
2480 * x86.brg (stmt): don't emit unnecessary register moves
2482 * testjit.c (tree_allocate_regs): free registers earlier
2484 2001-09-14 Dietmar Maurer <dietmar@ximian.com>
2486 * x86.brg: branch addresses are now resolved
2488 * testjit.c (compute_branches): compute address of branches
2490 * x86.brg: emit real x86 instructions
2492 * testjit.c: call objdump to disassemble the output
2494 2001-09-13 Dietmar Maurer <dietmar@ximian.com>
2496 * x86.brg: use the right offsets to access local variables
2499 * emit-x86.c: only save/restore callee saved registers if they are
2502 * testjit.c (tree_allocate_regs): use the new MonoRegSet to
2504 (mono_compile_method): changed the tree for mothod calls
2511 2001-09-10 Miguel de Icaza <miguel@ximian.com>
2513 * x86.brg: Use Unix assembly syntax.
2515 * emit-x86.c: support code, should be moved
2517 * testjit.c: Use GPtrArrays instead of GLists, as those are very
2518 inefficient at appends.
2520 * Renamed `create_new_leave' to `create_new_leaf'