d7a946595906c0755d85d67798357fe8d5101358
[mono.git] / mono / jit / ChangeLog
1 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
2
3         * x86.brg: do not encode exception objects into the instruction
4         stream, because they are domain dependend. Use
5         arch_get_throw_exception_by_name() instead;
6
7 Mon Feb 18 15:51:40 CET 2002 Paolo Molaro <lupus@ximian.com>
8
9         * jit.c: intern command line arguments.
10
11 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
12
13         * jit.c (mono_analyze_stack): use the magic trampoline for all
14         calls (since we cant store the address of compiled code in
15         method->addr).
16         (mono_analyze_stack): imp. LDSTR for shared code
17
18         * emit-x86.c (x86_magic_trampoline): handle x86_call_code().
19         (arch_compile_method): add a cache for compiled methods to avoid
20         recompilation. dont use method->addr to store domain dependent
21         code address.
22
23 2002-02-15  Dietmar Maurer  <dietmar@ximian.com>
24
25         * x86.brg: impl. BLE,BGT for freg
26
27 Sat Feb 16 16:27:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28
29         * emit-x86.c: handle unreachable code. Eliminate some unneeded
30         malloc() calls.
31         * jit.c: handle unreachable code. Move setting of mono_end_of_stack to
32         main(). Add --compile classname and --ncompile num command line
33         options to do performance evaluation of the jitter (and help
34         debugging).
35
36 2002-02-15  Dietmar Maurer  <dietmar@ximian.com>
37
38         * emit-x86.c (arch_compile_method): bug fix in static delegate
39         Invoke code.
40
41 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
42
43         * jit.c (mono_analyze_stack): do a LDIND after NEWOBJ for value types.
44
45 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
46
47         * jit.c (mono_analyze_stack): impl. CEE_SIZEOF
48
49 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
50
51         * jit.c (arch_allocate_var): Only assert that the alignment is
52         at least 32-bits aligned, not always 32-bits aligned (for I8 for example).
53
54 Mon Feb 11 11:20:57 CET 2002 Paolo Molaro <lupus@ximian.com>
55
56         * x86.brg: fix invalid cast check in unbox. Pack MBTree structure.
57
58 Sun Feb 10 12:54:05 CET 2002 Paolo Molaro <lupus@ximian.com>
59
60         * emit-x86.c: make x86_magic_trampoline() handle call instructions
61         with an imm8 displacement. x86.brg not yet changed to take advantage
62         of it.
63
64 Sun Feb 10 11:47:30 CET 2002 Paolo Molaro <lupus@ximian.com>
65
66         * jit.c: use opcode info from libmetadata to do flow analysis
67         and simplify code.
68
69 2002-02-06  Dietmar Maurer  <dietmar@ximian.com>
70
71         * jit.c (MAKE_LDELEM, MAKE_STELEM): added bound checking 
72
73 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
74
75         * x86.brg: use element_class for type check
76
77 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
78
79         * jit.c (main): impl. __array_Address icall
80
81         * mempool.c (mono_mempool_alloc): handle large block allocation
82
83 2002-02-01  Dietmar Maurer  <dietmar@ximian.com>
84
85         * x86.brg: impl. SHL/SHR/CLT for 64 bit values
86
87 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
88
89         * x86.brg: impl. CEQ(lreg,lreg)
90
91         * jit.c (mono_analyze_stack): impl. LDVIRTFTN
92         (mono_analyze_stack): handle MONO_TABLE_MEMBERREF in LDSFLD/STSFLD
93
94         * x86.brg: removed some dead code.
95
96 2002-01-18  Dietmar Maurer  <dietmar@ximian.com>
97
98         * jit.c (arch_allocate_var): fixed alignment bugs
99
100 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
101
102         * jit.c (mono_analyze_stack): use LDIND_REF/STIND_REF
103
104 2002-01-16  Dietmar Maurer  <dietmar@ximian.com>
105
106         * jit.c (main): install the trampoline before we start to create
107         objects.
108
109         * x86.brg: impl. CLT_UN, CGT_UN
110
111         * emit-x86.c (leave_method): added check for null object
112         (enter_method): consider byref arguments
113
114 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
115
116         * x86.brg: bug fix in CONV_OVF_I1_UN
117         impl. ADD_OVF, MUL_OVF
118         impl. ADD_OVF_UN, SUB_OVF, SUB_OVF_UN
119         (SUB (lreg, lreg)): bug fix - use SBB instead of SUB
120         (EMIT_COND_EXCEPTION): added signed flag
121
122 Fri Jan 11 20:06:22 CET 2002 Paolo Molaro <lupus@ximian.com>
123
124         * jit.c: implement stloc, ldloc, ldloca.
125
126 2002-01-11  Dietmar Maurer  <dietmar@ximian.com>
127
128         * jit.c (mono_analyze_stack): fixed calculation of last_instr
129
130         * x86.brg (LDLEN): emit null_reference exception
131         (BLE_UN): bug fix. 
132         (RET, RET_VOID, RET_OBJ, ...) fixed jump to epilog
133
134 2002-01-04  Dietmar Maurer  <dietmar@ximian.com>
135
136         * x86.brg: bug fix in CASTCLASS
137
138 2001-12-21  Dietmar Maurer  <dietmar@ximian.com>
139
140         * jit.c (mono_analyze_stack): spill MUL to avoid problem with
141         register allocation.
142
143         * emit-x86.c (arch_compile_method): fixed static delegate bug
144
145 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
146
147         * x86.brg, jit.c: Split up the nodes that we used to share on
148         CONV_OVF.  They were sharing the nodes because they are the same
149         on 32-bit machines, but on 64-bit machines you need different
150         code for them.
151
152 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
153
154         * x86.brg: removed prerequisite that (tree->left->reg1 <
155         tree->right->reg1) to make register allocation easier.
156
157 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
158
159         * emit-x86.c (arch_handle_exception): new code to handle
160         exceptions inside unmanaged code.
161
162         * x86.brg: impl. SAVE_LMF, RESTORE_LMF, pass implizit valuetype
163         address as first argument.
164
165 2001-12-15  Dietmar Maurer  <dietmar@ximian.com>
166
167         * x86.brg: pass exceptions on the stack
168
169         * jit.h (ISSTRUCT): new macro to check for real value types
170         (return false for enum types). 
171
172 2001-12-11  Dietmar Maurer  <dietmar@ximian.com>
173
174         * x86.brg: use position indepentent code if possible. 
175
176         * x86.brg (EMIT_COND_EXCEPTION): new macro.
177
178         * emit-x86.c (mono_emit_cfg): impl. variable code buffer size
179
180 2001-12-10  Dietmar Maurer  <dietmar@ximian.com>
181
182         * jit.c (mono_analyze_flow): use g_malloc0 o allocate large bcinfo
183         blocks.
184         (mono_analyze_flow): use g_malloc0 o allocate large bblocks array.
185
186         * x86.brg (stmt): added opt. for STIND_R4/STIND_R8
187
188 2001-12-07  Dietmar Maurer  <dietmar@ximian.com>
189
190         * jit.c (mono_allocate_intvar): bug fix.
191
192         * emit-x86.c (get_unbox_trampoline): impl.
193
194         * jit.c (mono_analyze_stack): impl STOBJ, LEAVE
195
196 2001-12-06  Dietmar Maurer  <dietmar@ximian.com>
197
198         * x86.brg: raise exceptions.
199
200 2001-12-05  Dietmar Maurer  <dietmar@ximian.com>
201
202         * x86.brg: impl. CEQ for freg, NEWSTRUCT now allocates valuetypes on
203         the stack. 
204
205 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
206
207         * jit.c (mono_analyze_stack), x86.brg: Implement CONV.OVF.I1,
208         CONV.OVF.I4, CONV.OVF.I1.UN, CONV.OVF.U1, CONV.OVF.U1.UN,
209         CONV.OVF.I2.UN, CONV.OVF.I8.UN
210
211 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
212
213         * x86.brg: impl. UNBOX, NEWSTRUCT, removed VTYPE, bug fixes,
214         removed the locaddr nonterminal, reimplemented value types
215         
216         * jit.c: reimplemented value type support, better support for
217         enumeration types. 
218
219 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
220
221         * x86.brg, jit.c: Implement conv.ovf.u4, conv.ovf.u2, conv.ovf.i2,
222         conv.ovf.u8 
223
224 Mon Dec 3 17:16:36 CET 2001 Paolo Molaro <lupus@ximian.com>
225
226         * jit.c: call mono_init() after registering internal calls.
227
228 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
229
230         * emit-x86.c (tree_preallocate_regs): improved register allocation
231
232         * x86.brg: impl. ISINST, CASTCLASS
233
234 Fri Nov 30 12:02:24 CET 2001 Paolo Molaro <lupus@ximian.com>
235
236         * x86.brg: rearrange fields to reduce struct size.
237         * jit.c: use signature->param_count, not signature->params_size.
238         * debug.c: off-by-one error fix.
239
240 2001-11-29  Radek Doulik  <rodo@ximian.com>
241
242         * Makefile.am: build mono only for X86 architecture, compilation
243         fails for ppc now because of accessing registers in sigcontext
244         structure
245
246 2001-11-29  Dietmar Maurer  <dietmar@ximian.com>
247
248         * jit.c (mono_analyze_stack): bug fix in DUP
249
250 Thu Nov 29 12:32:01 CET 2001 Paolo Molaro <lupus@ximian.com>
251
252         * debug.c: fix type handling. Position function position at start of
253         IL code. Output more fine-grained stepping information.
254
255 2001-11-28  Dietmar Maurer  <dietmar@ximian.com>
256
257         * x86.brg (LDIND_I1, LDIND_I2): use x86_widen_ instead of x86_mov_
258
259         * jit.c (mono_analyze_stack): record the cli_address for later use
260         with gdb.
261         (sigsegv_signal_handler): translate sigsegv into "Internal error"
262         exception.
263
264 Tue Nov 27 16:32:41 CET 2001 Paolo Molaro <lupus@ximian.com>
265
266         * debug.c, debug.h: added support for generating stabs.
267         Stabs can be compiled with as and the resulting object file can be
268         loaded in a gdb session with add-symbol-file object.o.
269         * jit.c, jit.h: add --stabs and --debug command line arguments. Keep track
270         where locals and arguments are stored in the stack. Add support for
271         passing command line arguments to CLR programs.
272         * emit-x86.c: insert a breakpoint at method invocation if needed.
273
274 2001-11-27  Dietmar Maurer  <dietmar@ximian.com>
275
276         * jit.c: exception support
277
278         * emit-x86.c (arch_emit_epilogue): bug fix: restore the regs in
279         the right order.
280
281 2001-11-26  Dick Porter  <dick@ximian.com>
282
283         * Makefile.am (mono_LDADD): Add io-layer library
284
285 2001-11-19  Dietmar Maurer  <dietmar@ximian.com>
286
287         * jit.c (mono_analyze_stack): impl. LDFTN
288         (MAKE_SPILLED_BI_ALU): always spill DIV/REM results to memory to
289         make register allocation easier on x86
290
291         * emit-x86.c (enter_method): more debugging output for Strings
292         (arch_compile_method): added delegate support
293         (arch_compile_method): align EBP to 8 byte boundary
294
295 Mon Nov 19 11:36:22 CET 2001 Paolo Molaro <lupus@ximian.com>
296
297         * jit.c: use mono_install_trampoline (), instead of exporting
298         a function to a lower-level library.
299
300 2001-11-16  Dietmar Maurer  <dietmar@ximian.com>
301
302         * x86.brg (STRING_ARG): impl. a way to marshal strings. This
303         will be extensible to handle all possible kinds of marshalling
304         requirements. 
305
306         * jit.c (map_call_type): added MB_TERM_CALL_VOID
307         (mono_analyze_stack): impl. LDELEMA, reimplemented CALL
308         instructions to handle this arguments more effectively.
309
310 2001-11-15  Dietmar Maurer  <dietmar@ximian.com>
311
312         * Makefile.am (mono_SOURCES): renamed testjit to mono
313
314         * x86.brg: added debugging support 
315
316         * testjit.c: added support for value types, CFG improvements
317
318         * emit-x86.c (enter_method): handle value types
319         (tree_allocate_regs): impl. a better way to handle chain rules
320
321 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
322
323         * x86.brg (INITOBJ): bug fix: initialize data before use,
324         simplified the code.
325
326 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
327
328         * testjit.c (mono_analyze_stack): Remove compiler warning by
329         testing against NULL.
330
331 2001-11-09  Dick Porter  <dick@ximian.com>
332
333         * Makefile.am (testjit_LDADD): Don't need THREAD_LIBS any more
334
335 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
336
337         * testjit.c (mono_analyze_stack): new BOX impl.
338
339         * x86.brg: implemented INITOBJ
340
341         * testjit.c (mono_analyze_stack): finished array support
342         (mono_analyze_stack): reimplemented DUP instruction
343
344 2001-11-08  Dietmar Maurer  <dietmar@ximian.com>
345
346         * testjit.c (MAKE_STELEM, MAKE_LDELEM): we build a tree which
347         represents the address of the element. This way we can emit highly
348         optimized x86 instructions to access elements (using base+index+offset
349         adressing mode)
350
351 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
352
353         * mempool.c: Include string.h to kill warning.
354
355         * testjit.c: Add typecast to kill warning.
356
357         * x86.brg: Include string.h to eliminate warning.
358
359         * emit-x86.c (tree_allocate_regs): Fix arguments to g_warning to
360         kill warning.
361
362 2001-11-07  Dietmar Maurer  <dietmar@ximian.com>
363
364         * emit-x86.c (enter_method): print out all method arguments
365         (x86_magic_trampoline): impl.
366         (arch_create_simple_jit_trampoline): we use different trampolines
367         for static methods (no need to write the address back into to
368         vtable).
369
370 2001-11-06  Dietmar Maurer  <dietmar@ximian.com>
371
372         * emit-x86.c (arch_create_jit_trampoline): optimised trampoline to
373         use less the 16 bytes.
374
375         * x86.brg: code cleanup
376
377 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
378
379         * testjit.c: bug fixes.
380
381         * emit-x86.c (leave_method): print result values
382
383 2001-11-03  Dietmar Maurer  <dietmar@ximian.com>
384
385         * emit-x86.c (enter_method): new debugging code
386         (leave_method): new debbuging code, this functions are called
387         when you use the new option --trace-calls
388
389 2001-11-02  Dietmar Maurer  <dietmar@ximian.com>
390
391         * testjit.c: impl. STELEM_XX, STELEM_XX
392
393         * x86.brg: impl. LDLEN, LDELEMA
394         
395
396 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
397
398         * x86.brg: added some experimental code for CALL
399         instructions - still not found the optimal way to do it.
400
401         * testjit.c (map_stind_type): add support for value types with
402         a size of 1, 2 or 4 bytes, implemented CEE_UNBOX, CEE_LDOBJ,
403         CEE_LDSTR, CEE_LDFLD, CEE_LDFLDA, CEE_STFLD, CEE_NEWOBJ, CEE_CEQ
404         (ctree_create_newobj): impl.
405         
406
407         * emit-x86.c (tree_allocate_regs): removed allocation code for
408         addr nonterminal.
409         (get_address): use a simple, but bug free search instead of the
410         buggy binary search.
411
412 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
413
414         * testjit.c: support virtual functions
415
416         * x86.brg: support different addressing modes for calls
417
418 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
419
420         * testjit.c: impl. STFLD
421
422 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
423
424         * x86.brg: impl. CEQ
425
426 2001-10-04  Dick Porter  <dick@ximian.com>
427
428         * testjit.c:
429         * emit-x86.c: include mono-endian.h not endian.h
430
431 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
432
433         * testjit.c (ctree_create_dup): really duplicate the tree.
434         attach the arguments to the CALL node. Added a new macro to
435         make argument order configurable (ARCH_ARGS_RIGHT_TO_LEFT).
436
437 2001-10-01  Dietmar Maurer  <dietmar@ximian.com>
438
439         * interp.brg: the burm based interpreter: added the file as example.
440
441 2001-09-27  Dietmar Maurer  <dietmar@ximian.com>
442
443         * x86.brg: cleanup
444
445         * testjit.c: impl. LDIND/STIND/LDLOCA, use g_malloc to alloc static
446         data.
447         (map_stind_type): support enum types
448         (map_ldind_type): support enum types
449
450         * emit-x86.c (tree_allocate_regs): added code to support
451         register allocation for addressing modes trees.
452         (tree_emit): bug fix: we have to emit all mono_burg_functins. The
453         previous impl. did not work for chain rules.
454         (compute_branches): support for SWITCH statements
455
456         * x86.brg: added rules to model x86 addressing modes
457
458 2001-09-26  Dietmar Maurer  <dietmar@ximian.com>
459
460         * emit-x86.c (compute_branches): implemented SWITCH
461
462         * testjit.c (mono_create_forest): implemented LDIND/STIND opcodes
463         (map_ldind_type): add enumeration types.
464         (map_stind_type): add enumeration types.
465
466         * emit-x86.c (arch_compile_method): more documentation.
467
468         * testjit.c: moved the architecture specific things to emit-x86.c
469         and x86.brg. Added more documentation. code cleanup.
470
471 2001-09-25  Dietmar Maurer  <dietmar@ximian.com>
472
473         * x86.brg: we now have different types of addresses: ADDR_L for local
474         values, ADDR_A for arguments and ADDR_G for global addresses. We
475         also use LDIND_XX token to load values from a specific address
476         instead of LDLOC/STLOC. 
477
478         * testjit.c: use the new adressing scheme everywhere:
479         LDIND _XX (ADDR_X), and STIND_XX (ADDR_X, tree)  
480
481 2001-09-24  Dietmar Maurer  <dietmar@ximian.com>
482
483         * testjit.c (main): fix bug in parameter parsing
484
485         * x86.brg: impl. more opcodes
486
487 2001-09-23  Dick Porter  <dick@ximian.com>
488
489         * Makefile.am (testjit_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
490
491 2001-09-23  Dietmar Maurer  <dietmar@ximian.com>
492
493         * testjit.c: use the memory pool to avoid memory leaks
494
495 2001-09-22  Dietmar Maurer  <dietmar@ximian.com>
496
497         * x86.brg: increment the stack pointer after function calls
498
499 2001-09-21  Dick Porter  <dick@ximian.com>
500
501         * Makefile.am (testjit_LDADD): Added PTHREAD_LIBS to the link line
502
503 2001-09-21  Dietmar Maurer  <dietmar@ximian.com>
504
505         * x86.brg: implemented long MUL/DIV
506         (MB_OPT_LEVEL): define optimisation level macro
507
508         * testjit.c (tree_allocate_regs): added a way to prevent EDX usage
509         for operations like idiv. it is also possible to assign specific registers.
510
511 2001-09-20  Dietmar Maurer  <dietmar@ximian.com>
512
513         * x86.brg: added basic support for long
514
515         * testjit.c (mono_compile_method): implemented POP
516
517 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
518
519         * testjit.c (usage): Added a couple of more usage options.
520
521 2001-09-19  Dietmar Maurer  <dietmar@ximian.com>
522
523         * x86.brg: added more floating point grammar 
524
525         * testjit.c (mono_compile_method): make local offsets negative
526
527         * x86.brg: added some floating point trees
528
529         * testjit.c (mono_compile_method): arguments on the runtime 
530         stack are at least 4 bytes
531
532         * x86.brg: partly implemented 8,16 bit integers
533
534         * testjit.c (get_address): mark basic blocks
535
536 2001-09-18  Dietmar Maurer  <dietmar@ximian.com>
537
538         * x86.brg: added some rules to optimize code
539
540         * testjit.c (get_address): use a binary search to get the address
541         (main): added an option to debug the jit (-d)
542
543 Tue Sep 18 13:19:16 CEST 2001 Paolo Molaro <lupus@ximian.com>
544
545         * testjit.c: better/faster align code. Handle ldloc.s and stloc.s.
546
547 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
548
549         * testjit.c (mono_compile_method): Provide better error reporting.
550
551 2001-09-17  Dietmar Maurer  <dietmar@ximian.com>
552
553         * testjit.c (tree_get_address): impl. to fix address bug
554         (tree_get_address): make sure that we can only jump to the first
555         instruction of a tree.
556
557         * x86.brg: emit real code for calls
558
559         * testjit.c (create_jit_trampoline): creates a function to trigger jit
560         compilation.
561         (mono_compile_method): reversed argument order
562
563 2001-09-15  Dietmar Maurer  <dietmar@ximian.com>
564
565         * x86.brg (stmt): don't emit unnecessary register moves
566
567         * testjit.c (tree_allocate_regs): free registers earlier
568
569 2001-09-14  Dietmar Maurer  <dietmar@ximian.com>
570
571         * x86.brg: branch addresses are now resolved
572
573         * testjit.c (compute_branches): compute address of branches
574
575         * x86.brg: emit real x86 instructions
576
577         * testjit.c: call objdump to disassemble the output
578
579 2001-09-13  Dietmar Maurer  <dietmar@ximian.com>
580
581         * x86.brg: use the right offsets to access local variables
582         and arguments.
583
584         * emit-x86.c: only save/restore callee saved registers if they are
585         really modified.
586
587         * testjit.c (tree_allocate_regs): use the new MonoRegSet to
588         allocate registers.
589         (mono_compile_method): changed the tree for mothod calls
590
591         * regset.h: impl.
592         
593         * regset.c: impl.
594         
595
596 2001-09-10  Miguel de Icaza  <miguel@ximian.com>
597
598         * x86.brg: Use Unix assembly syntax.
599
600         * emit-x86.c: support code, should be moved
601
602         * testjit.c: Use GPtrArrays instead of GLists, as those are very
603         inefficient at appends.
604
605         * Renamed `create_new_leave' to `create_new_leaf'
606
607         
608