2002-03-20 Martin Baulig <martin@gnome.org>
[mono.git] / mono / metadata / ChangeLog
1 2002-03-20  Martin Baulig  <martin@gnome.org>
2
3         * icall.c (ves_icall_InternalInvoke): Create a new object if the
4         method is a constructor.
5         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
6         points to ves_icall_InternalInvoke().
7
8 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
9
10         * file-io.c: Flush shouldn't throw exceptions.
11
12 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
13
14         * file-io.c: FileStream flush support; FileSetLength now
15         restores file pointer.
16
17 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
18
19         * class.c: set image for pointer classes.
20
21 2002/03/19  Nick Drochak <ndrochak@gol.com>
22
23         * sysmath.c: Forgot one.
24
25 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
26
27         * sysmath.c: Avoid redefining existing names.
28
29 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
30
31         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
32         handled by runtime as icall rather than dllimport from libm.so
33         * file-io.c, file-io.h: fixed handle argument type.
34
35 2002-03-18  Dick Porter  <dick@ximian.com>
36
37         * reflection.c (mono_image_get_type_info): rename interface to
38         iface, because of "#define interface struct" on windows.
39
40 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
41
42         * class.c, class.h: rename and export mono_ptr_class_get().
43         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
44         * reflection.c, reflection.h, icall.c: better/saner type name
45         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
46         method signatures.
47
48 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
49
50         * class.c (mono_class_init): removed hardcoded GHC_SLOT
51
52         * icall.c (ves_icall_InternalInvoke): impl.
53
54 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
55
56         * reflection.c: output the interface map table, too.
57
58 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
59
60         * class.c (class_compute_field_layout): separate computation of 
61         static field layout
62
63 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
64
65         * icall.c: added System.Buffer support.
66         * file-io.c: moved file icalls from PAL to FileStream.
67
68 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
69
70         * icall.c (ves_icall_System_Object_GetHashCode): impl.
71
72 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
73
74         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
75
76 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
77
78         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
79
80 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
81
82         * debug-helpers.{c,h}: moved here from monograph some useful functions
83         to locate a method by name/signature in a class or image. Included
84         also a small and flexible IL disassembler.
85
86 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
87
88         * reflection.c: fixup tokens in methods with small header size, too.
89
90 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
91
92         * object.c (mono_string_to_utf8): remove assert(!error), instead
93         print a warning. 
94
95 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
96
97         * icall.c: update to the new mono_Array_class_get interface.
98
99 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
100
101         * appdomain.c, object.c: Boehm-GC enable.
102         * icall.c: make get_data_chunk() support split data requests.
103         Ensure a class is initialized in more cases. Return only the first
104         property found in GetProperties() or the compiler gets confused. 
105         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
106         * reflection.h, reflection.c: add fixup mechanism for field and method
107         tokens. Initialize assembly->typeref in a single place. Output
108         properties after events. Support custom attributes for events, too.
109         Typo fix for paramter custom attrs.
110
111 2002-03-07  Martin Baulig  <martin@gnome.org>
112
113         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
114
115 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
116
117         * class.c (mono_array_class_get): fix. for multi. dim. arrays
118
119 2002-03-06  Martin Baulig  <martin@gnome.org>
120
121         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
122         non-zero lower bounds. See testcases #F10-#F13.
123
124 2002-03-05  Martin Baulig  <martin@gnome.org>
125
126         * exception.c (mono_get_exception_argument_out_of_range): New exception.
127
128         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
129         ves_icall_System_Array_GetValue(), only calculate the absolute array position
130         here.
131         (ves_icall_System_Array_SetValue): Likewise.
132         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
133         as argument and does the actual work. This function is used when copying a
134         multi-dimensional array.
135         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
136         now do all the widening conversions of value types.
137         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
138
139 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
140
141         * class.c: remove some magic numbers and use the smbolic names,
142         instead. Added init_events() to load event info at class init time.
143         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
144         and mono_metadata_methods_from_event().
145         * reflection.h, reflection.c: added support for writing out the evnets
146         related information.
147
148 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
149
150         * reflection.h, icall.c: use a different method (GetInterfaces)
151         to gather interface info and add isbyref, isprimitive and
152         ispointer to the ves_icall_get_type_info() return value.
153
154 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
155
156         * class.h: stared adding support for events.
157         * icall.c: split find_members implementation. Added debug icall to get
158         the address of an object.
159         * reflection.c: handle TypeBuilders in mono_type_get_object().
160
161 2002-03-01  Martin Baulig  <martin@gnome.org>
162
163         * icall.c (ves_icall_System_Array_GetLength): This must throw an
164         ArgumentOutOfRangeException(), not an ArgumentException().
165         (ves_icall_System_Array_GetLowerBound): Likewise.
166         (ves_icall_System_Array_GetValue): Improved argument checking.
167         (ves_icall_System_Array_SetValue): Improved argument checking.
168
169 2002-03-01  Martin Baulig  <martin@gnome.org>
170
171         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
172         called with invalid arguments rather than just dying with g_assert().
173         (ves_icall_System_Array_SetValue): Likewise.
174         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
175         raise a NotImplementedException instead.
176         (ves_icall_System_Array_GetLength): Added argument checking.
177         (ves_icall_System_Array_GetLowerBound): Added argument checking.
178
179 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
180
181         * object.h (mono_assert): new macros mono_assert and
182         mono_assert_not_reached
183
184 2002-02-28  Martin Baulig  <martin@gnome.org>
185
186         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
187         and "System::String::IsInterned" to "System::String::_IsInterned".
188
189 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
190
191         * icall.c: remove hacks for typebuilder. Added icall to create a
192         modified type from a tybebuilder.
193         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
194         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
195         to create a backing MonoClass for a TypeBuilder.
196
197 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
198
199         * class.c, class.h: more refactoring of class init.
200         Export mono_class_setup_mono_type() and mono_class_setup_parent().
201
202 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
203
204         * marshal.c, marshal.h: start of marshaling interface.
205
206 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
207
208         * icall.c: fix order in assembly qualified name icall.
209
210 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
211
212         * class.c: do not free str, since we store it in the hash table.
213         * reflection.h: add label field to MonoILExceptionInfo.
214         * reflection.c: handle references to more than one assembly. Handle
215         case when there isn't a module created in the assembly.
216
217 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
218
219         * class.c: Fix typo. Start refactoring of class init code.
220
221 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
222
223         * appdomain.c: exit with 1 on error.
224         * class.c: we already have the name in MonoClassField.
225         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
226         MonoStreamHeader instead of an offset of image->raw_metadata.
227
228 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
229
230         * appdomain.c (mono_init): Be even more descriptive about the error.
231
232 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
233
234         * appdomain.c: give the user an informative message when corlib can't
235         be loaded.
236
237 2002-02-26  Martin Baulig  <martin@gnome.org>
238
239         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
240         New icall to get the time zone data.
241
242 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
243
244         * reflection.c: set virtual and raw size of section correctly.
245         * threads.c: transfer domain information to newly created threads.
246
247 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
248
249         * class.c: when instancing a class in a domain, load the default
250         vaules for static fields from the constant table. Fix System.Enum to
251         not be an enum.
252         * icall.c: implement Object::GetType() internalcall. Implemented
253         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
254         Fixed checking of binding flags in find_members().
255         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
256         * reflection.c: handle enumerations when writing to the constant
257         table. Use a different object cache for types.
258
259
260 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
261
262         * object.c (mono_object_isinst): fix for arrays
263
264         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
265
266 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
267
268         * object.c: don't use mprotect ()  and fix intern pool hash table
269         lookup for big endian systems.
270
271 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
272
273         * icall.c: change type_is_subtype_of () signature.
274
275 2002-02-21  Mark Crichton  <crichton@gimp.org>
276
277         * rand.c, rand.h: Added random number generator for
278         System.Security.Cryptography classes.
279
280         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
281
282         * icall.c: Added System.Security.Cryptography calls.
283
284 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
285
286         * class.c, icall.c, metadata.c: better support for pointer types.
287         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
288         * reflection.c: Add support for getting custom attrs for properties
289         and simplify some code.
290
291 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
292
293         * icall.c: change getToken () and add custom attribute GetBlob()helper
294         method.
295         * reflection.h: add custom attrs array to the reflection builder structures.
296         * reflection.c: encode and emit custom attributes for all the relevant
297         reflection objects. Cache fieldref and methodref tokens. Change
298         mono_image_create_token() interface to take a MonoDynamicAssembly.
299         More complete custom attributes decoder. Load custom attributes for
300         Assembly, Field, Method and Constructor objects, too. Make the
301         returned array an Attribute[] one, not object[]. Added
302         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
303         custom attribute constructor.
304
305 2002-02-20  Dick Porter  <dick@ximian.com>
306
307         * icall.c:
308         * rawbuffer.c:
309         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
310         problem code out for now).
311
312 2002-02-19  Radek Doulik  <rodo@ximian.com>
313
314         * object.c (mono_ldstr): use hash table to avoid multiple swapping
315
316 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
317
318         * icall.c: register the GetCustomAttributes method.
319         * object.c, object.h: add mono_string_new_len ().
320         * reflection.h, reflection.c: added mono_runtime_invoke(),
321         mono_install_runtime_invoke(). Added
322         mono_reflection_get_custom_attrs () to load custom attributes and
323         create the attribute objects.
324
325 2002-02-19  Dick Porter  <dick@ximian.com>
326         * threads-dummy-types.c:
327         * threads-dummy-types.h:
328         * threads-dummy.c:
329         * threads-dummy.h:
330         * threads-pthread-types.c:
331         * threads-pthread-types.h:
332         * threads-pthread.c:
333         * threads-pthread.h:  Deleted obsolete files
334
335 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
336
337         * class.c (mono_class_vtable): runtime init the class when we
338         allocate static class data.
339
340         * icall.c (ves_icall_System_Array_SetValue): check for null values.
341
342         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
343         and String - but we will need generic marshalling support in the
344         future. 
345         (mono_init): set the domain name in a ms compatible way
346
347         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
348         String[].
349
350 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
351
352         * object.c (mono_array_clone): use alloca() instead of g_malloc  
353         for sizes
354
355         * appdomain.c (mono_domain_unload): impl.
356
357 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
358
359         * appdomain.c, object.c: fix intern pool implementation.
360         * class.c: fix alignment code.
361
362 2002-02-16  Radek Doulik  <rodo@ximian.com>
363
364         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
365         and s2 > s1, just copy lower bytes to be compatible with little
366         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
367         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
368
369         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
370         force big_endian to be 1 for big endian machines 
371         (ves_icall_iconv_new_decoder): ditto
372
373 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
374
375         * socket-io.c (convert_sockopt_level_and_name): If the system
376         doesn't define SOL_IP or SOL_TCP, get them by hand using
377         getprotobyname() and caching the values (because this could be a
378         slow operation).
379         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
380         Use the appropriate struct when the system does support it. Ie,
381         not all systems have struct ip_mreqn so use struct ip_mreq when
382         appropriate.
383
384 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
385
386         * reflection.c: handle finally clauses.
387
388 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
389
390         * socket-io.c: use g_snprintf() instead of snprintf.
391
392 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
393
394         * reflection.c (mono_param_get_objects): Cast second argument to
395         mono_method_get_param_names to a const char** to silence the
396         compiler warning.
397
398         * appdomain.c (mono_domain_assembly_open): Put parens around the
399         truth statement in the for-loop.
400
401         * unicode.c (iconv_convert): Got rid of a compiler warning about
402         int i being unused when the system has a new iconv.
403         (iconv_get_length): Same.
404
405         * image.c (load_class_names): Cast the second argument to
406         g_hash_table_insert() to char* to hush compiler warnings about the
407         arg being a const.
408         (mono_image_open): Same here.
409
410         * socket-io.c: Don't conditionally include sys/filio.h or
411         sys/sockio.h here anymore since we now get them from
412         io-layer/io-layer.h
413         (inet_pton): If the system doesn't support inet_aton, implement
414         using inet_addr and also #define INADDR_NONE if it isn't defined
415         by the system.
416
417 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
418
419         * metadata.c, metadata.h: added function to get packing and size info
420         of a typedef.
421         * reflection.h, reflection.c: handle field RVA data. Save info about
422         the table layout if needed. Assign typedef indexes to all the types
423         before dumping the info about them to avoid forward reference problems.
424
425 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
426
427         * socket-io.c (convert_sockopt_level_and_name): ifdef
428         SO_ACCEPTCONN because it is not defined on my system (old debian)
429
430 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
431
432         * opcode.c: use stddef.h to get NULL.
433
434 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
435
436         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
437         for FIONBIO, FIONREAD and SIOCATMARK.
438         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
439         define INADDR_NONE and besides, inet_addr() is deprecated and
440         should not be used. Use inet_pton() instead - it also has the
441         added bonus that it can easily handle IPv6 addresses as well.
442         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
443
444 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
445
446         * decimal.c: remove _MSC_VER conditional.
447
448 2002-02-13  Dick Porter  <dick@ximian.com>
449
450         * socket-io.c: 
451         * icall.c: Internal calls for Blocking, Select, Shutdown,
452         GetSocketOption and SetSocketOption
453
454 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
455
456         * assembly.cs: better resolver: use it instead of some kludgy
457         code.
458
459 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
460
461         * reflection.c: the best way to speed-up the compiler is to avoid
462         infinite loops.
463
464 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
465
466         * class.c (mono_class_vtable): changed the object layout
467         (obj->vtable->class). 
468         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
469
470 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
471
472         * assembly.c: look for assemblies in the assembly dir, too.
473
474 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
475
476         * class.c: fix thinko in mono_class_from_type().
477
478 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
479
480         * exception.h, exception.c: added TypeLoadException.
481         * object.h, object.c: added mono_array_clone ().
482         * icall.c: handle throwOnError in AssemblyGetType().
483         Added Array.Clone().
484         * opcode.h, opcode.c: use a single value for the opcode val.
485         Compile fix for non-gcc compilers.
486
487 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
488
489         * opcodes.c, opcodes.h: export interesting info about opcodes.
490
491 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
492
493         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
494         icalls. 
495
496         * class.c (class_compute_field_layout): set element_class for enums
497         (mono_class_create_from_typedef): set element_class for normal classes
498
499         * icall.c (ves_icall_System_Enum_get_value): impl.
500
501         * class.c (mono_class_create_from_typedef): do not set valuetype
502         flag for System.ValueType and System.Enum
503
504 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
505
506         * unicode.c (iconv_convert): fix big endian problem.
507
508 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
509
510         * class.c: add asserts if we are ever going to scribble over memory.
511         * socket-io.c: not all systems have AF_IRDA defined.
512
513 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
514
515         * class.c (class_compute_field_layout): do not consider static
516         fields to compute alignment
517
518 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
519
520         * appdomain.c (mono_appdomain_get): impl.
521         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
522
523 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
524
525         * icall.c: ignore "file://" prefix when loading an assembly.
526
527 2002-01-23  Dick Porter  <dick@ximian.com>
528
529         * socket-io.c:
530         * icall.c:
531         * Makefile.am: Added socket support
532
533 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
534
535         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
536         code back.  This should return the assemblies that are loaded by
537         the runtime on behalf of an application domain. 
538
539         The current implementation is still broken, it just returns every
540         assembly loaded, but until we get real applications domain this
541         will do.
542
543 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
544
545         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
546         AppDomain object.
547
548 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
549
550         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
551         the mono_class_from_name lookup.
552         (ves_icall_get_parameter_info): ditto.
553         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
554         method.
555         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
556
557 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
558
559         * class.c: load also nested classes on class init.
560         System.ValueType instance methods gets passed boxed
561         values, unless methods in derived classed that get a pointer to the
562         data.
563         * icall.c: use better name parsing code in GetType().
564         * image.c, image.h: add mono_image_loaded ().
565         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
566         * reflection.c, reflection.h: added mono_reflection_parse_type().
567
568 2002-01-22  Veronica De Santis <veron78@interfree.it>
569
570         * icall.c : Added mapping of internal calls for Manual and Auto reset events
571         * threads.c : Added the implementation of internal calls for events
572         * threads.h : Added prototypes of internal calls for events
573         
574 2002-01-21  Radek Doulik  <rodo@ximian.com>
575
576         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
577
578 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
579
580         * class.c (mono_class_init): set min_align to 1 (instead of 0)
581         (mono_class_value_size): use min_align
582
583 2002-01-20  Dick Porter  <dick@ximian.com>
584
585         * threads.h:
586         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
587         so it compiles on w32.
588
589 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
590
591         * metadata.c (mono_type_stack_size): impl.
592
593         * class.c (mono_class_get_field): impl. memberref token
594
595 2002-01-16 Veronica De Santis <veron78@@interfree.it>
596
597         * icall.h : Added the internal calls mapping for CreateMutex_internal
598                     and ReleaseMutex_internal.
599         * threads.h : Added the prototype of mutexes internal calls.
600         * threads.c : Added the implementations of mutexes internal calls.
601
602 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
603
604         * metaparse.h: removed unused file.
605         * reflection.c, reflection.h: added stream_data_align () function 
606         to align data in streams and keep stream aligned. Add support for
607         exception support in method headers.
608
609 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
610
611         * unicode.c: make iconv_convert () return the number of bytess written
612         in the output buffer.
613
614 2002-01-15  Dick Porter  <dick@ximian.com>
615         * threads.c: Make the runtime's idea of infinite timeouts coincide
616         with the class library's
617
618         Fix a particularly egregious bug in mono_thread_cleanup(). That
619         code was so utterly bogus it must have been written on a Monday.
620
621 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
622
623         * reflection.h: add subtypes field to TypeBuilder.
624         * reflection.c: encode constants for literal fields.
625         Handle subtypes. Fix user string token (and add a zero byte)
626         at the end.
627         
628 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
629
630         * class.c (mono_class_init): bug fix: assign slot numbers for
631         abstract methods.
632
633 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
634
635         * reflection.c: don't try to output a code RVA for abstract methods.
636         Small fixes for method header format. Output parameter info to the
637         ParamDef table. Save method overriding info to MethodImpl table.
638         Fix property support. Allow typedef.extends to be a type in the
639         building assembly.
640         * verify.c: fix off-by-one error.
641
642 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
643
644         * class.c: fix mono_class_from_mono_type () for szarray types.
645         Remove unused cache check in mono_class_from_type_spec().
646         * icall.c: *type_from_name () functions handle simple arrays and byref.
647         * reflection.c: handle byref and szarray types. Handle methods without
648         body (gets P/Invoke compilation working). Handle types and fields in
649         get_token ().
650         * reflection.h: add rank to MonoTypeInfo.
651
652 2002-01-10  Dick Porter  <dick@ximian.com>
653
654         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
655         internal calls
656
657 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
658
659         * icall.c: initialize class in type_from_handle ().
660         Loop also in parent classes for get_method ().
661         * reflection.c: properly encode class and valuetype types.
662         Start on encoding TypeBuilder types. Handle fieldrefs.
663         Use correct length when registering a user string.
664         Handle ConstructorBuilder and MonoMethod in get_token ().
665         Make mono_type_get_object () aware of cached types.
666         * object.c: back out change to mono_string_new ().
667
668 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
669         * object.c: mono_string_new should return a NULL when the string 
670         passed in is NULL -- not try to deference it.
671         
672 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
673
674         * icall.c: hack to make IsSubType work for TypeBuilders.
675         * reflection.c: emit constructors before methods.
676         Retrieve param names in mono_param_get_objects().
677
678 2002/01/05  Nick Drochak  <ndrochak@gol.com>
679
680         * Makefile.am: fix list of headers and sources so automake 1.5
681         doesn't complain. Removed \# at end of list.
682
683 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
684
685         * reflection.c: get token for a method ref. Set return type of
686         constructor to void.
687         * loader.c: debug message.
688         * class.c: typo fix.
689
690 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
691
692         * icall.c: fix array init with rank > 1. FindMembers
693         loops in parent class as well.
694         * image.c: do not insert nested types in name cache.
695         * reflection.c: warning fix.
696         * reflection.h: add override method (for interface impl).
697
698 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
699
700         * metadata.c: fix customattr decoding.
701
702 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
703
704         * rawbuffer.cs: Added native Win32 implementation, avoids using
705         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
706
707 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
708
709         * class.c: make the low-level routines handle the cache.
710
711 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
712
713         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
714
715 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
716
717         * class.c: fix mono_array_element_size() for objects.
718         * class.h, class.c: add properties to MonoClass and load them
719         at init time.
720         * icall.c: check with isinst() when assigning a value to an array
721         instead of requiring the classes to match exactly.
722         Implemented icall for System.Type::GetType().
723         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
724         enums. Handle bindingflags when looking for methods and fields.
725         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
726         and mono_metadata_methods_from_property().
727         * reflection.h, reflection.c: added structures for propreties,
728         parameters and enums. Implemented mono_property_get_object() and
729         mono_param_get_objects().
730
731 2001-12-18  Dick Porter  <dick@ximian.com>
732
733         * file-io.c: Use mono_string_to_utf16() instead of
734         mono_string_chars()
735
736         * object.c: Added mono_string_to_utf16(), which copies the non
737         NULL-terminated MonoString into a new double-null-terminated
738         buffer.
739
740 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
741
742         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
743
744 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
745
746         * file-io.c: raise exceptions if handle is invalid.
747
748 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
749
750         * assembly.c: yet another check for mscorlib.
751         * class.c, class.h: load nesting info for classes.
752         * icall.c: many new functions to support the Reflection classes.
753         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
754         * reflection.h, reflection.c: mono_image_create_token(),
755         mono_assembly_get_object(), mono_type_get_object(),
756         mono_method_get_object(), mono_field_get_object(): methods to return
757         objects that parallel the C representation of assemblies, types,
758         methods, fields.
759
760 2001-12-11  Dick Porter  <dick@ximian.com>
761
762         * icall.c:
763         * file-io.c: Internal calls for file IO.
764
765 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
766
767         * tabledefs.h: missing FileAttributes.
768         * verify.h, verify.c: use is_valid_string () to simplify and check for
769         valid strings more correctly. Fix warnings and speeling.
770         Check more tables: Filed, File, ModuleRef, StandAloneSig.
771         Check code: branches, maxstack, method calls.
772
773 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
774
775         * object.c (mono_object_allocate): removed static, so that the jit
776         can allocate value types.
777
778         * icall.c (ves_icall_System_DateTime_GetNow): impl.
779
780 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
781
782         * class.c: init enum types right away and register the
783         token->MonoClass map in mono_class_create_from_typedef ().
784         * verify.h, verify.c: first cut of the verifier.
785         * pedump.c: add --verify switch to verify metadata tables.
786         * tabledefs.h: add some missing enums.
787
788 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
789
790         * class.c (mono_install_runtime_class_init): impl.
791         (mono_class_init): renamed mono_class_metadata_init to
792         mono_class_init, also removed the metadata_inited flag
793
794         * object.c (mono_object_isinst): use faster algorithm
795
796 2001-11-30  Radek Doulik  <rodo@ximian.com>
797
798         * mono-endian.h: reverted last change
799         added function prototypes
800
801         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
802         add mono-endian.c back
803
804         * mono-endian.c: returned back, as Paolo pointed out, it's needed
805         for unaligned access, I've mistaked it with endianess. I am
806         sorry.
807         (mono_read16): fix reverted endianess
808         (mono_read64): ditto
809         (mono_read32): ditto
810
811 2001-11-30  Dick Porter  <dick@ximian.com>
812
813         * exception.c: Implement mono_exception_from_name()
814
815 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
816
817         * metadata.h, metadata.c: remove params_size and locals_size and their
818         calculation from the metadata code: they are only usefult to the
819         interp.
820
821 2001-11-29  Radek Doulik  <rodo@ximian.com>
822
823         * object.c (mono_ldstr): swap bytes here, it's probably not the
824         best place, but works for me now, I'll redo it once I know mono
825         better, also note that I add PROT_WRITE and don't reset back, also
826         note that it's only affects big endians, so x86 should be OK
827
828         * mono-endian.h (read16): use just glib macros for both endians
829
830         * mono-endian.c: removed as glib macros are used in in
831         mono-endian.h so we don't need to care about endianess for read
832         macros as glib does that for us already
833
834 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
835
836         * class.h, class.h: take minimum alignment into consideration so
837         that the fields of a class remain aligned also when in an array.
838
839 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
840
841         * loader.h, loader.c: add mono_method_get_param_names().
842         * class.c: 0-init class fields.
843
844 2001-11-26  Dick Porter  <dick@ximian.com>
845
846         * icall.c:
847         * threads-types.h:
848         * threads.c: New file that handles System.Threading on all platforms
849
850         * object.c: 
851         * object.h: Remove the synchronisation struct from MonoObject,
852         replace it with a pointer that gets initialised on demand
853
854         * Makefile.am: Replace all the system-specific threading code with
855         a single file that uses the new wrapper library
856
857 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
858
859         * class.c, class.h: add mono_install_trampoline() so that the runtime
860         can register a function to create a trampoline: removes the ugly
861         requirement that a runtime needed to export arch_create_jit_trampoline.
862         * object.h, object.c: added mono_install_handler() so that the runtime
863         can install an handler for exceptions generated in C code (with
864         mono_raise_exception()). Added C struct for System.Delegate.
865         * pedump.c: removed arch_create_jit_trampoline.
866         * reflection.c: some cleanups to allow registering user strings and
867         later getting a token for methodrefs and fieldrefs before the assembly
868         is built.
869         * row-indexes.h: updates and fixes from the new ECMA specs.
870
871 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
872
873         * class.h, class.c: add enum_basetype field to MonoClass.
874         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
875         to get index in the constant table reated to a field, param or
876         property.
877         * reflection.h, reflection.c: handle constructors. Set public-key and
878         version number of the built assembly to 0.
879         * row-indexes.h: update from new ECMA spec.
880
881 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
882
883         * class.h, class.c: add a max_interface_id to MonoClass.
884         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
885         since it's used to do that. Added mono_type_type_from_obj().
886         Make GetType() return NULL instead of segfaulting if the type was not
887         found. Handle simple arrays in assQualifiedName.
888         * object.h: add a struct to represent an Exception.
889         * reflection.c: output call convention in method signature.
890         Add code to support P/Invoke methods and fixed offsets for fields.
891
892 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
893
894         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
895         the value.
896         * icall.c: use mono_array_addr instead of array->vector: fixes the
897         reflection image writing.
898         * reflection.c: init call convention byte to 0 in method signature.
899         Encode the property signature. Don't output property-related methods
900         twice. Really process the properties for a type (don't cast a field to
901         a property, my mom always told me that).
902         Fix 64 bit issues in pointer alignment in a different and more
903         readable way.
904
905 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
906
907         * loader.h: Removed type class from MonoDefaults, added monotype
908
909         * loader.c: Loaded MonoType, removed loading of Type
910
911         * icall.c (my_mono_new_object): Now returns a System.MonoType,
912         and fills in System.Type._impl with a RuntimeTypeHandle rather
913         than the actual MonoClass *
914
915         (ves_icall_type_from_handle): change from type_class to
916         monotype_class
917
918         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
919         implemented
920
921         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
922         implemented
923
924         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
925
926         (ves_icall_System_Reflection_Assembly_GetType): implemented
927
928         (ves_icall_System_MonoType_assQualifiedName): implemented
929
930         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
931
932 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
933
934         * assembly.c (mono_assembly_open): Implement a cache for the
935         assemblies. 
936
937         (mono_assembly_close): only destroy the assembly when the last
938         reference is gone.
939         
940 2001-11-09  Dick Porter  <dick@ximian.com>
941
942         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
943
944 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
945
946         * class.c (mono_class_metadata_init): bug fix: compute the right slot
947
948 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
949
950         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
951         from Martin Weindel.
952         * object.h: add mono_string_chars ().
953
954 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
955
956         * reflection.c (build_compressed_metadata): Eliminates warnings
957         and uses 64-bit clean code.
958
959         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
960         (mono_type_equal): Change signature to eliminate warnings.
961
962 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
963
964         * icall.c, loader.c: remove the internalcall array constructors.
965         Changes to match the new MonoArray structure.
966         * object.h, object.c: an array object doesn't allocate an extra
967         vector. Add mono_array_new_full () to create jagged arrays easily.
968
969 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
970
971         * metadata.h, metadata.c: add mono_metadata_field_info () to
972         retreive all the info about a field from vairous tables.
973         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
974         * class.h, class.c: augment MonoClassField with more info.
975         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
976         policy and load a field's RVA if needed.
977
978 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
979
980         * class.c (mono_class_metadata_init): create a trampoline for all
981         virtual functions instead of actually compiling them.
982
983 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
984
985         * class.h, class.c: include name in MonoClassField.
986         * class.c: fix fundamental type of System.Object and System.String.
987         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
988         tokens in ldtoken.
989         * icall.c: remove internalcalls for the Reflection stuff that is now
990         done in C# code.
991         * loader.c: mono_field_from_memberref () implementation.
992         * mono-endian.c: thinko (s/struct/union/g).
993         * object.c, object.h: make the mono_string_* prototypes actually use
994         MonoString instead of MonoObject.
995         * reflection.c, reflection.h: updates for changes in the reflection
996         code in corlib: we use C structures that map to the actual C# classes.
997         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
998         fat method header if needed and use the info from the ILGenerator for
999         methods. Handle fields in types. Misc fixes.
1000
1001 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
1002
1003         * class.c (mono_class_metadata_init): bug fix: always allocate
1004         space for static class data
1005
1006 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
1007
1008         * class.c (mono_compute_relative_numbering): use relative
1009         numbering to support fast runtime type checks.
1010
1011 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
1012
1013         * class.c (mono_class_create_from_typeref): added debugging output
1014         to print class name when MonoDummy is returned instead of real class
1015
1016 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
1017
1018         * class.c (mono_class_metadata_init): interface offset table now
1019         contains pointers into the vtable - this is more efficient for the jit
1020
1021 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
1022
1023         * class.c (mono_class_metadata_init): use a temporary vtable (the
1024         old algorithm only worked for the interpreter, but not for the jit)
1025
1026 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
1027
1028         * loader.c (method_from_memberref): use mono_class_get to get the
1029         class of an array instead of using System.Array directly.
1030         (mono_get_method): also add MEMBERREF methods to the method cache
1031         which usefull for arrays.
1032
1033 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
1034
1035         * pedump.c (arch_compile_method): added to compute vtable entry
1036
1037         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
1038         number of interfaces.
1039         
1040         * class.h: merged MonoArrayClass into MonoClass
1041
1042         * class.c (mono_class_create_from_typedef): compute the vtable size and
1043         allocate space to include the vtable inside MonoClass
1044         (mono_class_metadata_init): initialize the vtable
1045
1046 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
1047
1048         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
1049         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
1050         * image.c: endian fixes by Laurent Rioux.
1051         * object.h, object.c: rename MonoStringObject to MonoString and
1052         MonoArrayObject to MonoArray. Change some function names to conform to
1053         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
1054         guint16* as first argument, so don't use char*.
1055         Provide macros to do the interesting things on arrays in a portable way.
1056         * threads-pthread.c: updates for the API changes and #include <sched.h>
1057         (required for sched_yield()).
1058         * icall.c: updates for the API changes above.
1059         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
1060         platforms that need them.
1061
1062 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
1063
1064         * class.c: set the correct type for all the fundamental
1065         type when loading the class.
1066
1067 2001-10-05  Dick Porter  <dick@ximian.com>
1068
1069         * threads-pthread.c (pthread_mutex_timedlock): Simple
1070         compatibility version for C libraries that lack this call.
1071
1072 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
1073
1074         * class.c: MonoTypes stored in MonoClass are stored as
1075         fundamental MonoTypes when the class represents a
1076         fundamental type (System.Int32, ...).
1077         The TypeHandle return by ldtoken is a MonoType*.
1078         * icall.c: ves_icall_get_data_chunk () write out all the
1079         PE/COFF stuff. Implement ves_icall_define_method (),
1080         ves_icall_set_method_body (), ves_icall_type_from_handle ().
1081         * image.c: properly skip unknown streams.
1082         * loader.h, loader.c: add type_class to mono_defaults.
1083         * metadata.c, metadata.h: export compute_size () as
1084         mono_metadata_compute_size () with a better interface.
1085         Typo and C&P fixes.
1086         * pedump.c: don't try to print the entry point RVA if there is no entry point.
1087         * reflection.c, reflection.h: many cleanups, fixes, output method
1088         signatures and headers, typedef and typeref info, compress the metadata
1089         tables, output all the heap streams, cli header etc.
1090         * row-indexes.h: typo fixes.
1091
1092 2001-10-04  Dick Porter  <dick@ximian.com>
1093
1094         * object.h: Add a synchronisation mutex struct to MonoObject
1095
1096         * object.c (mono_new_object): Initialise the object
1097         synchronisation mutexes
1098
1099         * icall.c: System.Threading.Monitor internal calls
1100         
1101         * threads-pthread.h:
1102         * threads-pthread.c: System.Threading.Monitor internal calls
1103
1104         * threads-types.h: New file, includes the system-specific thread
1105         structures
1106         
1107         * threads-pthread-types.h:
1108         * threads-pthread-types.c: New files, handle pthread-specific
1109         synchronisation types
1110
1111         * threads-dummy-types.h: 
1112         * threads-dummy-types.c: New files of dummy support for
1113         thread-specific types
1114
1115         * metadata.c:
1116         * image.c:
1117         * pedump.c: include mono-endian.h not endian.h
1118         
1119         * Makefile.am: More threads files.
1120         Name mono-endian.h not endian.h
1121
1122 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
1123
1124         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
1125         stuff and implement a few more bits.
1126         * icall.c: a field needs to be dereferenced twice. Do not use the same
1127         name for two variables in the same scope.
1128         * image.c, image.h: cleanups.
1129
1130 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
1131
1132         * class.c (mono_class_metadata_init): bug fix: compute the right size
1133
1134 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
1135
1136         * icall.c: implemented some of the Reflection internalcalls.
1137         * image.c, image.h: start writing out the PE/COFF image.
1138         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
1139         that does the reverse than decode_blob_size ().
1140         * object.c: use mono_metadata_encode_value (). Move here
1141         temporary implementation of mono_string_to_utf8 ().
1142         * rawbuffer.c: make malloc_map static.
1143
1144 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
1145
1146         * metadata.c: fix type comparison for arrays.
1147         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
1148         Added a couple of new classes to monodefaults.
1149         * icall.c: added a couple of Reflection-related internalcalls.
1150         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
1151         Added a byval_arg MonoType to MonoClass.
1152
1153 2001-09-28  Dick Porter  <dick@ximian.com>
1154
1155         * icall.c:
1156         * threads-pthread.h: 
1157         * threads-pthread.c: Implemented internal calls for
1158         LocalDataStoreSlot operations.  Applied mutexes around all shared
1159         data.  Reworked the thread creation and Start() operations to
1160         avoid a race condition.
1161         
1162         * threads-dummy.h:
1163         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
1164
1165 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
1166
1167         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
1168
1169 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
1170
1171         * class.c, loader.c: warn and return NULL instead of erroring out.
1172         * icall.c: added System.AppDomain::getCurDomain().
1173         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
1174
1175 2001-09-25  Dick Porter  <dick@ximian.com>
1176
1177         * threads-pthread.h:
1178         * threads-pthread.c: Implemented timed thread joining and added
1179         System.Threading.Thread::Join_internal internal call
1180
1181         * icall.c: Added System.Threading.Thread::Join_internal internal call
1182
1183         * threads-dummy.h:
1184         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
1185
1186 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
1187
1188         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
1189         mono_string_intern () to implement the semantics of the ldstr opcode
1190         and the interning of System.Strings.
1191         * icall.c: provide hooks to make String::IsIntern and String::Intern
1192         internalcalls.
1193
1194 2001-09-23  Dick Porter  <dick@ximian.com>
1195
1196         * threads-dummy.c: 
1197         * threads-dummy.h: New files of dummy threading routines
1198
1199         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
1200         support code based on system specifics
1201
1202         Rename PTHREAD_LIBS to THREAD_LIBS
1203         
1204 2001-09-23  Dick Porter  <dick@ximian.com>
1205
1206         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
1207         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
1208         internal calls.
1209         (mono_thread_init): Set up a Thread object instance to return when
1210         the main thread calls Thread.CurrentThread
1211         (mono_thread_cleanup): Wait for all subthreads to exit
1212
1213         * icall.c: New internal calls for System.Threading.Thread::Sleep
1214         (including Schedule) and CurrentThread
1215
1216         * threads.h: New file, to insulate thread-specific stuff from the
1217         rest of the code
1218
1219 2001-09-21  Dick Porter  <dick@ximian.com>
1220
1221         * threads-pthread.h: 
1222         * threads-pthread.c: New file, for handling pthreads-style
1223         threading support.  Start() now starts a new thread and executes
1224         the ThreadStart delegate instance.
1225
1226         * icall.c: Added the internalcall for
1227         System.Threading.Thread::Start_internal
1228
1229         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
1230
1231 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
1232
1233         * loader.c: work around the different signatures for delegates
1234         constructors csc generates in compiled code vs the ones compiled in mscorlib.
1235
1236 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
1237
1238         * class.h, class.c: add mono_class_get_field_from_name ().
1239         * *: Fix C comments and other ANSI C issues.
1240
1241 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
1242
1243         * endian.h, assembly.c: fix some endianness issues.
1244
1245 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
1246
1247         * loader.h, load.c: add delegate_class to mono_defaults.
1248         Handle runtime provided methods in mono_get_method ().
1249
1250 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
1251
1252         * loader.c (mono_get_method): use pinvoke for internal call
1253
1254         * icall.c: use pinvoke for internal call
1255
1256         * loader.c (method_from_memberref): set the method name
1257
1258 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
1259
1260         * metadata.c: help the compiler generate better code for
1261         mono_class_from_mono_type ().
1262
1263 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
1264
1265         * class.c (mono_class_metadata_init): delayed computing of the
1266         class size to mono_class_metadata_init ()
1267
1268 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
1269
1270         * class.c, class.h: add an interfaces member to MonoClass.
1271         * image.c, image.h: add assembly_name field to MonoImage
1272         from the assembly table.
1273         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
1274
1275 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
1276
1277         * class.c: Handle Array in mono_class_from_mono_type ().
1278         * metadata.c, pedump.c: some endian fixes.
1279
1280 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
1281
1282         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
1283         * metadata.c: fix small problem introduced with the latest commit.
1284
1285 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
1286
1287         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
1288         We don't need a MonoMetadata pointer anymore to compare signatures in
1289         mono_metadata_signature_equal (), update callers.
1290         Reduced memory usage an number of allocations for MonoMethodHeader and
1291         MonoMethodSignature.
1292
1293 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
1294
1295         * metadata.c: added compare for szarray.
1296
1297 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
1298
1299         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
1300         and add a couple more types to it and mono_defaults. Give an hint on
1301         classes that need implementing in our corlib and are referenced
1302         in mscorlib.
1303
1304 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
1305
1306         * class.h, class.c: keep track if a class is also an Enum.
1307         * loader.c: Implement a couple more types for use in libffi
1308         marshalling. Gives better diagnostics when failing to dlopen
1309         a library. Set method->klass for P/Invoke methods, too.
1310
1311 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
1312
1313         * class.c, class.h: add a MonoType this_arg to MonoClass that
1314         represents a pointer to an object of the class' type that
1315         can be used by the interpreter and later the type cache.
1316         Add best guess alignment info for valuetype objects.
1317
1318 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
1319
1320         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
1321         into MonoType: one less level of indirection and allocation and
1322         simplifies quite a bit of code. Added cache for MonoTypes that are
1323         used frequently, so that we don't need to allocate them all the time.
1324
1325 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
1326
1327         * class.c (mono_class_create_from_typedef): System.Enum is also a
1328         value type, although it does not derive from System.ValueType
1329         (maybe a bug in the ms compiler?)
1330
1331         * metadata.c (mono_type_size): return the right size for value types
1332
1333         * loader.c (mono_get_method): only initialize method header if not abstract
1334
1335         * class.c (mono_class_from_mono_type): use mono_default values. 
1336
1337 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
1338
1339         * *: use MonoClass pointers instead of <type_tokens>
1340         
1341         * class.h: new flag: metadata_inited.
1342
1343         * class.c (mono_class_metadata_init): impl.
1344         (mono_class_instance_size): impl.
1345         (mono_class_data_size): impl.
1346
1347 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
1348
1349         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
1350         MonoClass now has the name and name_space fields. 
1351         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
1352         mono_get_method () takes and optional MonoClass as argument.
1353         Removed mono_typedef_from_name() and added mono_class_token_from_name()
1354         instead that takes advantage of a map from class names to typedef
1355         tokens in MonoImage.
1356
1357 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
1358
1359         * metadata.c: zero is not a valid alignment boundary.
1360         Merge MONO_TYPE_VOID in default decoding code.
1361
1362 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
1363
1364         * image.h: merged MonoMetadata into MonoImage
1365
1366         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
1367         identify the type of elements.
1368
1369 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
1370
1371         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
1372         * cil-coff.h: split MonoMSDOSHeader and add size info.
1373         * image.c: add some consistency checks.
1374         * metadata.c: fix row size computation: one programmer
1375         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
1376         add explanation for the locator routine.
1377         Fix decoding of size in method header.
1378         
1379 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
1380
1381         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
1382         (g_concat_dir_and_file): Bring g_concat_dir_and_file
1383         function from gnome-libs.  This uses the right path separator
1384         based on the OS, and also works around a bug in some systems where
1385         a double slash is not allowed. 
1386         (default_assembly_name_resolver): Use g_concat_dir_and_file
1387         (mono_assembly_open): ditto.
1388
1389 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
1390
1391         * metadata.c (mono_metadata_signature_equal): impl.
1392
1393         * *: void is now a realy MonoType (instead of using NULL)
1394         
1395         * metadata.c (do_mono_metadata_parse_type): use
1396         mono_metadata_parse_type to parse void value.
1397
1398 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
1399
1400         * metadata.c, metadata.h: in the signature and method header store
1401         only the space required for holding the loca vars and incoming arguments.
1402
1403 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
1404
1405         * metadata.c (do_mono_metadata_parse_type): treat void like any
1406         other type (instead of assigning NULL);
1407
1408 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
1409
1410         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
1411
1412 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
1413
1414         * image.c (do_mono_image_open): added a cache for arrays.
1415
1416 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
1417
1418         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
1419         decode a single column from a row in a metadata table and changes
1420         to take advantage of it in the typedef locator (gives a nice speed up).
1421         Store offset info for function params.
1422
1423 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
1424
1425         * image.h (MONO_IMAGE_IS_CORLIB): removed 
1426
1427 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
1428
1429         * assembly.c: how could mono_assembly_close () had ever worked?
1430         * metadata.c, metadata.h: provide offset info for local vars.
1431         Implement mono_type_size () to take care of alignment as well
1432         as size (it was mono_field_type_size in cli/class.c before).
1433
1434 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
1435
1436         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
1437
1438         * assembly.h (CORLIB_NAME): set to corlib.dll
1439
1440         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
1441
1442 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
1443
1444         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
1445         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
1446         tokentype.h: massive namespace cleanup.
1447
1448 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
1449
1450         * metadata.h, metadata.c: decode exception clauses when parsing method header.
1451
1452 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
1453
1454         * metadata.c (mono_metadata_free_type): added check for type !=
1455         NULL (void) before calling mono_metadata_free_type()
1456
1457 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
1458
1459         * metadata.h, row_indexes.h: added header with enumerations to use
1460         to index in the columns from tables in metadata and to decode coded
1461         tokens: we should start using this instead of embedding magic numbers
1462         all over the code.
1463
1464 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
1465
1466         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
1467         Move metadata_t info from cli_image_info_t to MonoImage, where
1468         it's easily accessible. Changed all the uses accordingly.
1469         Added the method and class caches to MonoImage.
1470         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
1471         and mono_metadata_decode_value () signature to be more consistent
1472         with the other parse functions (and simplify code). Taken advantage
1473         of zero-length array allocation with GCC. Removed reduntant (and
1474         wrong) MonoFieldType struct and use MonoParam instead. Changed
1475         mono_metadata_parse_field_type () to use common code for parsing.
1476         Added mono_metadata_typedef_from_field () and
1477         mono_metadata_typedef_from_method () to lookup a typedef index from a
1478         field or method token.
1479         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
1480
1481 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
1482
1483         * metadata.c (mono_metadata_parse_field_type): Implement. 
1484         (do_mono_metadata_parse_type): Split engine from
1485         mono_metadata_parse_type, so that we can create smaller structures
1486         for things that just have one pointer to the MonoType (look at
1487         the MonoFieldType)
1488
1489 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
1490
1491         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
1492         as Jan Gray found out, it is incorrect. 
1493
1494 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
1495
1496         * assembly.c: Implement asssembly loading.  This loads an image
1497         and loads all the referenced assemblies.  Come to think of it, we
1498         could always do lazy loading of the assemblies. 
1499
1500         * image.c (mono_image_open): Keep loaded images in a hashtable.
1501
1502         * image.h (MonoImage): Add reference count.
1503
1504 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
1505
1506         * assembly.c (mono_assembly_open): Keep track of the file name in
1507         case the assembly has no ASSEMBLY table.
1508
1509         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
1510         from get.c here.
1511
1512 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
1513
1514         * metadata.c, metadata.h: decode local vars in method header
1515         parse function. Change callers accordingly.
1516
1517 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
1518
1519         * metadata.h, cil-coff.h: protect against multiple inclusion.
1520         Added some new structures to hold information decoded from metadata:
1521         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
1522         and relevant decoding/free functions.
1523         * metadata.c: implement decoding functions. Add warning for out of bounds
1524         index in mono_metadata_locate(). Implement mono_get_method () to retreive
1525         all the info about a method signature and invocation. Remove check on
1526         uninitialized local var in parse_mh() and fix memory leak.
1527
1528 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
1529
1530         * metadata.h: More macros.
1531
1532         * tokentype.h: New file.
1533
1534 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
1535
1536         * assembly.c: added a consistency check and initialize
1537         some structures with g_new0().
1538         * metadata.c: fixed a couple more bugs in table size computation
1539         and add other checks for out-of bound access to metadata.
1540
1541 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
1542
1543         * metatada.c: fix bugs computing table sizes. Spew a
1544         warning when index in string heap is out of bounds.
1545
1546 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
1547
1548         * metadata.h: Add a couple of macros to manipulate tokens. 
1549
1550 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
1551
1552         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
1553         cli_section_tables).
1554
1555 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
1556
1557         * metadata.c (mono_metadata_user_string): New function, provides
1558         access to the UserString heap. 
1559
1560 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
1561
1562         * metadata.c: Add inline documentation.
1563
1564 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
1565
1566         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
1567         files. 
1568
1569 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
1570
1571         * typeattr.h: New file, TypeAttribute flags. 
1572
1573 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
1574
1575         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
1576         mono_assembly_ensure_section): Section loading code.
1577         (load_section_tables): Load the sections.
1578
1579         * mono/metadata/metadata.c (mono_metadata_locate_token,
1580         mono_metadata_locate): Functions to locate the information
1581         definition given a token or a table and an index.
1582         (mono_metadata_compute_table_bases): New.
1583         (compute_size): New function to compute the sizes of the various
1584         tables.
1585
1586         * mono/metadata/metadata.h: Finish listing the different index
1587         types. 
1588
1589         * mono/metadata/pedump.c: Improve to dump new information.
1590
1591 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
1592
1593         * mono/metadata/metadata.c: Entered all the tables matching
1594         Beta2. 
1595
1596         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
1597