2001-12-23 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mono / interpreter / ChangeLog
1
2 Thu Dec 20 20:09:48 CET 2001 Paolo Molaro <lupus@ximian.com>
3
4         * interp.c: fix delegate method invocation to handle both
5         static and instance methods.
6
7 Tue Dec 18 18:48:50 CET 2001 Paolo Molaro <lupus@ximian.com>
8
9         * interp.c: make segv_handler static, handle runtime methods in stack
10         trace.
11
12 Thu Dec 13 20:24:28 CET 2001 Paolo Molaro <lupus@ximian.com>
13
14         * interp.c: correctly handle exceptions generated in C code.
15         Install an handler for SIGSEGV. Bare-bones profiler and hook for the
16         verifier.
17
18 Mon Dec 3 17:15:44 CET 2001 Paolo Molaro <lupus@ximian.com>
19
20         * interp.c: call mono_init() after registering internal calls.
21
22 2001-11-30  Dick Porter  <dick@ximian.com>
23
24         * interp.c: Replace get_named_exception() with
25         mono_exception_from_name()
26
27 Fri Nov 30 12:05:21 CET 2001 Paolo Molaro <lupus@ximian.com>
28
29         * interp.c: calculate locals and args offsets only once
30         per method call. Cache trampoline code as well.
31
32 2001-11-23  Dietmar Maurer  <dietmar@ximian.com>
33
34         * interp.c (ves_exec_method): bug fix for exception5.cs
35
36 Mon Nov 19 11:33:00 CET 2001 Paolo Molaro <lupus@ximian.com>
37
38         * interp.c: start adding support for handling exceptions across
39         managed/unmanaged boundaries. Cleanup Delegate method invocation.
40         Pass the correct target object in Delegate::Invoke and use the correct
41         'this' pointer in ldvirtftn (bugs pointed out by Dietmar).
42
43 Thu Nov 15 17:40:24 CET 2001 Paolo Molaro <lupus@ximian.com>
44
45         * interp.c: handle enums with underlying type different from int32.
46         More checks for C structs <-> C# objects consistency.
47
48 Wed Nov 14 19:23:00 CET 2001 Paolo Molaro <lupus@ximian.com>
49
50         * interp.c: move the stack frame dumping code to a function so it can
51         be called from the debugger. Fix virtual method lookup for interfaces.
52         Throw exceptions instead of aborting in more places.
53         Print also the message in an exception. Updates for field renames in
54         corlib.
55
56 2001-11-09  Dick Porter  <dick@ximian.com>
57
58         * Makefile.am (mint_LDADD): Don't need THREAD_LIBS any more
59
60 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
61
62         * interp.c: Include stdlib to kill warning.
63         (check_corlib): Adjust format encodings to remove warnings.
64
65 Wed Nov 7 15:47:36 CET 2001 Paolo Molaro <lupus@ximian.com>
66
67         * interp.c: updates for changes in array code.
68
69 Fri Nov 2 19:06:54 CET 2001 Paolo Molaro <lupus@ximian.com>
70
71         * interp.c: hanlde field refs. Throw an exception on NULL references.
72         Check consistency of corlib types with the C struct representation.
73
74 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
75
76         * interp.c (ves_exec_method): use relative numbering for runtime
77         type checks (and make it work with interfaces)
78
79 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
80
81         * interp.c: removed newobj()
82
83 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
84
85         * interp.c (get_virtual_method): use the vtable
86         (arch_compile_method): added to compute vtable entry
87
88 Mon Oct 8 16:14:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
89
90         * interp.c: use the accessors provided in object.h to deal with
91         MonoArrays. Updates for API renames in metadata. Throw exception
92         in ldelema if index is out of bounds.
93
94 Mon Oct 8 10:44:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
95
96         * interp.c: fixes for changes in metadata.
97
98 2001-10-04  Dick Porter  <dick@ximian.com>
99
100         * interp.c (ves_runtime_method): init_class() the
101         mono_defaults.delegate_class
102         Include mono-endian.h not endian.h
103
104 Tue Oct 2 18:51:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
105
106         * interp.c: set frame->ip in the leave opcode. Make db_methods static.
107
108 Sun Sep 30 11:57:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
109
110         * interp.c: compiler and ANSI C portability fixes.
111
112 Fri Sep 28 19:37:46 CEST 2001 Paolo Molaro <lupus@ximian.com>
113
114         * interp.c: Implemented ldtoken, conv.ovf.i. Use MonoClass->byval_arg
115         (and remove related kludges). Don't choke on access to arrays of
116         references. Throw an exception when an internalcall or P/Invoke
117         function don't have an implementation. Throw and EngineException
118         for unimplemented opcodes.
119
120 Tue Sep 25 11:12:35 CEST 2001 Paolo Molaro <lupus@ximian.com>
121
122         * interp.c: fixed get_virtual_method () to deal with interface
123         methods better.
124
125 Mon Sep 24 18:50:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
126
127         * interp.c: catch a few more error conditions with exceptions instead of
128         erroring out.
129         Don't use g_print() in stack traces because it doesn't work with
130         some float values.
131         When we call an instance method of a valuetype class, unbox the 'this'
132         argument if it is an object.
133         Use mono_ldstr () to implement the ldstr opcode: it takes care of
134         interning the string if necessary.
135         Implemented new opcodes: ckfinite, cgt.un, clt.un, ldvirtftn, ldarga.
136         Fixes to handle NaNs when comparing doubles.
137         Make sure the loaded assembly has an entry point defined.
138         Fixed portability bugs in neg and not opcodes.
139
140 2001-09-24  Dietmar Maurer  <dietmar@ximian.com>
141
142         * interp.c (ves_exec_method): LDC_I4: 8bit constants are signed
143         (ves_exec_method): bug fix for NOT/NEG
144         (main): fix bug in parameter parsing
145
146 2001-09-23  Dick Porter  <dick@ximian.com>
147
148         * Makefile.am (mint_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
149
150 2001-09-23  Dick Porter  <dick@ximian.com>
151
152         * interp.c (main): Do some thread setup and cleanup around the
153         call to ves_exec()
154
155 2001-09-21  Dick Porter  <dick@ximian.com>
156
157         * Makefile.am (mint_LDADD): Added PTHREAD_LIBS to the link line
158
159 Thu Sep 20 16:32:42 CEST 2001 Paolo Molaro <lupus@ximian.com>
160
161         * interp.c: implemented some more opcodes: calli, rem.un,
162         shr.un, conv.u, cpobj, stobj, conv.r.un, conv.ovf.i1.un,
163         conv.ovf.i2.un, conv.ovf.i4.un, conv.ovf.i8.un, conv.ovf.i.un,
164         conv.ovf.u1.un, conv.ovf.u2.un, conv.ovf.u4.un, conv.ovf.u8.un,
165         conv.ovf.u.un.
166         Fix some 64 bit issues in the array element access code and a small bug.
167         Throw an exception on index out of range instead of asserting.
168         Throw an exception on a NULL array instead of dying.
169         Stomped a memory corruption bug (.cctor methods were freed after
170         executing them, but they are stores in MonoClass now...).
171         Added a simple facility to invoke the debugger when a named
172         function is entered (use the cmdline option --debug method_name).
173         * interp.h: fix 64 bit issue.
174
175 Tue Sep 18 13:21:33 CEST 2001 Paolo Molaro <lupus@ximian.com>
176
177         * interp.c: fix some 64 bit issues. Safer support for delegates.
178
179 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
180
181         * interp.c (ves_exec_method): implement conv.u8 opcode. 
182
183 Mon Sep 10 20:20:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
184
185         * interp.c: endian fixes, comments.
186
187 Fri Sep 7 18:45:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
188
189         * interp.c, interp.h: make ves_exec_method () and stackval_from_data ()
190         non static. Implement a couple of runtime methods needed to
191         use delegates (ves_runtime_method ()).
192         Implemented ldftn opcode.
193
194 Thu Sep 6 15:41:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
195
196         * Makefile.am: link to libmonoarch.
197         * interp.h, interp.c: use mono_create_trampoline ().
198         Pass the command line arguments to Main (String[]) methods.
199
200 2001-08-30  Dietmar Maurer  <dietmar@ximian.com>
201
202         * interp.c (ves_pinvoke_method): removed the libffi dependency
203
204 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
205
206         * interp.c (ves_array_set): moved from icall.c
207         (ves_array_get): moved from icall.c
208
209         * icall.c: moved to metadata/icall.c
210
211 Wed Aug 29 12:46:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
212
213         * interp.c: some small optimizations. Fixes to do signed
214         compares when needed. Change C++ comments into C.
215         Implemented cgt, clt. Added --opcode-count cmdline switch.
216
217 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
218
219         * interp.c (ves_exec_method): better check for value types (get
220         the class to detect if we have a value type), implemented CEE_CONV_U1,
221         CEE_CONV_U2, CEE_CEQ
222         
223
224 Mon Aug 27 21:30:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
225
226         * interp.c: warn and exit when Main () expects the cmdline arguments
227         instead of creashing.
228
229 Mon Aug 27 20:16:37 CEST 2001 Paolo Molaro <lupus@ximian.com>
230
231         * interp.c: merge isinst/castclass handling. Hopefully implement
232         the right semantics for handling callvirt correctly (changes
233         here and there to support it). Integrate bugfix from Dietmar quickly
234         so he needs to handle the cvs conflict:-)
235
236 Mon Aug 27 12:20:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
237
238         * interp.c: fix compilation and updates for changes in metadata/.
239
240 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
241
242         * interp.c (main): Add option handling for the interpreter,
243         support the `--trace' option.
244
245 Sun Aug 26 23:04:46 CEST 2001 Paolo Molaro <lupus@ximian.com>
246
247         * interp.c: get in a dummy virtual method dispatch.
248         Added support for int64, native int and native uint as arguments.
249         Added debug enter/leave for icall and pinvoke methods, too.
250         Implement opcodes conv.i, conv.i8, ldelema.
251
252 Sun Aug 26 11:37:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
253
254         * interp.h, interp.c: load also a MonoClass pointer when we load
255         an address on the stack. Implemented conv.i1, conv.i2, con.i4,
256         conv.u4, conv.r4, conv.r8. Print the arguments in the stack trace
257         and the name of the exception.
258
259 Sat Aug 25 15:56:03 CEST 2001 Paolo Molaro <lupus@ximian.com>
260
261         * interp.c: Implemented some opcodes: starg.s, ldobj, isinst,
262         ldarg, starg, ldloc, ldloca, stloc, initobj, cpblk, sizeof.
263
264 Sat Aug 25 12:57:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
265
266         * interp.c: handle enumerations specially (not as valuetypes).
267
268 Fri Aug 24 19:34:04 CEST 2001 Paolo Molaro <lupus@ximian.com>
269
270         * interp.h, interp.c: add support for valuetypes.
271
272 Fri Aug 24 16:09:20 CEST 2001 Paolo Molaro <lupus@ximian.com>
273
274         * interp.c: updates for merge of MonoParam in MonoType.
275
276 Thu Aug 23 12:04:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
277
278         * interp.c: removed beforefieldinit check, it's a useless flag.
279         Added a couple more test cases to tests/ dir.
280
281 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
282
283         * interp.c (usage): Add version information
284         (ves_pinvoke_method): Typo fix.
285
286 Wed Aug 22 20:37:51 CEST 2001 Paolo Molaro <lupus@ximian.com>
287
288         * interp.c: simplified init_class (). Make sure a class
289         is fully initialized before executing a method in the class.
290         Search for the class constructor only on beforefieldinit classes.
291         Implement a bunch of opcodes: br, brfalse, brtrue, beq, bge,
292         bgt, blt, ble, bne.un, bge.un, bgt.un, ble.un, blt.un, stind.i,
293         ldflda, ldsflda, ldelem.i8, stelem.i8, leave.
294
295 Wed Aug 22 16:34:03 CEST 2001 Paolo Molaro <lupus@ximian.com>
296
297         * interp.c: Updates for changes in metadata/. Better output in debug mode
298         and in the stack trace. Completed rethrow handling
299
300 Tue Aug 21 18:56:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
301
302         * interp.c: new macro INIT_FRAME() to properly
303         initialize a MonoInvocation. Fixed a couple of buglets in exception code:
304         increase stack pointer when pushing the exception for catch blocks,
305         initialize frame->ex_handler to NULL, correctly try all the
306         catch blocks (don't incorrectly fallback on filter handling).
307         Added a couple more checks where we may need to throw an
308         exception. Added more exception creation functions.
309         Changed stackval_from_data() to take the target stackval as
310         argument. Implemented a couple more opcodes.
311         * interp.h: prepare stackval for value type code.
312
313 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
314
315         * Makefile.am (mint_LDADD): Renamed interpreter to mint.
316
317 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
318
319         * interp.c (get_named_exception): use the right constructor.
320
321 Mon Aug 20 18:58:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
322
323         * interp.c: fix buglet with the leave.s opcode.
324
325 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
326
327         * icall.c: changed everything to support the new calling convention
328
329         * hacks.h: added some macros for FreeBSD 
330
331         * interp.c (get_named_exception): use mono_object_new instead of
332         newobj, initialize the stack before we call the constructor.
333
334 Sat Aug 18 12:43:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
335
336         * interp.c, interp.h: added support code to create exceptions.
337         Changed interncal calling convnetion over to MonoInvocation, to support
338         exceptions, walking the stack back and forward and passing the 'this'
339         pointer separately (remove the cludges required before to pass this on the
340         stack). Use alloca heavily for both local vars and a copy of the incoming 
341         arguments. Init local vars to zero.
342         Simplify stackval_from_data() and stackval_to_data() to only take a pointer
343         instead of pointer + offset.
344         Implement a few exceptions-related opcodes and the code to run finally, fault and
345         catch blocks as well as a stack trace if no handler is found.
346         
347 2001-08-16  Alex Graveley  <alex@ximian.com>
348
349         * Makefile.am (mono_int_LDADD): Link with ../../libffi/libffi.a
350         instead of ../../libffi/.libs/libffi.a.
351
352 2001-08-10  Dietmar Maurer  <dietmar@ximian.com>
353
354         * interp.c (ves_exec_method): impl CASTCLASS
355
356         * icall.c: moved the internal call stuff to this file
357
358         * interp.c (ves_exec_method): impl. BOX/UNBOX
359         (ves_icall_System_Array_GetValue): impl.
360         (ves_icall_System_Array_SetValue): impl.
361         added myself to Authors
362
363 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
364
365         * implemented arrays, but you will need a modified version of 
366         Array.cs to get arrays working (will commit soon)
367         
368         * interp.c (ves_icall_array_Set): impl.
369         (ves_icall_array_Get): impl.
370         (ves_icall_array_ctor): impl.
371         (ves_icall_System_Array_GetRank): impl.
372         (ves_icall_System_Array_GetLength): impl.
373         (ves_icall_System_Array_GetLowerBound): impl.
374         (mono_lookup_internal_call): impl.
375
376 2001-08-06  Dietmar Maurer  <dietmar@ximian.com>
377
378         * interp.c (ves_exec_method): impl. NEWARR
379         (ves_exec_method): impl. most LDELEM/STELEM opcodes, LDLEN
380         (newarr): impl.
381         (mono_get_ansi_string): impl.
382         (mono_lookup_internal_call): impl.
383         (ves_exec_method): implemented internal calls
384
385 2001-08-05  Dietmar Maurer  <dietmar@ximian.com>
386
387         * interp.c (ves_pinvoke_method): removed all static vars.
388
389 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
390
391         * interp.c (ves_exec_method): found a way to do unordered
392         compares, implemented CEE_BNE_UN_S, CEE_BGE_UN_S, CEE_BGT_UN_S, 
393         CEE_BLE_UN_S, CEE_BLT_UN_S
394         
395 Wed Aug 1 22:51:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
396
397         * interp.c: handle also MONO_TYPE_CLASS to/from the stack.
398         Change locals to be a memory blob, instead of the structured
399         (but wrong) stackval. Implement bne.un.s opcode. Make the program
400         exit with the error code from Main().
401
402 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
403
404         * interp.c (ves_exec_method): implemented LDSTR
405
406 2001-07-31  Miguel de Icaza  <miguel@ximian.com>
407
408         * interp.c (GET_NATI): Switched from using nati_t to cli/types.h
409         m_i type.  Maybe we should rename the types to be m_i_t instead of
410         m_i alone.
411         
412         Make the code compile after I broke it.
413
414 Tue Jul 31 23:46:33 CEST 2001 Paolo Molaro <lupus@ximian.com>
415
416         * interp.c: fix cleanup.
417         * Makefile.am: don't link with disassembler library.
418
419 2001-07-31  Miguel de Icaza  <miguel@ximian.com>
420
421         (ves_exec_method): Cleanup of the source code.
422
423 Tue Jul 31 20:13:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
424
425         * interp.c: implement stind.*, ldind.*, ldloca.s opcodes.
426         Provide better tracing with DEBUG_INTERP.
427
428 Tue Jul 31 17:52:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
429
430         * interp.c: massive namespace cleanup.
431
432 Mon Jul 30 20:09:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
433
434         * interp.c: update to use mono_method->name.
435
436 Fri Jul 27 20:54:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
437
438         * interp.c: start implementing callvirt. Classes with
439         class constructors are properly initialized when needed.
440         Fix error introduced in version 1.17.
441
442 Fri Jul 27 14:03:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
443
444         * interp.c: implement static field loading and storing.
445
446 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
447
448         * interp.c (ves_pinvoke_method): impl.
449
450 Fri Jul 27 11:49:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
451
452         * interp.c: Removed some debugging printouts. Made stackval_to_data
453         static. Handle also instance methods in CALL opcode. Fix ret to properly
454         deal with void functions. Fixed constructor to leave the object on
455         the stack.
456
457 Thu Jul 26 13:24:51 CEST 2001 Paolo Molaro <lupus@ximian.com>
458
459         * interp.c: ves_exec_method () doesn't take a MonoImage arg
460         anymore. Use the method cache in MonoImage. Updates to
461         mache recent changes in metadata. 
462         Fix newobj code to use new metadata features. Call the class
463         constructor after allocationg the object. Implemented load field
464         and store field opcodes (the support functions need to be finished).
465         
466 Tue Jul 24 16:51:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
467
468         * interp.c, hacks.h: moved a few ugly macros out of the code.
469         Implemented switch opcode.
470
471 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
472
473         * interp.c (newobj): Added function to handle newobj opcode.
474
475 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
476
477         * interp.c (ves_exec_method): Make the interpreter abort with more
478         information than it currently does.
479
480         Enable the slow processor, as it is easier to debug.
481
482 Sun Jul 15 17:50:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
483
484         * Started changelog.
485         * interp.c: use new mono_get_method () function to get the complete
486         info on a method invocation: we support now method invocation with
487         multiple (or zero) simple arguments and with or without a return value.
488         Implement also a couple more opcodes.