e2a1855edccba432960101e195c89203296a5205
[mono.git] / mono / metadata / ChangeLog
1 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
2
3         * reflection.c (resolve_object): Inflate the inst with the context for
4         FieldOnTypeBuilderInst. Fixes #399010.
5
6 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7
8         * reflection.c (mono_image_get_field_on_inst_token): Don't
9         inflate the field to encode it's signature. If it's a
10         VAR or MVAR it should stay that way in the signature.
11         Fixes #399047.
12
13 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
14
15         * reflection.c (resolve_object): Release memory of inflated types.
16
17 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
18
19         * loader.c (mono_method_get_signature_full): Remove assert about
20         loading a methodspec to a generic method. We have such methods, such as
21         System.Threading.Interlocked::CompareExchange<T>.
22         This assert was removed since it crashes the verifier when it checks
23         methods calling CompareExchange<T>.
24
25 2008-06-10  Marek Safar  <marek.safar@gmail.com>
26
27         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
28         of Type array and not MonoType.
29
30 2008-06-10  Marek Habersack  <mhabersack@novell.com>
31
32         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
33         <lupus@ximian.com>
34
35 2008-06-10  Martin Baulig  <martin@ximian.com>
36
37         * debug-mono-symfile.h
38         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
39         changes to the file format, but we were generating incorrect
40         source file indices in the line number table due to a bug, which
41         made backtraces report an incorrect source file.
42
43 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
44
45         * mono-debug.c: Moved mono_debug_free_method_jit_info from
46         mini/debug-mini.c to here.
47
48         * mono-debug.c (il_offset_from_address): Free memory from find_method.
49
50         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
51         use it to release structs returned by mono_debug_find_method.
52
53 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
54
55         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
56         since it needs to set method->slot for all interface methods.
57
58 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
59
60         * class-internals.h: Forgot to add.
61
62 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
63
64         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
65
66         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
67         Lookup the custom attributes from property_hash.
68
69         * reflection.c (mono_save_custom_attrs): Save the custom attributes
70         in property_hash. Allocate all data using the image mempool.
71
72         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
73         for dynamic_custom_attrs to checks if the image is dynamic.
74
75 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
76
77         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
78         assemblies array.
79         
80         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
81         runtime functions while holding the domain assemblies lock.
82
83 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
84
85         * verify.c: Reapplied the last bit of the reverted changes.
86
87 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
88
89         * verify.c: Reapplied more of the reverted changes.
90
91 2008-06-09  Martin Baulig  <martin@ximian.com>
92
93         * debug-mono-symfile.c (load_symfile): Check the major version
94         first; if it's wrong, don't print the minor version in the error message.
95
96 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
97
98         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
99         lock instead of the domain lock to avoid deadlocks, since the thread might
100         already hold the loader lock.
101
102         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
103         (mono_thread_attach): Ditto.
104
105         * monitor.c: Use a TLS variable for holding the current thread id instead
106         of calling pthread_self ().
107         (mono_monitor_init_tls): New internal function to initialize the TLS
108         variable.
109         (mono_monitor_try_enter_internal): Put the owner == id check after the
110         owner == 0 check.
111
112         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
113         missed optimizations when using gcc-4.3.
114
115 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
116
117         * reflection.c (mono_dynamic_image_free): Free the memory
118         used by MonoGenericParam in MonoDynamicImage::gen_param.
119
120         * reflection.c (mono_reflection_setup_generic_class): Allocate
121         container from mempool.
122
123         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
124         container from mempool.
125
126 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
127
128         * threads.c (mono_set_pending_exception): New internal function to set the
129         pending exception of the current thread.
130         (mono_thread_get_and_clear_pending_exception): Check for 
131         thread->pending_exception as well.
132
133         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
134
135         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
136         it can trigger a collection.
137
138 2008-06-06  Martin Baulig  <martin@ximian.com>
139
140         Merged the `debugger-kahalo' branch.
141
142         * mono-debug.h
143         (MONO_DEBUGGER_VERSION): Bumped to 72.
144
145         * debug-mono-symfile.h
146         (MonoSymbolFileMethodIndexEntry): Removed.
147         (MonoSymbolFileMethodEntry): New public typedef.
148         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
149         (MonoSymbolFileSourceEntry): Remove everything except `index' and
150         `data_offset'.
151         (MonoSymbolFileMethodEntry): Removed.
152         (MonoSymbolFileLexicalBlockEntry): Removed.
153         (MonoSymbolFileLineNumberEntry): Removed.
154         (MonoDebugLexicalBlockEntry): Removed.
155         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
156         removed `num_il_offsets' and `il_offsets'.
157         (MonoSymbolFile): Replace `version' with `major_version' and
158         `minor_version'.
159         (MONO_SYMBOL_FILE_VERSION): Replace with
160         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
161         `MONO_SYMBOL_FILE_MINOR_VERSION'.
162
163         * debug-mono-symfile.c
164         (mono_debug_symfile_lookup_location): Add support for the new line
165         number table format.
166
167 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
168
169         * metadata.c (free_generic_class): Release the inflated
170         MonoClass of dynamic generic classes if it's not a generic
171         type definition.
172
173 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
174
175         * verify.c: Reapplied more of the reverted changes.
176
177 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
178
179         * reflection.c (lookup_custom_attr): Clean the cached flag or
180         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
181         for SRE types.
182
183 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
184
185         * verify.c: Reapplied a small part of the reverted changes.
186
187 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
188
189         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
190
191         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
192         previously in managed code.
193         (mono_monitor_exit): Ditto.
194         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
195
196         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
197         the managed definition.
198
199 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
200
201         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
202
203 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
204
205         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
206         
207         * monitor.c: Add some micro optimizations.
208
209         * icall.c (type_from_typename): Handle 'bool'.
210
211 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
212
213         * verify.c: Implement constructor verification per P III 1.8.1.4.
214         Fixes #396716.
215
216 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
217
218         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
219         holding the assemblies lock here too.
220
221 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
222
223         * verify.c: Kill stack_top function.
224
225 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
226
227         * verify.c: Kill stack_get function.
228
229 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
230
231         * verify.c (mono_method_verify): Last change broke the build. Fixed.
232
233 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
234
235         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
236         more reliable.
237
238         * verify.c (mono_method_verify): Inflate params and locals to avoid
239         mismatch when checking for compatibility.
240
241 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
242
243         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
244         Length prefix should be size in bytes. Fix bug #339530.
245         
246         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
247         Length prefix should be size in bytes. Fix bug #339530.
248
249         Code is contributed under MIT/X11 license.
250
251 2008-06-05  Bill Holmes <billholmes54@gmail.com>
252
253         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
254
255         Contributed under MIT/X11 license.
256
257 2008-06-05  Martin Baulig  <martin@ximian.com>
258
259         * mono-debug-debugger.c
260         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
261
262 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
263
264         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
265         while holding the assemblies lock to prevent deadlocks. Handle the case
266         where the search hook returns NULL but the assembly was still loaded.
267         Fixes #323696.
268
269         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
270         modify domain state.
271
272 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
273
274         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
275         * Makefile.am (pedump_LDADD): Post-process object files and
276         add dtrace-generated object file, if necessary.
277
278         Code is contributed under MIT/X11 license.
279
280 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
281
282         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
283
284 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
285
286         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
287
288 2008-06-04  Mark Probst  <mark.probst@gmail.com>
289
290         * threads.c: Try to free everything from the delayed free table
291         when shutting down threads, and set the variable to NULL after the
292         table is freed so that calling
293         mono_thread_hazardous_try_free_all() when shutting down the root
294         domain doesn't crash.
295
296 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
297
298         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
299         the caller if resulting type was inflated.
300
301         * class.c (mono_class_create_from_typespec): Free the MonoType if it
302         was inflated.
303
304         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
305
306
307 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
308
309         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
310         class library tests.
311
312         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
313         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
314         #396989.
315
316 2008-06-04  Mark Probst  <mark.probst@gmail.com>
317
318         * domain.c, domain-internals.h: The JIT infos are now freed by the
319         JIT info table code.  They are freed immediately if there only a
320         single JIT info table in circulation.  If there is more, the free
321         is delayed via a queue.
322
323         * threads.c, threads-types.h: New hazard pointer function for
324         freeing all freeable delayed items in one sitting.
325
326 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
327
328         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
329
330         * reflection.c (typebuilder_setup_properties): Same.
331
332         * reflection.c (typebuilder_setup_events): Same.
333
334 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
335
336         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
337         and use it for allocating memory.
338
339         * reflection.c (mono_marshal_spec_from_builder): Same.
340
341         * reflection.c: Change code to use new signatures.
342
343         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
344
345 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
346
347         * decimal.c (rescale128): Put back one line which was accidently commented
348         out.
349         
350         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
351         to cause crashes.
352
353 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
354
355         * reflection.c (mono_reflection_generic_class_initialize): Name must
356         be always malloc'ed so we can free it later on. Do this for field, property
357         and event.
358
359         * metadata.c (free_generic_class): Free field, property and event names.
360
361 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
362
363         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
364         instead of g_memdup.
365
366         * reflection.c (typebuilder_setup_fields): Same.
367
368 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
369
370         * decimal.c (rescale128): Optimize this function a bit more.
371
372 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
373
374         * metadata.c (free_generic_class): Release some memory from
375         SRE generic classes.
376
377 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
378
379         * reflection.c (mono_image_get_generic_field_token): No reference
380         to name is kept, free it.
381
382         * reflection.c (mono_reflection_generic_class_initialize): Free
383         more memory of the inflated field.
384
385 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
386
387         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
388         code.
389
390 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
391
392         * reflection.c (mono_dynamic_image_free): Release memory used by
393         MonoDynamicImage::array_methods elements.
394
395         * reflection.c (assembly_add_win32_resources): Release memory after
396         encoding.
397
398 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
399
400         * decimal.c (log2_32): Use an optimized version for this function too.
401         
402         * decimal.c (log2_64): Fix this on 32 bit machines.
403
404 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
405
406         * class.c (mono_dup_array_type): Implement allocation using a mempool.
407
408         * class.c (mono_metadata_signature_deep_dup): Same.
409
410         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
411         a mempool.
412
413         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
414
415         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
416
417         * metadata-internals.h: Added mono_metadata_signature_dup_full.
418
419         * class-internals.h: Update signatures to take a MonoMemPool.
420
421 2008-06-02  Dick Porter  <dick@ximian.com>
422
423         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
424         * icall-def.h: Add
425         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
426         FormatMessage API to get the error text.  Fixes bug 321827.
427
428 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
429
430         * decimal.c: Add some micro optimizations to make decimal operations faster.
431
432 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
433
434         * reflection.c (method_encode_clauses): Take a mempool
435         as parameter and use it to allocate the clause array.
436
437         * reflection.c (mono_image_get_field_on_inst_token): Free
438         the inflated type after encoding it.
439
440         * reflection.c (mono_dynamic_image_free): Free each element
441         of MonoDynamicImage::gen_params.
442
443         * reflection.c (reflection_methodbuilder_to_mono_method):
444         Allocate the generic param array from the mempool.
445         Allocate signature params from the mempool.
446
447         * reflection.c (mono_reflection_generic_class_initialize):
448         Free inflated fields after been used.
449
450 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
451
452         * icall.c: Reapply the memory leak fixes as they no
453         longer make mono crash.
454
455 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
456
457         * reflection.c (mono_type_get_object): Don't store the suplied
458         MonoType with type_hash. A caller which pass a type that
459         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
460         might end with a pointer to freed memory.
461         The solution is to use byval_arg or this_arg from the associated
462         MonoClass of the supplied type.
463
464 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
465
466         * icall.c: Revert the rest of the last change as it breaks the build too.
467
468 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
469
470         * icall.c: Revert a leak fix as it's breaking the build.
471
472 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
473
474         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
475
476 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
477
478         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
479
480 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
481
482         * icall.c: Fix some memory leaks.
483
484 2008-05-29  Dick Porter  <dick@ximian.com>
485
486         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
487         async socket operations from the pending list when a socket
488         closes.  Leaving it until the threadpool services the event
489         exposes a race condition when a socket descriptor is reused.
490         Fixes bug 377589.
491
492 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
493
494         * object.c: Fix negative index check for array alocation.
495
496 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
497
498         * icall.c, marshal.c: Delegate wrappers should skip visibility.
499         This check is performed by the verifier for IL created delegates
500         and by Delegate::CreateDelegate for programatically created ones.
501         Fixes #372406.
502
503 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
504
505         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
506         Fix code to use mono_array_size_t instead of int.
507
508         Based on patch by Luis F. Ortiz.
509         Contributed under X11 license.
510         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
511
512 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
513
514         * icall.c: Added ves_icall_System_Array_GetLongLength and
515         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
516         arrays.
517
518         * icall.h: Export both new functions.
519
520         Based on patch by Luis F. Ortiz.
521         Contributed under X11 license.
522         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
523
524 2008-05-28  Martin Baulig  <martin@ximian.com>
525
526         The debugger now requires exactly r103463.
527
528         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
529         This version is not supported by the debugger, wait for 72.
530
531 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
532
533         * object.h: Changed array related functions to use
534         mono_array_size_t instead of guint32. Forgot to commit this file.
535
536         Patch by Luis F. Ortiz.
537         Contributed under X11 license.
538         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
539
540
541 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
542
543         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
544         don't define it. Use the number literal instead.
545
546 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
547
548         * icall.c: Changed array related functions to use
549         mono_array_size_t instead of guint32.
550
551         * icall.c (ves_icall_System_Array_GetLength): Check for length
552         overflow under MONO_BIG_ARRAYS.
553
554         Based on patch by Luis F. Ortiz.
555         Contributed under X11 license.
556         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
557
558 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
559
560         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
561
562         Based on patch by Luis F. Ortiz.
563         Contributed under X11 license.
564         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
565
566 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
567
568         * object.c, object.h: Changed array related functions to use
569         mono_array_size_t instead of guint32.
570
571         Patch by Luis F. Ortiz.
572         Contributed under X11 license.
573         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
574
575 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
576
577         * object.h: Introduced mono_array_size_t typedef. This must be used
578         in all places an array length is expected. This is 64bits wide if
579         MONO_BIG_ARRAYS is enabled.
580
581         Patch by Luis F. Ortiz.
582         Contributed under X11 license.
583         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
584
585 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
586
587         * security-manager.c class.c: Set the class exception info by calling
588         mono_class_set_failure ().
589
590         * class.c (mono_class_get_exception_data): New accessor function.
591         (mono_class_set_failure): Store exception_data in the property hash.
592
593         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
594         the struct as a property.
595
596         * loader.c (mono_get_method_full): Store the lookup result for method
597         tokens in method_cache, the others in methodref_cache to decrease the memory
598         usage of hash tables.
599
600         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
601         (mono_image_init): method_cache is lazy inited now.
602
603         * metadata-internals.h (struct _MonoImage): Change method_cache to
604         a MonoValueHashTable, add a separate methodref_cache.
605
606 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
607
608         * number-formatter.h: Fix tables to avoid arithemtic overflow in
609           Double.ToString as exposed by Bug #383531.
610
611 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
612
613         * number-formatter.h: Make some tables static.
614
615         * class.c (mono_method_set_generic_container): New accessor function.
616         (mono_method_get_generic_container): Ditto.
617
618         * class-internals.h (struct _MonoMethod): Remove rarely used 
619         'generic_container' field, store it in the property hash instead. Add 
620         'is_generic' boolean field instead.
621
622         * image.c (mono_image_init): Initialize property_hash.
623         (mono_image_close): Destroy property_hash.
624
625         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
626         hold rarely used fields of runtime structures belonging to this image.
627
628         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
629         to get/set method->generic_container.
630
631         * loader.c (mono_get_method_from_token): Avoid loading the method header for
632         generic methods.
633
634 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
635
636         * class.c (mono_class_inflate_generic_method_full): Don't increase
637         mono_stats.inflated_method_count for methods found in the cache.
638
639         * threads.c (mono_thread_request_interruption): Add a comment about 
640         QueueUserAPC ().
641
642 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
643
644         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
645         interface_offsets_packed table.
646         
647         * class.c (mono_class_init): Remove some dead code.
648
649         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
650         mono_class_setup_vtable () when CAS is active to detect security problems.
651
652 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
653
654         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
655
656         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
657         parameters as it's irrelevant for delegate checking.
658
659 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
660
661         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
662
663         * class.c (mono_class_init): Control the creation of a generic vtable using
664         a global which is true by default, but set to false by the runtime startup code.
665         
666         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
667         Disabled for now since it breaks the embedding API.
668         Move the setup of class->methods for arrays to mono_class_setup_methods ().
669         (mono_class_setup_methods): Add a memory barrier.
670
671         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
672         when mono_class_init () doesn't compute the generic vtable.
673         
674 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
675         * profiler.c: Added mono_profiler_install_statistical_call_chain,
676         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
677         to support call chains (backtrace) in the stat profiler.
678         * profiler.c, profiler-private.h: Likewise.
679
680 2008-05-22  Mark Probst  <mark.probst@gmail.com>
681
682         * generic-sharing.c: Init generic class when a method of it is
683         requested via a runtime generic context.
684
685 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
686
687         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
688
689         * reflection.c (mono_type_get_object): Add a FIXME.
690
691         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
692
693         * class.c (mono_class_get_method_by_index): New helper function, returning an
694         entry in the class->methods array.
695
696 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
697
698         * class.c (mono_class_init): Only do the array optimization for szarrays. 
699         Avoid creating a generic vtable for generic instances as well.
700         (mono_class_get_method_from_name_flags): Don't search in the metadata for
701         generic instances.
702
703 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
704
705         * loader.c (mono_get_method_constrained): Inflate the signature
706         with class context. Fix #325283.
707
708 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
709
710         * object.c (mono_class_create_runtime_vtable): Add a comment.
711
712         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
713         where needed.
714         (setup_interface_offsets): Handle the case when this is called twice for arrays.
715         (mono_class_setup_vtable_general): Add an assert.
716         (mono_class_init): Avoid creating a generic vtable for arrays.
717
718         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
719         here, let mono_class_init () do that.
720
721         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
722         interfaces in mscorlib.
723
724         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
725         interfaces. Add some comments.
726         (mono_class_init): Call mono_class_setup_methods () here since it is no
727         longer called by mono_class_setup_vtable ().
728
729         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
730         not set in class->vtable.
731         (mono_class_create_runtime_vtable): Reenable the disabled code.
732
733         * object.c (mono_class_create_runtime_vtable): Disable the last change for
734         now as it causes some test failures.
735
736         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
737         if using the vtable trampoline. Also remove some strange code which put the
738         generic methods themselves into the vtable slots. Remove the AOT init_vtable
739         stuff as it is no longer needed.
740
741 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
742
743         * pedump.c: Give make --verify all option check code as well.
744         Using --verify code won't check for metadata now.
745
746 2008-05-19  Martin Baulig  <martin@ximian.com>
747
748         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
749
750         * mono-debug.c
751         (_mono_debug_using_mono_debugger): New global variable; it's set
752         directly by the debugger, so mono_debug_using_mono_debugger() also
753         works after attaching.
754
755 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
756
757         * object.c (mono_class_create_runtime_vtable): Use memory barriers
758         as we do double checked locking on MonoClass::runtime_info and
759         MonoClassRuntimeInfo::domain_vtables.
760
761 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
762
763         * debug-helpers.c (print_field_value): Fix a warning.
764
765 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
766
767         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
768         set in the AOT case.
769
770 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
771
772         * class.c (mono_class_setup_vtable_general): Use memory barriers
773         as we do double checked locking on MonoClass::vtable.
774
775 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
776
777         * reflection.c (resolve_object): Inflate only if the generic context
778         is not null. Fixes #389886.
779
780 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
781
782         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
783         instead of g_free.
784
785         Code is contributed under MIT/X11 license.
786
787 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
788
789         * class.c: Revert unrelated change.
790
791 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
792
793         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
794         a generic instantiation, use mono_class_from_mono_type instead of playing
795         with MonoType directly.
796
797 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
798
799         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
800         checks must ignore generic instantiations, so mono_class_has_parent is not
801         suitable. Fixes #390128.
802
803 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
804
805         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
806         it to avoid registering tokens during metadata generation. Fixes #390023.
807
808 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
809
810         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
811         consistent.
812
813         Contributed under MIT/X11 license.
814
815 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
816
817         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
818         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
819         to fixup the EXE image.
820         (mono_cleanup): Use mono_close_exe_image.
821         (mono_close_exe_image): New function.
822         * image.c: Include "marshal.h".
823         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
824         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
825         counting when the image is loaded outside of mono_image_open_full. Set status
826         based on GetLastError.
827         * coree.c: Include required headers. Add init_from_coree.
828         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
829         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
830         (_CorExeMain): Set init_from_coree.
831         (CorExitProcess): Only call ExitProcess for now.
832         (CorBindToRuntimeEx): New stub implementation.
833         (CorBindToRuntime): New function.
834         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
835         (MonoFixupExe): ILONLY executables require no fixups.
836         (mono_set_act_ctx): New function to set activation context.
837         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
838         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
839         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
840         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
841         as MONO_INTERNAL.
842         * domain-internals.h: Add mono_close_exe_image.
843
844         Contributed under MIT/X11 license.
845
846 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
847
848         * metadata.c (mono_metadata_compute_size): Correctly calculate field
849         size for generic param and event tables. Fixes #388977.
850
851 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
852
853         * loader.c (mono_method_signature): Use memory barriers because of the double
854         checked locking pattern.
855
856         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
857         aborting or aborted as well. Fixes #376391.
858         
859         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
860         existing runtime state in the Suspend handler during shutdown.
861
862 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
863
864         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
865
866         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
867         which are starting up or shutting down.
868
869         * threads.c (mono_threads_set_shutting_down): Don't return a value since
870         this function never returns if the runtime is already shutting down.
871
872         * icall.c (ves_icall_System_Environment_Exit): Update after 
873         mono_threads_set_shutting_down () signature change.
874         
875 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
876
877         * class.c: Added can_access_instantiation to verify if the instantiation
878         is visible. Fix access check for nested types as they returned TRUE
879         before doing type and generic instantiation visibility checks.
880
881 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
882
883         * reflection.c (mono_reflection_create_generic_class): The created type
884         must have a different container from its TypeBuilder. Otherwise they
885         will end sharing generic arguments, which is wrong.
886
887         Due to the sharing, making a generic instance of the created type using
888         the TypeBuider generic arguments resulted in the generic type definition
889         been returned, which is wrong as well.
890
891         As a bonus the code was leaking the type_params array. This memory should
892         be allocated from the image mempool.
893
894         This fixes bug #354047.
895
896 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
897
898         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
899         to here         as they are now used in assembly.c new code.
900         Added a skipverification flag to MonoAssembly.
901         New internal function mono_assembly_has_skip_verification.
902
903         * assembly.c: New function mono_assembly_has_skip_verification. It checks
904         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
905         part of #387274.
906
907 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
908
909         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
910         needed. Fixes #387034.
911
912         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
913
914 2008-05-06  Miguel de Icaza  <miguel@novell.com>
915
916         * assembly.c (mono_assembly_load_reference): Prevent crash while
917         disassembling Silverlight 2.0 executables while we still do not
918         have GACed libraries.
919
920 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
921
922         * reflection.c: Special case generic type definitions as well. Fixes #383444.
923
924 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
925
926         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
927         of the dynamic case. Fixes #387404.
928
929 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
930
931         *verify.c (mono_verifier_is_class_full_trust): If under
932         verify_all and the verifier mode was not set, only
933         gac and corlib types are fulltrust. This makes --verify-all
934         usable to detect unverifiable code, which is the expected
935         use case.
936
937 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
938
939         * verify.h: Ops, commited the header with debug
940         enabled.
941
942 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
943
944         * verify.c (merge_stack): Use the new value on unverifiable
945         stack merges.
946
947         * verify.c (verify_type_compatibility_full): Comparison
948         of nullable types can't use mono_class_is_assignable_from.
949
950         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
951         that makes all verification errors be reported.
952
953         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
954         mono_method_verify.
955
956 2008-05-05  Robert Jordan  <robertj@gmx.net>
957
958         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
959         support for value types. See #386415.
960
961         * object.c: comments.
962
963         Code is contributed under MIT/X11 license.
964
965 2008-05-05  Martin Baulig  <martin@ximian.com>
966
967         * debug-mono-symfile.h
968         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
969         for old pre-terrania symbol files.
970
971 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
972
973         * mono-config.c: Add ppc64 architecture.
974
975         Code is contributed under MIT/X11 license.
976
977 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
978
979         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
980           PPC64 uses function descriptors as well.
981
982         Code is contributed under MIT/X11 license.
983
984 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
985
986         * object.c (compute_class_bitmap): Ignore literal static fields.
987
988         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
989         var has an invalid format.
990         (describe_ptr): Add some sanity checks for the vtable.
991         (add_nursery_frag): Clear unused nursery fragments.
992         (major_collection): Clear all remaining nursery fragments.
993
994 2008-05-03  Robert Jordan  <robertj@gmx.net>
995
996         * image.c, metadata-internals.h: add thunk_invoke_cache.
997
998         * marshal.c, marshal.h: implement
999         mono_marshal_get_thunk_invoke_wrapper ().
1000
1001         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
1002
1003         Code is contributed under MIT/X11 license.
1004
1005 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
1006
1007         * verify.c (do_leave): Empty the stack.
1008
1009 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
1010
1011         * class.c (mono_class_is_assignable_from): Variance
1012         doesn't work between reference and value types. For example,
1013         given type C<T+>, C<int32> is not assignable to C<object>.
1014         Break the argument checking loop on first error. 
1015
1016 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
1017
1018         * icall.c : base64_to_byte_array() needs some more strict
1019           check for sequence of '=' characters. Patch by Santa
1020           Marta (http://deee.g.hatena.ne.jp/santamarta).
1021
1022           Contributed under MIT/X11 license.
1023           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
1024
1025 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
1026
1027         * domain.c: Disable LoadLibrary support to fix Win32 build.
1028
1029         Code is contributed under MIT/X11 license.
1030
1031 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
1032
1033         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
1034         to help with cache behaviour.
1035
1036 2008-05-01  Miguel de Icaza  <miguel@novell.com>
1037
1038         * appdomain.c (mono_domain_from_appdomain): Add new accessor
1039         method. 
1040
1041 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
1042
1043         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
1044
1045 2008-05-01  Dick Porter  <dick@ximian.com>
1046
1047         * process.c (process_get_fileversion): Only pass 16 bits of
1048         language ID to VerLanguageName.  Fixes bug 381204.
1049
1050 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
1051
1052         * verify.c (mono_method_verify): Fix the comparison
1053         operator for code bounds check.
1054
1055 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
1056
1057         * verify.c (mono_method_verify): Check the bounds of
1058         all access of the code array.
1059
1060 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
1061
1062         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
1063
1064 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
1065
1066         * image.c (mono_image_strong_name_position): Fix return value when the rva is
1067         not valid.
1068
1069 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
1070
1071         * loader.c (mono_get_method_from_token, mono_method_signature): Add
1072         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
1073         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
1074         fixup main EXE images when using mono.exe for mixed-mode assembly support.
1075         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
1076         mono_runtime_load.
1077         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
1078         runtime initialization from metadata.
1079         * assembly.c: Remove obsolete ceGetModuleFileNameA.
1080         (mono_set_rootdir): Use mono_get_module_file_name.
1081         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
1082         handles.
1083         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
1084         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
1085         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
1086         MonoCLIImageInfo. Add support for module handles.
1087         (load_cli_header): Update mono_cli_rva_image_map signature.
1088         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
1089         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
1090         (mono_image_rva_map): Add support for module handles.
1091         (mono_image_ensure_section_idx): Add support for module handles.
1092         (mono_image_close): Add support for module handles.
1093         (do_load_header): Add support for module handles.
1094         (mono_image_open_from_module_handle): New function for internal use.
1095         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
1096         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
1097         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
1098         handles.
1099         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
1100         * image.h: Add mono_image_fixup_vtable.
1101         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
1102         support.
1103         * coree.h: New file.
1104         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
1105         unsupported native code.
1106         (mono_marshal_set_callconv_from_modopt): New function splitted from
1107         mono_marshal_get_managed_wrapper.
1108         (mono_marshal_get_managed_wrapper): Use
1109         mono_marshal_set_callconv_from_modopt.
1110         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
1111         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
1112         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
1113         that results in a deadlock when the runtime is loaded in _CorDllMain.
1114         * Makefile.am: Add coree.c and coree.h.
1115
1116         Contributed under MIT/X11 license.
1117
1118 2008-04-28  Mark Probst  <mark.probst@gmail.com>
1119
1120         * generic-sharing.c: Search for type arguments in array element
1121         types as well.
1122
1123 2008-04-28  Mark Probst  <mark.probst@gmail.com>
1124
1125         * class-internals.h, generic-sharing.c: New, small runtime generic context.
1126
1127         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
1128
1129         * object.c: Don't setup the RGCTX when the vtable is created,
1130         because we're setting it up lazily now.
1131
1132 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
1133
1134         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
1135         64 bit support.
1136
1137 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
1138
1139         * verify.c (verify_class_for_overlapping_reference_fields): 
1140         If class is under fulltrust allow reference types to overllap
1141         if they have the same RVA.
1142
1143 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
1144
1145         * pedump.c: Added new flag valid-only, that makes the verifier
1146         behaves just like --security=validil. It won't fail type load
1147         due to unverifiable restrictions.
1148
1149 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
1150
1151         * class-internals.h (struct MonoMethod): Added a verification_success
1152         field to cache verifier executions. Reduced MonoMethod:slot size by
1153         one bit.
1154
1155 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
1156
1157         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
1158         instead of a 'vt' argument to save an indirection and to allow these to be used
1159         for valuetypes.
1160         (scan_vtype): New helper function to scan an area using a gc descriptor.
1161         (mono_gc_wbarrier_value_copy): Implement this.
1162         (handle_remset): Add support for REMSET_VTYPE.
1163         (find_in_remset_loc): Ditto.
1164         (mono_gc_base_init): Allow some debugging options to be controlled through the
1165         use of the MONO_GC_DEBUG env variable.
1166         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
1167         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
1168
1169 2008-04-23  Martin Baulig  <martin@ximian.com>
1170
1171         * domain.c (mono_domain_create): Move the call to
1172         mono_debug_domain_create() down, after allocating the domain id.
1173
1174 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
1175
1176         verify.c (verify_class_for_overlapping_reference_fields): Skip
1177         static fields while verifying for overlapping fields as they
1178         don't matter at all.
1179
1180 2008-04-23  Marek Habersack  <mhabersack@novell.com>
1181
1182         * domain-internals.h: added a declaration of
1183         mono_make_shadow_copy.
1184
1185         * assembly.c (mono_assembly_open_full): shadow copying of
1186         assemblies moved to here, so that all the assemblies within the
1187         application domain's private binary directories can be
1188         processed. Fixes bug #380546
1189
1190         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
1191         mono_make_shadow_copy and made non-static. The decision whether
1192         to shadow-copy an assembly is made based on its location - it's
1193         copied if it's in one of the private application domain binary
1194         directories and its different to the target file in the shadow
1195         directory. Fixes bug #380546
1196
1197 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
1198
1199         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
1200
1201         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
1202         types.
1203
1204         * reflection.c (mono_image_create_token): Handle 
1205         Method/ConstructorOnTypeBuilderInst.
1206         (resolve_object): Ditto.
1207         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
1208         so it can be called from resolve_object. Also handle the case when the inflated
1209         class already has its methods setup.
1210
1211 2008-04-21  Martin Baulig  <martin@ximian.com>
1212
1213         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
1214
1215 2008-04-20  Geoff Norton  <gnorton@novell.com>
1216
1217         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
1218         pointer dereference.
1219
1220 2008-04-15  Marek Habersack  <mhabersack@novell.com>
1221
1222         * appdomain.c (try_load_from): if IOMAP is in effect, call the
1223         portability API to look up the assembly file. Fixes behavior in
1224         situations when the application has a bin/ directory, but the
1225         assembly search patch refers to Bin/ (and thus the requested file
1226         name is Bin/SomeLibrary.dll). Fixes bug #379888
1227
1228 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
1229
1230         verify.c (mono_type_is_generic_argument): Extracted this check
1231         from a dozen places to here.
1232
1233         verify.c: Fixed all issues related to boxing generic arguments
1234         and their constraints.
1235
1236 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
1237
1238         verify.c (mono_class_interface_implements_interface): Fix win32 build.
1239
1240 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
1241
1242         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
1243         isn't finished yet. Fixes #363447.
1244
1245 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
1246
1247         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
1248         Fixes #346419.
1249
1250 2008-04-13  Jb Evain  <jbevain@novell.com>
1251
1252         * domain.c: update the 2.1 profile versions.
1253         Merged from the Moonlight 2 branch.
1254
1255 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
1256
1257         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
1258         mscorlibs for the non-refonly case as well.
1259
1260         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
1261         in mono_assembly_load_from_full (). Fixes #378924.
1262
1263 2008-04-11  Geoff Norton  <gnorton@novell.com>
1264
1265         * icall.c: The global extern environ doesn't exist on Mac.  We
1266         need to call NSGetEnviron instead.
1267
1268 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
1269
1270         verify.c: Add generic method constraint verification.
1271
1272 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
1273
1274         class.c (mono_class_inflate_generic_method_full): Add a long
1275         explanation to the is_mb_open hack. Remove the FIXME.
1276
1277 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
1278
1279         * verify.c (mono_method_verify): Mark all unknown opcodes
1280         as invalid. Mark jmp as unverifiable.
1281
1282 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
1283
1284         * verify.c: Add code to do type constraint verification on class instances.
1285
1286         * verify.c (mono_verifier_verify_class): Use the type constraint 
1287         verification code.
1288
1289 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
1290
1291         * class.c (mono_class_get_field_default_value): Don't pass cindex
1292         as hint to mono_metadata_get_constant_index. The local is not initialized
1293         and should contain garbage most of the time. This could only work
1294         with a lot of luck.
1295
1296 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
1297
1298         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
1299
1300 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
1301
1302         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
1303
1304         * class.c (mono_class_from_generic_parameter): Save the token of the
1305         generic param in MonoClass::sizes.generic_param_token.
1306
1307         * reflection.c (mono_custom_attrs_from_class): If the class type is
1308         VAR or MVAR retrieve the attributes of the generic param.
1309
1310 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
1311
1312         * class.c (mono_class_init): Do class verification if the verifier
1313         is enabled.
1314
1315 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
1316
1317         * verify-internal.h: Added mono_verifier_verify_class.
1318
1319         * verify.c: Added mono_verifier_verify_class. It checks for
1320         classes with explicit layout that have overlapping reference fields.
1321
1322         * pedump.c: Init the verifier state prior to verification. Fixed
1323         command line arguments.
1324
1325 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
1326
1327         * Makefile.am: Added verify-internals.h, hopefully fix the build.
1328
1329 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
1330
1331         * verify-internals.h: Fix a warning.
1332
1333 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
1334
1335         * verify-internals.h: New header with the verifier configuration
1336         extracted from mini.c.
1337
1338         * verify.c: Implemented the new functions exported by verify-internals.h.
1339
1340 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
1341
1342         * verify.c: Add proper verification of ckfinite.
1343
1344 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
1345
1346         * verify.c (do_conversion): Improved error message to something
1347         more meanfull.
1348
1349         * verify.c (check_is_valid_type_for_field_ops): Fix to work
1350         with primitive types.
1351
1352 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
1353
1354         * verify.c: Added tail prefix checking. Marked icall
1355         as unverifible.
1356
1357 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
1358
1359         * verify.c: Fix the detection of branches to the middle
1360         of an instruction.
1361
1362 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
1363
1364         * verify.c: Implemented verification of volatile. and
1365         unaligned. prefix. Check if a type is valid after retrieving it.
1366
1367 2008-04-01  Dick Porter  <dick@ximian.com>
1368
1369         * process.c (process_get_fileversion): If there's no string block,
1370         set the file language to en_US.  Fixes the other new part of bug
1371         374600.
1372
1373 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
1374
1375         * class.c: New functions mono_method_can_access_field_full and
1376         mono_method_can_access_method_full. They perform type visibility
1377         and type site check.
1378
1379         * class-internal.h: Added exported functions.
1380
1381         * verify.c: Use new functions to implement proper visibility checks.
1382
1383 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
1384
1385         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
1386
1387 2008-03-28  Dick Porter  <dick@ximian.com>
1388
1389         * process.c (process_get_fileversion): Use the first language ID
1390         we see, rather than insisting on an invariant language.  Fixes bug
1391         374600.
1392
1393 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
1394
1395         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
1396         the streams to fix reading of invalid memory later.
1397
1398         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
1399         to ease debugging.
1400
1401 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
1402
1403         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
1404         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
1405
1406 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
1407         * threads.h: Added MonoThreadManageCallback type and
1408         mono_thread_set_manage_callback prototype
1409         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
1410         (used to store the mono_thread_manage callback).
1411         * threads.c: Added mono_thread_set_manage_callback, and handle
1412         "MonoThread->manage_callback" in build_wait_tids.
1413
1414 2008-03-26  Dick Porter  <dick@ximian.com>
1415
1416         * process.c (process_get_fileversion): Set FileVersionInfo strings
1417         to Empty when the resource doesn't have the particular info.
1418         Fixes bug 355717.
1419
1420 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
1421
1422         * verify.c (mono_method_verify): Proper prefix validation.
1423
1424 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
1425
1426         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
1427         itself in a separate argument instead of throwing them. Fixes #373448.
1428
1429         * appdomain.c: Bump corlib version.
1430
1431 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
1432
1433         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
1434
1435 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
1436
1437         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
1438         version macros.
1439
1440 2008-03-20  Mark Probst  <mark.probst@gmail.com>
1441
1442         * generic-sharing.c, class-internals.h: Code for putting
1443         reflection types into the runtime generic context.
1444
1445 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
1446
1447         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
1448         Fixes #340662. 
1449
1450
1451 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
1452
1453         * verify.c (VerifyContext): Added instruction prefix data to the struct.
1454
1455         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
1456
1457         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
1458
1459         * verify.c (do_cast): Let the result value keep the boxed status.
1460
1461         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
1462
1463 2008-03-17  Jb Evain  <jbevain@novell.com>
1464
1465         * reflection.c: when running on a 2.0 runtime, emit
1466         unconditionally the #~ header version as 2.0, and the
1467         CLI header version as 2.5, for symmetry's sake with csc.
1468
1469 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
1470
1471         * class.c: Remove the unused cache_interface_offsets stuff.
1472
1473         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
1474         profiler.c: Fix warnings.
1475
1476 2008-03-16  Mark Probst  <mark.probst@gmail.com>
1477
1478         * generic-sharing.c, class-internals.h: Support for putting
1479         methods into the runtime generic context.
1480
1481 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
1482
1483         * class.c (mono_class_setup_fields): Ignore calls made to this function for
1484         classes which are generic instances of not-yet finished typebuilders. Fixes
1485         #351172.
1486
1487         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
1488
1489 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
1490
1491         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
1492
1493         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
1494         field, replace it with a hash table in MonoDynamicImage.
1495
1496         * reflection.c (inflate_mono_method): Access the generic definition object from
1497         image->generic_def_objects instead of imethod->reflection_info.
1498
1499         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
1500
1501         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
1502         
1503         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
1504         function in reflection.c so it is easier to keep in sync with the dynamic image
1505         creation code.
1506
1507         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
1508         mono_image_close ().
1509
1510 2008-03-15  Mark Probst  <mark.probst@gmail.com>
1511
1512         * class.c (mono_class_generic_sharing_enabled): Disable generic
1513         sharing for all architectures except AMD64 and x86 to fix build.
1514
1515 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
1516
1517         * verify.c: Use the generic definition MonoGenericContext when available.
1518         Remove code for checking generics instance compatibility in favor of
1519         mono_class_is_assignable_from.
1520
1521 2008-03-14  Mark Probst  <mark.probst@gmail.com>
1522
1523         * marshal.c, marshal.h, metadata-internals.h, image.c,
1524         wrapper-types.h: New wrapper for invoking a shared static method
1525         without having to pass the runtime generic context argument.
1526
1527 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
1528
1529         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
1530
1531 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
1532
1533         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
1534         
1535         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
1536         create a token from a FieldOnTypeBuilderInst.
1537         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
1538         (resolve_object): Ditto.
1539
1540         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
1541         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
1542
1543 2008-03-14  Martin Baulig  <martin@ximian.com>
1544
1545         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
1546
1547         * debug-mono-symfile.h
1548         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
1549         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
1550
1551 2008-03-10  Martin Baulig  <martin@ximian.com>
1552
1553         * debug-mono-symfile.h
1554         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
1555         `lexical_block_table_offset'.
1556         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
1557         `lexical_blocks'.
1558         (MonoSymbolFile): Added `version'.
1559
1560         * mono-debug.h
1561         (MonoDebugLexicalBlockEntry): Removed.
1562         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
1563         `lexical_blocks'.
1564
1565         * mono-debug.c (mono_debug_add_method): Don't compute lexical
1566         blocks here; the debugger now does this internally.
1567
1568 2008-02-27  Martin Baulig  <martin@ximian.com>
1569
1570         * object.c (mono_runtime_exec_main): Call
1571         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
1572         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
1573
1574 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
1575
1576         * verify.c (verify_type_compatibility_full): Allow native int to be converted
1577         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
1578
1579 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
1580
1581         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
1582         ldftn with a virtual method.
1583
1584 2008-03-13  Geoff Norton  <gnorton@novell.com>
1585
1586         * decimal.c:  Only include memory.h if the platform has it.
1587
1588 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
1589
1590         * assembly.c, class.c, metadata-internals.h: make sure public key
1591         tokesns are compared in a case-insensitive way. Also, all
1592         the lookups in the GAC use a lowercase public key token
1593         (gaacutil already does the lowercasing on install). Fixes
1594         bug #369541.
1595
1596 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
1597
1598         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
1599         and return value.
1600
1601 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
1602
1603         * image.c: when someone loads a mscorlib from a file, return the
1604         currently loaded mscorlib (fixes bug #369253).
1605
1606 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
1607
1608         * class.c: handle types with no parents by forcing them to have
1609         System.Object as a parent and marking them as broken (this currently
1610         allows the first part of bug #369173 to work as well, likely because
1611         we don't check for typeload exceptions everywhere yet).
1612
1613 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
1614
1615         * class.c: more complete check that types belong to corlib
1616         (fixes second part of bug #369173).
1617
1618 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
1619
1620         * generic-sharing.c:  Including glib.h for the MSVC builds to define
1621           "inline" to "__inline" before including mono-membar.h.
1622           
1623         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
1624           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
1625           MSVC builds.
1626
1627         Contributed under MIT/X11 license.
1628
1629 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
1630
1631         * verify.c (do_invoke_method): Remove return type validation.
1632
1633         * verify.c (do_ret): Do return type validation at return site instead of
1634         call site.
1635
1636 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
1637
1638         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
1639
1640         * verify.c: Some todos cleaned and improved a few error messages.
1641
1642 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
1643
1644         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
1645
1646 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
1647
1648         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
1649         system types correctly.
1650
1651         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
1652         function.
1653
1654 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
1655
1656         * assembly.c (build_assembly_name): Fix a warning.
1657
1658 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
1659
1660         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
1661         the called function takes an object type argument. Fixes storing or
1662         valuetypes across remoting as well as reducing memory usage.
1663         * image.c, metadata-internals.h: remove now unused ldfld_remote and
1664         stfld_remote wrapper caches.
1665
1666 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
1667
1668         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
1669         is not found.
1670
1671         * reflection.c (mono_image_register_token): New helper function to save
1672         a token->object mapping.        
1673
1674         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
1675         managed code.
1676
1677         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
1678         one dimension arrays. Fixes #367670.
1679         (mono_reflection_get_type_internal): Ditto.
1680
1681 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
1682
1683         * marshal.c: mono_load_remote_field_new() always returns object.
1684         so use the proper signature (fixes bug #366445).
1685
1686 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
1687         
1688         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
1689         add an 'inline_failure' flag instead.
1690
1691 2008-03-04  Mark Probst  <mark.probst@gmail.com>
1692
1693         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
1694         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
1695         contains the location of "this", used for exception handling.
1696
1697 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
1698
1699         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
1700         their size on all platforms for perf reasons.
1701
1702 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
1703
1704         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
1705         object-internal.h
1706
1707         * object-internal.h: Same.
1708
1709 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
1710
1711         * reflection.h: Fix the build I just broke.
1712
1713 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
1714
1715         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
1716         Test if a token is valid, this remove explicit usage of 
1717         MonoDynamicImage::tokens from the verifier code.
1718
1719         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
1720
1721         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
1722         instead of direct access to MonoDynamicImage::tokens.
1723
1724 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
1725
1726         * verify.c (token_bounds_check): Fix the build I just broke.
1727
1728 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
1729
1730         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
1731
1732         * verify.c (verifier_load_method): Fixed the errors message.
1733
1734         * verify.c (mono_method_verify): Fixed a debug message.
1735
1736 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
1737
1738         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
1739         mono-perfcounters.h, class-internals.h: support for predefined
1740         writable counters, query of categories and counters, bugfixes.
1741
1742 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
1743
1744         * verify.c (do_refanytype): Verify the refanytype opcode.
1745
1746         * verify.c (mono_method_verify): Use do_refanytype.
1747
1748 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
1749
1750         * verify.c (do_mkrefany): Verify the mkrefany opcode.
1751
1752         * verify.c (mono_method_verify): Use do_mkrefany.
1753
1754 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
1755
1756         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
1757         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
1758         implementation.
1759
1760 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
1761
1762         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
1763         the type load exception.
1764
1765 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
1766
1767         * verify.c: Added a few FIXME for method signatures
1768
1769         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
1770         of mono_method_get_signature and get vararg call working. Removed unused
1771         checks for return value.
1772
1773         * verify.c (do_refanyval): Verify the refanyval opcode.
1774
1775         * verify.c (mono_method_verify): Implemented verification of arglist and
1776         use do_refanyval.
1777
1778 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
1779
1780         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
1781         vtypes to marshal.c.
1782
1783         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
1784         it works for AOT as well.
1785
1786 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
1787
1788         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
1789         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
1790         the system time is adjusted.
1791
1792 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
1793
1794         * icall.c, icall-def.h: use the new time functions (fixes the
1795         non-monotonic behaviour of TickCount).
1796
1797 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
1798
1799         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
1800         it breaks the build.
1801         
1802         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
1803         cattr is not finished yet.
1804
1805 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
1806
1807         * verify.c: Proper token validation for field, method and type.
1808
1809 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
1810
1811         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
1812
1813         * loader.c (method_from_memberref): Generate type load error instead of method missing
1814         if the type is not found.
1815
1816 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
1817
1818         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
1819         some of the conversions caused the generation of a marshal directive exception.
1820
1821 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
1822
1823         verify.c: Report which exception should be thrown by the JIT.
1824         Added a lot of FIXME notes.
1825
1826 2008-02-22  Mark Probst  <mark.probst@gmail.com>
1827
1828         * generic-sharing.c: Runtime generic context slots are not
1829         instantiated on init anymore.  Instead, provide function to do the
1830         instantiating on demand.
1831
1832         * class-internals.h: Added vtable to runtime generic context.
1833         Macros for encoding direct and indirect slot offsets in one
1834         guint32.
1835
1836 2008-02-21  Mark Probst  <mark.probst@gmail.com>
1837
1838         * object.c, generic-sharing.c: Moved some generic sharing code
1839         from object.c to generic-sharing.c.
1840
1841         * generic-sharing.c: Added support for extensible runtime generic
1842         context.
1843
1844         * metadata-internals.h: Two new hash tables in MonoImage for
1845         extensible runtime generic context support.
1846
1847         * domain.c: Unregister generic vtables upon domain unloading.
1848
1849         * image.c: Destroy new hash tables upon image unloading.
1850
1851         * metadata.c: Unregister generic subclasses upon image unloading.
1852
1853         * class-internals.h: New data structure for runtime generic
1854         context template.  New fields in the runtime generic context for
1855         extensible part.
1856
1857         * Makefile.am: Added generic-sharing.c.
1858
1859 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
1860
1861         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
1862         there is a pending loader exception, raise it.
1863
1864         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
1865         same.
1866
1867         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
1868         same.
1869
1870         Fixes #363450.
1871
1872 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
1873
1874         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
1875
1876         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
1877         
1878         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
1879         ref-only requests for compatibility with MS.
1880
1881 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1882
1883         * reflection.c (mono_custom_attrs_from_method): Don't silently
1884         return an empty list for generic method instances.
1885         (mono_custom_attrs_from_param): Likewise.
1886
1887 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
1888             Raja R Harinath  <harinath@hurrynot.org>
1889
1890         Fix #354757
1891         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
1892         * class.c (mono_class_inflate_generic_method_full): Initialize it
1893         when a fully-open method is instantiated.
1894         * metadata.c (inflated_method_equal, inflated_method_hash): Update
1895         to new field.
1896         * reflection.c (inflate_mono_method): Don't create a temporary context.
1897
1898 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1899
1900         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
1901         Compute correct value, to prepare for imethod->reflection_info going away.
1902
1903 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
1904
1905         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
1906
1907 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
1908
1909         * verify.c: Implement skip visibility flag.
1910
1911 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
1912
1913         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
1914         which contains an extra field to tell the kind of exception that should be thrown.
1915
1916         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
1917
1918 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
1919
1920         * loader.c (mono_method_get_param_names): Initialize 'klass' after
1921         'method' is updated.
1922
1923 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
1924
1925         * class.c (mono_class_layout_fields): Set class->min_align for classes using
1926         explicit layout as well. Fixes #360375.
1927
1928 2008-02-11  Geoff Norton  <gnorton@novell.com>
1929
1930         * loader.c: Guard and dereference against inflated generic methods
1931
1932 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
1933
1934         * class.c: Include Retargetable spec in assembly name.
1935         * assembly.c: Always include PublicKeyToken spec in assembly name
1936         (with value "null" if assembly is not signed), and include
1937         Retargetable spec.
1938         * icall-def.h: Added icall for Assembly.get_fullname.
1939         * icall.c: Added icall returning the fullname of an assembly.
1940
1941 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
1942
1943         * class.c (mono_class_setup_vtable_general): Add a missing call to
1944         mono_class_setup_methods () which is needed in the AOT case.
1945
1946 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
1947
1948         * verify.c (mono_type_get_stack_name): Added. Return the name for the
1949         stack type of the given MonoType.
1950
1951         * verify.c (verify_type_compatibility_full): Handle the void type.
1952
1953         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
1954         way stack merging works.
1955
1956         * verify.c (store_local): Improved verification message.
1957
1958         * verify.c (do_branch_op): If the merging is invalid, the method
1959         is unverifiable and not invalid. Improved error message.
1960
1961         * verify.c (merge_stacks): Properly merge a boxed valuetype and
1962         a reference type diferent than System.Object. Improved error
1963         message.
1964
1965 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
1966
1967         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
1968
1969         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
1970         type of an enum even if the argument is byref.
1971
1972         * verify.c: Replace all explicit uses of enumtype and enum_basetype
1973         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
1974
1975         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
1976
1977         *verify.c (verify_type_compatibility_full): Make enum types
1978         compatible with their base types.
1979
1980         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
1981         types are compatible for the special case of a boxed valuetype and
1982         System.Object.
1983
1984         * verify.c (verify_stack_type_compatibility): The function
1985         is_compatible_boxed_valuetype was extracted from here.
1986
1987         * verify.c (push_arg): Only set ctx->has_this_store if the method
1988         is not static.
1989
1990         * verify.c (do_ldelem): Fixed a typo in an error message and added
1991         strict check for mixing int32 and native int as the array type
1992         and ldelem type.
1993
1994         * verify.c (merge_stacks): Consider boxed valuetypes in the
1995         compatibility checks.
1996
1997 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
1998         * profiler.h: (MonoGCEvent): Added start-stop the world events.
1999
2000 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
2001         *class.c: use_new_interface_vtable_code: renamed the env var to have
2002         a "MONO_" prefix, and fix the logic to enable it by default.
2003
2004 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
2005         *class.c:
2006         mono_class_setup_vtable_general: rewrote the way in which interface
2007         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
2008         makes the code more maintainable.
2009         For now the old code is still there, and can be activated setting
2010         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
2011
2012 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
2013
2014         * verify.c: guarded some debug functions around and #ifdef.
2015
2016         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
2017
2018 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
2019
2020         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
2021         changes for now since they seem to break too many things.
2022
2023 2008-02-05  Mark Probst  <mark.probst@gmail.com>
2024
2025         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
2026         mono_marshal_find_nonzero_bit_offset): Added macro and function
2027         for finding the byte- and bit-offset of a bitfield within a
2028         struct.
2029
2030 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
2031
2032         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
2033         (mono_marshal_get_struct_to_ptr): Ditto.
2034
2035         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
2036         cctor_signature.
2037
2038 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
2039
2040         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
2041         between methods for non-corlib types.
2042
2043 2008-02-02  Geoff Norton  <gnorton@novell.com>
2044
2045         * loader.c (mono_method_get_param_names): Populate the parameter name for 
2046         generic parameters as well. (Fixes #342536)
2047
2048 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
2049
2050         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
2051
2052         * verify.c (do_invoke_method): Fix for calling with byref structs.
2053
2054         * verify.c (do_cast): push a boxed value type based on the type token and not
2055         the type of stack.
2056
2057 2008-01-31  William Holmes  <billholmes54@gmail.com>
2058
2059         * process.c (process_module_string_read): Check the size returned form 
2060           VerQueryValue to avoid out of memory exception. 
2061
2062 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
2063
2064         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
2065         Handle properly modules which are not in the moduleref table. Fixes
2066         #356938.
2067
2068 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
2069
2070         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
2071         the dynamic case which is now in managed code.
2072         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
2073
2074         * marshal.c (mono_string_to_bstr): Fix a warning.
2075         (init_com_provider_ms): Ditto.
2076
2077         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
2078
2079         * exception.c (mono_get_exception_out_of_memory): New helper function.
2080
2081 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
2082
2083         * marshal.c: Add support for BSTR marshalling
2084         using other COM systems.
2085
2086         Code is contributed under MIT/X11 license.
2087
2088 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
2089
2090         * object.c (mono_runtime_invoke_array): reverted previous
2091         commit as it breaks the build.
2092
2093 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
2094
2095         * object.c (mono_runtime_invoke_array): Verify arguments for
2096         invalid types. Fixes #348522.
2097
2098 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
2099
2100         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
2101         non-final virtual calls using call. 
2102
2103         * verify.c (do_invoke): fixed some TODOs.
2104
2105         * verify.c (push_arg): set has_this_store for "ldarga 0".
2106
2107 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
2108
2109         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
2110         which belong to an inflated class. Fixes #356531.
2111
2112 2008-01-26  Robert Jordan  <robertj@gmx.net>
2113
2114         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
2115         which resort to FindFirstFile when a certain error condition
2116         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
2117         Code is contributed under MIT/X11 license.
2118
2119 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
2120
2121         * marshal.c (emit_marshal_string): Fix out string marshalling
2122         to use specified encoding. Fixes #323900.
2123
2124         Code is contributed under MIT/X11 license.
2125
2126 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
2127
2128         * class.c (mono_class_inflate_generic_method_full): Don't modify
2129         iresult->context after cache check.
2130
2131 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
2132
2133         * class.c (mono_class_inflate_generic_method_full): Change the
2134         struct assignments to memcpy for better visibility and add some comments.
2135
2136 2008-01-23  Dick Porter  <dick@ximian.com>
2137
2138         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
2139         procedure, and make it work on windows.
2140
2141 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
2142
2143         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
2144         a MonoReflectionTypeBuilder since it is always of that type.
2145
2146         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
2147
2148         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
2149
2150         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
2151         
2152         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
2153
2154         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
2155
2156         * reflection.c (mono_reflection_create_runtime_class): Remove already created
2157         instantiations from the type cache.
2158
2159 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
2160
2161         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
2162
2163         * verify.c (do_unbox_value): push a controled mutability managed pointer.
2164
2165 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
2166
2167         * verify.c (do_ldstr): added, verifies if the #US token is valid.
2168
2169         * verify.c (mono_method_verify): removed old TODO
2170
2171 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
2172
2173         * verify.c (do_newobj): add visibility check.
2174
2175 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
2176
2177         * verify.c (do_load_function_ptr): add visibility check.
2178
2179 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
2180         *class.c:
2181         mono_generic_class_get_class: hook profiler events.
2182         mono_field_get_offset: added to support heap-shot in the new profiler.
2183         *class.h: exported mono_field_get_offset.
2184         * reflection.c:
2185         mono_reflection_setup_internal_class: hook profiler events.
2186
2187 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
2188
2189         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
2190         argument here too and use it to avoid checking for pending exceptions if 
2191         possible.
2192
2193 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
2194
2195         * assembly.c (build_assembly_name): add arg for passing the assembly
2196         flags. Do not consider a PublicKey with value "null" valid.
2197         (mono_assembly_name_parse_full): added boolean argument that will be
2198         set if the assembly name contains a PublicKeyToken spec. Added support
2199         for the Retargetable spec for which only Yes or No are allowed as valid
2200         value. Consider assembly name invalid if Retargetable spec is set, but
2201         either version, culture or public key (token) are not specified.
2202         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
2203         with implementation in assembly.c.
2204         * icall.c (fill_reflection_assembly_name): also copy assembly flags
2205         from MonoAssemblyName.
2206         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
2207         introduced argument for mono_assembly_name_parse_full to know if the
2208         assembly name has a PublicKeyToken spec, and if it has instruct
2209         fill_reflection_assembly_name to use default value for keyToken (if
2210         PublicKeyToken is null).
2211
2212 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
2213
2214         * verify.c (mono_method_verify): fixed ovf ops with
2215         float values. They are unverifiable now.
2216
2217 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
2218
2219         * class.c (set_failure_from_loader_error): add BadImageException to the
2220         list of exceptions that can cause a type to fail to load.
2221
2222         * class.c (mono_class_get_exception_for_failure): same.
2223
2224 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
2225
2226         * verify.c (in_any_exception_block): added, check if offset
2227         is part of any exception handling clause.
2228
2229         * verify.c (get_stack_type): added VAR and MVAR types.
2230
2231         * verify.c (do_stobj): better error messages.
2232
2233         * verify.c (do_cpobj): added, check cpobj.
2234
2235         * verify.c (do_initobj): added, check initobj.
2236
2237         * verify.c (do_sizeof): added, check sizeof.
2238
2239         * verify.c (do_localloc): added, check localloc.
2240
2241         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
2242
2243 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
2244
2245         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
2246         save_lmf/restore_lmf opcodes.
2247
2248         * threads.c (mono_threads_install_notify_pending_exc): New function to
2249         install a callback notifying the JIT there is a pending exception on a thread.
2250         (mono_thread_request_interruption): Call the new callback.
2251         (mono_thread_get_and_clear_pending_exception): New function to return the
2252         exception pending on a thread.
2253
2254         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
2255         to turn off checking for pending exceptions.
2256         (mono_marshal_get_native_wrapper): Ditto.
2257
2258 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
2259
2260         * threads-types.h: Get rid of the unnecessary extern declarations.
2261
2262 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
2263
2264         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
2265         return field from parent class if not private.
2266         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
2267         returns fields from parent class if they are not private.
2268         (method_nonpublic): added function to determine if a given method
2269         should be considered non-public. Returns false for private methods
2270         on parent class, and internal methods from parent on the 1.0 profile.
2271         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
2272         use method_nonpublic function to determine whether method should be
2273         returned.
2274         (property_accessor_public): use newly introduced method_nonpublic
2275         function to determine whether accessor is non-public. 
2276         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
2277         event from parent class if not private. Only return static event if
2278         Static flag is set, and only return static event from parent class if
2279         FlattenHierarchy flag is set.
2280         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
2281         include non-private events from parent class.
2282
2283 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
2284
2285         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
2286         warning.
2287
2288 2008-01-16  Wade Berrier <wberrier@novell.com>
2289
2290         * security.c: Add assembly.h header to appease some warnings
2291
2292 2008-01-16  Dick Porter  <dick@ximian.com>
2293
2294         * process.c (process_module_string_read): Remove trailing null
2295         when saving string.
2296
2297 2008-01-16  Mark Probst  <mark.probst@gmail.com>
2298
2299         * class-internals.h: A new data structure describing the layout of
2300         a runtime generic context (MonoRuntimeGenericContextTemplate).
2301
2302         * metadata-internals.h: Added a hash table to MonoDomain that maps
2303         from open generic classes to their runtime generic context
2304         templates.
2305
2306         * object.c: Building of the runtime generic context, including
2307         proper handling of generic type arguments of superclasses.
2308         Building of the runtime generic context according to the template.
2309
2310 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
2311
2312         * class.c (mono_class_setup_fields): Set field.count for generic instances.
2313         Fixes #350856.
2314
2315         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
2316         mono_portability_find_file (). Fixes #325466.
2317         (mono_image_get_public_key): Fix a warning.
2318
2319 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
2320
2321         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
2322         Fixes #353550.
2323         (mono_class_from_name_case): Ditto.
2324
2325 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
2326
2327         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
2328           common storage for the tables used in the System/NumberFormatter class.
2329
2330 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
2331
2332         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
2333
2334 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
2335
2336         * verify.c (get_boxable_mono_type): check if the token is valid.
2337
2338         * verify.c (set_stack_value): changed to add an error if an
2339         invalid type is set on stack. Changed all callers due to signature change.
2340
2341         * verify.c (do_stobj): implement stobj validation.
2342
2343 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
2344
2345         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
2346         set container->is_method, it was set earlier.
2347
2348         * metadata.c (type_in_image): Handle MVARs which belong to not finished
2349         generic methods.
2350
2351         * reflection.c (mono_reflection_initialize_generic_parameter): Set
2352         is_method of the generic container to TRUE for methods.
2353
2354 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
2355
2356         * metadata.c (type_in_image): Handle type parameters properly.
2357
2358         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
2359         memory ownership of this structure.
2360
2361 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
2362
2363         * verify.c (get_boxable_mono_type): make typedref types been just
2364         unverifiable. check for void type.
2365
2366         * verify.c (do_unbox_any): added, verify opcode unbox.any.
2367
2368         * verify.c (do_load_function_ptr): accept method spec tokens.
2369
2370 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
2371
2372         * marshal.c (mono_class_native_size): Always set *align even if this is called
2373         recursively.
2374
2375 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
2376
2377         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
2378         out-of-date.
2379
2380 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
2381
2382         * verify.c: removed some old unused tables. A huge bunch of small fixes
2383         to things found while testing the verifier with mono basic.
2384
2385         * verify.c (dump_stack_value): dump null literal flag to.
2386
2387         * verify.c (verify_type_compatibility_full): fix comparison
2388         for types that have a generic super type.
2389
2390         * verify.c (verify_stack_type_compatibility): fix compatibility
2391         between null literals and reference types. fix compatibility between
2392         boxed valuetypes and object. fix corner case test for enums.
2393
2394         * verify.c (do_cmp_op): proper verification of cgt.un in case
2395         of reference types.
2396
2397         * verify.c (do_invoke_method): fix error message.
2398
2399         * verify.c (do_store_indirect
2400
2401         * verify.c (check_is_valid_type_for_field_ops): proper verification
2402         of managed pointers to valuetypes and boxed valuetypes. proper verification
2403         of null literals.
2404
2405         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
2406         allow token to be a reference type.
2407
2408         * verify.c (do_cast): proper handling of boxes valuetypes.
2409
2410         * verify.c (do_stelem): proper handling of storing a boxed valuetype
2411         in object[].
2412
2413         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
2414         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
2415         fixed the decoding of unbox_any
2416
2417 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
2418
2419         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
2420
2421 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
2422
2423         * verify.c (do_newobj): do delegate verification.
2424
2425         * verify.c (verify_delegate_compatibility): perform delegate
2426         verification.
2427
2428         * verify.c (verify_ldftn_delegate): perform tests related to
2429         ldftn delegates.
2430
2431         * verify.c (mono_delegate_signature_equal): perform the
2432         slightly diferent signature comparison required by delegates.
2433
2434         * metadata.c (mono_metadata_type_equal_full): added and exported
2435         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
2436         allows signature only comparison.
2437
2438         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
2439         as MONO_INTERNAL.
2440
2441 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
2442
2443         * verify.c: added a bunch of stack_slot_* functions to
2444         make access to stack slot type easier. This is required to
2445         allow optional flags, like null literal, boxed value and
2446         this pointer.
2447         All access paths to IlStackDesc::stype have been changed 
2448         to use these new funcions.
2449         Removed a bunch of unused functions and cleared all warnings.
2450         This patch introduces the usage of the this pointer and 
2451         boxed value flags.
2452
2453 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
2454
2455         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
2456
2457 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
2458
2459         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
2460         match managed version.
2461
2462         * appdomain.c: Bump corlib version.
2463         
2464         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
2465         argument.
2466
2467 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
2468
2469         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
2470         Set public key token to zero-length byte array if assembly is not
2471         strongnamed.
2472
2473 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
2474
2475         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
2476         writing a vtype array elem.
2477
2478 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
2479
2480         * assembly.c (build_assembly_name): return FALSE if length of token is
2481         not 16 (if not "null").
2482         (mono_assembly_name_parse_full): return FALSE if value of version,
2483         culture, token or key is 0.
2484         * icall.c (fill_reflection_assembly_name): add boolean arguments to
2485         specify whether public key and public key token must be set to default
2486         value (zero-length byte array) if not available. Set versioncompat to
2487         SameMachine. If public key is available or the default is set, then
2488         set PublicKey flag.
2489         (ves_icall_System_Reflection_Assembly_FillName): if no public key
2490         is available, use empty byte array as default value. On the 2.0
2491         profile, use default value for public key token if not set.
2492         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
2493         profile, use default value for public key if not set. On the 2.0
2494         profile, use default value for public key token if not set.
2495         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
2496         default values for public key and public key token.
2497
2498 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
2499
2500         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
2501         field to keep it in synch with the managed object.
2502
2503         * marshal.c (emit_marshal_object): Add support for byref marshalling of
2504         delegates. Fixes #351520.
2505
2506         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
2507         contains defined memory.
2508         
2509         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
2510
2511         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
2512         
2513         * sgen-gc.c (check_consistency): New helper function to do a consistency check
2514         of the GC data structures.
2515
2516         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
2517
2518         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
2519         
2520         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
2521         barrier.
2522         (mono_array_clone_in_domain): Ditto.
2523         (mono_array_clone_in_domain): Ditto.
2524
2525         * threads.c (start_wrapper): Register the thread start argument as a GC root.
2526         (cache_culture): Use a write barrier.
2527
2528         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
2529         (ves_icall_get_property_info): Ditto.
2530
2531         * object.h (MONO_STRUCT_SETREF): New macro.
2532
2533         * class-internals.h (MonoStats): Add some GC statistics.
2534
2535         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
2536
2537 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
2538
2539         * exception.c (mono_exception_from_name_two_strings):
2540         Break from loop after method is found.
2541
2542 2008-01-04  Dick Porter  <dick@ximian.com>
2543
2544         * process.c (process_module_string_read): Rename variable to
2545         reflect correct usage, after fixing bug 345972.
2546
2547 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
2548
2549         * verify.c (mono_type_create_fnptr_from_mono_method): 
2550         created a MonoType function pointer instance to be used during
2551         verification. The verifier releases this memory at end.
2552
2553         * verify.c (mono_method_is_constructor): extracted repeated
2554         checks for constructor into a single class.
2555
2556         * verify.c (do_push_field): use new extracted method
2557         for constructor check.
2558
2559         * verify.c (do_newobj): same.
2560
2561         * verify.c (do_ldftn): renamed to do_load_function_ptr
2562         and make it verify ldvirtftn too.
2563
2564         * verify.c (mono_method_verify: proper verification
2565         of ldvirtftn. release created MonoMethod instances.
2566
2567 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
2568
2569         * verify.c (token_bounds_check): added.
2570
2571         * verify.c (do_ldftn): added.
2572
2573         * verify.c (mono_method_verify): proper verificartion of ldftn.
2574
2575 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
2576
2577         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
2578         than the table row count. It's the resposibility of the caller to
2579         make the bounds check and raise the correct error.
2580
2581         * metadata.c (mono_metadata_decode_row_col): Same.
2582
2583         * loader.c (mono_get_method_from_token): perform bounds check
2584         on token for methoddef table.
2585
2586 2007-12-29  Miguel de Icaza  <miguel@novell.com>
2587
2588         * icall.c
2589         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
2590         assert into a negative result, the managed code already coped with
2591         that.
2592
2593         Some folks on Windows reported this error. 
2594
2595 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
2596
2597         * appdomain.c: Bump corlib version.
2598         * icall.c:
2599         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
2600         CultureInfo.CreateCulture to create CultureInfo for name.
2601         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
2602         create CultureInfo for name. Fixes bug #347174.
2603
2604 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
2605
2606         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
2607         flags.
2608
2609         * verify.c (is_valid_branch_instruction): allow branching to the
2610         first instruction of the protected block.
2611
2612         * verify.c (is_valid_cmp_branch_instruction): same.
2613
2614         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
2615         avoid double initialization.
2616
2617         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
2618         detect which cases the eval stack should just be copied.
2619
2620         * verify.c (mono_method_verify): check if the eval stack
2621         is empty when entering a protected block.
2622
2623 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
2624
2625         * verify.c: added is_clause_in_range, is_clause_inside_range,
2626         is_clause_nested and verify_clause_relationship. They perform
2627         the verifications stated in P1 12.4.2.7.
2628
2629         * verify.c (mono_method_verify): remove some unused variables,
2630         add the new exception clause checks, add instruction border
2631         checks for protected block start/end, improved some error 
2632         messages and fixed a bug in the way invalid instruction access
2633         is detected.
2634
2635 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
2636
2637         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
2638         from GC 7.0 if available.
2639
2640         * object.c: Remove an unused define.
2641         
2642         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
2643
2644         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
2645
2646         * null-gc.c (mono_gc_make_descr_for_array): Implement.
2647
2648         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
2649
2650         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
2651         to take the same arguments as the other make_descr functions.
2652
2653         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
2654
2655         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
2656         directly.
2657
2658         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
2659         mini.c.
2660
2661         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
2662         call to boehm-gc.c.
2663
2664         * boehm-gc.c (mono_gc_register_root): Fix a warning.
2665
2666         * null-gc.c (mono_gc_register_root): Fix a warning.
2667
2668         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
2669
2670         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
2671         (mono_gc_base_init): Call GC_init ().
2672
2673         * null-gc.c: Define mono_gc_register_root () as a no-op.
2674
2675         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
2676
2677 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
2678
2679         * verify.c: add prototype for merge_stacks at top
2680
2681         * verify.c (do_switch): added.
2682
2683         * verify.c (merge_stacks): on some cases the stack merging
2684         was not happening properly. Unequal stack sizes at merge
2685         points should be invalid.
2686
2687         * verify.c (mono_method_verify): added more debug info on stack state.
2688         verify switch properly.
2689
2690 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
2691
2692         * method-builder.h: New file, moved the mono_mb_ declarations here from 
2693         marshal.h.
2694
2695         * boehm-gc.c marshal.c: Include method-builder.h.
2696
2697         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
2698
2699         * marshal.c: Remove some code which is now in method-builder.c.
2700
2701 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
2702
2703         * method-builder.c: New file, extraction of the method builder functionality 
2704         from marshal.c.
2705
2706         * marshal.c: Move the mb functions into method-builder.c.
2707
2708         * marshal.h marshal.c: Export some mono_mb_... functions.
2709
2710         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
2711
2712         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
2713         the caller.
2714
2715         * class.c (mono_class_get_full): Check the token type in the dynamic case.
2716
2717         * loader.c (mono_field_from_token): Ditto.      
2718
2719         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
2720         type as well.
2721         
2722         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
2723         Fixes #342565.
2724
2725         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
2726         a helper function for setting it.
2727
2728         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
2729
2730         
2731         * assembly.c: Significally simplify code now that referenced assemblies are 
2732         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
2733
2734         * threads.h: Don't include  the internal threads-types.h header file. Fixes
2735         #349952.
2736
2737 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
2738
2739         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
2740         instructions that were target of branches or are at protected block boundaries.
2741
2742         * verify.c (in_same_block): handle filter clauses.
2743
2744         * verify.c (is_valid_branch_instruction): added. checks the target of
2745         instructions br or brtrue/false.
2746
2747         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
2748         binary branch instructions such as beq and bge.
2749
2750         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
2751         and made it pin the instruction as been part of the exception block.
2752
2753         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
2754         of in_same_block.
2755
2756         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
2757         of in_same_block.
2758
2759         * verify.c (do_ret): ret from a protected block is unverifiable and
2760         not invalid.
2761
2762         * verify.c (do_static_branch): verify br and br.s instructions.
2763
2764         * verify.c (merge_stacks): add extra param to support detection
2765         of branches in the middle of instructions.
2766         
2767         * verify.c (mono_method_verify): verify branches and exception blocks
2768         that target the middle of instructions. Proper verification of br and br.s.
2769
2770 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
2771
2772         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
2773         skip_visibility field.
2774         (reflection_methodbuilder_from_dynamic_method): Ditto.
2775
2776         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
2777         registrations. Fixes #348193.
2778
2779         * threads.h: Move the internal mono_thread_get_pending_exception () to
2780         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
2781
2782 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
2783
2784         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
2785         icall registration. Fixes #348193.
2786
2787         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
2788         for corlib classes into object. Fixes #349621.
2789
2790 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
2791
2792         * icall.c (property_accessor_nonpublic): new function to determine
2793         whether an accessor allows a property to be considered non-public.
2794         Returns false for private accessor(s) from parent class, and internal
2795         accessor(s) from parent on 2.0 profile (and higher).
2796         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
2797         to determine whether property should be included if NonPublic flag
2798         is set. Fixes bug #349078.
2799
2800 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
2801
2802         * verify.c (init_stack_with_value): added.
2803
2804         * verify.c (mono_method_verify): extracted common
2805         code for exception initialization into init_stack_with_value.
2806
2807         * verify.c (mono_method_verify): initialize the exception
2808         for handler clauses as well.
2809
2810         * verify.c (mono_method_verify): fix the exception clause
2811         ordering rules, it should use handler end offset and not
2812         start offset.
2813
2814 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
2815
2816         * rawbuffer.c: remove useless warning.
2817
2818 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
2819
2820         * threads.h, threads-types.h: move functions to the correct header
2821         (fixes bug#349952).
2822
2823 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
2824
2825         * verify.c (mono_method_verify): proper verification
2826         of exception handling clauses ranges and fallthru in
2827         and out of protected blocks.
2828
2829 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
2830
2831         * verify.c (mono_method_verify): fixed compilation issue.
2832
2833 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
2834
2835         * verify.c (mono_method_verify): a printf slipped in, changed
2836         to use verifier debug macro.
2837
2838 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
2839
2840         * verify.c (is_correct_leave): check for filter clauses.
2841
2842         * verify.c (do_filter): added.
2843
2844         * verify.c (mono_method_verify): property verification of leave.
2845
2846
2847 2007-12-18  Mark Probst  <mark.probst@gmail.com>
2848
2849         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
2850         Win32 build, until we figure out how to do the proper thing on
2851         Win32.
2852
2853 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
2854
2855         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
2856         by the previous patch.
2857         
2858         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
2859         the assembly resolve handler for refonly assemblies.
2860
2861 2007-12-17  Mark Probst  <mark.probst@gmail.com>
2862
2863         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
2864         Make sure only one thread is allowed to commence shutdown, and
2865         don't allow new threads to be started once shutdown is in
2866         progress.
2867
2868 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
2869
2870         * verify.c (is_correct_endfilter): added.
2871
2872         * verify.c (is_unverifiable_endfilter): added.
2873
2874         * verify.c (do_endfilter): added.
2875
2876         * verify.c (mono_method_verify): property verification of endfilter
2877         and fixed a corner case or endfinally.
2878
2879 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
2880
2881         * verify.h: new flags to support fail fast of unverifiable code and
2882         do non-strict verification. Non-strict verification is required to
2883         have MS runtime compatibility. There are a huge amount of unverifiable
2884         code that it accepts as verifiable. The strict mode verifies the code
2885         as the specs says.
2886         Non-strict mode will be required in cases where code needs to be
2887         accepted as verifiable but fails under strict mode.
2888
2889         * pedump.c: added support to fail fast and non-strict verification.
2890
2891         * verify.c: added support for both fail fast and non-strict verification.
2892
2893 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
2894
2895         * verify.c (is_correct_endfinally): added.
2896
2897         * verify.c (mono_method_verify): property verification of endfinally.
2898
2899 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
2900
2901         * verify.c (in_any_block): check for filter clauses.
2902
2903         * verify.c (is_correct_rethrow): added.
2904
2905         * verify.c (mono_method_verify): property verification of rethrow.
2906
2907         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
2908
2909 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
2910
2911         * verify.c (do_throw): added.
2912
2913         * verify.c (mono_method_verify): property verification of throw
2914
2915 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
2916
2917         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
2918         assemblies. Fixes #346425.
2919
2920 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
2921
2922         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
2923         FieldBuilders.
2924
2925         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
2926
2927         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
2928         prevent asserts when this is called with a token which might not be valid.
2929
2930         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
2931         lookup_dynamic_token_class with valid_token == FALSE.
2932
2933         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
2934
2935         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
2936
2937         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
2938         
2939 2007-12-10  Mark Probst  <mark.probst@gmail.com>
2940
2941         * gc.c: Don't delay threadpool thread finalization unless Mono is
2942         shutting down.
2943
2944 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
2945
2946         * threads.c: turn an assert into a non-fatal warning.
2947
2948 2007-12-09  Robert Jordan  <robertj@gmx.net>
2949
2950         * icall.c (GetVirtualMethod): Add missing argument validation.
2951
2952 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
2953
2954         * verify.c (do_cast): added.
2955
2956         * verify.c (mono_method_verify): property verification of castclass and isinst.
2957
2958
2959 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
2960
2961         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
2962
2963         * verify.c (do_stelem): added.
2964
2965         * verify.c (mono_method_verify): property verification of stelem.X.
2966
2967 2007-12-07  Mark Probst  <mark.probst@gmail.com>
2968
2969         * class.c, class-internals.h: Introduce an environment variable
2970         (MONO_GENERIC_SHARING) through which the extent of generic code
2971         sharing can be controlled (share all classes, share only corlib
2972         classes, or share nothing).
2973
2974         * object.c: Only create runtime generic context for classes for
2975         which sharing is enabled.
2976
2977 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
2978
2979         * verify.c (do_ldelem): refactor it to work with ldelem.any.
2980
2981         * verify.c (mono_method_verify): property verification of ldelem.any.
2982
2983 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
2984
2985         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
2986         added ldelem.X opcodes.
2987
2988         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
2989
2990         * verify.c: proper verification of ldelem.X 
2991
2992 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
2993
2994         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
2995
2996 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
2997
2998         * verify.c (mono_method_verify): null literal requires special handling,
2999         the value pushed on stack need to be flagged as so.
3000
3001         * verify.c (do_ldelema): Verify ldelema properly.
3002
3003 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
3004
3005         * verify.c: Verify ldlen properly.
3006
3007 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
3008
3009         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
3010         to the target object's type. Fixes #346160.
3011
3012 2007-12-05  Dick Porter  <dick@ximian.com>
3013
3014         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
3015         Solaris needs the same workaround as BSD-derived systems.  Fixes
3016         bug 323524, patch by Burkhard Linke
3017         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
3018
3019 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
3020
3021         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
3022         handle to use when error dialog is shown; otherwise, update mask
3023         to show no error dialog when an error occurs.
3024
3025 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
3026
3027         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
3028
3029         * class.c (mono_class_get_field_default_value): New helper function to initialize
3030         field->def_type and field->data.
3031
3032 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
3033
3034         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
3035         the general one.
3036
3037         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
3038
3039         * marshal.c: Avoid depending on delegate->method_info being set.
3040
3041         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
3042         
3043         * object.c (mono_delegate_ctor): Set delegate->method.
3044
3045         * object-internals.h (struct _MonoDelegate): Add 'method' field.
3046
3047         * appdomain.c: Bump corlib version.
3048
3049 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3050
3051         * metadata.c (mono_generic_inst_equal_full): Short-circuit
3052         equality check if we're comparing canonicalized MonoGenericInsts.
3053
3054 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
3055
3056         * class.c (generic_array_methods): Call mono_class_setup_methods () before
3057         accessing class->methods.
3058
3059 2007-11-22  Dick Porter  <dick@ximian.com>
3060
3061         * threads.c: Ensure that the synch_cs is set before trying to use
3062         it.
3063
3064 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
3065
3066         * profiler.c: r89126 broke the statistial profiler, unbreak.
3067
3068 2007-11-22  Martin Baulig  <martin@ximian.com>
3069
3070         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
3071
3072         * mono-debug.c
3073         (mono_debug_debugger_version): Bump to 3.
3074         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
3075         -> mono_debugger_class_initialized().
3076
3077         * mono-debug-debugger.c
3078         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
3079
3080         * class.c
3081         (mono_debugger_start_class_init_func): Removed.
3082         (mono_debugger_class_loaded_methods_func): Added.
3083         (mono_class_setup_methods): Call it here.
3084
3085 2007-11-22  Martin Baulig  <martin@ximian.com>
3086
3087         * mono-debug.c
3088         (mono_debug_add_delegate_trampoline): New public method.
3089         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
3090
3091         * mono-debug.h
3092         (MonoSymbolTable): Added `global_data_table'.
3093         (MonoDebuggerTypeKind): Removed.
3094
3095 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
3096
3097         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
3098         these methods.
3099
3100         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
3101         
3102 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
3103
3104         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
3105
3106 2007-11-20  Martin Baulig  <martin@ximian.com>
3107
3108         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
3109
3110         * mono-debug-debugger.c
3111         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
3112         (mono_debugger_remove_breakpoint): Likewise.
3113         (mono_debugger_check_breakpoints): Likewise.
3114         (mono_debugger_register_class_init_callback): New public method.
3115         (mono_debugger_remove_class_init_callback): Likewise.
3116         (mono_debugger_add_type): Likewise.
3117
3118         * mono-debug-debugger.h
3119         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
3120
3121 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
3122
3123         * class.c: more interface implementations needed for the
3124         array enumerator (fixes bug #341112).
3125
3126 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
3127
3128         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
3129         fix ParamName of ArgumentNullExceptions.
3130
3131 2007-11-17  Miguel de Icaza  <miguel@novell.com>
3132
3133         * reflection.c (mono_reflection_encode_sighelper): Generate the
3134         modopts and modreqs.   I have a useless test that crashes monodis,
3135         but that shows the code working.
3136
3137 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
3138
3139         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
3140         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
3141
3142 2007-11-15  Dick Porter  <dick@ximian.com>
3143
3144         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
3145         When joining a thread, it's the thread that's calling Join that
3146         gets WaitSleepJoin state not the target.  Fixes the standalone
3147         test case in bug 334740, and hopefully the whole bug too.
3148
3149 2007-11-15  Dick Porter  <dick@ximian.com>
3150
3151         * process.c: Read file version info from the files pointed at by
3152         process modules, not the current process.  Fixes bug 315969.
3153
3154         Use windows typedef names in some places to fix warnings on the
3155         windows build.
3156
3157 2007-11-15  Mark Probst  <mark.probst@gmail.com>
3158
3159         * image.c, metadata-internals.h: Added a generic_class_cache hash
3160         to MonoImage for looking up generic classes when sharing generics.
3161
3162 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
3163
3164         * sgen-gc.c: warning cleanups.
3165
3166 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
3167
3168         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
3169         inherited properties.
3170
3171 2007-11-14  Mark Probst  <mark.probst@gmail.com>
3172
3173         * object.c, class-internals.h: Added more information to the
3174         runtime generic context.
3175
3176 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
3177
3178         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
3179         instead of just the target method. Generalize the abstract method handling to
3180         handle any non-static method.
3181
3182         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
3183         mono_marshal_get_delegate_invoke () signature change.
3184
3185 2007-11-13  Mark Probst  <mark.probst@gmail.com>
3186
3187         * class.c, class-internals.h: Made
3188         mono_type_get_basic_type_from_generic () public.  Fixed member
3189         access check for shared generics.
3190
3191         * loader.c: Don't insert field into field cache if it's part of a
3192         non-inflated generic class.
3193
3194         * domain.c, domain-internals.h: The generic sharing context is now
3195         part of the jit info data structure.  Added two accessor
3196         functions.
3197
3198 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
3199
3200         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
3201         the array Get/Set/Address methods, since the JIT inlines them.
3202
3203         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
3204
3205         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
3206         (mono_image_init): Initialize runtime_invoke_direct_cache.      
3207
3208         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
3209         mono_marshal_get_delegate_invoke signature change.
3210
3211         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
3212         an additional argument. Add support for invoking abstract methods.
3213
3214         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
3215
3216         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
3217
3218 2007-11-09  Mark Probst  <mark.probst@gmail.com>
3219
3220         * class.c: Do field layout for open generic classes as well.
3221
3222 2007-11-09  Mark Probst  <mark.probst@gmail.com>
3223
3224         * gc.c, gc-internal.h: Don't finalize threadpool threads with
3225         other objects, because the threadpool is still around.  Put them
3226         in a list instead and after finalizing all other objects in the
3227         root domain shut down the thread pool and then finalize the
3228         threads.  Fixes bug #337383.
3229
3230         * threads.c, thread-types.h: New mono_thread_create_internal()
3231         function for marking a thread with the threadpool flag before it
3232         started.  Set synch_cs to NULL after freeing it.
3233
3234         * threadpool.c: Mark threadpool threads before they start.
3235
3236 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
3237
3238         * reflection.h, reflection.c: don't export random functions
3239         and lazy load dbnull and missing objects.
3240
3241 2007-11-07  Jonathan Chambers <joncham@gmail.com>
3242
3243         * class.c: Initialize COM types if COM interfaces
3244         are present (not just COM classes).
3245         
3246         Code is contributed under MIT/X11 license.
3247
3248 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
3249         * reflection.c:
3250         create_dynamic_mono_image: hook module profiler events (dynamic case).
3251         mono_image_basic_init: hook assembly profiler events (dynamic case).
3252
3253 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
3254         * profiler.c:
3255         simple_appdomain_unload: completely terminate the profiler
3256         instead of only processing the statistical samples.
3257         simple_shutdown: make sure this is really called exactly once,
3258         even in multithreaded applications, and always listen to
3259         appdomain events.
3260         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
3261         here, the "[un]load" functions will do it.
3262         Fixes bugs #333791 and #325261.
3263
3264 2007-11-07  Geoff Norton  <gnorton@novell.com>
3265
3266         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
3267         rather than depend on __APPLE__.
3268
3269 2007-11-07  Mark Probst  <mark.probst@gmail.com>
3270
3271         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
3272
3273 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
3274
3275         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
3276         UTF16 MonoString. Fix the crash from bug #335488
3277
3278 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
3279
3280         * marshal.c: Correct (for non-Win32 OS) length != size in 
3281         mono_string_from_bstr. Fix #339530.
3282
3283 2007-11-06  Geoff Norton  <gnorton@novell.com>
3284
3285         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
3286         to succeed
3287
3288 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
3289
3290         * process.c: Added run-time GetProcessId API detection for Windows.
3291
3292 2007-11-04  Miguel de Icaza  <miguel@novell.com>
3293
3294         * reflection.c  (mono_param_get_objects): If a parameter has the
3295         attribute [System.Runtime.InteropServices.Optional] we should
3296         set the DefaultValue of the ParameterInfo to be
3297         System.Reflection.Missing instead of DBNull.
3298
3299         See bug #339013.
3300
3301         (mono_get_reflection_missing_object): New method,
3302         returns the System.Reflection.Missing.Value singleton instance.
3303
3304 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
3305
3306         * culture-info-table.h : regenerated.
3307
3308 2007-11-02  Jonathan Chambers <joncham@gmail.com>
3309
3310         * icall.c: Use GetEnvironmentStrings on windows
3311         so we are using the same environment block as 
3312         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
3313         #333740.
3314         
3315         Code is contributed under MIT/X11 license.
3316
3317 2007-10-31  Martin Baulig  <martin@ximian.com>
3318
3319         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
3320
3321         * mono-debug-debugger.h
3322         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
3323
3324 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
3325
3326         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
3327         classes.
3328
3329 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
3330
3331         * culture-info-table.h : regenerated.
3332
3333 2007-10-30  Robert Jordan  <robertj@gmx.net>
3334
3335         * icall-def.h, icall.c:
3336         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
3337
3338         Code is contributed under MIT/X11 license.
3339
3340 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
3341
3342         * class.c (mono_class_setup_vtable): Find the inflated methods in the
3343         inflated class instead of inflating them again.
3344         
3345         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
3346         dynamic case.
3347
3348         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
3349         Call setup_supertypes () after klass->parent is set.
3350         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
3351
3352         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
3353         for inflated instances of not yet created dynamic generic classes.
3354         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
3355         times from inflated_method.
3356         (methodbuilder_to_mono_method): Ditto.
3357
3358 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
3359
3360         * gc.c: code cleanup and removed old untested option of not creating the
3361         finalizer thread.
3362
3363 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
3364
3365         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
3366         creating a jump trampoline for dynamic methods.
3367
3368 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
3369
3370         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
3371         generic TypeBuilders when called from another method of the same type (bug #335131).
3372
3373
3374 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
3375
3376         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
3377         doesn't seem to work perfectly.
3378         
3379         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
3380         called multiple times.
3381         (methodbuilder_to_mono_method): Ditto.
3382         (resolve_object): Inflate FieldBuilder's.
3383
3384 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
3385
3386         * string-icalls.c, string-icalls.h, appdomain.c: patch from
3387         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
3388         RemoveEmptyEntries in the string.Split implementation (bug #322375).
3389
3390 2007-10-26  Dick Porter  <dick@ximian.com>
3391
3392         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
3393         Thread initialisation changes
3394
3395 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
3396
3397         * verify.c: fix compatibility check between arrays and System.Array
3398
3399 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
3400
3401         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
3402         too. Fixes #336999.
3403
3404 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
3405
3406         * object.c (mono_value_box): Use typed allocation here.
3407
3408 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
3409
3410         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
3411         trampoline instead of compiling the method right away.
3412
3413         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
3414
3415 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
3416
3417         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
3418         related fields for dynamic classes. Fixes #334493.
3419
3420 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
3421
3422         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
3423         
3424         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
3425
3426         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
3427         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
3428
3429         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
3430
3431         * reflection.c (create_generic_typespec): Initialize klass->generic_container
3432         if needed.
3433         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
3434
3435 2007-10-18  Jonathan Chambers <joncham@gmail.com>
3436
3437         * marshal.c: Use correct key when removing item
3438         from ccw_hash.
3439         
3440         Code is contributed under MIT/X11 license.
3441
3442 2007-10-17  William Holmes  <billholmes54@gmail.com>
3443
3444         *marshal.c: Adding a case to marshal booleans to U1
3445
3446         Code is contributed under MIT/X11 license.
3447
3448 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
3449
3450         * class.c (mono_class_from_name): Search the modules compromising dynamic
3451         assemblies. Fixes #331601.
3452
3453 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
3454
3455         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
3456         exception if the type name contains an assembly component. Fixes #334203.
3457
3458         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
3459         modules inside dynamic assemblies. Fixes #334200.
3460         
3461         * reflection.c: Set image->public_key and image->public_key_length;
3462
3463         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
3464         fields.
3465
3466         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
3467         
3468 2007-10-16  Mark Probst  <mark.probst@gmail.com>
3469
3470         * metadata.c: Implemented correct comparing of generic classes.
3471         An inflated generic class can be equal to a non-inflated one if it
3472         is inflated with generic type variables as type arguments.  Fixes
3473         bug #333798.
3474
3475 2007-10-15  Dick Porter  <dick@ximian.com>
3476
3477         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
3478         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
3479         81646.
3480
3481         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
3482         instead of a monitor lock.  This means that monitor_try_enter and
3483         co can set the thread state safely.
3484         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
3485         thread_interrupt_requested, so interrupt actually works.
3486
3487         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
3488         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
3489         state accessor function
3490
3491 2007-10-15  Martin Baulig  <martin@ximian.com>
3492
3493         * mono-debug.h
3494         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
3495         the debugger with the current runtime.
3496
3497 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
3498
3499         * object.c, object-internals.h: added the ability to set a single
3500         trampoline for all the slots in a vtable.
3501
3502 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
3503
3504         * marshal.c: deal with a possible race condition during multicast
3505         delegate invocation.
3506
3507 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
3508
3509         * class.c: ensure value type methods don't have the synchronized
3510         flag set.
3511
3512 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
3513
3514         * string-icalls.c, string-icalls.h: reverted unapproved patch that
3515         breaks the build.
3516
3517 2007-10-11  Joel Reed  <joelwreed@comcast.com>
3518
3519         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
3520         to take an options parameter so that empty entries can be removed during
3521         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
3522
3523 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
3524
3525         * marshal.c: make sure we don't store the signature from a dynamic
3526         method into the runtime invoke cache (bug #327189).
3527
3528 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
3529
3530         * marshal.c: make sure the wrapper methods are properly initialized.
3531
3532 2007-10-11  Mark Probst  <mark.probst@gmail.com>
3533
3534         * metadata.c, metadata-internals.h: Generalized
3535         mono_type_stack_size() to mono_type_stack_size_internal() which
3536         takes an additional argument specifying whether it allows open
3537         types.
3538
3539 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
3540
3541         * verify.c (do_invoke_method): handle typedbyref params
3542         correctly and check for unverifiable return values.
3543
3544         * verify.c (do_newobj): fix a warning.
3545
3546 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
3547
3548         * verify.c: don't tread typedbyref as allways unverifable,
3549         so uses, like (ld/st)loc.0 are valid. verify for the cases
3550         that it matters, like boxing related operations.
3551
3552 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
3553
3554         * verify.c: add verification of the newobj opcode. verification
3555         of delegate instantation still missing due ldftn and virldftn not
3556         pushing the function type on stack
3557
3558 2007-10-08  Mark Probst  <mark.probst@gmail.com>
3559
3560         * class-internals.h: Runtime generic context data structure
3561         definition.
3562
3563         * object.c: Initialization of runtime generic context at runtime
3564         vtable creation time.
3565
3566 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
3567         * class.c (mono_class_create_from_typedef,
3568         mono_class_from_generic_parameter, mono_ptr_class_get,
3569         mono_fnptr_class_get, mono_bounded_array_class_get)
3570         * domain.c (mono_domain_create, mono_domain_free)
3571         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
3572         * image.c (do_mono_image_load, mono_image_close):
3573         Hooked up load-unload profiler events.
3574
3575 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
3576
3577         * domain.c: track statistics about the actual amount of native code
3578         allocated.
3579
3580 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
3581
3582         * class.c: the valuetype enumerators don't have the additional
3583         supertypes interfaces.
3584
3585 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
3586
3587         * class.c: need more interfaces setup for the IEnumerator<T>
3588         object created for arrays (tests/ienumerator-interfaces.2.cs).
3589
3590 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
3591
3592         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
3593
3594 2007-10-05  Alp Toker  <alp@atoker.com>
3595
3596         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
3597         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
3598         #315863.
3599
3600 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
3601
3602         * verify.c (verify_type_compatibility_full): verification of
3603         compatibility improved, validates correctly non-strict checks between
3604         native int and I4 types different than (unsigned)int32.
3605
3606         * verify.c (do_store_indirect): added, do all verification of
3607         ldind.X opcodes. 
3608
3609         * verify.c (get_load_indirect_mono_type): renamed to
3610         get_indirect_op_mono_type, as it now returns the MonoType for 
3611         ldind.X and stind.X opcodes.
3612
3613 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
3614
3615         * reflection.c: Fix the encoding of generic type definition for
3616         TypeBuilders.
3617
3618         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
3619         mono_image_typedef_or_ref but allows to specify if typespec lookups should
3620         be made. Typespec check is done prior to typeref cache lookup.
3621
3622         * reflection.c (mono_image_typedef_or_ref): now just delegate to
3623         mono_image_typedef_or_ref_full.
3624
3625         * reflection.c (encode_generic_class): encode the generic class
3626         directly instead of calling encode_type.
3627
3628         * reflection.c (encode_type): encode the generic type definition
3629         MonoClass as a generic instantiation.
3630
3631         * reflection.c (create_typespec): cache typespec tokens in
3632         the assembly->typespec cache. Don't create typespec for a generic
3633         instance MonoClass. Create typespec for the generic type defintion.
3634
3635         * reflection.c (create_generic_typespec): encode the generic
3636         class directly instead of calling encode_type.
3637
3638         * reflection.c (mono_image_create_token): encode the generic
3639         type definition not using a typespec for MonoType instances.
3640
3641
3642 2007-10-04  Raja R Harinath  <rharinath@novell.com>
3643
3644         Fix #328812
3645         * class.c (mono_image_init_name_cache): Don't return nested
3646         'protected internal' classes.
3647         (mono_class_from_name_case): Likewise.
3648
3649 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
3650
3651         * icall-def.h, icall.c : get_bundled_machine_config() is now the
3652           common function used by both DefaultConfig in System.dll and
3653           InternalConfigurationHost in System.Configuration.dll.
3654
3655 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
3656
3657         * class.c: automatically add to vectors only a few essential explicit
3658         generic interfaces. The rest of the interfaces that arrays should
3659         provide are currently implicitly added (but still not lazily, see the
3660         design in the discussion of bug#325495 for the details of what is
3661         needed for that). Additionally, implicit interfaces are assigned the
3662         same vtable slot as the explicit interfaces (as they are compatible):
3663         this enables huge memory savings since we don't need to instantiate
3664         as many memthods and as large vtables anymore. Also, Since
3665         GetEnumerator<T> returns an instance of a type that is required to
3666         support a similarly large set of interfaces as arrays, we add
3667         implicit interfaces and interface offset sharing support to those
3668         types, too. This change adds all the required interfaces so that
3669         the anonarray.cs test case in the bug report works (we don't add
3670         all the interfaces to arrays of arrays 3-level deep and more because
3671         of the memory requirements explained in the bug and since they are much
3672         less common: the lazy-loading support will enabled them to work, too).
3673
3674 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
3675
3676         * verify.c (merge_stacks): major clean up, all type compatibility
3677         checks are done by verify_type_compatibility. This fix my earlier lack
3678         of understanding of the CLR type system and merge_stacks no longer looks
3679         scary.
3680
3681         * verify.c: fixed some bad spelling.
3682
3683 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
3684
3685         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
3686         a given stack slock.
3687         
3688         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
3689         verify_type_compatibility_full. This removed a near indentical function and fixed
3690         handling of Int32 and IntPtr across all opcodes.
3691
3692 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
3693
3694         * class.c: only vectors have the additional generic interfaces.
3695
3696 2007-10-01  Jonathan Chambers <joncham@gmail.com>
3697
3698         * mono-config.c: Use g_strcasecmp instead of
3699         strcasecmp like everywhere else to fix
3700         compilation with MSVC.
3701         
3702         Code is contributed under MIT/X11 license.
3703
3704 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
3705
3706         * object.c, object-internals.h: refactored the IMT code to enable
3707         building a single slot at a time and lazily creating the IMT trampolines
3708         and thunks.
3709
3710 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
3711
3712         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
3713
3714         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
3715         Fixes #328501.
3716         
3717 2007-09-29  Raja R Harinath  <harinath@gmail.com>
3718
3719         * loader.c (method_from_methodspec): Rearrange to avoid
3720         un-necessary exposition.  Don't assert out if the method's
3721         declaring type is a generic type definition.
3722
3723 2007-09-28  Martin Baulig  <martin@ximian.com>
3724
3725         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
3726
3727 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
3728
3729         * class-internals.h: optimize field layout of MonoClass to
3730         requires less cachelines at runtime and save a few bytes on 64 bit
3731         systems.
3732
3733 2007-09-28  Jb Evain  <jbevain@novell.com>
3734
3735         * reflection.c: when encoding type names in custom attributes,
3736         if the type is a closed generic type, its generic arguments
3737         have to be serialized as AssemblyQualifiedName, so that when
3738         they are deserialized, it's possible to re-create them properly.
3739         Fixes #329450.
3740
3741
3742 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
3743
3744         * object.c, class-internals.h: added delegate-creation counter.
3745
3746 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
3747
3748         * class.c: cleanup of the code that synthetizes interfaces for
3749         arrays in 2.0: saves quit a bit of corlib mempool memory.
3750         Code to fix bug #325495 ifdeffed out for now until the issues
3751         with memory usage and O(n^2) behaviour are fixed.
3752
3753 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
3754
3755         * marshal.c: when possible, do not duplicate the name of the methods
3756         in the method builder and in the generated MonoMethod.
3757
3758 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
3759         * verify.c: added support for type checking ldind_* opcodes.
3760
3761 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
3762
3763         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
3764         which is used to distinguish the fully open instantiation of a TypeBuilder
3765         with the rest. This temporary hack is required to restore the property that
3766         the fully open instantiation is the same type of the generic type definition.
3767
3768         * class-internals.h (mono_generic_class_is_generic_type_definition):
3769         new function as part of the internal API.
3770
3771         * class.c (inflate_generic_type): return NULL when the generic inst is
3772         fully open. The fully open generic type is now the same as the generic type
3773         definition for non TypeBuilder types.
3774
3775         * class.c (mono_generic_class_get_class): removed assert since it is
3776         no longer valid, gklass->cached_class can point to the generic type definition.
3777
3778         * class.c (mono_generic_class_is_generic_type_definition): new.
3779
3780         * metadata.c (mono_generic_class_hash): added is_tb_open field
3781         to the hash calculation.
3782
3783         * metadata.c (free_generic_class): if the generic class is associated
3784         with the generic type definition, its field will come from the mempool and
3785         must not be freed.
3786
3787         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
3788         new, this function identifies the corner case of a TypeBuilder fully open
3789         instantiation.
3790
3791         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
3792         for lookup. Set gclass->cached_class to be the container class in case of
3793         the fully open instantiation of non TypeBuilder types.
3794
3795         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
3796         to compare generic classes.
3797
3798         * reflection.c (method_encode_methodspec): remove assert that
3799         no longer is valid.
3800
3801         * reflection.c (mono_reflection_generic_class_initialize): add
3802         an aditional assert to ensure the proper type is used.
3803
3804 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
3805
3806         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
3807         to enjoy it.
3808
3809 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
3810
3811         * verify.c (push_arg): Fixed support for ldarga
3812         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
3813         MonoType used as first arg in case of instance calls.
3814
3815 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
3816
3817         * verify.c: Support for verifying VAR and MVAR types, 
3818
3819 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
3820
3821         * icall.c (ves_icall_get_property_info): Set the reflected type of the
3822         accessors correctly.
3823
3824 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
3825
3826         * threads.c: support OSX and other systems in
3827         mono_thread_get_stack_bounds (bug #328026).
3828
3829 2007-09-25  Martin Baulig  <martin@ximian.com>
3830
3831         * mono-debug.h
3832         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
3833
3834 2007-09-24  Martin Baulig  <martin@ximian.com>
3835
3836         * mono-debug.h
3837         (MonoDebugClassEntry): Moved the definition of this struct into
3838         mono-debug.c to make it private.
3839
3840         * mono-debug.c
3841         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
3842         type table per symbol file, we don't need to store the symfile id
3843         any longer.
3844
3845 2007-09-24  Martin Baulig  <martin@ximian.com>
3846
3847         Create one type table per symbol file, since a `MonoClass *' gets
3848         invalid when its image is unloaded.
3849
3850         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
3851         (MonoDebugHandle): Added `type_table'.
3852
3853 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
3854
3855         * mempool.c, mempool.h: added mono_mempool_new_size () API
3856         to be able to specify a smaller initial size for the pool.
3857         Adjusted the code to slowly increase pool size before using
3858         the previous default size.
3859         * image.c: use a small initial size for image mempools.
3860
3861 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
3862
3863         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
3864         Fixes ##320990.
3865
3866         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
3867         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
3868
3869 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
3870
3871         * metadata.c (mono_type_create_from_typespec): Remove an invalid
3872         free. Fixes #327438.
3873
3874 2007-09-21  Raja R Harinath  <harinath@gmail.com>
3875
3876         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
3877         generic instantiations, etc.
3878         <MONO_TYPE_ARRAY>: Likewise.
3879
3880 2007-09-21  Martin Baulig  <martin@ximian.com>
3881
3882         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
3883         these structs were never defined.
3884         (MonoDebugHandle): Removed the `_priv' field, it was never used.
3885
3886 2007-09-21  Martin Baulig  <martin@ximian.com>
3887
3888         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
3889
3890 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
3891
3892         * image.c: removed the guid hash tables: we can get the same info
3893         without the additional memory usage hit (partially fixes also bug #327052).
3894
3895 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
3896
3897         * profiler.h, profiler-private.h, profiler.c: add a new profiler
3898         event to handle unloading methods. After the event is called, the
3899         corresponding MonoMethod* must be considered invalid.
3900         * loader.c (mono_free_method): call the new mono_profiler_method_free
3901         event.
3902
3903 2007-09-20  Mark Probst  <mark.probst@gmail.com>
3904
3905         * domain-internals.h: New flag in MonoJitInfo which marks shared
3906         generic methods.  New hash table (shared_generics_hash) in
3907         MonoDomain to keep track of shared generic methods.  Prototypes
3908         for functions to register and lookup shared generic methods.
3909
3910         * domain.c: Support for registering and looking up shared generic
3911         methods via a hash table (shared_generics_hash) in MonoDomain.
3912
3913         * class-internals.h: New exception to signal failure of shared
3914         compilation of a generic method.  New counters for generics
3915         sharing in MonoStats.
3916
3917 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
3918
3919         * image.c, metadata-internals.h: don't keep a file descriptor open
3920         for loaded assemblies (bug#325988).
3921
3922 2007-09-19  Raja R Harinath  <rharinath@novell.com>
3923
3924         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
3925         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
3926         use the corresponding datatypes.
3927         (type_in_image): Update to changes.
3928         (CleanForImageUserData): Simplify.
3929         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
3930         Avoid quadratic behaviour in handling the "stolen" list by
3931         separating the filter predicate out, and by prepending the stolen
3932         items rather than appending them.
3933         (steal_ginst_in_image): Likewise.
3934         (mono_metadata_clean_for_image): Update to changes.
3935
3936 2007-09-19  Martin Baulig  <martin@ximian.com>
3937
3938         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
3939
3940 2007-09-19  Martin Baulig  <martin@ximian.com>
3941
3942         * mono-debug.c (mono_debug_cleanup): Don't call
3943         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
3944
3945 2007-09-19  Raja R Harinath  <harinath@gmail.com>
3946
3947         Fix crash on 'make run-test' in mcs/errors
3948         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
3949         Avoid more potential allocations in mono_class_from_mono_type.
3950         (ginst_in_image): Update to changes.
3951         (gclass_in_image): Rearrange slightly.
3952
3953 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
3954
3955         * class.c (mono_class_init): Move the code that sets up class->methods to 
3956         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
3957
3958         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
3959         canonical instance of an inflated generic signature.
3960         (mono_type_create_from_typespec): Remove an invalid free.
3961
3962         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
3963
3964 2007-09-18  Marek Habersack  <mhabersack@novell.com>
3965
3966         * domain-internals.h: added a declaration of the
3967         mono_assembly_load_full_nosearch internal function.
3968
3969         * assembly.c (mono_assembly_load_with_partial_name): use
3970         mono_try_assembly_resolve return value properly.
3971         (mono_assembly_load_full_nosearch): copied the function body from
3972         mono_assembly_load_full, without the code to invoke assembly
3973         search hooks.
3974         (mono_assembly_load_full): calls the above new function and if the
3975         assembly is not resolved, invokes the search hooks.
3976
3977         * appdomain.c (mono_runtime_init): restore the global postload
3978         assembly search handlers.
3979
3980 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
3981
3982         * class.c (mono_class_init): Make sure class->methods and class->properties
3983         are never NULL in the generics case.
3984
3985         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
3986
3987 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
3988
3989         * metadata.c (free_generic_class): Disable some code to fix the build.
3990
3991         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
3992
3993         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
3994         from the image mempool.
3995
3996         * metadata.c (free_generic_class): Free more data from the inflated class.
3997
3998         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
3999
4000         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
4001         mempool.
4002         (mono_type_create_from_typespec): Ditto.
4003
4004         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
4005         MonoImage to the caller.
4006         (mono_init_internal): Save the opened image in a global variable.
4007         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
4008
4009         * reflection.c (resolve_object): Fix a leak.
4010
4011         * metadata.c: Fix the freeing of data in the generics caches.
4012         
4013         * metadata.c (free_generic_inst): Comment this out to fix the build.
4014         (free_generic_class): Ditto.
4015
4016         * metadata.c: Free cached generic methods, instantinations and classes when
4017         they are removed from the caches.
4018         (mono_metadata_free_type): Free the type itself.
4019
4020         * class.c: Free the result of mono_class_inflate_generic_type () in a few
4021         places.
4022
4023 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
4024
4025         * boehm-gc.c: restrict managed allocs to __thread supporting
4026         architectures.
4027
4028 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
4029
4030         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
4031         (mono_generic_class_get_class): Fix a leak.
4032
4033         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
4034         mono_metadata_free_type ().
4035         (mono_metadata_inflate_generic_inst): Fix a leak.
4036
4037 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
4038
4039         * mono-debug.c (free_header_data): Fix a leak missed earlier.
4040
4041         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
4042         mempool.
4043
4044         * mono-debug.c (mono_debug_close_image): Fix call to 
4045         g_hash_table_remove ().
4046
4047 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
4048
4049         * icall-def.h: redirect all the string ctor to the managed
4050         CreateString () methods.
4051         * string-icalls.c, string-icalls.h: removed dead code for string
4052         ctors and icalls.
4053
4054 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
4055
4056         * mono-debug.c: Fix memory leaks.
4057
4058 2007-09-14  Jonathan Chambers <joncham@gmail.com>
4059
4060         * threads-types.h: Implement mono_hazard_pointer_set and 
4061         mono_hazard_pointer_clear macros using do/while(0) to fix
4062         compilation with MSVC.
4063         
4064         Code is contributed under MIT/X11 license.
4065
4066 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
4067
4068         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
4069         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
4070
4071 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
4072
4073         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
4074         icalls.
4075
4076 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
4077
4078         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
4079         managed-code allocated as well.
4080
4081 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
4082
4083         * class.c (mono_class_is_assignable_from): Add support for generic variance.
4084
4085 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
4086
4087         * boehm-gc.c: fixed the build after the AOT changes.
4088
4089 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
4090
4091         * wrapper-types.h: Add an ALLOC wrapper type.
4092
4093         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
4094         reference managed allocator methods.
4095
4096 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4097
4098         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
4099         of Type array and not MonoType, a fix suggested by Hari.
4100         
4101 2007-09-12  Jonathan Chambers <joncham@gmail.com>
4102
4103         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
4104         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
4105         
4106         Code is contributed under MIT/X11 license.
4107
4108 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
4109
4110         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
4111
4112 2007-09-12  Marek Habersack  <mhabersack@novell.com>
4113
4114         * image.c (do_mono_image_open): if assembly file fails to open and
4115         MONO_IOMAP is in effect, try to find the path in a
4116         case-insensitive way.
4117
4118         * appdomain.c (mono_runtime_init): do not install postload hooks -
4119         tests show that MS.NET doesn't use anything of that sort to
4120         trigger the AppDomain.AssemblyResolve event.
4121         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
4122         made non-static.
4123         (mono_runtime_init): init portability helpers here.
4124
4125         * assembly.c (mono_assembly_load_with_partial_name): if other   
4126         attempts fail, trigger the AppDomain.AssemblyResolve event handler
4127         to resolve the assembly.
4128
4129         * domain-internals.h: added mono_try_assembly_resolve and marked
4130         it as internal.
4131
4132 2007-09-11  Jb Evain  <jbevain@novell.com>
4133
4134         * object-internals.h (MonoReflectionDynamicMethod): add
4135         a `MonoReflectionType *owner` field. The owner is used
4136         * reflection.c:
4137         (mono_reflection_create_dynamic_method): use the owner of the dynamic
4138         method as the class declaring the dynamic method.
4139         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
4140         dynamic method to the declaring type of the methodbuilder.
4141
4142 2007-09-11  Mark Probst  <mark.probst@gmail.com>
4143
4144         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
4145         rules for calling methods via reflection.
4146
4147 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
4148
4149         * reflection.c (resolve_object): Add support for MonoGenericClass. 
4150         Inflate MonoType's.
4151
4152 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
4153
4154         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
4155         provide a managed method that does fast allocations without needing
4156         a managed->unmanaged transition. Boehm GC implementation currently
4157         enabled for ptrfree objects on sane architectures.
4158
4159 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
4160
4161         * marshal.c, marshal.h: exported a couple of useful functions and
4162         added mono_mb_get_label () to easily handle backward branches.
4163
4164 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
4165
4166         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
4167
4168 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
4169
4170         * loader.c (find_method): Fixed the regression introduced while
4171         fixing bug #81466.
4172
4173 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
4174
4175         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
4176         well.
4177         
4178         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
4179         icall.c reflection.c: Pass a MonoGenericContext argument to 
4180         mono_lookup_dynamic_token ().
4181
4182         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
4183         #82744.
4184         
4185 2007-09-09  Robert Jordan  <robertj@gmx.net>
4186
4187         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
4188         for generic methods.
4189
4190         * object.c (mono_object_get_virtual_method): Handle generic methods.
4191         Fixes bug #78882.
4192
4193         Code is contributed under MIT/X11 license.
4194
4195 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
4196
4197         * image.c: fix locking in mono_image_load_file_for_image ().
4198
4199 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
4200
4201         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
4202         used only as a cache: added an icall to fill it.
4203
4204 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
4205
4206         * reflection.h: exposed mono_reflection_free_type_info
4207         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
4208         since mono_reflection_bind_generic_parameters makes a copy of it.
4209         * reflection.c (free_type_info): subinfos should be freed.
4210         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
4211         made non static.
4212         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
4213         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
4214         this fixes #82695 and #81726.
4215    
4216
4217 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
4218
4219         * process.h, process.c:  added support for user profile/info in
4220           ProcessStartInfo. For now only Windows works.
4221
4222 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
4223
4224         * metadata.c: consider the generic arguments when comparing
4225         signatures (bug #82614).
4226
4227 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
4228
4229         * cil-coff.h, image.c: updated assembly loader to cope with the
4230         PE32+ 64 bit file format.
4231
4232 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
4233
4234         * assembly.c, class.c, domain.c, loader.c: remove useless
4235         inclusion of cil-coff.h.
4236
4237 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
4238
4239         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
4240         if interface is marked with CoClassAttribute. 
4241    
4242         Code is contributed under MIT/X11 license.
4243
4244 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
4245
4246         * sgen-gc.c: ensure no object from the to space is copied again or finalized
4247         if it's seen twice in major collections.
4248
4249 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
4250
4251         * sgen-gc.c: big objects are not copied to the gray area, but they
4252         need to be considered for scanning, too, if they are brought alive
4253         by an object ready for finalizations or a survived one.
4254
4255 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
4256
4257         * sgen-gc.c: properly account the number of disappearing links when
4258         they are nullified.
4259
4260 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
4261
4262         * sgen-gc.c: share the code to scan the registered roots between the
4263         different types of collections.
4264
4265 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
4266
4267         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
4268
4269 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
4270
4271         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
4272         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
4273
4274 2007-08-28  Mark Probst  <mark.probst@gmail.com>
4275
4276         * security-manager.c (mono_security_manager_get_methods):
4277         LinkDemandSecurityException now has 2 arguments instead of 3.
4278
4279 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
4280
4281         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
4282         platforms which need it.
4283
4284 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
4285
4286         * sgen-gc.c: unregister thread data structures with a pthread_key_t
4287         dtor.
4288
4289 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
4290
4291         * threads.c: free the thread static data on thread exit.
4292
4293 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
4294
4295         * class.c: walk the hierarchy to find the generic definition for
4296         a class (fixes runtime part of bug #82498).
4297
4298 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
4299
4300         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
4301         ...
4302
4303         * image.c (mono_image_close): Here. Hopefully fixes #82510.
4304
4305 2007-08-24  Mark Probst  <mark.probst@gmail.com>
4306
4307         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
4308
4309 2007-08-24  Robert Jordan  <robertj@gmx.net>
4310
4311         * appdomain.c: don't perform the ':'->';' substitution on Win32.
4312
4313 2007-08-24  Jb Evain  <jbevain@novell.com>
4314
4315         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
4316         for byref types.
4317
4318 2007-08-24  Mark Probst  <mark.probst@gmail.com>
4319
4320         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
4321         #82286.
4322
4323 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
4324
4325         * assembly.c: Fix a warning.
4326         
4327 2007-08-23  Marek Habersack  <mhabersack@novell.com>
4328
4329         * appdomain.c: parse the <runtime> section looking for the probing
4330         element with the 'privatePath' attribute, which sets additional
4331         directories in which the runtime should look for assemblies.
4332
4333 2007-08-23  Robert Jordan  <robertj@gmx.net>
4334
4335         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
4336         Fixes #82499.
4337
4338 2007-08-23  Martin Baulig  <martin@ximian.com>
4339
4340         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
4341         _mono_debug_init_corlib() and remove it from the header file.
4342
4343 2007-08-23  Martin Baulig  <martin@ximian.com>
4344
4345         * mono-debug-debugger.c
4346         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
4347         don't notify the debugger about it.
4348
4349         * mono-debug-debugger.h
4350         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
4351
4352 2007-08-23  Robert Jordan  <robertj@gmx.net>
4353
4354         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
4355         Code is contributed under MIT/X11 license.
4356
4357 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
4358
4359         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
4360
4361 2007-08-22  Martin Baulig  <martin@ximian.com>
4362
4363         * mono-debug.c: Store debugging info on a per-domain basis and
4364         free it on domain unload.  Add support for unloading symbol files.
4365
4366         * mono-debug.h
4367         (MonoDebugList): New typedef.
4368         (MonoSymbolTable):
4369         - add `data_tables and `type_table'.
4370         - replace 'symbol_files' and `num_symbol_files' with a
4371           `MonoDebugList *'.
4372         (mono_debug_data_table): Removed.
4373         (mono_debug_list_add): New public function.
4374         (mono_debug_list_remove): New public function.
4375         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
4376         (mono_debug_init_2_memory): Renamed into
4377         mono_debug_open_image_from_memory().
4378         (mono_debug_close_image): New public function.
4379         (mono_debug_domain_create): Likewise.
4380         (mono_debug_domain_unload): Likewise.
4381         (MONO_DEBUGGER_VERSION): Bump to 60.
4382
4383         * mono-debug-debugger.h
4384         (MonoDebuggerEvent):
4385         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
4386         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
4387         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
4388         - rename `THREAD_CREATED' and `THREAD_EXITED' into
4389           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
4390         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
4391           meaning.
4392         (mono_debugger_add_symbol_file): Removed.
4393         (mono_debugger_add_type): Removed.
4394         (mono_debugger_lookup_type): Removed.
4395         (mono_debugger_lookup_assembly): Removed.
4396
4397         * domain.c
4398         (mono_domain_create): Call mono_debug_domain_create().
4399         (mono_init_internal): Call mono_debug_init_corlib().
4400
4401         * assembly.c
4402         (mono_assembly_close): Call mono_debug_close_image().
4403
4404 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
4405
4406         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
4407         mmap call.
4408
4409 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
4410
4411         * sgen-gc.c: ensure section->pin_queue_end is initialized
4412         correctly when non pinning objects in the section have been found.
4413
4414 2007-08-22  Marek Habersack  <mhabersack@novell.com>
4415
4416         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
4417         containing a list of directories separated by ':'. MSDN docs say
4418         the directories should be separated with ';'. Part of a bugfix for
4419         bug #81446
4420
4421 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
4422
4423         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
4424         it should MonoType and not MonoClass.
4425
4426 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
4427
4428         * culture-info-table.h : regenerated.
4429
4430 2007-08-20  William Holmes  <billholmes54@gmail.com>
4431
4432         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
4433          to call ReplaceFile Kernel32 on windows or in io-layer.
4434         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
4435         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
4436          as an internal call.
4437
4438         Code is contributed under MIT/X11 license.
4439
4440 2007-08-20  Jb Evain  <jbevain@novell.com>
4441
4442         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
4443         and MONO_EXCEPTION_FIELD_ACCESS.
4444
4445         * debug-helpers.[c|h]: new mono_field_full_name function.
4446
4447 2007-08-20  Mark Probst  <mark.probst@gmail.com>
4448
4449         * class.c: Removed class_security_level() and moved it to
4450         security-core-clr.c.
4451
4452         * security-core-clr.c, security-core-clr.h: class_security_level()
4453         is now public and renamed to mono_security_core_clr_class_level().
4454         It also looks for security attributes in the classes a class is
4455         nested in.
4456
4457 2007-08-20  Mark Probst  <mark.probst@gmail.com>
4458
4459         * security-core-clr.c, security-core-clr.h: CoreCLR security
4460         utility functions.
4461
4462         * Makefile.am: Added security-core-clr.[ch].
4463
4464         * security-manager.c, security-manager.h: Functions and enum for
4465         setting and getting the security mode.
4466
4467         * class.c: CoreCLR security checks.
4468
4469 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
4470
4471         * icall-def.h, process.c, process.h: implemented icall to get
4472         user/system processor times.
4473
4474 2007-08-17  Mark Probst  <mark.probst@gmail.com>
4475
4476         * domain.c, threads.c, class-internals.h, domain-internals.h: New
4477         reader-lock-free jit_info_table.
4478
4479 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
4480
4481         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
4482
4483         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
4484
4485         * object-internals.h (MonoException): Add missing _data member.
4486
4487 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
4488
4489         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
4490         checking that only methods with matching qname or fqname are picked
4491         from implemented interfaces.
4492
4493 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
4494
4495         * verify.c (do_newarr):added, do type verification of
4496         newarr ops, push the right value on the eval stack.
4497         * verify.c (mono_method_verify): use do_newarr
4498
4499
4500 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
4501
4502         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
4503         factored the common code into get_boxable_mono_type, which
4504         is now using mono_type_get_full, this fixed byref related tests.
4505
4506 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
4507
4508         * class.c: added mono_type_get_full, this function has the same
4509         behavior of mono_class_get_full but the returned MonoType has
4510         all metadata of the associated token in case of a typespec token.
4511         * class.c: added mono_type_retrieve_from_typespec, used by 
4512         mono_type_get_full to retrieve the token type.
4513         * class.c (mono_class_create_from_typespec): changed to use
4514         mono_type_retrieve_from_typespec.
4515         * class.c (mono_ldtoken): changed to use mono_type_get_full
4516         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
4517         * class-internals.h: exported mono_type_get_full for internal use.
4518
4519 2007-08-16  Jb Evain  <jbevain@novell.com>
4520
4521         * domain.c (supported_runtimes): add entry for
4522         the 'moonlight' runtime version.
4523
4524 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
4525
4526         * verify.c (mono_method_verify): small typo sliped in.  
4527
4528 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
4529
4530         * verify.c (do_unbox_value): added, do type verification of
4531         unboxing ops
4532         * verify.c (mono_method_verify): use do_unbox_value
4533
4534
4535 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
4536
4537         * verify.c (dump_stack_value): fixed typo, was printing string
4538         instead of object on stack.
4539         * verify.c (do_box_value): moved the byref check up as it leads
4540         to invalid code and should be done earlier.
4541         * verify.c: improved error messages for and ldobj
4542
4543 2007-08-15  William Holmes  <billholmes54@gmail.com>
4544
4545         * marshal.c (emit_marshal_custom): Omit the call to 
4546           marshal_native_to_managed when calling native to managed 
4547           and the argument is specified as an out argument.
4548
4549         Code is contributed under MIT/X11 license.
4550
4551 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
4552
4553         * verify.c: fixed the type checks for generics, function pointers and vectors.
4554         Added type verification for ldobj and ldtoken. The verifier
4555         would segfault if header or signature of a method contained references
4556         to non-existant types.
4557
4558 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
4559
4560         * marshal.c (cominterop_get_ccw): Patch from
4561         Bill Holmes to no walk up interface hierarchy. 
4562         All parent methods should be present in the interface for COM.
4563    
4564         Code is contributed under MIT/X11 license.
4565
4566 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
4567
4568         * marshal.c (emit_marshal_com_interface): Patch from
4569         Bill Holmes to handle COM Interfaces as return values
4570         for native->managed calls.
4571    
4572         Code is contributed under MIT/X11 license.
4573
4574 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
4575
4576         * marshal.c (cominterop_get_idispatch_for_object): Implement
4577         for runtime callable wrappers.
4578    
4579         Code is contributed under MIT/X11 license.
4580
4581 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
4582
4583         * pedump.c (main): changed from mono_init to mono_init_from_assembly
4584         so 2.0 types are accessible
4585
4586
4587 2007-08-13  Miguel de Icaza  <miguel@novell.com>
4588
4589         * domain.c (mono_init_internal): Call mono_assembly_load_friends
4590         once we load mscorlib.   Due to the order in which we initialize,
4591         the mono_assembly_load_full routine that loads mscorlib did not
4592         load friends.   We now load it once we load the
4593         mono_defaults.internals_visible_class class. 
4594
4595         * assembly.c: Expose the mono_load_friend_assemblies method.
4596
4597 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
4598
4599         * verify.c: improved the handling of boxing, better
4600         type checking for unary ops and conversion. Fix bug
4601         regarding managed pointer compatibility checking
4602
4603 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
4604
4605         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
4606
4607         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
4608
4609 2007-08-09  Raja R Harinath  <rharinath@novell.com>
4610
4611         * reflection.c (dup_type): Remove.
4612         * class.c (dup_type): Remove.
4613         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
4614         instead of the dodgy 'dup_type'.
4615         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
4616         handle the case where 'dup_type' needed the second argument.
4617
4618 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
4619
4620         * domain.c: Fix a warning.
4621
4622 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
4623
4624         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
4625         checking that methods with the same fqname are not overridden
4626         with a method from an ancestor.
4627
4628 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
4629
4630         * threads.c (free_thread_static_data_helper): Avoid a crash if
4631         thread->static_data is not yet set.
4632
4633 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
4634
4635         * marshal.c: Use correct image when emitting
4636         native wrapper for COM calls.
4637    
4638         Code is contributed under MIT/X11 license.
4639
4640 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
4641
4642         * icall-def.h, security.c, security.h :
4643           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
4644
4645 2007-08-07  Martin Baulig  <martin@ximian.com>
4646
4647         * mono-debug-debugger.h
4648         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
4649
4650         * domain.c (mono_domain_free): Call
4651         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
4652
4653 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
4654
4655         * verify.c (check_underflow, check_overflow): error message now returns IL offset
4656         * verify.c (in_same_block): code should test if either offset is inside the clauses
4657         * verify.c (mono_method_verify): push the exception into the eval stack of exception
4658         and filter blocks
4659
4660 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
4661
4662         * image.c (mono_image_close): Fix a leak.
4663
4664         * object.c (mono_runtime_invoke_array): Avoid using alloca.
4665
4666         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
4667
4668 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
4669
4670         * domain.c, threads.c, threads-types.h: fix memory retention issue
4671         with thread static variables not being cleared on domain unload.
4672         Reuse thread static slots after domain unload.
4673
4674 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
4675
4676         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
4677         nullable type.
4678
4679         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
4680         now done in mono_runtime_invoke_array.
4681
4682         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
4683         receiver is a nullable type.
4684
4685         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
4686         generic parameter.
4687
4688 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
4689
4690         * marshal.c: Implement COM Objects as return type for 
4691         managed->unmanaged calls. Added Release calls for COM Object
4692         out/return values in managed->unmanaged calls.
4693
4694         Code is contributed under MIT/X11 license.
4695
4696 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
4697
4698         * threads.h, threads-type.h: move the hazard pointer declarations
4699         to the private header.
4700
4701 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
4702
4703         * file-io.c, appdomain.c: memory leak fixes.
4704
4705 2007-08-02  Dick Porter  <dick@ximian.com>
4706
4707         * socket-io.c
4708         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
4709         SO_REUSEADDR setting into io-layer/sockets.c.
4710
4711 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
4712
4713         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
4714         from Object when called on a generic parameter. Fixes #82211.
4715
4716 2007-08-01  Dick Porter  <dick@ximian.com>
4717
4718         * file-io.c (convert_share): Test FileShare values bit-by-bit.
4719         Fixes bug 79250 yet again.
4720
4721 2007-07-30  Martin Baulig  <martin@ximian.com>
4722
4723         Merged the `debugger-dublin' branch.
4724
4725         * mono-debug.h
4726         (MonoDebugDataTable): New typedef.
4727         (MonoDebugMethodAddressList): New typedef.
4728         (MonoDebugWrapperData): Removed.
4729         (MonoDebugSymbolTable): Removed `current_data_table',
4730         `current_data_table_size', `current_data_table_offset'.
4731         (MonoDebugDataItemType): Moved into mono-debug.c.
4732         (MonoDebugMethodJitInfo): Remove `address'.
4733         (mono_debug_data_table): New global variable.
4734         (mono_debug_lookup_method_addresses): New public function.
4735         (mono_debug_find_method): Take a `MonoMethod *', not a
4736         `MonoDebugMethodInfo *'.
4737
4738         * mono-debug.c: Drop support for the old symbol tables.
4739
4740 2007-06-28  Martin Baulig  <martin@ximian.com>
4741
4742         * mono-debug.c (mono_debug_debugger_version): New public variable.
4743
4744 2007-07-31  William Holmes  <billholmes54@gmail.com>
4745
4746         * metadata.c Changed mono_type_create_from_typespec to not insert
4747           the type into the hash map until after
4748           do_mono_metadata_parse_type has completed.
4749         Fixes Bug #82194
4750         Code is contributed under MIT/X11 license.
4751
4752 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
4753
4754         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
4755         generic parameter. Fixes #82211.
4756
4757 2007-07-27  Jb Evain  <jbevain@novell.com>
4758
4759         * pedump.c (dump_metadata, dump_metadata_header): dump
4760         versions contained in the metadata header.
4761
4762 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
4763
4764         * threads.c: register small_id_table with the GC.
4765
4766 2007-07-27  Mark Probst  <mark.probst@gmail.com>
4767
4768         * threads.c, threads.h, class-internals.h, object-internals.h:
4769         Hazard pointers, to be used by lock-free parallel algorithms.
4770
4771 2007-07-26  Dick Porter  <dick@ximian.com>
4772
4773         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
4774         routine on non-windows platforms, as I've not managed to think of
4775         a non-kludgy way of doing this.  Finishes off bug 78739.
4776
4777 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
4778
4779         * object.c: properly setup interface_bitmap in proxy vtables.
4780
4781 2007-07-25  Marek Habersack  <mhabersack@novell.com>
4782
4783         * appdomain.c (get_shadow_assembly_location): do not use TickCount
4784         to create unique shadow copy target directories, use the domain's
4785         serial number instead. Each domain gets a unique target directory
4786         that way.
4787
4788         * domain.c (mono_domain_create): added code to increment domain
4789         shadow copy serial number and cache the value in the current
4790         domain structure.
4791
4792         * domain-internals.h (struct _MonoDomain): added a new field -
4793         shadow_serial to hold the serial number used in generation of
4794         shadow-copy directories. This is to make sure that the directory
4795         name is unique for each and every domain created. We avoid a race
4796         condition with overriding assemblies already in use by other app
4797         domains.
4798
4799 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
4800
4801         * class.c (mono_bounded_array_class_get): fixed memory leak when 
4802         binding generic parameters.
4803
4804 2007-07-24  Raja R Harinath  <rharinath@novell.com>
4805
4806         * metadata.c (do_mono_metadata_parse_generic_class): Use
4807         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
4808         error.
4809
4810 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
4811
4812         * loader.c, class-internals.h, reflection.c: removed the per-method
4813         generics hashtable: we use the global one through the call of
4814         mono_class_inflate_generic_method ().
4815
4816 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
4817
4818         * class.c, metadata.c, class-internals.h: introduce yet another
4819         generics global cache for inflated methods (fixes 98% of the perf
4820         issue in bug #81806).
4821
4822 2007-07-23  Raja R Harinath  <rharinath@novell.com>
4823
4824         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
4825         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
4826         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
4827         return a MonoGenericInst containing (a copy) of those types.
4828         (mono_metadata_inflate_generic_inst): Update to changes.
4829         (mono_metadata_parse_generic_inst): Likewise.
4830         (mono_get_shared_generic_inst): Likewise.
4831         * reflection.c (mono_class_bind_generic_parameters): Likewise.
4832         (mono_reflection_bind_generic_method_parameters): Likewise.
4833         * metadata-internals.h: Likewise.
4834         * icall.c (free_generic_context): Kill.
4835         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
4836
4837         * reflection.c (reflection_methodbuilder_to_mono_method): Use
4838         mono_metadata_type_dup.
4839         * marshal.c (mono_mb_create_method): Likewise.
4840
4841         * metadata.c (mono_metadata_type_dup): Rename from
4842         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
4843         MonoImage.  Handle a few more cases, esp. when no mempool is given.
4844         * marshal.c, metadata-internals.h: Update to changes.
4845
4846 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
4847
4848         * class.c: fixed a small leak for array classes and removed warning.
4849
4850 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
4851
4852         * loader.c (mono_method_get_param_token): Make this work on generic methods.
4853         Return 0x8000000 for return parameters. Fixes #82161.
4854
4855 2007-07-21  Marek Habersack  <grendello@gmail.com>
4856
4857         * appdomain.c (get_shadow_assembly_location): append the current
4858         ticks value to the path. Avoids overwriting the same assemblies by
4859         several threads at the same time.
4860
4861 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
4862         and Raja R Harinath  <rharinath@novell.com>
4863
4864         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
4865         Simplify slightly.
4866         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
4867         property for testing if a method is a generic method definition.
4868
4869 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
4870
4871         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
4872
4873 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
4874
4875         * verify.c: used function from private branch, reverted to the one in class.h 
4876
4877 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
4878
4879         * verify.c: a typo slipped in and the code wont compile
4880
4881 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
4882
4883         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
4884         disabled box instruction as it is doing the wrong thing
4885         improved stack dump messages, now it is easier to debug type related issues
4886
4887
4888 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
4889
4890         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
4891
4892 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
4893
4894         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
4895         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
4896         grouped with class and valuetype. This change will simply 
4897         the code as it should be handled just like unmanaged pointers.
4898
4899 2007-07-19  Mark Probst  <mark.probst@gmail.com>
4900
4901         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
4902
4903 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
4904
4905         * verify.c: several stack merge issues fixed, reference comparisons now
4906         check the type size. strict type check now works correctly.
4907         added more uses of IS_MANAGED_POINTER macro.
4908         fixed issues pointed by running the test suite against .net.
4909         
4910
4911 2007-07-19  Mark Probst  <mark.probst@gmail.com>
4912
4913         * class.c, loader.c, class-internals.h: Removed the
4914         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
4915         defines.
4916
4917         * icall.c: Better error checking in some internal reflection
4918         methods.
4919
4920 2007-07-18  William Holmes  <billholmes54@gmail.com>
4921
4922         * filewatcher.c : removed unused variable 'filename' in 
4923           ves_icall_System_IO_FSW_SupportsFSW
4924
4925 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
4926
4927         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
4928         obsolete, removed.
4929
4930 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
4931
4932         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
4933         
4934         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
4935
4936 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
4937
4938         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
4939         Implement generics support.
4940         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
4941
4942         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
4943         type_args and method_args arguments.
4944         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
4945         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
4946         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
4947
4948 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
4949
4950         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
4951           It adds a rootimage parameter to mono_reflection_get_type_internal,
4952           adds new function mono_reflection_get_type_with_rootimage and use
4953           the rootimage to resolve the types instead of the current image
4954
4955 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
4956
4957         * culture-info-table.h: Forgot to update after r78304.
4958
4959 2007-07-13  Raja R Harinath  <rharinath@novell.com>
4960
4961         * class.c (mono_class_is_open_constructed_type)
4962         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
4963
4964 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
4965
4966         * class.c (mono_bounded_array_class_get):  method fails if used with
4967         an incomplete TypeBuilder enum (no basetype field), fixed it by 
4968         avoiding calculating the size for such array as it cannot be instantiated.
4969         Fix bug #82015
4970
4971 2007-07-12  Raja R Harinath  <rharinath@novell.com>
4972
4973         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
4974         field.
4975         * metadata.c, reflection.c: Update to changes.
4976
4977 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
4978
4979         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
4980         mono_class_is_valid_enum, they are used to valide a enum when loading.
4981         * reflection.c: used new functions to throw TypeLoadException when and
4982         invalid enum is build with TypeBuilder. Fixes #82018
4983   
4984 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
4985
4986         * object.c: forgot commit of mono_class_setup_methods () to access
4987         iface->methods.
4988         * object-internals.h: added a few more handy fields to
4989         MonoIMTCheckItem.
4990
4991 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
4992
4993         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
4994         iface->methods.
4995
4996 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
4997
4998         * class-internals.h, object-internals.h, object.c: IMT-based
4999         interface invocation core from Massimiliano Mantione
5000         (massi@ximian.com) with a reworked arch-specific interface,
5001         bsearch implementation and a few bugfixes and memory savings by me.
5002
5003 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
5004
5005         * class.c (mono_class_create_from_typedef): mono would segfault if 
5006         an enum did not have a __value field. It now throws a TypeLoadException
5007         for such cases. Fix bug #82022
5008
5009 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
5010
5011         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
5012
5013 2007-07-09  Mark Probst  <mark.probst@gmail.com>
5014
5015         * class.c (mono_class_init): If a class is already inited but has
5016         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
5017
5018 2007-07-09  Mark Probst  <mark.probst@gmail.com>
5019
5020         * class.c: Properly handle the case of an unimplemented interface
5021         method.  Fixes: 81673.
5022
5023 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
5024
5025         * class-internals.h, object.c: cleanup patch from massi: use
5026         MonoVTable->interface_bitmap since the vtable interfaces offset array
5027         is going away.
5028
5029 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
5030
5031         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
5032         GetMDStreamVersion icall instead.
5033
5034 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
5035
5036         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
5037         not use mono_dl_build_path() with a full library name: makes
5038         fallbacks to libgaim and libfam work.
5039
5040 2007-07-06  William Holmes  <billholmes54@gmail.com>
5041
5042         * assembly.c: Added a continue statement in probe_for_partial_name when
5043          parse_assembly_directory_name fails.  Fixes : 82002
5044
5045 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
5046
5047         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
5048         and added a verification  for TYPEDBYREF.
5049         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
5050         make native int interchangeable with int32 and some small cleanup and formating.
5051         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
5052         handle byref of byref.
5053         * verify.c (push_local): handle byref of byref.
5054         * verify.c (do_binop): invalid mix of values is unverifiable
5055         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
5056         added visibility checks
5057         * verify.c (field related method): added visibility checks
5058         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
5059
5060 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
5061
5062         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
5063         string.
5064
5065 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
5066
5067         * profiler.c (mono_profiler_load): Fix an off-by-one error.
5068
5069         * marshal.c (emit_marshal_string): When returning a string from managed code,
5070         allways make a copy even for unicode strings. Fixes #81990.
5071
5072 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
5073
5074         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
5075         of byref generic inst types (bug #81997).
5076
5077 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
5078
5079         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
5080         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
5081
5082 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
5083
5084         * marshal.c (emit_marshal_string): Add support for unicode strings in
5085         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
5086
5087 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
5088
5089         * verify.c: field load/store are now verified, missing only access checks now
5090
5091 2007-06-28  Martin Baulig  <martin@ximian.com>
5092
5093         * mono-debug.c (mono_debug_debugger_version): New public variable.
5094
5095 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
5096
5097         * locales.c: When constructing DateTimeFormat or NumberFormat for
5098         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
5099         MonoCultureInfo contructed from the current locale is always
5100         read-only and has UseUserOverride set to true. All MonoCultureInfo
5101         instances returned for GetCultures have both IsReadOnly and
5102         UseUserOverride set to true. Fixes part of bug #81930.
5103
5104 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
5105
5106        * icall-def.h: Update System.__ComObject icalls
5107        * marshal.c: Avoid managed transition (and object creation)
5108        when looking up COM interface in RCW.
5109        * marshal.h: Ditto.
5110        
5111        Code is contributed under MIT/X11 license.
5112
5113 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
5114
5115         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
5116         to avoid crashes during assembly unloading.
5117
5118 2007-06-22  Raja R Harinath  <rharinath@novell.com>
5119
5120         Fix MethodInfo.IsGenericMethodDefinition
5121         * reflection.c (mono_reflection_bind_generic_method_parameters):
5122         Rearrange code to ensure we always uses a generic method definition.
5123         * class.c (mono_class_inflate_generic_method_full): Set
5124         'generic_container' field only for generic method definitions.
5125         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
5126         Use presense of 'generic_container' field as indication of being a
5127         generic method definition.
5128
5129 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
5130
5131         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
5132
5133         * object-internals.h: Reflect changes in the layout of the managed Delegate
5134         class.
5135         
5136         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
5137         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
5138         runtime memory used by the dynamic method. Fixes #77146.
5139
5140 2007-06-21  Dick Porter  <dick@ximian.com>
5141
5142         * file-io.h: 
5143         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
5144         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
5145         81767.
5146
5147 2007-06-21  Raja R Harinath  <rharinath@novell.com>
5148
5149         * reflection.c (method_encode_methodspec): Add a tripwire.
5150         * class.c (inflate_generic_type): The fully open generic type is
5151         not the same as the generic type definition.
5152
5153 2007-06-21  Martin Baulig  <martin@ximian.com>
5154
5155         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
5156
5157         * mono-debug-debugger.h
5158         (MonoDebuggerBreakpointInfo): Removed.
5159         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
5160         (mono_debugger_remove_breakpoint): Likewise.
5161         (mono_debugger_breakpoint_callback): Likewise.
5162         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
5163
5164 2007-06-21  Raja R Harinath  <rharinath@novell.com>
5165
5166         * metadata.c (mono_metadata_lookup_generic_class): The fully open
5167         generic type is not the same as the generic type definition.
5168         * class.c (mono_generic_class_get_class): Likewise.
5169
5170 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
5171
5172         * icall.c: The second argument to 
5173         System.Reflection.MethodBase.GetMethodFromHandleInternalType
5174         is a MonoType not a MonoClass.
5175
5176 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
5177
5178         * verify.c: support for function pointers in the verifier
5179
5180 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
5181
5182         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
5183
5184 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5185
5186         * assembly.c: removed Mono.Data.SqliteClient from the list of
5187         forward-compatible assemblies as it breaks the ABI (bug #81899).
5188
5189 2007-06-19  Raja R Harinath  <rharinath@novell.com>
5190
5191         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
5192         lookup/update with the loader lock.
5193         * reflection.c (mono_class_bind_generic_parameters): No need to
5194         protect mono_metadata_lookup_* with the loader lock.
5195         * class.c (inflate_generic_type): Likewise.
5196         
5197         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
5198         on a generic instantiated type.
5199
5200 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
5201
5202         *verify.c: produce meanfull error messages on verification error
5203         *verify.c: fixed some cases of verification errors reported as validation errors
5204         *pedump.c: fixed the error name array, now it shows validation errors properly
5205         *verify.h: fixed the contant that should be used for verification errors
5206
5207 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
5208
5209         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
5210         for bug #77596, 81858 and 80743 (generics data structures on domain
5211         unload).
5212
5213 2007-06-15  Raja R Harinath  <rharinath@novell.com>
5214
5215         Avoid allocating 'MonoGenericContext' on the heap.
5216         * class-internals (_MonoMethodInflated::context): Make field
5217         inline, not a pointer.
5218         * loader.c (method_from_methodspec): Allocate 'new_context' on the
5219         stack.  Use the context embedded within the inflated method as the
5220         hash key, rather than 'new_context'.
5221         * class.c (inflate_generic_context): Simplify.  Return a struct
5222         rather than allocating on the heap.
5223         (mono_class_inflate_generic_method_full): Update to changes.  Now,
5224         doesn't salt away a copy of the context -- simplifying the
5225         lifetime rules of a 'MonoGenericContext *'.
5226         (mono_method_get_context): Return pointer to embedded context.
5227         (setup_generic_array_ifaces): Allocate temporary context on stack.
5228         * reflection.c (inflate_mono_method): Likewise.
5229         (mono_reflection_bind_generic_method_parameters): Likewise.
5230         Use the context embedded within the inflated method as the hash key.
5231
5232         Avoid a source of allocation of 'MonoGenericContext'.
5233         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
5234         and 'cached_context' fields into embedded 'MonoGenericContext' field.
5235         * class.c: Update to changes.
5236         (mono_generic_class_get_context): Simplify drastically.  Now just
5237         returns a pointer to the field.
5238         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
5239         argument as a const pointer.
5240         (mono_metadata_generic_context_equal): Likewise.
5241         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
5242         Update to changes.
5243
5244 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
5245
5246         * verify.c improved the handling of brtrue/brfalse, factored out common code
5247
5248 2007-06-14  Raja R Harinath  <rharinath@novell.com>
5249
5250         Kill MonoGenericMethod.
5251         * class-internals.h (MonoGenericContext::method_inst): Rename from
5252         'gmethod' and convert to a MonoGenericInst.
5253         (MonoGenericMethod): Remove.
5254         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
5255         * loader.c (method_from_methodspec): Update to changes.  Use a
5256         MonoGenericContext as the key to the hashtable.
5257         * metadata.c (mono_metadata_generic_context_equal): Rename from 
5258         'mono_metadata_generic_method_equal' and take MonoGenericContext.
5259         (mono_metadata_generic_context_hash): Likewise from
5260         'mono_metadata_generic_method_hash'.  Change hash function.
5261         (mono_metadata_load_generic_params): Update to changes.
5262         (mono_get_shared_generic_method): Remove.
5263         * metadata-internals.h (mono_get_shared_generic_method): Remove.
5264         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
5265         (inflate_generic_context): Likewise.
5266         (mono_class_inflate_generic_method_full): Likewise.
5267         (setup_generic_array_ifaces): Likewise.
5268         (mono_class_create_from_typespec): Likewise.
5269         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
5270         (method_encode_methodspec): Update callsite.
5271         (reflection_methodbuilder_to_mono_method): Update to changes.
5272         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
5273         MonoGenericContext as the key to the hashtable.
5274         (inflate_mono_method): Update to changes.
5275
5276         * class-internals.h (MonoGenericMethod::container): Remove.
5277         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
5278
5279 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
5280
5281         * profiler-private.h, profiler.c, profiler.h: added API to profile
5282         exception events.
5283
5284 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
5285
5286         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
5287
5288 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
5289
5290         * verify.c: method invocation is now validated, now we verify parameter types on stack.
5291         Fixed overflow and underflow not aborting the verification process.
5292
5293 2007-06-13  Mark Probst  <mark.probst@gmail.com>
5294
5295         * class-internals.h (MonoStats): Added stats entries for dynamic
5296         code allocations.
5297
5298 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
5299
5300         * loader.c (mono_free_method): Free header->locals and header->clauses.
5301
5302         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
5303         dynamic case.
5304
5305         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
5306
5307         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
5308
5309 2007-06-12  Raja R Harinath  <rharinath@novell.com>
5310
5311         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
5312         the tables.
5313
5314 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
5315
5316         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
5317
5318 2007-06-11  Raja R Harinath  <harinath@gmail.com>
5319
5320         MonoGenericMethod on a diet
5321         * class-internals.h (_MonoMethodInflated::reflection_info): Move
5322         here ...
5323         (_MonoGenericMethod::reflection_info): ... from here.
5324         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
5325         Update to changes.
5326         * reflection.c (inflate_mono_method): Likewise.
5327         (mono_reflection_bind_generic_method_parameters): Likewise.
5328
5329 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
5330
5331         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
5332         *verify.c: factored long ldarg forms to share code with short forms
5333
5334 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
5335
5336         *verify.c: fixed code formating factored some duplicate code
5337         into a new function
5338
5339         *verify.h: fixed binary incompatibility introduced earlier
5340
5341         *pedump.c: fixed formating
5342
5343 2007-06-11  Raja R Harinath  <harinath@gmail.com>
5344
5345         Fix assertion when disassembling Mono.C5.dll
5346         * loader.c (method_from_methodspec): Avoid inflating a method
5347         twice with the same context.  If the methodref is inflated, use
5348         the declaring method instead.
5349
5350         * class.c (mono_class_from_generic_parameter): Fix case similar to
5351         bug #81830 handled below, but for method containers.
5352
5353 2007-06-10  Raja R Harinath  <harinath@gmail.com>
5354
5355         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
5356         get_shared_generic_class.  Directly inflate the instance.
5357         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
5358         (inflate_generic_class): Delete.
5359         (get_shared_generic_class): Delete.  Move setting of
5360         'cached_class' and 'cached_context' ...
5361         * metadata.c (mono_metadata_lookup_generic_class): ... here.
5362
5363         * metadata.c (mono_metadata_lookup_generic_class): Change
5364         signature to take the components of a MonoGenericClass rather than
5365         an allocated MonoGenericClass.  Change semantics to be intern-like.
5366         * reflection.c (mono_class_bind_generic_parameters): Update to
5367         changes.  Make locking region tighter.
5368         * class.c (inflate_generic_class): Update to changes.
5369         (get_shared_generic_class): Likewise.
5370         * metadata-internals.h: Likewise.
5371
5372         * reflection.c (mono_class_bind_generic_parameters): Take and
5373         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
5374         (mono_reflection_bind_generic_parameters): Use
5375         'mono_class_bind_generic_parameters' rather than duplicate the code.
5376         * class.c (mono_bounded_array_class_get): Update to changes.
5377         * object-internals.h: Likewise.
5378
5379         * reflection.c (mono_class_bind_generic_parameters): Only support
5380         parameterizing generic type definitions.  Remove support for other
5381         open types.
5382
5383 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
5384
5385         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
5386
5387         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
5388         in the dynamic case.
5389
5390 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
5391
5392         * threads.c: When cleaning up thread, reset the Background bit.
5393         Fixes bug #81720.
5394
5395 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
5396
5397        * metadata.c: Move variable declarations to top of scope.
5398        * verify.c: Move variable declarations to top of scope.
5399
5400        Code is contributed under MIT/X11 license.
5401
5402 2007-06-08  Raja R Harinath  <rharinath@novell.com>
5403
5404         * reflection.c (mono_class_bind_generic_parameters): Replace
5405         open-coded loop with mono_metadata_inflate_generic_inst.
5406
5407         * class.c (get_shared_generic_class): Don't call
5408         mono_get_shared_generic_inst.  Use the container's own
5409         'class_inst'.
5410
5411         * metadata.c (mono_metadata_load_generic_params): Move
5412         initialization of 'context' field here from ...
5413         * class.c (mono_class_create_from_typedef): ... here, and ...
5414         * loader.c (mono_get_method_from_token): ... here.
5415
5416         * class.c (get_shared_generic_class): Rename from
5417         mono_get_shared_generic_class and make static.
5418         (mono_get_shared_generic_inst): Move to metadata.c.
5419         * loader.c (mono_get_shared_generic_method): Likewise.
5420         * class-internals.h, metadata-internals.h: Update to changes.
5421
5422         Fix #81830
5423         * class.c (mono_class_from_generic_parameter): Don't assume a
5424         generic container owner exists.  Generic containers from monodis
5425         don't have any.
5426
5427 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
5428
5429         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
5430         * verify.h: new typedefs to returns the non-verifiable status
5431         * verify.c: initial implementation of generics, stack merging and object compatibility check
5432
5433 2007-06-06  Mark Probst  <mark.probst@gmail.com>
5434
5435         * class.c, image.c, class-internals.h (MonoImage): class_cache is
5436         a MonoInternalHashTable again (fixed bug in internal hash table
5437         code).
5438
5439 2007-06-06  Mark Probst  <mark.probst@gmail.com>
5440
5441         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
5442         MonoInternalHashTable again (fixed bug in internal hash table
5443         code).
5444
5445 2007-06-06  Mark Probst  <mark.probst@gmail.com>
5446
5447         * class.c, image.c, class-internals.h, domain.c,
5448         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
5449         changes.  Have to figure out what makes them break the SWF
5450         regression.
5451
5452 2007-06-04  Mark Probst  <mark.probst@gmail.com>
5453
5454         * class.c, image.c, class-internals.h (MonoImage): class_cache is
5455         a MonoInternalHashTable now.
5456
5457 2007-06-04  Mark Probst  <mark.probst@gmail.com>
5458
5459         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
5460         MonoInternalHashTable now.
5461
5462 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
5463
5464         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
5465         invoke_impl code.
5466
5467         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
5468
5469         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
5470         dependent trampoline.
5471
5472         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
5473
5474         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
5475
5476 2007-05-29  Robert Jordan  <robertj@gmx.net>
5477
5478         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
5479
5480 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
5481
5482         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
5483
5484 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
5485
5486        * marshal.c: Fix interface lookup loops for
5487        cominterop_get_com_slot_for_method and 
5488        cominterop_get_method_interface. Only need to lookup
5489        if type is a class, else use interface type method is on.
5490
5491        Code is contributed under MIT/X11 license.
5492
5493 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
5494
5495         * reflection.c: HasSecurity can be present even if no specially 
5496         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
5497         SecurityAttribute). Fix CAS regression tests on buildbot.
5498
5499 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
5500
5501        * appdomain.c: Add configure checks for header files.
5502        * image.c: Add configure checks for header files.
5503        * file-io.c: Add configure checks for header files.
5504        * debug-mono-symfile.c: Add configure checks for header files.
5505        * threadpool.c: Add configure checks for header files.
5506        * console-io.c: Add configure checks for header files.
5507        * profiler.c: Add configure checks for header files.
5508        * rawbuffer.c: Add configure checks for header files.
5509        * icall.c: Add configure checks for header files.
5510        * rand.c: Add configure checks for header files.
5511        * socket-io.c: Add configure checks for header files.
5512
5513        Code is contributed under MIT/X11 license.
5514
5515 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
5516
5517         * reflection.c (mono_custom_attrs_from_builders): Remove the 
5518         assertion as it breaks the build.
5519         
5520         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
5521
5522         * reflection.c (lookup_custom_attr): Make a copy here too.
5523
5524         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
5525         dynamic images.
5526
5527         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
5528         images.
5529
5530         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
5531         info.
5532
5533 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
5534
5535         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
5536         (load_cattr_value): Ditto.
5537
5538 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
5539
5540         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
5541
5542 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
5543
5544         * threads.c: In "start_wrapper", set apartment_state to MTA if
5545         apartment_state is Unknown and we're running on 2.0 profile or
5546         higher.
5547         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
5548         to main method, then set apartment_state to Unknown on 1.0 profile,
5549         and MTA on 2.0 profile.
5550
5551 2007-05-16  Jb Evain  <jb@nurv.fr>
5552
5553         * class-internals.h (MonoDefaults): Add an attribute_class and
5554           customattribute_data_class.
5555         * domain.c (mono_init_internal): Populate them.
5556         * reflection.c: Use them to remove duplicates. Make a vew
5557         MonoClass variables `static'.
5558
5559 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
5560
5561         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
5562         step in implementing IMT, so that all isinst checks now can go
5563         through the bitmap.
5564         This was needed because vtables for TransparentProxy need to look
5565         like the vtable of the "target" class, so they need to point to
5566         its interface bitmap directly.
5567
5568         * object.c: inside "mono_class_create_runtime_vtable" and
5569         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
5570
5571 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
5572
5573         * object-internals.h
5574           culture-info.h : added territory field in MonoCulture and
5575           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
5576         * locales.c : fill territory field above too.
5577         * culture-info-table.h : regenerated.
5578
5579 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
5580
5581         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
5582         Fixes #81599.
5583
5584 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
5585
5586         * object.c: Always initialize apartment, even if 
5587         there is no custom attributes on entry point.
5588         
5589         Code is contributed under MIT/X11 license.
5590
5591 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
5592
5593         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
5594         * metadata.c: If no encoding is set, check for unicode
5595         on class.
5596         
5597         Code is contributed under MIT/X11 license.
5598
5599 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
5600
5601         * threads.c: Handle if mono_thread_current returns NULL 
5602         
5603         Code is contributed under MIT/X11 license.
5604
5605 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
5606
5607         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
5608         in start_wrapper. Added mono_thread_init_apartment_state and
5609         mono_thread_cleanup_apartment_state.
5610         * object.c: Initialize thread apartment state on main thread
5611         by checking for STAThreadAttribute on entry point.
5612         * object-internals.h: Add apartment_state field to MonoThread.
5613         * threads-types.h: Add unmanaged definition of 
5614         System.Threading.ApartmentState, MonoThreadApartmentState.
5615         
5616         Code is contributed under MIT/X11 license.
5617         
5618 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
5619
5620         * class.c: Fix windows build.
5621         * class-internals.h: Fix windows build.
5622         
5623         Code is contributed under MIT/X11 license.
5624
5625 2007-05-08  Robert Jordan  <robertj@gmx.net>
5626
5627         * process.c (CreateProcess_internal):
5628         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
5629         .CreateNoWindow was specified. Fixes #81496.
5630
5631 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
5632
5633         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
5634         step in implementing IMT, replaced it with two compact arrays
5635         (interfaces_packed and interface_offsets_packed) and a bitmap that
5636         is used for isinst checks (interface_bitmap).
5637
5638         * class.c: (compare_interface_ids): compare function to pass to
5639         bsearch when looking for an interface with a given id.
5640         (mono_class_interface_offset): reimplemented using bsearch on
5641         interfaces_packed, getting the offset from interface_offsets_packed.
5642         (print_implemented_interfaces): utility debugging function.
5643         (setup_interface_offsets): reworked to initialize interfaces_packed,
5644         interface_offsets_packed and interface_bitmap.
5645
5646         * object.c: replaced all accesses to "MonoClass.interface_offsets"
5647         with uses of interfaces_packed and interface_offsets_packed.
5648
5649 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
5650
5651         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
5652         mono_class_interface_offset prototype to wrap all accesses to
5653         "MonoClass.interface_offsets".
5654
5655         * class.c: Implemented mono_class_interface_offset, and wrapped all
5656         accesses to "MonoClass.interface_offsets".
5657
5658         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
5659         "MonoClass.interface_offsets".
5660
5661 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
5662
5663         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
5664         GetMethodFromHandle overloads (bug #78637).
5665
5666 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
5667
5668         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
5669         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
5670
5671 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
5672
5673         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
5674         #81498.
5675
5676         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
5677         gracefully.
5678         (mono_custom_attrs_from_index): Ditto.
5679
5680         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
5681         Fixes #81501.
5682
5683 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
5684
5685         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
5686         is now allocated from a mempool.
5687
5688 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
5689
5690         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
5691         caller holds threads_lock, leading to deadlocks. Fixes #81476.
5692
5693 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
5694
5695         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
5696         mono_loader_clear_error () too late. Fixes #81463.
5697
5698 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
5699
5700         * culture-info-table.h : regenerated.
5701
5702 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
5703
5704         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
5705         is missing.
5706
5707 2007-04-25  Dick Porter  <dick@ximian.com>
5708
5709         * Makefile.am: Put the mingw enforced-optimisation back into the
5710         PLATFORM_WIN32 section.
5711
5712 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
5713
5714         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
5715         patch.
5716
5717         * image.c (mono_image_load_module): New API function to load a module reference.
5718
5719         * image.c (load_modules): Load modules lazily. Fixes #80812.
5720
5721         * class.c (mono_class_from_typeref): Use mono_image_load_module.
5722         
5723         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
5724
5725         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
5726         to mono_image_load_module_dynamic.
5727
5728 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
5729
5730         * marshal.c: Fix calling convention for CCW on non-windows
5731         platforms. STDCALL on windows, CDECL everywhere else to work 
5732         with XPCOM and MainWin COM.
5733         
5734         Code is contributed under MIT/X11 license.
5735
5736 2007-04-23  Martin Baulig  <martin@ximian.com>
5737
5738         Fix #80969.
5739
5740         * loader.c
5741         (method_from_memberref): Added `gboolean *used_context' argument.
5742         (mono_get_method_from_token): Likewise.
5743         (mono_get_method_full): Don't insert the method in the cache when
5744         `used_context' is true.
5745
5746 2007-04-23  Raja R Harinath  <rharinath@novell.com>
5747
5748         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
5749
5750         * reflection.c (mono_reflection_bind_generic_parameters): Don't
5751         create new MonoTypes for returned types.
5752         * class.c (mono_generic_class_get_class): Export mono-internal.
5753         * class-internals.h: Update to changes.
5754
5755 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
5756
5757         * threadpool.c, threadpool.h, icall-def.h: patch from
5758         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
5759
5760 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
5761
5762         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
5763         
5764         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
5765
5766         * threads.c (mono_thread_get_stack_bounds): New helper function.
5767
5768         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
5769         Correctly compute stack bounds when attaching. Fixes #81394.
5770
5771 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
5772
5773         * reflection.c: fix handling of doubles in custom attributes
5774         for the arm-fpa format (bug #81368).
5775
5776 2007-04-18  Raja R Harinath  <rharinath@novell.com>
5777
5778         * reflection.c (assembly_add_win32_resources): Mildly relax an
5779         bounds check to let the end pointer point just past the end of the
5780         allocated buffer.  (may fix #81384)
5781
5782 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5783
5784         * culture-info-table.h : regenerated.
5785
5786 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
5787
5788         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
5789         the thread is aborted early.
5790
5791 2007-04-05  Dick Porter  <dick@ximian.com>
5792
5793         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
5794         FindFirstFile()/FindNextFile() to find entries.  This lets the
5795         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
5796         81038.
5797
5798         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
5799         the parameters of
5800         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
5801
5802 2007-04-04  Martin Baulig  <martin@ximian.com>
5803
5804         * debug-helpers.c
5805         (mono_method_desc_full_match): Add support for nested classes.
5806
5807 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
5808
5809         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
5810
5811 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
5812
5813         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
5814         waiting for too many threads.
5815
5816 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
5817
5818         * environment.c: Fix return value check on uname so we can get the 
5819         executing version on Solaris operating systems.
5820
5821 2007-03-28  Jb Evain  <jbevain@gmail.com>
5822
5823         * class.c (mono_type_get_name_recurse): Complete the
5824         fix for the creation of assembly qualified names for
5825         pointer types. Fixes #81208.
5826
5827 2007-03-27  Dick Porter  <dick@ximian.com>
5828
5829         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
5830         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
5831         changed.
5832
5833         * threads.c
5834         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
5835         the value of ReleaseMutex().
5836
5837 2007-03-27  Dick Porter  <dick@ximian.com>
5838
5839         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
5840         in little-endian order, not network endian, so must be converted
5841         to host endian here.  Fixes bug 80593.
5842
5843 2007-03-22  Jb Evain  <jbevain@gmail.com>
5844
5845         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
5846         qualified names for pointer types. Fixes #81208.
5847
5848 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
5849
5850         * marshal.c: Add support for PreserveSigAttribute. 
5851         
5852         Code is contributed under MIT/X11 license.
5853
5854 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
5855
5856         * process.c: Fix endianness issues. Fixes #81126.
5857
5858         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
5859         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
5860
5861         * image.c (mono_image_lookup_resource): Make this work on big-endian
5862         machines.Change API contract so the caller needs to free the return value.
5863         
5864         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
5865         API change.
5866         
5867 2007-03-14  Martin Baulig  <martin@ximian.com>
5868
5869         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
5870         mono_type_get_desc() as well.
5871
5872 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
5873
5874         * icall.c:  Fix environ access in VS.  
5875         
5876 2007-03-13  Alp Toker  <alp@atoker.com>
5877
5878         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
5879         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
5880         #63841.
5881
5882 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
5883
5884         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
5885         circular references among dynamic methods. Fixes #81091.
5886
5887         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
5888
5889 2007-03-09  Martin Baulig  <martin@ximian.com>
5890
5891         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
5892
5893 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
5894
5895         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
5896         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
5897         
5898         Code is contributed under MIT/X11 license.
5899         
5900 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
5901
5902         * loader.c: Reapply patch for bug #79424.
5903
5904 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
5905
5906         * metadata.c (mono_type_to_unmanaged): Only convert object to
5907         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
5908
5909 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
5910
5911         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
5912         (and incorrectly set) is_reference field from MonoGenericInst.
5913
5914 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
5915
5916         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
5917         a little earlier.
5918
5919         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
5920
5921         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
5922
5923 2007-03-05  Miguel de Icaza  <miguel@novell.com>
5924
5925         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
5926         FileOptions.1 value to mean "temporary", map that to
5927         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
5928
5929         Fixes 80688
5930
5931 2007-03-03  Marek Habersack  <mhabersack@novell.com>
5932
5933         * appdomain.c: implement MS .Net style shadow copying. Copies of
5934         the assemblies are made in a subdirectory of the dynamic base
5935         directory, the assembly names are preserved.
5936         Copy .mdb and .config files along with the assemblies being shadowed.
5937
5938 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
5939
5940         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
5941         (emit_marshal_handleref): Ditto.
5942
5943         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
5944         on Visual C++. Fixes #80671.
5945
5946 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
5947
5948         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
5949         for clone operations.
5950
5951 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
5952
5953         * marshal.c: Fix warnings.
5954
5955 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
5956
5957         * loader.c: allow case-insensitive matching of the dll name
5958         in dllmap handling when prefixed with "i:".
5959
5960 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
5961
5962         * threads.c: Fix #ifdef for dummy_apc function for VS.
5963
5964 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
5965
5966         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
5967
5968 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
5969         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
5970         giving precedence to the methods with a fully qualified name
5971         (InterfaceName.MethodName) when building the interface sections
5972         of the vtable.
5973
5974 2007-02-16  Dick Porter  <dick@ximian.com>
5975
5976         * threadpool.c (append_job): Fix fast-path array handling, so it's
5977         less likely the array will grow exponentially when the load is
5978         heavy.
5979
5980 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
5981
5982         * metadata-internals.h, loader.c: fix dllmap lookup order
5983         for non-function maps, too, and prepare for fallback code.
5984
5985 2007-02-12  Robert Jordan  <robertj@gmx.net>
5986
5987         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
5988         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
5989         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
5990         GlobalFree. Fixes a part of bug #77075.
5991
5992 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
5993
5994         * loader.c: implemented typedef parent in field memberref.
5995
5996 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
5997
5998         * marshal.c: Fix warnings and remember to call Release on
5999         IUnknown of RCW.
6000         
6001         Code is contributed under MIT/X11 license.
6002
6003 2007-02-10  Miguel de Icaza  <miguel@novell.com>
6004
6005         * class-internals.h: Add MonoHandleRef definition, and
6006         handleref_class to mono_defaults. 
6007
6008         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
6009         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
6010
6011         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
6012         (do nothing on this stage)
6013         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
6014         (emit_marshal_handleref): New method, used for argument handling
6015         of HandleRefs. 
6016
6017 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
6018
6019         * class.c (mono_class_setup_parent): Lazily init com types.
6020         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
6021         init com types.
6022         * object.c (mono_remote_class_vtable): Lazily init com types.
6023         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
6024         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
6025         * domain-internals.h: Expose mono_init_com_types.
6026         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
6027         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
6028         Add support for COM Callable Wrapper marshalling.
6029         * marshal.h: Add icall definitions.
6030         * gc.c: Handle freeing of CCWs in finalizer code.
6031         
6032         Code is contributed under MIT/X11 license.
6033
6034 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
6035
6036         * reflection.c: changed all the signature encoding code to use
6037         a variable-sized buffer.
6038
6039 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
6040
6041         * marshal.c: locking fixes: never take the loader lock
6042         or other runtime locks when holding the marshal lock
6043         (fixes bug#80664).
6044
6045 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
6046
6047         * marshal.c: make the delegate function pointer mapping
6048         work for the moving GC.
6049
6050 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
6051
6052         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
6053         for bug #80618.
6054
6055 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
6056
6057         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
6058         gmodule.
6059
6060 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
6061
6062         * threadpool.c: made the code moving-GC safe.
6063
6064 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
6065
6066         * assembly.c, boehm-gc.c, class-internals.h, class.c,
6067         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
6068         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
6069         warning cleanup.
6070         * reflection.c: warning cleanup, some threading and moving GC fixes.
6071
6072 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
6073
6074         * class.c, loader.c: create the needed Set/Get/Address array methods
6075         as well as the .ctors in mono_class_init (), fixes bug #80567.
6076
6077 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
6078
6079         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
6080         we doesn't decrease its alignment. Should fix the sparc build.
6081
6082 2007-01-24  Dick Porter  <dick@ximian.com>
6083
6084         * socket-io.c
6085         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
6086         Create the returned object if we need to ignore an unsupported
6087         socket option.  Fixes a segfault reported by Atsushi.
6088
6089 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
6090
6091         * class.c, object.c: restrict GC-tracked fields to
6092         UIntPtr fields used inside corlib, so we provide better
6093         type info to the GC and also allow broken packing as in
6094         bug #80580.
6095
6096 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
6097
6098         * sgen-gc.c: removed duplicated function.
6099
6100 2007-01-19  Miguel de Icaza  <miguel@novell.com>
6101
6102         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
6103         value that means that the value is not supported, but that we
6104         should not return a failure, but instead report this as a
6105         successful operation.
6106
6107 2007-01-19  Raja R Harinath  <rharinath@novell.com>
6108
6109         Fix tests/bug79956.2.il
6110         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
6111         (mono_generic_class_get_class): If the generic definition in an
6112         enum, copy over other fields related to it.
6113
6114 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
6115
6116         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
6117         genericinst enums (bug #79215).
6118
6119 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
6120         * class.c: Fix bug 80307.
6121
6122 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
6123
6124         * image.c: if the file table is not present, try to load
6125         all the modules, since we don't have info about them
6126         having or not metadata (bug #80517).
6127         * assembly.c: allow mono_assembly_load_references () to
6128         work for netmodules.
6129
6130 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
6131
6132         * image.c, metadata-internals.h, object.c: execute module
6133         cctors when running on the 2 runtime if present (bug #80487).
6134
6135 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
6136
6137         * icall.c: optimized InitializeArray() on bigendian.
6138
6139 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
6140
6141         * icall.c: fix for the broken ARM FPA double format.
6142
6143 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
6144
6145         * icall.c: handle endian issues for r4 and r8 types, too, in
6146         the InitializeArray() icall.
6147
6148 2007-01-15  Miguel de Icaza  <miguel@novell.com>
6149
6150         * loader.c (mono_loader_error_prepare_exception): Clear the error
6151         once we have extracted the information from it, do this before we
6152         call into the JIT's class loading mechanisms.
6153
6154         * object.c (mono_class_create_runtime_vtable): Do not clear the
6155         loader error before calling mono_class_get_exception_for_failure
6156         as the loader error is needed inside
6157         mono_class_get_exception_for_failure to throw the error (thinko).
6158
6159         Fixes #80521
6160         
6161 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
6162
6163         * reflection.c: align fields rva data so it's faster to load at
6164         runtime.
6165
6166 2007-01-12  Raja R Harinath  <rharinath@novell.com>
6167
6168         Prepare to simplify GenericMethod handling.
6169         * class-internals.h (mono_method_get_context): New accessor function.
6170         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
6171         rather than directly accessing '->context' field.
6172
6173         * class-internals.h (_MonoGenericParam.method): Move ...
6174         (_MonoGenericContainer): ... here.  Add into union with klass field.
6175         * class.c, icall.c, loader.c, metadata.c, reflection.c:
6176         Update to changes.
6177
6178 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
6179
6180         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
6181         the wrapper type enum and reduce relocations.
6182
6183 2007-01-12  Raja R Harinath  <rharinath@novell.com>
6184
6185         * reflection.c (inflate_mono_method): Reuse method instantiation
6186         from the generic method, if available.
6187
6188 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
6189
6190         * marshal.c (emit_marshal_variant): Fix conv_arg
6191         type in last commit, based on whether parameter is byref.
6192         
6193 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
6194
6195         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
6196         marshalling.
6197         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
6198         MONO_TYPE_OBJECT back for VARIANT support.
6199
6200 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
6201
6202         * marshal.c, marshal.h, icall-def.h: Implement 
6203         Marshal.ReAllocCoTaskMem.
6204
6205 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
6206
6207         * marshal.c: memory retention fixes: use the proper
6208         image cache for runtime_invoke method lookups.
6209
6210 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
6211
6212         * mempool.c: added code to help debug mempool allocations.
6213
6214 2007-01-11  Dick Porter  <dick@ximian.com>
6215
6216         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
6217         support (experimenting with faking it with IP_MTU_DISCOVER for
6218         systems that don't have IP_DONTFRAGMENT.)
6219         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
6220         icall.
6221
6222         * icall-def.h: new System.Net.Sockets.Disconnect icall.
6223
6224         * socket-io.h: Add new fields to MonoSocketAsyncResult
6225         corresponding to the new ones in Socket.cs.
6226
6227 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6228
6229         Fix IronPython regression mentioned in #80249
6230         * metadata.c (do_mono_metadata_parse_generic_class): Clear
6231         'cached_context' field, since it may have been initialized as a
6232         side-effect of metadata parsing.
6233
6234         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
6235         (_MonoGenericClass.cached_class): Move here and rename from lone
6236         remaining field of ...
6237         (_MonoInflatedGenericClass): ... this.  Remove.
6238         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
6239         to changes.
6240
6241         Fix mcs/tests/test-128.cs regression.
6242         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
6243         2007-01-10 change below.
6244         [MONO_TYPE_OBJECT]: Recurse into array case.
6245
6246 2007-01-11  Raja R Harinath  <harinath@gmail.com>
6247
6248         * class-internals.h (mono_get_inflated_generic_class): Remove.
6249         * class.c (mono_get_inflated_generic_class): Remove.
6250         (mono_generic_class_get_class): Rename from
6251         mono_class_create_generic.
6252         (mono_class_from_mono_type) [GENERICINST]: Use it.
6253         * reflection.c, metadata.c: Update to changes.  Use
6254         'mono_class_from_mono_type'.
6255
6256 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
6257
6258         * reflection.c: use passed type when encoding an array element
6259         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
6260
6261 2007-01-09  Robert Jordan  <robertj@gmx.net>
6262
6263         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
6264         result arguments (someDelegate.EndInvoke (unrelatedAres)).
6265         Fixes bug #80392.
6266
6267 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6268
6269         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
6270
6271         * object.c (set_value): Avoid aliasing between type->data.klass
6272         and type->data.generic_class.
6273
6274         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
6275
6276 2007-01-08  Raja R Harinath  <rharinath@novell.com>
6277
6278         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
6279         between type->data.klass and type->data.generic_class.
6280
6281 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
6282
6283         * marshal.c: In MS.NET, StringBuilder objects are not copied by
6284         value in out parameters.
6285
6286 2007-01-08  Raja R Harinath  <rharinath@novell.com>
6287
6288         Simplify invariant for MonoGenericClass::klass field.
6289         * class.c (mono_class_create_generic): Verify 'klass' is null.
6290         * metadata.c (do_mono_metadata_parse_generic_class): Don't
6291         initialize 'klass' field.
6292
6293 2007-01-05  Raja R Harinath  <rharinath@novell.com>
6294
6295         Ongoing work to avoid redundant data and simplify invariants.
6296         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
6297         'generic_class', and change type to a GenericInst.
6298         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
6299         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
6300
6301 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
6302
6303         * class.c : skip io-layer under PLATFORM_WIN32.
6304
6305 2007-01-03  Tor Lillqvist  <tml@novell.com>
6306
6307         Fix #80305: In a bundled executable, look in the bundled exe
6308         assembly to determine the runtime version. Add the possibility to
6309         bundle also the machine.config file.
6310         
6311         * assembly.c (mono_assembly_open_from_bundle): Make
6312         non-static. Allow being called even if we have no bundled
6313         assemblies, and return NULL right away in that case.
6314
6315         * domain-internals.h: Declare mono_assembly_open_from_bundle()
6316         here.
6317
6318         * domain.c (app_config_parse): Take an assembly exe file name as
6319         parameter instead of a config file name. Check for a bundled
6320         config file for that assembly by calling
6321         mono_config_string_for_assembly_file() (see below) before looking
6322         for one in the file system.
6323         (get_runtimes_from_exe): Corrsponding change to call of
6324         app_config_parse().
6325         (get_runtimes_from_exe): Check for bundled assembly exe file first
6326         by calling mono_assembly_open_from_bundle(). If no bundled
6327         assembly exe file is found, call mono_image_open() as before to
6328         look it up in the file system.
6329
6330         * mono-config.c: Add variable bundled_machinec_onfig.
6331         (mono_config_string_for_assembly_file): New function.
6332         (mono_config_for_assembly): Move code snippet that looks for a
6333         bundled assembly .config file into the above new function. Call
6334         it.
6335         (mono_register_machine_config, mono_get_machine_config): New
6336         functions to set and retrieve
6337
6338         * assembly.h: Declare mono_register_machine_config().
6339
6340         * mono-config.h: Declare mono_get_machine_config() and
6341         mono_config_string_for_assembly_file().
6342
6343         * icall.c: No declaration of environ necessary on Win32. It is
6344         declared (as a macro expanding to a function call) in stdlib.h.
6345         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
6346         New internal mono function. Returns the value of
6347         mono_get_machine_config() as a Mono string.
6348
6349         * icall-def.h: Add get_bundled_machine_config().
6350
6351 2007-01-04  Raja R Harinath  <rharinath@novell.com>
6352
6353         Remove redundant field
6354         * class-internals.h (_MonoGenericContext.container): Remove field.
6355         * loader.c (mono_method_get_signature_full): Don't parse a
6356         "container" for a signature parse when the signature is inflated
6357         immediately.
6358         (method_from_methodspec): Likewise, for a generic_inst.
6359         * class.c, metadata.c, reflection.c: Update to changes.
6360
6361 2006-01-04  Raja R Harinath  <rharinath@novell.com>
6362
6363         * class-internals.h (_MonoGenericClass): Rename 'context' field to
6364         'cached_context', and change semantics -- it starts off NULL, and
6365         is initialized on demand.
6366         * class.c (mono_generic_class_get_context): New accessor to
6367         replace 'context' field accesses.
6368         (mono_class_get_context): New helper.
6369         (*): Update to changes.
6370         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
6371
6372 2007-01-03  Miguel de Icaza  <miguel@novell.com>
6373
6374         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
6375         before the memcpy.   Fixes Marshal2 regression.
6376
6377 2007-01-02  Jb Evain  <jbevain@gmail.com>
6378
6379         * blob.h: add a MONO_TYPE_ENUM definition
6380         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
6381         fix the encoding of arrays of enums in custom attributes.
6382
6383         Fixes #79666.
6384
6385 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6386
6387         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
6388         string is null terminated, but only cut the string short if it
6389         overflows the buffer.   
6390         
6391         (mono_string_to_byvalstr): Also fix this routine.   The code here
6392         was not properly terminating a string (it was only terminated
6393         because of the previous catch-all memset). 
6394
6395         I left the memset, because I do not know if applications expect
6396         the runtime to clear this region. 
6397
6398         Fixes #79944.
6399
6400         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
6401         Clear the error before returning to unmanaged code to prevent the
6402         runtime from being confused later on (fixes  80420).
6403         (ves_icall_type_from_name): Always call mono_loader_clear_error
6404         after parsing a type that could have failed.
6405         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
6406
6407         * loader.c (mono_loader_clear_error): Fix indentation.
6408
6409 2006-12-28  Martin Baulig  <martin@ximian.com>
6410
6411         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
6412
6413 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
6414
6415         * reflection.c: patch from Rolf Bjarne Kvinge to fix
6416         getting a token for an EnumBuilder.
6417
6418 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
6419
6420         * reflection.c: be more careful in case resource generation
6421         fails to create the data array.
6422
6423 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
6424
6425         * sgen-gc.c: write barrier for clone and fix unregister handles.
6426
6427 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
6428
6429         * reflection.c: some fixes needed in the generics code for the moving GC.
6430
6431 2006-12-22  Robert Jordan  <robertj@gmx.net>
6432
6433         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
6434         account. Fixes bug #80299.
6435
6436 2006-12-21  Raja R Harinath  <rharinath@novell.com>
6437
6438         Fix WaitHandle usage in delegates.
6439         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
6440         * object.c (mono_wait_handle_new): Use the property set method to
6441         initialize the handle.
6442         (mono_wait_handle_get_handle): New.
6443         * threadpool.c (mono_async_invoke): Use it.
6444         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
6445         Likewise.
6446         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
6447
6448 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
6449
6450         * marshal.c (emit_marshal): Call emit_marshal_variant and
6451         emit_marshal_com_interface when applicable.
6452         (emit_marshal_variant, emit_marshal_com_interface): Add
6453         methods for this case and remove if's from emit_marshal_object.
6454         
6455 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
6456
6457         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
6458
6459 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
6460
6461         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
6462         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
6463         and GlobalFree on Windows. Remove FIXME.
6464
6465 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
6466
6467         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
6468         implementation for managed objects.
6469
6470 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
6471
6472         * object.c: implemented code to be used for checking
6473         that no reference field overlaps with non-references.
6474
6475 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
6476
6477         * threadpool.c: fix queue code to be compatible with the
6478         moving GC.
6479
6480 2006-12-18  Miguel de Icaza  <miguel@novell.com>
6481
6482         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
6483         in structures by throwing ArgumentNullException.
6484
6485         (emit_marshal_safehandle): Also when they are null parameters.
6486
6487         (emit_marshal_safehandle): Add support for ref
6488         SafeHandles parameters
6489
6490 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
6491
6492         * profiler.c: updated to use the mono-dl API instead of
6493         gmodule.
6494
6495 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
6496
6497         * profiler.c: updated to use the mono-dl dynamic loading
6498         API instead of gmodule.
6499
6500 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
6501
6502         * profiler.c: use readlink, older versions of glib don't have
6503         g_file_read_link ().
6504
6505 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
6506
6507         * profiler.c: try to detect the path to mono if libc fails to provide
6508         a useful name (bug #80286).
6509
6510 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6511
6512         Fix #80242
6513         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
6514         instance, use the generic type definition instead.
6515         (ves_icall_Type_GetNestedTypes): Likewise.
6516         * class.c (mono_class_create_generic): Always set the
6517         nested_classes of a generic instance to NULL, even if the generic
6518         type definition has nested types.
6519
6520 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
6521
6522         * marshal.c (mono_string_from_bstr): Revert previous Windows change
6523         and fix on Linux.
6524         
6525 2006-12-15  Miguel de Icaza  <miguel@novell.com>
6526
6527         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
6528         my arguments were in the wrong order.   I also fixed the Windows
6529         version which seems to have had the same issue.
6530
6531         (mono_free_bstr): On Unix, this is g_free.
6532         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
6533         conversions (for the tests in corlib to pass).
6534
6535 2006-12-14  Miguel de Icaza  <miguel@novell.com>
6536
6537         * marshal.c (emit_ptr_to_object_conv): For now, ignore
6538         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
6539         exception if a ref SafeHandle in a struct has changed).
6540         
6541         (emit_struct_conv): Do not perform layout checks for classes
6542         derived from SafeHandle, as those are specially handled. 
6543
6544         (emit_object_to_ptr_conv): Add support for
6545         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
6546
6547         (emit_marshal_safehandle): Implement conversion of return values
6548         of safehandles (MARSHAL_ACTION_CONV_RESULT).
6549         
6550         * threads.c: WaitHandle now is compiled with two different handles
6551         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
6552         for 2.0.
6553         
6554         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
6555         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
6556         these routines to cope with both kinds of fields.
6557
6558 2006-12-12  Miguel de Icaza  <miguel@novell.com>
6559
6560         * metadata.c (mono_type_to_unmanaged): Handle the case where
6561         type->data.klass is a SafeHandle, and in that case, return the
6562         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
6563         MONO_MARSHAL_CONV_SAFEHANDLE. 
6564
6565 2006-12-11  Miguel de Icaza  <miguel@novell.com>
6566
6567         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
6568         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
6569         calling emit_marshal_object.
6570
6571         (emit_marshal_safehandle): Implement marshalling of
6572         SafeHandle parameters (no ref support yet).
6573
6574         (MarshalAction): Document the defines as I implement
6575         them for SafeHandle.
6576
6577         (emit_marshal_object): indentation police.
6578
6579         * class-internals.h: Define MonoSafeHandle.
6580         Add safehandle_class to MonoDefaults type.
6581
6582         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
6583         list of classes to check for fields. 
6584
6585         * domain.c (mono_init_internal): Add SafeHandle to the list of
6586         mono_defaults loaded.
6587
6588 2006-12-15  Raja R Harinath  <rharinath@novell.com>
6589
6590         Fix #80253
6591         * reflection.c (mono_reflection_bind_generic_parameters): If the
6592         generic type definition is a type builder, ensure that it is fully
6593         initialized before instantiating it.  Kill some dead code.
6594
6595 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
6596
6597         * object.c: clear the loader_error () before loading
6598         more metadata stuff (bug #80258).
6599
6600 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
6601
6602         * icall.c, icall-defs.h: type modifiers icalls for
6603         parameters and properties.
6604
6605 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
6606
6607         * object.c, icall.c: fixed warnings.
6608
6609 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
6610
6611         * marshal.c: fixed a couple of leaks and coding style in a few places.
6612
6613 2006-12-08  Dick Porter  <dick@ximian.com>
6614
6615         * process.c: Cope with NULL ProcessStartInfo arguments on windows
6616         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
6617         80173.
6618
6619 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
6620
6621         * process.c: ProcessStartInfo may have only filename set and
6622         arguments can be NULL.
6623
6624 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
6625
6626         * icall.c: fix leak found by Robert Jordan.
6627
6628 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
6629
6630         * marshal.c, marshal.h: generate managed method to access an element
6631         of a multi-dimensional array.
6632
6633 2006-11-30  Paolo Molaro (lupus@ximian.com)
6634
6635         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
6636
6637 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
6638
6639         * icall.c: back out GetFields () fix until the serialization code is
6640         fixed to not depend on the incorrect behaviour.
6641
6642 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
6643
6644         * profiler.c: provide defaults if none are set.
6645
6646 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
6647
6648         * Makefile.am, attrdefs.h: new public header file with
6649         constants for attributes for use by embedders.
6650
6651 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
6652
6653         * icall.c: GetFields () fix for bug #80064.
6654
6655 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
6656
6657         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
6658         removed long unused icalls.
6659
6660 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
6661   
6662         * marshal.c: 
6663                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
6664                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
6665                 can be generated without a delegate class.
6666                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
6667         
6668         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
6669
6670 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6671
6672         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
6673         #80069.
6674
6675 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
6676
6677         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
6678         icall-def.h: added icalls needed by System.GC.
6679
6680 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
6681
6682         * loader.c: ensure the class in catch clauses is handled
6683         correctly for generics methods (fixes bug#79980).
6684
6685 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
6686
6687         * monitor.h, monitor.c: added mono_locks_dump () function
6688         to help debug deadlocks involving managed locks.
6689
6690 2006-11-13  Dick Porter  <dick@ximian.com>
6691
6692         * file-io.c (get_file_attributes): If the file is a symlink try
6693         and get the stat data for the target, but also add the
6694         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
6695         the specs for the windows symlink support, but will probably have
6696         to be reworked when I have test data from a vista machine.  Fixes
6697         bug 79887.
6698
6699 2006-11-13  Dick Porter  <dick@ximian.com>
6700
6701         * gc.c (mono_domain_finalize): 
6702         * marshal.c (mono_delegate_begin_invoke): 
6703         * threadpool.c (socket_io_init, mono_thread_pool_init)
6704         (mono_thread_pool_finish): 
6705         * monitor.c (mono_monitor_try_enter_internal): 
6706         * threads.c (mono_thread_resume, mono_thread_init)
6707         (mono_thread_suspend_all_other_threads)
6708         (mono_thread_execute_interruption): 
6709         * appdomain.c (mono_domain_unload): Check for NULL error returns
6710         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
6711         75733.
6712
6713 2006-11-11  Miguel de Icaza  <miguel@novell.com>
6714
6715         * process.c
6716         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
6717         Only close the handle if the value of the handle is not
6718         INVALID_HANDLE_VALUE.  This just makes the process a bit more
6719         robust.
6720
6721         Improvement for #75733, so that we do not run into this problem. 
6722
6723         
6724         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
6725         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
6726         internal variables.  Fixes #79462 
6727         
6728
6729 2006-11-09  Dick Porter  <dick@ximian.com>
6730
6731         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
6732         Use poll() not select().  Fixes bug 79397.
6733
6734 2006-11-09  Raja R Harinath  <rharinath@novell.com>
6735
6736         Fix #79872
6737         * assembly.c (mono_assembly_load_from_full): Check that the given
6738         image has an assembly manifest.
6739
6740 2006-11-09  Ankit Jain  <jankit@novell.com>
6741
6742         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
6743         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
6744         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
6745
6746 2006-11-07  Dick Porter  <dick@ximian.com>
6747
6748         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
6749         Put the old resolver behaviour back for pre-2.0 profiles.
6750
6751 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
6752
6753         * threadpool.c: precise GC and locking fixes.
6754
6755 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
6756
6757         * class.c: don't load types that have an explicit unaligned
6758         managed reference. Provide better info in the TypeLoad exception.
6759         Part of the fix for bug #79744.
6760         * object.c: use the correct check for class type load issues.
6761
6762 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
6763
6764         * class.c: enforce alignment of fields with managed references
6765         even when Pack=1 is forced by the user (bug #77788).
6766
6767 2006-11-03  Dick Porter  <dick@ximian.com>
6768
6769         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
6770         If the address reverse lookup fails, return it as the hostname
6771         anyway.  Fixes bug 79721.
6772
6773 2006-11-03  Dick Porter  <dick@ximian.com>
6774
6775         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
6776         Fix build on Windows.
6777
6778 2006-11-02  Dick Porter  <dick@ximian.com>
6779
6780         * icall-def.h: 
6781         * object-internals.h: 
6782         * exception.c (mono_get_exception_thread_interrupted): 
6783         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
6784         Fixes bug 74525.
6785
6786         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
6787         Check for pending Thread.Interrupt.
6788
6789 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
6790         * loader.c: Fixed bug 79684.
6791
6792 2006-10-27  Dick Porter  <dick@ximian.com>
6793
6794         * file-io.c (get_file_attributes): Force symlinks to directories
6795         to be returned as a regular file.  Fixes bug 79733.
6796 2006-10-26  Dick Porter  <dick@ximian.com>
6797
6798         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
6799         CreateFile to open a directory then we need to set the
6800         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
6801
6802 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
6803
6804         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
6805         friends.
6806
6807 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
6808
6809         * sgengc.c: small cleanup of timer code.
6810
6811 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
6812
6813         * sgen-gc.c: fix some warnings and start adding support for
6814         complete object removal on domain unload.
6815
6816 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
6817
6818         * assembly.c: build_assembly_name should not consider a version
6819         number without build or revision number invalid. Fixes bug #79715.
6820
6821 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
6822
6823         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
6824         call kernel32 function OutputDebugString directly.
6825         
6826         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
6827         
6828 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
6829
6830         * reflection.c: small cleanup, using a function to insert a MonoString
6831         in the string heap.
6832
6833 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
6834
6835         * reflection.c: moving GC fixes.
6836
6837 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
6838
6839         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
6840         all the objects with finalizers belonging to an unloading appdomain.
6841
6842 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
6843
6844         * sgen-gc.c: added ability to allocate even when the nursery is fully
6845         pinned and fixed a couple of bugs.
6846
6847 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
6848
6849         * threads.h: Revert the last change for now.
6850
6851         * threads.h (mono_thread_get_pending_exception): Rename this to
6852         mono_thread_get_undeniable_exception ().
6853
6854 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
6855
6856         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
6857         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
6858         when fname does not refer to valid assembly. This result in a more
6859         meaningful error message.
6860         * exception.c: added mono_get_exception_bad_image_format2 which 
6861         constructs a BadImageFormatException using the ctor taking a custom
6862         message and the file name. Passing in a NULL msg results in a default
6863         message.
6864         * exception.h: define mono_get_exception_bad_image_format2 function.
6865         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
6866         when file name pointed to an invalid IL image. Use 
6867         mono_get_exception_file_not_found2 to construct FileNotFoundException,
6868         as this results in a more meaningful error message.
6869
6870 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
6871
6872         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
6873         #79465.
6874
6875 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
6876
6877         * metadata.c (mono_type_size): Change the align parameter to guint32 for
6878         consistency with the other _size functions.
6879         (mono_type_stack_size): Ditto.
6880
6881         * class.c object.c icall.c: Fix warnings caused by the above change.
6882
6883         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
6884
6885         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
6886
6887         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
6888
6889 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
6890
6891         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
6892         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
6893         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
6894         threadpool.h, threads-types.h: mark more internal functions.
6895
6896 2006-10-11  Dick Porter  <dick@ximian.com>
6897
6898         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
6899         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
6900         reproduce the bug even before applying the fix.)
6901
6902 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
6903
6904         * reflection.c: allow retrieving attributes for arguments in generic
6905         methods (bug #79241).
6906
6907 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
6908
6909         * debug-mono-symfile.c: properly check fopen () result (found by
6910         coverity).
6911
6912 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
6913
6914         * reflection.c: make error message clearer and fixed two
6915         issuelets found by Coverity.
6916
6917 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
6918
6919         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
6920
6921 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
6922
6923         * object-internals.h, gc-internal.h, profiler-private.h:
6924         mark internal functions.
6925
6926 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
6927
6928         * reflection.c: put data in the text section.
6929         * icall.c: recognize more types in type_from_typename ().
6930         * process.c, marshal.c: added some GC FIXMEs.
6931
6932 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
6933
6934         * loader.c: check for NULL before initializing.
6935
6936 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
6937
6938         * gc.c (finalizer_thread): Use a non-alertable wait here.
6939
6940         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
6941         until the correct solution is found.
6942
6943 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
6944
6945         * reflection.c (mono_module_get_object): Avoid an assert when operating on
6946         modules with no metadata. Fixes #79596.
6947
6948         * image.c (load_metadata_ptrs): Put back the error message when
6949         the #- heap is encountered since the support is not complete yet.
6950
6951 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
6952
6953         * gc.c: do not allow the user to SuppressFinalize () a
6954         delegate because it would leak the trampoline if present.
6955
6956 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
6957
6958         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
6959         PropertyPtr table.
6960
6961 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
6962
6963         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
6964
6965         * metadata.c (mono_metadata_get_param_attrs): Ditto.
6966
6967         * row-indexes.h: Add definitions for *Ptr tables.
6968
6969         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
6970
6971         * metadata.c (mono_metadata_translate_token_index): New helper function to
6972         translate table indexes used in uncompressed metadata.
6973         (mono_metadata_decode_table_row): Ditto.
6974         (mono_metadata_decode_table_row_col): Ditto.
6975
6976         * metadata.c: Add table schema for *Ptr tables.
6977
6978         * class.c loader.c: Use the new helper function to access the affected metadata
6979         tables.
6980         
6981         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
6982         #38532.
6983         
6984 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
6985
6986         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
6987         sequences which can be unbounded in size. Fixes #79583.
6988
6989 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
6990
6991         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
6992         static initialization.
6993
6994         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
6995
6996         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
6997
6998         * domain.c (mono_domain_free): Free up type_init_exception_hash.
6999
7000         * object.c (mono_runtime_class_init): Implement correct semantics when a static
7001         ctor fails, i.e. throw the same exception on subsequent accesses.
7002         
7003 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
7004
7005         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
7006         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
7007         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
7008         Handle marshalling of interfaces and VARIANTs contained in structs.
7009         
7010         Code is contributed under MIT/X11 license.
7011         
7012 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
7013
7014         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
7015         
7016         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
7017         mempool.
7018
7019 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7020
7021         * console-io.c: ignore previous SIGINT handler.
7022
7023 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
7024
7025         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
7026         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
7027         #79460, #79461, #79485.
7028
7029         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
7030
7031         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
7032         #79217.
7033
7034 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
7035
7036         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
7037         could be generated from it.
7038
7039 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
7040
7041         * rand.c: fix read loop to correctly handle EINTR.
7042
7043 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
7044
7045         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
7046         internal calls are defined to keep methods closer to the declaring
7047         type and allow a significant reduction in runtime relocations and
7048         memory usage.
7049
7050 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
7051
7052         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
7053         exception message to have FileNotFoundException use the default
7054         assembly load error message. Fixes bug #79426.
7055         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
7056
7057 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7058
7059         * threadpool.c: (start_thread_or_queue) use the root domain when
7060         creating the thread instead of the async object one.
7061
7062 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
7063
7064         * class.c, object.c, class-internals.h, reflection.c:
7065         for arrays, store element_size inside MonoClass (speedup
7066         for array object creation).
7067
7068 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
7069
7070         * icall.c: fixed CodeBase to use the file name and not the module
7071         name (bug #79365).
7072
7073 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
7074
7075         * mono-debug.c, mono-debug.h: export find_method as
7076         mono_debug_find_method ().
7077
7078 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
7079
7080         * debug-helpers.c, class-internals.h: added a few functions useful
7081         when debugging under gdb.
7082
7083 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7084
7085         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
7086         characters that need special handling.
7087
7088 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
7089
7090         * mono-config.c: make the os/cpu specification more flexible,
7091         allowing lists and negation.
7092
7093 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
7094
7095         * marshal.c: COM Interop fixes. Handle case where method->klass.
7096         is interface. Handle BSTR/MonoString when null. Use CDECL as 
7097         calling convention on non-windows platforms. This is for
7098         compatibility with XPCOM and MainWin COM.
7099         
7100         Code is contributed under MIT/X11 license.
7101         
7102
7103 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
7104
7105         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
7106         correctly. Fixes #79217.
7107
7108         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
7109
7110 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
7111
7112         * mono-config.c: allow both an os and cpu attribute for dllmap
7113         and dllentry elemnets to enable a single config file to be used
7114         for multiple architectures.
7115
7116 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
7117
7118         * loader.c: MonoLoaderError was cleared too soon on load failure.
7119         Fixes bug #79424.
7120
7121 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
7122
7123         * icall.c: use the defining class vtable when accessing a
7124         static field, not a pobblibly derived class.
7125
7126 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
7127
7128         * icall.c string-icalls.c: Remove references to unicode.h.
7129
7130         * unicode.h unicode.c Makefile.am: Remove these unused source files.
7131
7132         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
7133
7134         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
7135         indicating the image where custom marshaller types should be looked up.
7136         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
7137         custom marshallers, instead of corlib. Fixes #79425.
7138
7139 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
7140
7141         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
7142
7143 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
7144
7145         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
7146         Implement Environment.ProcessorCount.
7147         
7148         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
7149         Implement Environment.ProcessorCount.
7150         
7151         * icall.c: 
7152         Add Environment.ProcessorCount icall.
7153         
7154         Patch by Jason McFall.
7155
7156 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7157
7158         * assembly.c: don't append .exe/.dll when the filename already contains
7159         one of those extensions.
7160
7161 2006-09-12  Martin Baulig  <martin@ximian.com>
7162
7163         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
7164         to array interfaces.
7165
7166 2006-09-11  Martin Baulig  <martin@ximian.com>
7167
7168         * reflection.c (mono_image_build_metadata): Create the
7169         MethodImpl's after emitting all types and methods, so we don't
7170         need another fixup pass for them.
7171
7172 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
7173
7174         * class.c (mono_class_from_name_case): Fix regression introduced by the last
7175         change.
7176
7177 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
7178
7179         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
7180         unload.
7181
7182 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
7183
7184         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
7185         args is not set. Fixes #78926.
7186
7187 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
7188
7189         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
7190
7191         * image.c (load_class_names): Move this to class.c, and rename it to 
7192         'mono_image_init_name_cache'.
7193         (load_modules): Fix a warning.
7194
7195         * class.c icall.c image.c: Initialize image->name_cache lazily.
7196
7197         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
7198         on its name using information in the AOT file.
7199
7200         * class.c (mono_class_from_name): Use the new hook function.
7201
7202 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
7203
7204         * reflection.c (mono_param_get_objects): Handle enum default parameter values
7205         correctly.
7206
7207         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
7208         Fixes #79289.
7209         
7210 2006-09-06  Martin Baulig  <martin@ximian.com>
7211
7212         * icall.c (mono_lookup_internal_call): Small fix.
7213
7214 2006-09-05  Raja R Harinath  <rharinath@novell.com>
7215
7216         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
7217         double g_free.
7218
7219 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
7220
7221         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
7222         when --debug is specified.
7223
7224 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
7225
7226         * class.c (setup_generic_array_ifaces): Fix a warning.
7227
7228 2006-09-04  Miguel de Icaza  <miguel@novell.com>
7229
7230         * Temporarily remove the patch to assemly.c that checks the
7231         assembly versions as it breaks our gacutil.
7232
7233 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
7234
7235         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
7236
7237         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
7238         a net 1.0 runtime.
7239
7240         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
7241         created using the default ctor. Fixes #79152.
7242         (mono_string_builder_to_utf16): Ditto.
7243
7244 2006-09-01  Martin Baulig  <martin@ximian.com>
7245
7246         Fix handling of the generic array interfaces.
7247
7248         * class-internals.h
7249         (MonoDefaults): Removed `generic_array_class' and added
7250         `generic_ilist' class.
7251
7252         * class.c
7253         (mono_bounded_array_class_get): Add the new generic array interfaces.
7254         (setup_generic_array_ifaces): New static method; create vtable
7255         entries for each method in the generic array interfaces.
7256
7257         * metadata.c
7258         (select_container): Allow "parent-less" generic methods.
7259
7260         * marshal.c
7261         (mono_marshal_get_generic_array_helper): New public method.
7262
7263         * icall.c
7264         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
7265         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
7266         moved the interncall into System.Array.
7267
7268 2006-09-01  Raja R Harinath  <rharinath@novell.com>
7269
7270         A few more cases of avoiding work on types with ->byref set.
7271         Has the real fix for #79238
7272         * icall.c (is_generic_parameter): New helper.
7273         (ves_icall_Type_GetGenericParameterPosition): Use it.
7274         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
7275         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
7276         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
7277         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
7278         reference types.
7279         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
7280         reference types.
7281         (ves_icall_Type_get_IsGenericInstance): Likewise.
7282         (ves_icall_Type_get_IsGenericType): Likewise.
7283
7284 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
7285
7286         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
7287         class if possible.
7288
7289         * mempool.h (mono_mempool_get_allocated): New helper function.
7290
7291         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
7292         change.
7293
7294         * mempool.c: Fix warnings and the calculation of stats.
7295
7296         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
7297
7298         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
7299
7300         * loader.c (mono_get_method_from_token): Update method_count stat.
7301
7302         * class-internals.h (MonoStats): Add some stats.
7303
7304 2006-08-31 Robert Jordan  <robertj@gmx.net>
7305
7306         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
7307         with managed variants.
7308         All code is contributed under the MIT/X11 license.
7309         
7310 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
7311
7312         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
7313         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
7314
7315         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
7316
7317         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
7318         with cycles in classes.
7319
7320         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
7321
7322         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
7323         missing a [MarshalAs] directive. Fixes #79203.
7324
7325         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
7326         klass->marshal_info. Fixes #79217.
7327
7328 2006-08-30  Martin Baulig  <martin@ximian.com>
7329
7330         Committing a patch from Joachim Ante <joe@otee.dk>:
7331         Add support for binary data symbol stores.
7332
7333         * debug-mono-symfile.c
7334         (mono_debug_open_mono_symbol_file): Renamed into
7335         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
7336         arguments.
7337
7338         * mono-debug.c
7339         (mono_debug_open_image): Added `raw_contents' and `size' args.
7340         (mono_debug_init_2_memory): New public function.
7341
7342 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
7343
7344         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
7345
7346 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7347
7348         * appdomain.c: implement support for ShadowCopyFiles.
7349
7350 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
7351
7352         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
7353         when value is NULL (and should remove CID #51).
7354
7355 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7356
7357         * image.c: moved 2 functions to ../utils.
7358
7359 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
7360
7361         * gc.c: cope with the target object of a GC handle being NULL
7362         (bug #78877).
7363
7364 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
7365
7366         * class.c: recursively check parent's explicit implementations
7367         of interface methods (fixes bug #79125).
7368
7369 2006-08-19  Miguel de Icaza  <miguel@novell.com>
7370
7371         * filewatcher.c: Avoid warnings when building, do not redefine
7372         constants that are defined.
7373
7374         Remove warnings.
7375
7376 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7377
7378         * image.c: don't fail when the link points to an absolute path.
7379
7380 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
7381
7382         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
7383         Fix CID #3.
7384
7385 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7386
7387         * image.c (full_path): A new method used to obtain the actual path
7388         of an assembly even in the presence of symbolic links.  
7389
7390         This is necessary for the case where we are running a binary that
7391         has been GACed, but we are using the "published" path name
7392         ($prefix/mono/1.0/blah.exe) which happens to point to the real
7393         file in the GAC.
7394
7395         This was the source of the failure for the `xsp' command with the
7396         recent AppDomain changes, as far as the runtime was concerned,
7397         there were two different assemblies: $prefix/mono/1.0/blah.exe and
7398         $prefix/mono/gac/blah/version/blah.exe.
7399
7400         (do_mono_image_open): use full path
7401
7402 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
7403
7404         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
7405
7406 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
7407
7408         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
7409         domain_id is supplied. Fix CID #241 and corlib's unit tests.
7410
7411 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
7412
7413         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
7414         small structures. Fixes #78990.
7415
7416 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
7417
7418         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
7419
7420         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
7421
7422 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7423
7424         * appdomain.c:
7425         * marshal.c: don't load all the assemblies from a domain into newly
7426         created ones. The new domains might have different rules and load
7427         assemblies from different locations. Fixes bug #76757.
7428
7429         Patch by Lluis. Conflicts resolved by Brian Crowell.
7430
7431 2006-08-16  Alp Toker  <alp@atoker.com>
7432
7433         * socket-io.c: First half of the fix for #79084.
7434         Set sa_size to the length of the content, not that of the struct.
7435         Don't add NULL suffix to the content, this should be done in
7436         managed code if needed.
7437
7438 2006-08-14  Raja R Harinath  <rharinath@novell.com>
7439
7440         Fix part of #79012
7441         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
7442         mono_metadata_parse_type returns NULL.
7443
7444 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
7445
7446         * normalization-tables.h : new file for string normalization data.
7447         * locales.c, locales.h, icall.c :
7448           added load_normalization_resource() for string normalization,
7449           and icall as well.
7450         * Makefile.am : added normalization-tables.h to the sources.
7451
7452 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
7453
7454         * marshal.c: Add more helper functions to reduce code duplication and use them
7455         everywhere.
7456
7457 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
7458
7459         * marshal.c: Fix non-x86 stdcall warnings.
7460         
7461         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
7462         them everywhere.
7463
7464 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
7465
7466         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
7467         type check on multi-dimensional arrays. Fixes #79000.
7468
7469 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
7470
7471         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
7472         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
7473         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
7474         * class-internals.h: add is_com_object to class structure.
7475         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
7476         null checks to COM object marshalling. Fix .ctor call on RCW.
7477         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
7478         
7479         All code is contributed under the MIT/X11 license.
7480
7481 2006-08-09  Dick Porter  <dick@ximian.com>
7482
7483         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
7484         racing mono_monitor_allocator_lock() somewhere, so don't delete
7485         the critical section for now.  Found by running and exiting
7486         monodevelop.
7487
7488 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
7489
7490         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
7491         (ves_icall_System_ComObject_FindInterface): Ditto.
7492         (ves_icall_System_ComObject_CacheInterface): Ditto.
7493
7494         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
7495         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
7496
7497 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7498
7499         * threadpool.c: treat pipes from process asynchronous reads as sockets
7500         when reading from them, so we get select/poll or epoll to wait for
7501         data.
7502
7503 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
7504
7505         * loader.c: Fix a typo (CID #233) in the null check.
7506
7507 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
7508
7509         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
7510         Hopefully fixes #78949.
7511         
7512         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
7513         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
7514         bytes. Fixes #78972.
7515
7516 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7517
7518         * filewatcher.c: we need to set errno here.
7519
7520 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7521
7522         * filewatcher.c: let Win32Exception get the error value.
7523
7524 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7525
7526         * filewatcher.c: translate errno into win32 errors for Win32Exception
7527         to know what happened.
7528
7529 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
7530
7531         * threadpool.c: Fix more warnings.
7532
7533         * assembly.c (search_loaded): Fix warnings.
7534
7535         * threadpool.c (mono_thread_pool_finish): Fix warnings.
7536         (mono_async_invoke): Ditto.
7537
7538 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
7539
7540         * object.c (mono_remote_class_vtable): Need to create proxy vtable
7541         entries for __ComObject type in addition to ComImport types.
7542         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
7543         about hash table.
7544         
7545         All code is contributed under the MIT/X11 license.
7546
7547 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
7548
7549         * image.c: avoid tentative loading of modulerefs that contain
7550         no metadata (P/Invoke library names).
7551
7552 2006-07-28  Dick Porter  <dick@ximian.com>
7553
7554         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
7555         mono_loader_lock() somewhere, so don't delete the critical section
7556         for now.  Found by running and exiting monodevelop.
7557
7558 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7559
7560         * filewatcher.c: define the inotify syscalls when we're building on
7561         linux and have sys/syscall.h. The build system might not have support
7562         for inotify but the target system might have it.
7563
7564 2006-07-26  Miguel de Icaza  <miguel@novell.com>
7565
7566         * domain.c: Documentation updates.
7567
7568         * loader.c (mono_free_method): Do not release the method
7569         information if we are being profiled, as profilers will use this
7570         information at shut down to present some data to the user.
7571
7572         This is needed so that the profiler does not crash, as the
7573         profiler tends to keep MonoMethods around, and they might become
7574         invalid if we free these.
7575
7576         (mono_get_method_constrained): Return the original CIL stream
7577         method as well, so verification can be performed against it.
7578
7579 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7580
7581         * filewatcher.[ch]: support for inotify file system watcher.
7582         * icall.c: add new internal calls for the inotify file system watcher.
7583
7584 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7585
7586         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
7587         #78888.
7588
7589 2006-07-20  Dick Porter  <dick@ximian.com>
7590
7591         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
7592         warning.
7593
7594 2006-07-20  Dick Porter  <dick@ximian.com>
7595
7596         * threads.c (start_wrapper): Do the thread cleanup while we still
7597         hold a reference to its object.  Fixes bug 78123.
7598
7599 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
7600
7601         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
7602         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
7603           "managed-to-managed".
7604         * icall.c: Redirect string constructors that take sbyte* to
7605           ves_icall_System_String_ctor_RedirectToCreateString.
7606         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
7607           to CreateString () methods with matching signature.
7608         * reflection.c: Use original security informations for
7609           MONO_WRAPPER_MANAGED_TO_MANAGED.
7610         * security-manager.c: Use original security informations for
7611           MONO_WRAPPER_MANAGED_TO_MANAGED.
7612         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
7613           that is a placeholder and only its address should be used.
7614         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
7615           that is a placeholder and only its address should be used.
7616
7617 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
7618
7619         Begin implementing COM Interop.
7620         * appdomain.c: Increment corlib version.
7621         * class.c: Set ComImport classes' parent to __ComObject.
7622         * loader.c: Mark cominterop methods as such.
7623         * domain.c: Add __ComObject class to MonoDefaults structure.
7624         * image.c: Add 2 hashtables to the image for COM Interop related methods
7625         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
7626         using the mempool allocator
7627         
7628         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
7629         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
7630         declaration for mono_metadata_type_dup_mp.
7631         
7632         * debug-helpers.c: Added strings for two additional wrapper types
7633         * object.c: Create proxy objects for ComImport classes
7634         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
7635         and added __ComObject class to MonoDefaults structure.
7636         
7637         * object-internals.h: Finish MonoRealProxy definition, and add definition of
7638         MonoComInteropProxy and MonoComObject.
7639         
7640         * marshal.c: Added support for COM Interop
7641         (signature_cominterop): Converts managed signature to corresponding
7642         unmanaged COM signature.
7643         (cominterop_get_function_pointer): gets unmanaged function pointer via
7644         COM object vtable
7645         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
7646         (cominterop_get_method_interface): returns interface type that method is defined on
7647         (mono_mb_emit_cominterop_call): emits native call to function pointer
7648         gotten from vtable
7649         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
7650         that matches signature of unmanaged function.
7651         (cominterop_get_native_wrapper): wrapper around adjusted method call.
7652         (cominterop_get_invoke): forwards call from proxy to __ComObject
7653         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
7654         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
7655         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
7656         
7657         * marshal.h: Added Marshal icall declarations.
7658         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
7659         so we can access them in finalizer
7660         
7661 2006-07-14  Dick Porter  <dick@ximian.com>
7662
7663         * object.c (mono_type_initialization_cleanup): Fix a race
7664         condition by temporarily commenting out the critical section
7665         deletion.
7666
7667 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
7668
7669         * reflection.c (create_custom_attr): Fix some warnings.
7670         (create_custom_attr_data): Ditto.
7671         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
7672         types. Fixes #78855.
7673
7674 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
7675
7676         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
7677
7678         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
7679
7680 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
7681
7682         * reflection.c (resolve_object): Add support for DynamicMethod.
7683
7684         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
7685         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
7686
7687 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
7688
7689         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
7690         don't leak GPtrArray's pdata has we have no use (nor free) for it.
7691
7692 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
7693
7694         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
7695         Fixes #77888.
7696
7697 2006-06-30  Raja R Harinath  <rharinath@novell.com>
7698
7699         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
7700         slightly: remove a shadow local variable.
7701
7702 2006-06-29  Raja R Harinath  <rharinath@novell.com>
7703
7704         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
7705         definition that introduces the virtual function slot.
7706         Also fix Coverity #105.
7707
7708 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
7709
7710         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
7711         for dynamic assemblies. Fixes #78724.
7712
7713 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
7714
7715         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
7716         Fixes #78722.
7717
7718 2006-06-21  Martin Baulig  <martin@ximian.com>
7719
7720         * reflection.c
7721         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
7722         fixes #76484.
7723
7724 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
7725
7726         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
7727
7728 2006-06-20  Raja R Harinath  <rharinath@novell.com>
7729
7730         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
7731         nor TYPEREFs.
7732         * class.c (mono_class_create_from_typespec): Add 'context' argument.
7733         Inflate result if necessary.
7734         (mono_class_get_full): Remove old version.  Rename from
7735         'mono_class_get' and add 'context' argument.  Pass it to
7736         ..._create_from_typespec.
7737         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
7738         (mono_ldtoken): Revert change below.
7739
7740 2006-06-20  Martin Baulig  <martin@ximian.com>
7741
7742         * class.c (mono_ldtoken): Don't pass the generic context to
7743         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
7744
7745 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
7746
7747         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
7748         and later freeing it. Fixes #78638.
7749
7750 2006-06-15  Miguel de Icaza  <miguel@novell.com>
7751
7752         * icall.c (mono_class_get_throw): Revert over-zealous error
7753         throwing, the caller for mono_class_get_throw will cope with
7754         errors when classes are not properly initialized already.
7755
7756         The code still copes with loader exceptions though.
7757
7758         Fixes the regression in reftype1 and reftype3 from the CAS tests.
7759         
7760 2006-06-14  Miguel de Icaza  <miguel@novell.com>
7761
7762         Fixes the `make run1' version of RuntimeAbort (to be commited,
7763         source is in Bugzilla).
7764         
7765         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
7766         FALSE on class loading failure instead of returning true.
7767
7768         * class.c (mono_class_create_from_typedef): It is possible for
7769         mono_metadata_interfaces_from_typedef_full to fail if a class is
7770         not found, cope with this.
7771         
7772
7773 2006-06-14  Dick Porter  <dick@ximian.com>
7774
7775         * socket-io.c: 
7776         * process.c: Fix a bunch of signed/unsigned warnings from gcc
7777         4.1.1
7778
7779 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
7780
7781         * culture-info-table.h : oops, forgot to make it nsync with r61548.
7782
7783 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
7784
7785         * icall.c: Another fix for building mono in Visual Studio.
7786
7787 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
7788
7789         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
7790         
7791 2006-06-09  Martin Baulig  <martin@ximian.com>
7792
7793         * debug-mono-symfile.c: Put this back and really fix it this
7794         time. Sorry for all the trouble.
7795
7796 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
7797
7798         * icall.c (mono_class_get_throw): Fix a warning.
7799         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
7800         ReflectionTypeLoadException if needed. Fixes #78606.
7801
7802         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
7803         (mono_class_init): Ditto.
7804
7805         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
7806         ref_only exceptions.
7807         (mono_loader_clear_error): Make this work even if there is no error.
7808
7809 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
7810
7811         * object-internals.h marshal.c marshal.h icall.c: Implement method 
7812         Marshal.GetComSlotForMethodInfo using internal call.
7813
7814 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
7815
7816         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
7817         a function for signalling it.
7818
7819         * class.c (mono_class_from_typeref): Use the new kind of loader error when
7820         a referenced assembly is not found.
7821
7822         * loader.c (mono_loader_error_prepare_exception): Add support for 
7823         LOADER_ERROR_ASSEMBLY. Fix formatting.
7824
7825 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
7826
7827         * domain.c appdomain.c class-internals.h marshal.c: Add support 
7828         for VARIANT marshalling on windows and increment corlib version
7829         since Variant struct was added.
7830
7831 2006-06-03  Miguel de Icaza  <miguel@novell.com>
7832
7833         * debug-mono-symfile.c: Revert Martin's previous patch which broke
7834         stack trace line information:
7835
7836         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
7837         (Martin) when looking up B which is between A and C, return A not C.
7838
7839         Bug is #78573.
7840
7841         Thanks to Alexander Olk for tracking this down.
7842
7843 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
7844
7845         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
7846         
7847         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
7848         avoid clobbering its value.
7849         (mono_string_to_lpstr): Fix a warning on windows.
7850
7851 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
7852
7853         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
7854
7855         * reflection.c loader.c: Removed references to 'dummy' flag.
7856
7857         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
7858
7859         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
7860         it gets GC tracking.
7861
7862         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
7863         GC tracking.
7864         
7865         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
7866
7867         * marshal.c threadpool.c: Update callers of mono_async_result_new.
7868
7869         * appdomain.c: Bump corlib version.
7870
7871 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
7872
7873         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
7874         CEE_STIND_REF when working with object references.
7875
7876 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
7877
7878         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
7879         Fixes #78539.
7880
7881 2006-05-30  Miguel de Icaza  <miguel@novell.com>
7882
7883         * loader.c (method_from_memberref): Fix argument value for
7884         mono_loader_set_error_method_load (I was passing the MonoClass
7885         instead of the class name char *).
7886
7887 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
7888
7889         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
7890         CEE_STIND_REF when working with object references.
7891
7892 2006-05-30  Martin Baulig  <martin@ximian.com>
7893
7894         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
7895         mono_method_full_name() change and replace the ':' with a '.'
7896         here.
7897
7898 2006-05-30  Martin Baulig  <martin@ximian.com>
7899
7900         * debug-mono-symfile.c
7901         (mono_debug_symfile_lookup_location): Fix the algorithm:
7902         when looking up B which is between A and C, return A not C.
7903
7904 2006-05-29  Martin Baulig  <martin@ximian.com>
7905
7906         * mono-debug.h
7907         (MonoDebugMethodInfo): Make the typedef public.
7908         (MonoDebugSourceLocation): New public struct.
7909
7910         * mono-debug.c
7911         (mono_debug_source_location_from_address): Removed.
7912         (mono_debug_source_location_from_il_offset): Removed.
7913         (mono_debug_il_offset_from_address): Removed.
7914         (mono_debug_address_from_il_offset): Removed.
7915         (mono_debug_lookup_method): New public function.
7916         (mono_debug_lookup_source_location): New public function; replaces
7917         the old mono_debug_source_location_from_*() functions; see the
7918         inline documentation.
7919         (mono_debug_free_source_location): New public function.
7920         (mono_debug_print_stack_frame): New public function; see the
7921         inline documentation.
7922
7923         * debug-mono-symfile.c
7924         (mono_debug_find_source_location): Renamed into
7925         mono_debug_symfile_lookup_location(); only take a
7926         `MonoDebugMethodInfo *' and an `offset' argument; added inline
7927         documentation.
7928         (mono_debug_find_method): Renamed into
7929         mono_debug_symfile_lookup_method().
7930
7931 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
7932
7933         * assembly.c (mono_assembly_open_full): Dont overwrite the status
7934         returned by mono_image_open_full ().
7935
7936         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
7937         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
7938         #78517.
7939
7940         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
7941         #78518.
7942
7943 2006-05-27  Miguel de Icaza  <miguel@novell.com>
7944
7945         * class.c (mono_class_from_typeref): handle missing images
7946         earlier, deals with bug #78418.   Refactor code; 
7947
7948         Fix a warning introduced in my previous commit (some stale code
7949         from before I revisited my patch).
7950
7951         * class.c (mono_class_create_from_typedef): On failure, remove the
7952         class from the MonoImage->class_cache as the class is not
7953         initialized;   Fixes the leak pointed out by Paolo.
7954
7955 2006-05-25  Dick Porter  <dick@ximian.com>
7956
7957         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
7958         DeleteCriticalSections until I figure out which one may still be
7959         sometimes locked when mono_thread_cleanup is called.
7960
7961 2006-05-24  Dick Porter  <dick@ximian.com>
7962
7963         * threads.c (mono_thread_cleanup): Move the threading cleanup out
7964         of mono_thread_manage and back into its own function, so it can be
7965         called after the finalizer thread has finished.
7966
7967         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
7968
7969 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
7970
7971         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
7972         Fixes #78495.
7973
7974         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
7975         with non-blittable elements.
7976         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
7977
7978 2006-05-24  Martin Baulig  <martin@ximian.com>
7979
7980         * mono-debug-debugger.h (MonoDebuggerEvent): Added
7981         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
7982
7983         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
7984         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
7985         `mono_debugger_event_handler' to NULL.
7986
7987 2006-05-24  Martin Baulig  <martin@ximian.com>
7988
7989         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
7990
7991 2006-05-24  Martin Baulig  <martin@ximian.com>
7992
7993         * mono-debug-debugger.h
7994         (mono_debugger_create_notification_function): Added
7995         `MonoCodeManager *' argument.
7996
7997 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
7998
7999         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
8000
8001 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
8002
8003         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
8004         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
8005         implementation.
8006
8007 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
8008
8009         * icall.c: precise GC support: objects can't be stored in unmanaged
8010         memory anymore, even if they are kept alive by other references: since
8011         they can move the GC needs to be able to always find them.
8012
8013 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
8014
8015         * object.c: precise GC support for static fields. Support
8016         for moving GCs: write barriers and pinned allocation for interned
8017         strings.
8018
8019 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
8020
8021         * domain.c, domain-internals.h: precise GC support for the MonoDomain
8022         structure.
8023
8024 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
8025
8026         * class.c, gc.c: sgen and precise GC updates.
8027
8028 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
8029
8030         * marshal.h, marshal.c: added write barrier wrapper and precise type
8031         fixes.
8032
8033 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
8034
8035         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
8036         support.
8037
8038 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
8039
8040         * reflection.c: precise and sgen GC updates.
8041
8042 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
8043
8044         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
8045
8046 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
8047
8048         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
8049
8050 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
8051
8052         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
8053         MONO_TYPE_OBJECT. Fixes #78462.
8054
8055 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
8056
8057         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
8058         and blittable types.
8059
8060 2006-05-17  Miguel de Icaza  <miguel@novell.com>
8061
8062         * class.c (mono_class_get_exception_for_failure): Implement parts
8063         of a TODO: if the loader error is set (instead of the class
8064         error), we return a Loader exception that can be properly thrown
8065         elsewhere.
8066
8067         This was exposed by some Winforms 2.0 code that I tried to run
8068         (Atsushi pointed me to it).
8069
8070 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
8071
8072         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
8073         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
8074         
8075         * marshal.c (emit_marshal_vtype): Add limited support for 
8076         UnmanagedType.LPStruct. Fixes #78427.
8077
8078         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
8079         Applied a patch from kangaroo to fix #77523.
8080
8081 2006-05-17  Martin Baulig  <martin@ximian.com>
8082
8083         * threads.c
8084         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
8085         (debugger_thread_created): Removed.
8086         (debugger_thread_exited): Removed.
8087
8088 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
8089
8090         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8091
8092         * object-internals.h (MonoReflectionResource): Sync with managed version.
8093
8094 2006-05-12  Wade Berrier <wberrier@novell.com>
8095
8096         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
8097
8098 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
8099
8100         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
8101         functions try to allocate from the image mempool.
8102
8103 2006-05-12  Dick Porter  <dick@ximian.com>
8104
8105         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
8106
8107 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
8108
8109         * object.c: The FieldGetter and FieldSetter methods require the full
8110         name of the class, not only the name. Fixes bug #78277.
8111
8112 2006-05-11  Miguel de Icaza  <miguel@novell.com>
8113
8114         * loader.c (method_from_memberref): Do not pass the NULL klass to
8115         mono_loader_set_error_() methods.  Pass the non-NULL value
8116         (class). 
8117
8118 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
8119
8120         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
8121         (mono_assembly_close): Null out assembly->image->references after freeing it.
8122
8123         * image.c (mono_image_close): Free image->references.
8124         
8125         * reflection.c (mono_image_basic_init): Fix a small memory leak.
8126
8127 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
8128
8129         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
8130         before checking if it's NULL (g_assert).
8131
8132 2006-05-10  Martin Baulig  <martin@ximian.com>
8133
8134         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
8135         I thought I already killed that two months ago, but now it somehow reappeared.
8136
8137 2006-05-10  Martin Baulig  <martin@ximian.com>
8138
8139         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
8140
8141 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
8142
8143         * reflection.c: Allocate memory for dynamically created methods in the image
8144         mempools.
8145
8146 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
8147
8148         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
8149         don't use the ad pointer before checking if it's NULL (g_assert).
8150
8151 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
8152
8153         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
8154         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
8155
8156         * marshal.c: Allocate all signatures from mempools.
8157
8158         * marshal.c: Allocate some more signatures from mempools.
8159
8160 2006-05-09  Miguel de Icaza  <miguel@novell.com>
8161
8162         * object.c (mono_load_remote_field): The code used to provide a
8163         temporary variable for returning results if the user did not
8164         provide a result pointer.  But our temporary variable was allocted
8165         on the satck.
8166
8167         Fix calling code to always pass a result area.   Coverity ID 103.
8168
8169 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
8170
8171         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
8172         value, not the old. Fixes #78312.
8173         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
8174
8175         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
8176         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
8177         per-image cache.
8178
8179         * assembly.c (mono_assembly_close): Free image->references.
8180
8181         * assembly.c (mono_assembly_names_equal): Fix a warning.
8182         (mono_assemblies_cleanup): Cleanup more global data.
8183
8184         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
8185
8186         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
8187         ptr_cache and image->modules.
8188
8189         * image.c (mono_image_init): Allocate array_cache lazily.
8190         
8191 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8192
8193         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
8194         behavior was changed recently and has bad side effects.
8195
8196 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
8197
8198         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
8199         
8200         * assembly.c (mono_assembly_close): Remove a debug printf.
8201
8202         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
8203
8204         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
8205         to also allow for temporary references between mono_image_open ()/close ().
8206
8207         * domain.c (get_runtimes_from_exe): Add a FIXME.        
8208
8209 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
8210
8211         * marshal.c: Fix support for dynamic methods.
8212
8213         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
8214
8215         * marshal.c (mono_marshal_cleanup): New cleanup function.
8216
8217         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
8218         image mempools.
8219
8220         * class.c (mono_class_init): Fix leaking class->nested_classes.
8221
8222         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
8223
8224         * image.c (mono_image_init): Initialize the new cashes.
8225
8226         * image.c (mono_image_close): Destroy the new cashes.
8227
8228         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
8229
8230         * mempool.c (mono_mempool_strdup): New helper function.
8231
8232         * class-internals.h: Add prototype for mono_loader_unlock ().
8233
8234         * domain.c (mono_jit_info_table_find): Fix a warning.
8235         (mono_debugger_check_runtime_version): Ditto.
8236
8237         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
8238         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
8239         functions to these modules.
8240
8241         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
8242         metadata modules.
8243         
8244         * marshal.c (mono_free_bstr): Fix a warning.
8245
8246         * assembly.c (mono_assembly_open_full): Fix another small leak.
8247
8248         * object.c: Fix some unload leaks in the remoting code.
8249
8250         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
8251         function.
8252
8253         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
8254
8255         * reflection.c: Fix some unload leaks in dynamic assemblies.
8256
8257 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
8258
8259         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
8260         * marshal.h: Add BSTR support on Win32
8261         * icall.c: Add BSTR icalls
8262         * metadata.h: Add BSTR enums
8263
8264 2006-04-28  Miguel de Icaza  <miguel@novell.com>
8265
8266         Work to catch the crash from #76795 and turn it into an
8267         exception.   As I stubbed out pieces of the VisualBasic support,
8268         I found a number of places where the code was failing and I added
8269         checks to those places. 
8270         
8271         * metadata.c (do_mono_metadata_parse_generic_class): Make this
8272         function return a status code.  If we fail to parse the signature
8273         from mono_metadata_parse_generic_inst, return FALSE.
8274
8275         * loader.c (mono_get_method_from_token): If we fail to load the
8276         method (mono_class_get) return NULL.   
8277
8278         * (method_from_memberref): Return NULL if we are unable to parse
8279         the method signature
8280
8281         (mono_loader_error_prepare_exception): Since we now use the
8282         loader_error flag internally to stop processing, and obtaining
8283         exceptions that might be thrown will walk this code path the
8284         proper way of going from a MonoLoaderError into a
8285         MonoException was convoluted.   This new routine encapsulates the
8286         process of turning the error into an exception and *clearing* the
8287         error afterwards.
8288         
8289 2006-04-27  Miguel de Icaza  <miguel@novell.com>
8290
8291         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
8292         with missing assemblies), and to cope with:
8293
8294                 * Missing fieldref from a non-existing assembly.
8295                 * Missing methodref from a non-existing assembly.
8296
8297         The first batch of work to address *some* of the issues from 76661.
8298         
8299         * object.c (mono_class_create_runtime_vtable): If we fail to
8300         initialize the class raise the exception here. 
8301
8302         * metadata.c (mono_class_get_overrides_full): If any methods fail
8303         to load return the failure to the caller.
8304
8305         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
8306         flagging assemblies that failed to load.   
8307
8308         Do not crash if we are unable to load the assembly.
8309
8310         (mono_assembly_close): Do nothing with REFERENCE_MISSING
8311         assemblies. 
8312
8313         * loader.c (mono_loader_set_error_type_load): Change the
8314         convention to always pass unallocated strings, so we make our own
8315         copies (I know our own code had duplicated strings before, but
8316         this keeps the normal conventions).
8317         (method_from_memberref): Call mono_loader_set_error_method_load
8318         for all possible failures of loading the class. 
8319         Remove assert, turn into a loader error.
8320
8321         (mono_loader_error_to_exception): Move this routine from mini
8322         (mini_loader_error_to_exception) there was no need to have that in
8323         mini. 
8324
8325         * class.c (mono_class_from_typeref): If we were not able to load
8326         the assembly with mono_assembly_load_reference, call the
8327         mono_loader_set_error_type_load to register the problem.
8328
8329         (mono_class_setup_fields): If we fail to load the type from
8330         mono_metadata_parse_type_full, call mono_class_set_failure and
8331         break from the loop.
8332
8333         If class->exception_type is set, we do not layout the fields as
8334         that might crash the runtime, and instead return (from breaking
8335         from the previous loop).
8336
8337         (mono_class_setup_vtable): This now returns a boolean indicating
8338         whether the table was properly setup.   The decision is driven by
8339         mono_class_get_overrides_full which might run into non-existing
8340         methods. 
8341         
8342         (mono_class_init): Returns TRUE on success or FALSE if there was a
8343         problem in loading the type (incorrect assemblies, missing
8344         assemblies, methods, etc).
8345
8346         When we call mono_class_setup_fields we also check for a potential
8347         error inside this call (either a class exception or a general
8348         loader exception).
8349
8350         (mono_class_create_from_typedef): If the parent fails to load
8351         (calling mono_class_get_full) return NULL.
8352         
8353         ** Important **
8354
8355         calls to mono_metadata_parse_type_full should be checked
8356         everywhere and set the mono_class_set_failure
8357         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
8358
8359         The current patch checks the places where my manually constructed
8360         tests show the errors are showing up, but we should do it
8361         everywhere. 
8362
8363         ** Important2 **
8364
8365         mono_class_init return values should be tested everywhere, like
8366         the previous case this is something that we should audit
8367         everywhere and not only on the cases exposed by the tests I
8368         created. 
8369
8370 2006-04-26  Miguel de Icaza  <miguel@novell.com>
8371
8372         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
8373         boolean parameter and instead pass the information on `options'
8374         parameter (FileOptions).
8375
8376         * icall.c: Register the new signature for MonoIO.Open.
8377
8378         * debug-helpers.c (dis_one): Trying to understand how coverity
8379         works.  Fix Run 5, item 78.
8380
8381 2006-04-26  Dick Porter  <dick@ximian.com>
8382
8383         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
8384         dereference.
8385
8386 2006-04-25  Martin Baulig  <martin@ximian.com>
8387
8388         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
8389
8390         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
8391         debugger_thread_created().
8392         (debugger_gc_push_all_stacks): Don't handle the main thread in any
8393         special way.
8394         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
8395         (mono_debugger_finalize_threads): New function; undo the effects
8396         of mono_debugger_init_threads().
8397         (mono_debugger_create_all_threads): Removed.
8398
8399 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
8400
8401         * image.c (mono_image_close): Tidy up trace messages.
8402
8403         * assembly.c (mono_assembly_close): Ditto.
8404
8405         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
8406         no longer references an already freed assembly. Fixes #78168.
8407
8408 2006-04-21  Dick Porter  <dick@ximian.com>
8409
8410         * threads.c (mono_thread_detach): Fix reference counting when
8411         detaching threads.
8412
8413 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
8414
8415         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
8416         #78155.
8417
8418 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
8419
8420         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
8421         (mono_type_to_stind): Ditto.
8422
8423         * marshal.c: Use the new helper functions to simplify code.
8424
8425         * image.c (mono_image_close): Add some code for help debug assembly unloading
8426         problems.
8427
8428         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
8429         image mempool.
8430
8431         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
8432         assembly was already loaded in another appdomain. Fixes #78083.
8433
8434 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
8435
8436         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
8437         referenced assemblies.
8438         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
8439
8440         * domain.c (mono_domain_free): Add a trace message.
8441
8442         * appdomain.c (add_assemblies_to_domain): Ditto.        
8443
8444         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
8445         field.  
8446
8447 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
8448
8449         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
8450
8451 2006-04-12  Martin Baulig  <martin@ximian.com>
8452
8453         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
8454         `USE_INCLUDED_LIBGC'.   
8455
8456 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
8457
8458         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
8459         the patch contains ../ and a small directory name later. Hopefully fixes
8460         #78035.
8461
8462 2006-04-10  Martin Baulig  <martin@ximian.com>
8463
8464         Clean up the debugger's thread-handling code.
8465
8466         The debugger's thread-handling code has been moved from
8467         ../mini/debug-debugger.c to threads.c.  We now iterate directly
8468         over the `threads' hash, keep track of exiting threads and also
8469         use proper locking.
8470
8471         We can now debug XSP and XSP based applications with the debugger.
8472
8473         * object-internals.h (MonoThread): Added `gpointer end_stack'.
8474
8475         * threads.h
8476         (MonoThreadCallbacks): Removed; this was only used by the debugger.
8477         (mono_install_thread_callbacks): Likewise.      
8478
8479         * threads.c (mono_thread_callbacks): Removed.
8480         (debugger_thread_created, debugger_thread_exited): New static functions.
8481         (start_wrapper): Call debugger_thread_created().
8482         (thread_cleanup): Call debugger_thread_exited().
8483         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
8484         (mono_debugger_init_threads): New public function.
8485         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
8486         iterate directly over the `threads' hash and also use proper locking.
8487
8488         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
8489
8490         * mono-debug-debugger.h
8491         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
8492
8493 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
8494
8495         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
8496         argument type=array. Fixes #78057.
8497
8498 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
8499
8500         * culture-info-table.h : regenerated. Fixed bug #69652.
8501
8502 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
8503
8504         * loader.c metadata.c: Reapply a variant r59116.
8505         
8506         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
8507
8508         * class.c (mono_class_setup_interface_offsets): New internal function.
8509
8510         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
8511         interfaces too. Fixes #77398.
8512
8513         * reflection.c (encode_cattr_value): Add support for 
8514         parameter type=object, argument type=array.
8515         (load_cattr_value): Ditto. Fixes #77916.
8516
8517         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
8518         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
8519
8520         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
8521         a byval char array and CharSet is Ansi.
8522
8523         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
8524
8525 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
8526
8527         * metadata.c: Add some locking comments.
8528         
8529         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
8530         mempool.
8531         (mono_metadata_free_method_signature): Don't free the signature itself.
8532
8533         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
8534
8535         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
8536         reference the same MonoImage.
8537         (mono_assembly_load_from_full): Add an assert.
8538
8539 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
8540
8541         * image.c (mono_image_close): Don't put the image we are about to free into the
8542         loaded_images_guid_hash.
8543
8544         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
8545         to reduce code duplication.
8546
8547         * marshal.c: Register the native functions called by this module as icalls, to
8548         somewhat centralize the creation of MonoMethodSignature's.
8549
8550         * loader.c (mono_method_signature): Add a cache for method signatures.
8551
8552         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
8553         the parameter attributes of a method.
8554         (mono_metadata_parse_method_signature_full): Refactored the computation of
8555         parameter attributes into a separate function. Also avoid one allocation in
8556         most cases.
8557
8558         * assembly.c (mono_assembly_close): Ditto.
8559
8560         * image.c (mono_image_close): Log trace messages with INFO level.
8561
8562         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
8563
8564         * image.c reflection.c: Correct reference counting of image modules.
8565         
8566         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
8567         of this function from the image mempool.
8568         
8569         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
8570         to allow more cached types to be used.
8571
8572         * mono-debug.c (mono_debug_add_method): Appled patch from
8573         David S. Miller  <davem@sunset.davemloft.net>: Access 
8574         minfo->lexical_blocks[] entry elements using read32().
8575
8576 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
8577
8578         * loader.c (mono_free_method): No longer free the method header for non-dynamic
8579         methods as it is allocated from the mempool.
8580
8581         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
8582         image mempool.
8583
8584         * metadata-internals.h: Add comments describing the reference counting scheme
8585         used for MonoImage and MonoAssembly.
8586
8587         * image.c assembly.c reflection.c: Rework reference counting of images and 
8588         assemblies so they are freed when the runtime is shut down. Free some 
8589         additional memory structures when an image is unloaded.
8590         
8591 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8592
8593         * class.c loader.c reflection.c: Allocate more data structures in
8594         the image mempool.
8595
8596 2006-03-31  Miguel de Icaza  <miguel@novell.com>
8597
8598         * icall.c
8599         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
8600         build on pre glib 2.4 systems.
8601
8602 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
8603
8604         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
8605
8606         * icall.c: Fix some warnings.
8607
8608 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
8609
8610         * culture-info-table.h : regenerated.
8611
8612 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
8613
8614         * threads.c, object-internals.h, verify.c: changed the culture caching
8615         code to use a normal MonoArray for storage so the GC can keep track of
8616         them easily. Fixed bits of the cache logic, too and simplified the
8617         code.
8618
8619 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
8620
8621         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
8622         thread for non-Boehm GCs.
8623
8624 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
8625
8626         * domain.c, object.c, domain-internals.h: reduce the amount of memory
8627         needed to keep track of the data for static fields.
8628
8629 2006-03-29  Raja R Harinath  <rharinath@novell.com>
8630
8631         Fix #75172
8632         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
8633         for interface classes.  Use 'num_methods' instead.
8634         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
8635         before using '->vtable_size' field.
8636
8637 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
8638
8639         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
8640         doesn't contain managed pointers, so use a normal hashtable.
8641
8642 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
8643
8644         * reflection.c, class-internals.h, domain.c: fixed handling of types
8645         used as values for objects in custom attributes (bug #77915):
8646
8647 2006-03-24  Martin Baulig  <martin@ximian.com>
8648
8649         * class.c (mono_class_setup_fields): Added support for generic
8650         instances; fixes #77580.
8651
8652 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8653
8654         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
8655
8656 2006-03-24  Dick Porter  <dick@ximian.com>
8657
8658         * file-io.c (get_file_attributes): More stat macro breakage.
8659         Fixes bug 77759.
8660
8661 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
8662
8663         * profiler.c: added the file=filename option in the default profiler
8664         to output the profile data to filename.
8665
8666 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8667
8668         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
8669         bug #77877.
8670
8671 2006-03-22  Martin Baulig  <martin@ximian.com>
8672
8673         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
8674         allocated `MonoClassField *' in `fb->handle'.
8675
8676 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
8677
8678         * class.c, image.c, metadata-internals.h: implemented new mechanism to
8679         allocate interface ID to save memory and allow better ID reuse on
8680         appdomain unload. setup_generic_vtable () removal from Martin.
8681
8682 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
8683
8684         * object.h, appdomain.c, domain.c, exception.c, icall.c,
8685         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
8686         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
8687         write barriers for reference stores with managed objects accessed with
8688         C structures in the runtime and in embedding programs.
8689
8690 2006-03-20  Raja R Harinath  <rharinath@novell.com>
8691
8692         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
8693         'interface_id' and 'max_interface_id' fields of MonoClasses
8694         representing open generic types.
8695
8696 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
8697
8698         * object.h, object.c, icall.c: added functions to deal with
8699         storing valuetypes that contain references in managed objects.
8700         * reflection.c, string-icalls.c, threads.c, marshal.c: small
8701         fixes and comments around uses of mono_array_addr ().
8702
8703 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
8704
8705         * object.h, icall.c, monitor.c: object.GetHashCode ()
8706         implementation that supports the moving garbage collector.
8707
8708 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
8709
8710         * icall.c, threads-types.h, threads.c: implemented finalizer for
8711         LocalDataStoreSlot.
8712
8713 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
8714
8715         * metadata.c (mono_type_size): Add a fixme.
8716         (mono_type_stack_size): Ditto.
8717
8718         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
8719         'type_forwarders' field.
8720
8721         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
8722         attribute from net 2.0.
8723
8724         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
8725         from class.c.
8726
8727         * class.c (mono_class_setup_fields): Fix a warning.
8728         
8729         * class.c (mono_class_from_name): Add support for assemblyref entries
8730         in the EXPORTEDTYPE table.
8731
8732         * reflection.c: Add support for handling type forwarders under net 2.0.
8733
8734         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
8735         
8736 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
8737
8738         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
8739         overwriting entries in ModuleBuild->types, also clean up the code
8740         a little. Fixes #77774.
8741
8742 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
8743
8744         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
8745         load friend assembly info when present.
8746
8747 2006-03-14  Raja R Harinath  <rharinath@novell.com>
8748
8749         Fix crasher on gtest-158.cs.
8750         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
8751         the return value if the MonoClass we want is yet in an
8752         inconsistent state.
8753         * class.c (mono_class_create_from_typedef): Add an comment
8754         explaining an order dependency between mono_class_setup_parent and
8755         mono_class_setup_mono_type.
8756
8757 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
8758
8759         * class.c: documentation updates and events bug fix.
8760
8761 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
8762
8763         * class.c: some cleanup, locking fixes.
8764
8765 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
8766
8767         * class.c: fix the generics code to setup nested
8768         type info to the instantiated type (bug #77770).
8769
8770 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
8771
8772         * marshal.c: fixed a few type correctness issues.
8773
8774 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
8775
8776         * loader.c: the Set/Get/Addrtess array methods should be public.
8777
8778 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
8779
8780         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
8781         
8782         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
8783         info->wrapper.
8784
8785 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
8786
8787         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
8788
8789         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
8790
8791         * mempool.c (mono_mempool_alloc): Speed this up a bit.
8792         (mono_mempool_alloc0): Ditto.
8793
8794 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8795
8796         * socket-io.c:
8797         (create_object_from_sockaddr): it was allocating 4 extra bytes
8798         for the AF_UNIX data. Fixes bug #77747.
8799
8800 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
8801
8802         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
8803
8804 2006-03-09  Dick Porter  <dick@ximian.com>
8805
8806         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
8807         Fixes bug 76966 again.
8808
8809 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
8810
8811         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
8812         names from r57532
8813         * appdomain.c: Bumped corlib version to 48 (due to r57532)
8814
8815 2006-03-07  Martin Baulig  <martin@ximian.com>
8816
8817         * object.c
8818         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
8819
8820 2006-03-07  Martin Baulig  <martin@ximian.com>
8821
8822         * class.c
8823         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
8824         regression introduced in r56970; see gtest-252.cs.
8825
8826         * loader.c (mono_get_method_constrained): Correctly handle generic
8827         methods; see gtest-253.cs.
8828
8829 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
8830
8831         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
8832
8833 2006-03-04  Martin Baulig  <martin@ximian.com>
8834
8835         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
8836         compute the parent type at runtime, just like we're already doing
8837         it for interfaces.
8838
8839         * reflection.c
8840         (mono_reflection_bind_generic_parameters): Don't compute the
8841         parent type anymore.
8842
8843         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
8844
8845 2006-03-04  Martin Baulig  <martin@ximian.com>
8846
8847         * mono-debug-debugger.h
8848         (mono_debugger_create_notification_function): Allocate memory at
8849         runtime and return a pointer to it.
8850
8851 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
8852
8853         * assembly.c: Fix windows build.
8854         
8855         * assembly.c: Fix build.
8856
8857         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
8858
8859         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
8860         
8861 2006-03-03  Dick Porter  <dick@ximian.com>
8862
8863         * process.c
8864         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
8865         Check parameters before dereferencing them.  Fixes Aaron's part of
8866         bug 77393.
8867
8868 2006-03-03  Raja R Harinath  <rharinath@novell.com>
8869
8870         Fix performance regression.
8871         * loader.c (find_method_in_class): Add 'from_class' argument.
8872         Rename 'klass' argument to 'in_class'.  The signature is compared
8873         against the method in 'in_class', and the corresponding method is
8874         returned from 'from_class'.
8875         (find_method): Walk both 'in_class' and 'from_class' in parallel.
8876         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
8877         type definition and generic instantiation in parallel.
8878         (mono_get_method_constrained): Update to changes.
8879
8880 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
8881
8882         * threads.c: make sure the domain is correct, too when doing
8883         mono_thread_attach ().
8884
8885 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
8886
8887         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
8888         windows. Fixes #77683.
8889
8890 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
8891
8892         * object.h, *: introduced specific way to set elements of an array
8893         of references to be used as write barrier. Still need to audit the
8894         uses of mono_array_addr.
8895
8896 2006-03-01  Miguel de Icaza  <miguel@novell.com>
8897
8898         * object-internals.h: New field to cache the assmebly name, patch
8899         from Tambet Ingo (tambet@ximian.com)
8900
8901 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
8902
8903         * decimal.h, class-internals.h, metadata-internals.h,
8904         file-io.h: mark a few function declarations as internal, to
8905         reduce the number of PLT entries.
8906
8907 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8908
8909         * file-io.c: fix typo in warning message.
8910
8911 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
8912
8913         * loader.c: on unix, lookup the "*A" version of a function
8914         if charset is auto as a second option before failing.
8915
8916 2006-02-28  Raja R Harinath  <rharinath@novell.com>
8917
8918         * class.h (mono_class_inflate_generic_method): Revert to two
8919         argument version.
8920         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
8921         (mono_class_inflate_generic_method_full): Add.
8922         * class.c (mono_class_inflate_generic_method_full): Rename from
8923         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
8924         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
8925         * loader.c, reflection.c: Update to changes.
8926
8927 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
8928
8929         * icall.c: const fixes and small improvements.
8930
8931 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8932
8933         * threadpool.c: for asynchronous connect(), enable the same workaround
8934         for BSD 6 as for the Mac. Fixes bug #77637.
8935
8936 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
8937
8938         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
8939         formatted classes. Fixes #77524.
8940
8941 2006-02-24  Raja R Harinath  <rharinath@novell.com>
8942
8943         * class.c (inflate_generic_type): Add a couple more
8944         micro-optimizations.
8945         (inflate_generic_context): Don't use the 'gmethod' from
8946         'inflate_with'.
8947         (mono_class_inflate_generic_method): If the method has generic
8948         parameters, but the passed-in context doesn't have a 'gmethod',
8949         create one.  Use the possibly simplified generic instantiation
8950         from the declaring class instead of the one passed in.
8951
8952 2006-02-24  Raja R Harinath  <harinath@gmail.com>
8953
8954         Make generic method signature and method header handling lazy.
8955         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
8956         (inflate_generic_header): Likewise.
8957         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
8958         parameter to avoid inflating types.
8959         (mono_get_inflated_method): Empty out.
8960         * class.h (mono_class_inflate_generic_method): Update to changes.
8961         * loader.c (mono_get_method_from_token): Don't parse signature for
8962         generic methods, nor methods of generic classes.
8963         (mono_method_signature): Rename from 'mono_method_signature'.
8964         Inflate signature on demand.
8965         (mono_method_get_header): Inflate method header on demand.
8966         * reflection.c: Update to changes.
8967
8968 2006-02-23  Raja R Harinath  <rharinath@novell.com>
8969
8970         * metadata.c (mono_metadata_inflate_generic_inst): If the
8971         instantiation is closed, don't bother expanding it in the new
8972         context.
8973         * class.c (inflate_generic_class): If the generic instantiation
8974         doesn't change after inflation, return the argument itself.
8975         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
8976         Add bounds checks.
8977         (inflate_generic_context): If neither the generic class nor the
8978         generic method instantiations change, return the original context.
8979         * reflection.c (mono_method_get_object): Do
8980         'mono_get_inflated_method' before accessing the ->klass field.
8981         (inflate_mono_method): Don't create a MonoGenericMethod unless
8982         necessary.
8983         (inflate_method): Don't pass a constructed type as the declaring
8984         type of a methodbuilder.
8985
8986 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
8987
8988         * object.c: fix memory overwrite.
8989
8990 2006-02-22  Dick Porter  <dick@ximian.com>
8991
8992         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
8993         it doesn't work any more.
8994         (mono_threads_request_thread_dump): Fix unused variable warnings.
8995
8996 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
8997
8998         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
8999         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
9000         the public header file.
9001
9002 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
9003
9004         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
9005
9006 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
9007
9008         * class-internals.h, object.c: reduce the size of MonoVTable
9009         and store the interface_offsets array at negative offsets.
9010
9011 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
9012
9013         * metadata.c: tweak table descriptors data structures to reduce
9014         size and runtime relocations.
9015
9016 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
9017
9018         * marshal.c: fix some types and opcodes to be type-safe
9019         in marshaling wrappers.
9020
9021 2006-02-21  Ankit Jain  <jankit@novell.com>
9022
9023         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
9024
9025 2006-02-21  Raja R Harinath  <rharinath@novell.com>
9026
9027         * metadata.c (get_constraints): Relax debugging checks for monodis.
9028
9029 2006-02-21  Ankit Jain  <jankit@novell.com>
9030
9031         * metadata.c (mono_metadata_load_generic_params): Move the code
9032         checking for ambiguous generic params from here to mono/dis/get.c
9033         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
9034
9035 2006-02-21  Raja R Harinath  <harinath@gmail.com>
9036
9037         Fix assertion triggered when compiling nemerle.
9038         * class.c (mono_get_shared_generic_inst): Rename from
9039         get_shared_inst and make non-static.
9040         * loader.c (mono_get_shared_generic_method): New.  Used to create
9041         the MonoGenericContext-equivalent of a MonoGenericContainer.
9042         (mono_get_method_from_token): Initialize the 'context' field of
9043         the created MonoGenericContainer.
9044         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
9045         * metadata.c (get_constraints): Add sanity check.
9046         * class-internals.h: Add new internal methods.
9047
9048         * reflection.c (verify_safe_for_managed_space): New sanity check.
9049         Currently checks that owner-less generic parameters aren't allowed
9050         in managed space.
9051         (mono_type_get_object): Use it.
9052         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
9053         that are now in mono_type_get_object.
9054         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
9055
9056 2006-02-19  Raja R Harinath  <harinath@gmail.com>
9057
9058         * metadata.c (mono_type_create_from_typespec): Rename from
9059         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
9060         argument and caching of types in the generic container.
9061         (unwrap_arrays, find_generic_param): Remove.
9062         * metadata-internals.h: Update.
9063         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
9064
9065 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
9066
9067         * class.c (mono_class_get_exception_for_failure): Fix a warning.
9068
9069         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
9070         return values. Fixes #77581.
9071
9072         * class.c (mono_fnptr_class_get): Switch name and name_space.
9073
9074         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
9075         classes and add support for [In, Out] attributes.
9076         (mono_marshal_free_asany): Ditto. Fixes #77524.
9077
9078 2006-02-18  Raja R Harinath  <harinath@gmail.com>
9079
9080         * class.c (mono_class_from_generic_parameter): Make more robust to
9081         incomplete MonoGenericContainers from monodis.
9082
9083 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
9084
9085         * class-internals.h: added some more exception types.
9086         * class.c, metadata.c: added a few checks to handle missing
9087         types.
9088
9089 2006-02-17  Raja R Harinath  <rharinath@novell.com>
9090
9091         Use owner-less generic-params some more.
9092         * class.c (my_mono_class_from_generic_parameter): Remove.
9093         (mono_class_from_generic_parameter): Handle null image,
9094         param->name and param->owner.
9095         (mono_class_from_mono_type): Update.
9096         (mono_class_create_from_typespec): Remove 'container' parameter.
9097         If that parameter is non-null, the result is always inflated by
9098         'mono_class_get_full' anyway.
9099         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
9100         parameter.
9101         (mono_class_get_full): Update.
9102
9103         * class.c (inflate_generic_type) [GENERICINST]: If the generic
9104         instance is not open, don't bother inflating.
9105         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
9106         parse metadata for inflated classes.
9107         (_mono_class_get): Change GenericContext* parameter to
9108         GenericContainer*.
9109         (mono_class_create_from_typespec): Likewise.  Simplify, and
9110         implement trivially.  All the cases are handled in
9111         mono_class_from_mono_type.  Don't inflate returned class.
9112         (mono_class_get_full): Delegate GENERICINST optimization to
9113         inflate_generic_type.
9114         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
9115
9116 2006-02-16  Dick Porter  <dick@ximian.com>
9117
9118         * socket-io.c (create_object_from_sockaddr): Fix typo.
9119         (create_sockaddr_from_object): Check array lengths before
9120         potentially accessing items off the end.
9121         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
9122         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
9123         (ves_icall_System_Net_Sockets_Socket_Send_internal)
9124         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
9125         length checks to avoid wraparound overflows.
9126         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
9127         contents of the array of sockets
9128         (hostent_to_IPHostEntry2)
9129         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
9130         Check return value of inet_ntop ().
9131         (addrinfo_to_IPHostEntry): Fix typo
9132
9133 2006-02-16  Raja R Harinath  <rharinath@novell.com>
9134
9135         Type metadata parsing doesn't use generic-instantiation information.
9136         * metadata.c (mono_metadata_parse_array_full): Change
9137         MonoGenericContext* parameter to MonoGenericContainer*.
9138         (mono_metadata_parse_type_full): Likewise.
9139         (mono_type_create_from_typespec_full): Likewise.
9140         (mono_metadata_parse_mh_full): Likewise.
9141         (mono_metadata_parse_generic_inst): Likewise.
9142         (do_mono_metadata_parse_generic_class): Likewise.
9143         (do_mono_metadata_parse_type): Likewise.
9144         * metadata-internals.h: Update to changes.
9145         * class.c (mono_class_find_enum_basetype): Likewise.
9146         (mono_class_setup_fields): Likewise.
9147         (mono_class_create_from_typespec): Likewise.
9148         * loader.c (method_from_methodspec): Likewise.
9149         (mono_get_method_from_token): Likewise.
9150         (mono_method_get_header): Likewise.
9151
9152 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
9153
9154         * marshal.c: handle additional GENERICINST case (patch from
9155         Thong Nguyen <tum@veridicus.com>).
9156         Fix a few cases where LDIND_I/STIND_I was used for references.
9157
9158 2006-02-16  Raja R Harinath  <rharinath@novell.com>
9159
9160         * reflection.c (mono_reflection_get_token): Remove unused variable.
9161
9162 2006-02-16  Martin Baulig  <martin@ximian.com>
9163
9164         * reflection.c (mono_reflection_get_token): Add support for fields
9165         in instantiated generic types.
9166
9167         * icall.c
9168         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
9169
9170 2006-02-15  Martin Baulig  <martin@ximian.com>
9171
9172         * icall.c
9173         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
9174         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
9175         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
9176         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
9177
9178 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
9179
9180         * class.c, metadata.c, metadata.h, object.c, icall.c,
9181         marshal.c: changed mono_type_get_underlying_type () to do
9182         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
9183         Fixed handling of instantiated generic valuetypes (bug #75479).
9184
9185 2006-02-15  Raja R Harinath  <rharinath@novell.com>
9186
9187         * metadata.c (mono_metadata_decode_signed_value): Simplify.
9188         Delegate to mono_metadata_decode_value, and work on the returned value.
9189
9190         * icall.c (ves_icall_MonoType_GetGenericArguments):
9191         Add consistency check here too.
9192         
9193 2006-02-15  Ankit Jain  <jankit@novell.com>
9194
9195         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
9196         char/short etc.
9197
9198 2006-02-15  Ankit Jain  <jankit@novell.com>
9199
9200         * metadata.c (mono_metadata_decode_signed_value): New function to decode
9201         signed values, used only for representing lower bounds of arrays.
9202         (mono_metadata_parse_array_full): Use new
9203         mono_metadata_decode_signed_value to decode lower bounds.
9204
9205 2006-02-14  Martin Baulig  <martin@ximian.com>
9206
9207         * reflection.c
9208         (mono_reflection_get_token): Support "MonoGenericMethod" and
9209         "MonoGenericCMethod" and allow generic instances / methods.
9210
9211 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
9212
9213         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
9214         to obtain the terminal size using an ioctl.
9215
9216         * object.c (mono_nullable_init): Revert this as nullable reference
9217         types are not valid.
9218         (mono_nullable_box): Ditto.
9219
9220 2006-02-09  Dick Porter  <dick@ximian.com>
9221
9222         * threads.c (mono_thread_detach): Drop a reference to the thread
9223         we're detaching.
9224
9225 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
9226
9227         * object.c (mono_nullable_init): Handle nullable reference types.
9228         (mono_nullable_box): Ditto. Fixes #77446.
9229
9230 2006-02-07  Martin Baulig  <martin@ximian.com>
9231
9232         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
9233
9234 2006-02-07  Ankit Jain  <jankit@novell.com>
9235
9236         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
9237         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
9238         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
9239         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
9240         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
9241         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
9242
9243 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
9244
9245         * class.c (mono_class_create_generic): Set type_token as well.
9246
9247         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
9248         compatible with MS.
9249
9250 2006-02-02  Martin Baulig  <martin@ximian.com>
9251
9252         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
9253         has never been used so far.
9254
9255 2006-02-02  Martin Baulig  <martin@ximian.com>
9256
9257         * mono-debug-debugger.h: Changed comment at the top of this file;
9258         the header is not installed, but it's safe to #include it from
9259         within the JIT.
9260
9261         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
9262         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
9263
9264 2006-02-02  Martin Baulig  <martin@ximian.com>
9265
9266         * mono-debug.h
9267         (MonoSymbolTable): Removed the `metadata_info' field.
9268
9269         * mono-debug.c
9270         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
9271
9272         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
9273         (mono_debugger_add_builtin_types): Removed.
9274         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
9275         (mono_debugger_create_notification_function): We now operate on a
9276         pre-allocated area; take a `gpointer' and return `void'.
9277
9278         * mono-debug-debugger.c
9279         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
9280         (mono_debugger_add_builtin_types): Removed.
9281
9282 2006-02-02  Martin Baulig  <martin@ximian.com>
9283
9284         * threads.c (mono_debugger_create_all_threads): New public method.
9285
9286 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
9287
9288         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
9289         breaks on several platforms.
9290
9291 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
9292
9293         * assembly.c: the VS.NET build doesn't supply default values for
9294         MONO_ASSEMBLIES and MONO_CFG_DIR.
9295
9296 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
9297
9298         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
9299         helper function.
9300
9301         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
9302
9303         * loader.c (method_from_memberref): Fix a warning.
9304
9305         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
9306
9307         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
9308         with explicit layout. Fixes #77433.
9309
9310 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
9311
9312         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
9313         max_interface_id is initialized before using it. Fixes #77398.
9314         (ves_icall_Type_GetInterfaces): Ditto.
9315
9316 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9317
9318         * metadata.c (mono_metadata_parse_method_signature_full): Don't
9319         allocate memory for parameter attributes when parsing memberref
9320         signatures.
9321         * loader.c (mono_loader_set_error_method_load): Don't warn.
9322         (method_from_memberref): Ensure MissingMethodException gets thrown
9323         if method is not found.  Make warning more informative.
9324
9325 2006-01-29  Raja R Harinath  <harinath@gmail.com>
9326
9327         Fix #77397
9328         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
9329         return true if is byref.
9330         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
9331         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
9332         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
9333
9334 2006-01-27  Raja R Harinath  <rharinath@novell.com>
9335
9336         Fix tests/find-method.2.il
9337         * loader.c (find_method, find_method_in_class): Remove is_inflated
9338         argument.  Revert 2006-01-18 change.
9339         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
9340         is generic, search for method in its generic definition.
9341         * class.c (mono_class_setup_vtable_general): Print generic
9342         arguments of generic types in debugging printf.
9343
9344 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
9345
9346         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
9347
9348         * threads.c (mono_threads_request_thread_dump): New helper function.
9349
9350 2006-01-25  Raja R Harinath  <rharinath@novell.com>
9351
9352         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
9353
9354 2006-01-25  Ankit Jain  <jankit@novell.com>
9355
9356         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
9357         move definition to ..
9358         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
9359         
9360 2006-01-25  Ankit Jain  <jankit@novell.com>
9361             Raja R Harinath  <rharinath@novell.com>
9362
9363         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
9364         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
9365         as necessary.
9366
9367 2006-01-25  Martin Baulig  <martin@ximian.com>
9368
9369         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
9370         `MonoDebuggerThread' into debug-debugger.c.
9371
9372 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
9373
9374         * profiler.c: fix printing of data.
9375
9376 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
9377
9378         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
9379           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
9380
9381 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
9382
9383         * object.c: fix deadlock related to string interning.
9384
9385 2006-01-23  Martin Baulig  <martin@ximian.com>
9386
9387         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
9388
9389         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
9390
9391 2006-01-23  Martin Baulig  <martin@ximian.com>
9392
9393         * mono-debug.h: Moved the prototypes of some functions which are
9394         used by the JIT here from mono-debug-debugger.h.
9395
9396 2006-01-21  Martin Baulig  <martin@ximian.com>
9397
9398         * Makefile.am: Don't install mono-debug-debugger.h.
9399
9400 2006-01-21  Martin Baulig  <martin@ximian.com>
9401
9402         * mono-debug-debugger.h: Enforce the private status of this header
9403         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
9404         Moved some stuff from mono-debugger-jit-wrapper.h here.
9405
9406 2006-01-20  Raja R Harinath  <rharinath@novell.com>
9407
9408         * class.c (mono_class_from_typeref): Add a sanity test to help
9409         catch lack of assembly load/search hooks.
9410
9411 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
9412
9413         * marshal.c (emit_struct_conv): Relax the fields with same offset
9414         check even more. Fixes #77230.
9415
9416 2006-01-18  Martin Baulig  <martin@ximian.com>
9417
9418         * loader.c (find_method_in_class): Added `gboolean is_inflated'
9419         argument; if false, we compare the uninstantiated signatures.
9420         (method_from_memberref): Compare the uninstantiated signatures;
9421         fixes #76417.
9422
9423 2006-01-18  Robert Jordan  <robertj@gmx.net>
9424
9425         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
9426         Clear the weak link. Fixes bug #77170.
9427
9428         * gc.c (mono_gchandle_free):
9429         Reflect *-gc.c changes (tiny optimization).
9430
9431 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
9432
9433         * metadata.c (mono_metadata_signature_dup): Applied patch from
9434         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
9435         Fixes #77288.
9436
9437 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
9438
9439         * marshal.c (emit_struct_conv): Allow fields with the same offset when
9440         marshalling from native to managed code. Fixes #77230.
9441
9442 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9443
9444         * threadpool.c: fix problem (Mac only) when more than one asynchronous
9445         connect. Fixes bug #77020.
9446
9447 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
9448
9449         * class.c: fixed id assignement for nested interfaces (bug #77275).
9450         Added also better info for --print-vtable debugging.
9451
9452 2006-01-12  Martin Baulig  <martin@ximian.com>
9453
9454         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
9455         interfaces on-the-fly; fixes #76625.
9456
9457         * class-internals.h
9458         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
9459         don't need that anymore.
9460
9461 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9462
9463         * socket-io.c
9464         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
9465         To avoid initing the nested_classes when not needed I turned the
9466         PeerCredData as a toplevel internal class, as it has to be shared
9467         anyways. 
9468
9469         Fixes the CASA issue.
9470
9471 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
9472
9473         * domain.c: Accessors for MonoJitInfo
9474
9475         * profiler-private.h: Add jitinfo to the end jit hook
9476
9477         * profiler.[ch]: Define new hooks, called after jitting which give
9478         the MonoJitInfo that was compiled
9479
9480 2006-01-10  Martin Baulig  <martin@ximian.com>
9481
9482         * class.c (mono_class_setup_events): Add support for generic
9483         classes; fixes #76440.
9484
9485 2006-01-06  Raja R Harinath  <rharinath@novell.com>
9486
9487         Fix #77160.
9488         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
9489         on passed-in method.
9490
9491 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
9492
9493         * object.c (mono_runtime_invoke_array): Add Nullable support.
9494
9495         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
9496
9497 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
9498
9499         * file-io.c: Don't consider sockets as directory and avoid an endless
9500         loop. Fix bug #76966.
9501
9502 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
9503
9504         * object.c (mono_nullable_init): New helper function.
9505         (mono_nullable_box): Ditto.
9506
9507         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
9508
9509         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
9510
9511         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
9512         
9513 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
9514
9515         * class.c (mono_class_is_assignable_from): Make T assignable to 
9516         Nullable<T>.
9517
9518 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
9519
9520         * appdomain.c: Bump corlib version to 46.
9521         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
9522         serialization purpose) and changed ves_icall_System_Reflection_
9523         Assembly_get_code_base signature to accept a boolean (to escape, or 
9524         not, the assembly code base).
9525
9526 2005-12-23  Dick Porter  <dick@ximian.com>
9527
9528         * icall.c: 
9529         * threads-types.h: 
9530         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
9531         CreateEvent icall now returns "created" boolean parameter.
9532
9533 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
9534
9535         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
9536         #76967.
9537
9538         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
9539         when attr_klass is an interface. Fixes #77045.
9540
9541 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
9542
9543         * marshal.c (emit_struct_conv): Fix previous patch.
9544         
9545         * marshal.c (emit_struct_conv): Add a check for fields with the same
9546         offset.
9547
9548 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9549
9550         Fix regression in Mono.C5.
9551         * class.c (mono_class_create_generic): If 'klass' is an interface
9552         set up the interface offsets.
9553         (mono_class_is_assignable_from): Don't throw away generic arguments.
9554
9555 2005-12-19  Raja R Harinath  <rharinath@novell.com>
9556
9557         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
9558         type parameters.
9559
9560 2005-12-15  Raja R Harinath  <rharinath@novell.com>
9561
9562         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
9563         dead store.
9564         (do_mono_metadata_parse_generic_class): Don't pass the current
9565         generic context when parsing the type being instantiated: it
9566         cannot use it, anyway.
9567
9568         * loader.c (method_from_memberref): Don't inflate a signature if
9569         it doesn't contain any type parameters.
9570
9571 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
9572
9573         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
9574
9575 2005-12-14  Martin Baulig  <martin@ximian.com>
9576
9577         * class.c
9578         (mono_type_get_name_recurse): Don't return null for type
9579         parameters and open generic classes.
9580         (mono_class_setup_methods): Don't exclude generic instances.
9581         (mono_get_unique_iid): Use different IDs for different
9582         instantiations of the same generic type.
9583         (mono_class_setup_vtable): Only use setup_generic_vtable() for
9584         open generic instances; create a normal vtable for closed generic
9585         instances.
9586         (mono_class_setup_vtable_general): We're now also called for
9587         closed generic instances.
9588
9589         * reflection.c
9590         (mono_reflection_bind_generic_parameters): Correctly use
9591         mono_metadata_lookup_generic_inst() everywhere.
9592
9593 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
9594
9595         * object.c (mono_class_create_runtime_vtable): Call 
9596         mono_class_setup_vtable ().
9597
9598         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
9599         function.
9600         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
9601         #76959.
9602
9603         * loader.c (mono_loader_set_error_type_load): Print the type load
9604         warnings to the console so they are more visible to the user.
9605         (mono_loader_set_error_method_load): Ditto.
9606
9607         * reflection.c (ensure_runtime_vtable): Revert the last change as it
9608         is still broken.
9609         
9610         * reflection.c (ensure_runtime_vtable): Fix build.
9611
9612         * reflection.c (ensure_runtime_vtable): Disable an optimization which
9613         doesn't work in all cases.
9614
9615 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
9616
9617         * object.c (mono_array_new_full): Treat a single dimensional array
9618         with 0 lower bounds as an szarray. Fixes #76973.
9619
9620         * reflection.c (custom_attr_visible): Really fix this.
9621
9622 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
9623
9624         * reflection.c (custom_attr_visible): Allow nested public attributes
9625         as well.
9626
9627         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
9628         interface check.
9629
9630 2005-12-12  Raja R Harinath  <harinath@gmail.com>
9631
9632         * class.c (set_generic_param_owner): Delete.
9633         (mono_class_create_from_typedef): Don't set ->owner field of
9634         generic parameters to "param containers" of enclosing classes.
9635         * reflection.c (mono_reflection_initialize_generic_parameter):
9636         Likewise.
9637
9638 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
9639
9640         * reflection.c (custom_attr_visible): Fix build.
9641
9642 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
9643
9644         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
9645         private attributes.
9646         
9647         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
9648         handling of null parameter defaults.
9649
9650 2005-12-09  Raja R Harinath  <rharinath@novell.com>
9651
9652         * class.c (mono_class_from_generic_parameter): Don't set
9653         klass->generic_container.
9654         (my_mono_class_from_generic_parameter): Likewise.
9655
9656 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
9657
9658         * reflection.c (load_public_key): Fix a warning.
9659         (method_encode_code): Fix unaligned accesses.
9660
9661 2005-12-07  Martin Baulig  <martin@ximian.com>
9662
9663         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
9664
9665         * reflection.c
9666         (write_generic_param_entry): Encode our custom attrs.
9667
9668         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
9669
9670 2005-12-07  Martin Baulig  <martin@ximian.com>
9671
9672         * reflection.c (encode_new_constraint): Removed; we don't use the
9673         `NewConstraintAttribute' anymore.
9674
9675 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
9676
9677         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
9678         not fire a TypeResolve event when Assembly.GetType () is called.
9679
9680 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
9681
9682         Beginning of support for nullable types in the runtime. Parts of
9683         this patch are from Martin.
9684
9685         * appdomain.c (MONO_CORLIB_VERSION): Bump
9686
9687         * domain.c (mono_init_internal): get the nullable type
9688
9689         * class.c (mono_class_is_nullable): New method
9690         (mono_class_get_nullable_param): New mehod
9691         (mono_class_create_generic): In types T? set cast_class to T
9692
9693         * class-internals.h (MonoDefaults): new nullable default class
9694         (mono_class_get_nullable_param, mono_class_get_nullable_param):
9695         new methods.
9696
9697 2005-12-05  Raja R Harinath  <rharinath@novell.com>
9698
9699         * metadata.c (select_container): New.  Refactor code to select the
9700         appropriate GenericContainer given the type of generic parameter
9701         we are looking for.
9702         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
9703         not a MonoGenericContext.  Use select_container.  Update parameters.
9704         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
9705         and MONO_TYPE_MVAR.
9706         (unwrap_arrays): Remove duplicate tests.
9707         (find_generic_param): Rename from 'has_same_context'.  Now walks a
9708         generic instantiated class to find any arguments that are generic
9709         parameters.
9710         (mono_type_create_from_typespec_full): Use find_generic_param to
9711         avoid evicting some generic instantiations from the typespec
9712         cache.
9713
9714 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
9715
9716         * reflection.c: fixed writing of doubles on ARM FPA.
9717
9718 2005-12-02  Robert Jordan  <robertj@gmx.net>
9719
9720         * icall.c: Fixed EventInfo.ReflectedType (#76829).
9721
9722 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9723
9724         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
9725         least on SUSE 10 they are not the same (on debian, they are just the
9726         same thing).
9727
9728 2005-12-01  Raja R Harinath  <rharinath@novell.com>
9729
9730         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
9731         DeclaringType for VARs and MVARs.
9732         * class.c (set_generic_param_owner): Fix initialization of owner
9733         fields.
9734
9735 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
9736
9737         * icall.c: fixed Enum.ToObject() to correctly convert the values.
9738
9739 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9740
9741         * threadpool.c: workaround for a bug that shows up on the Mac:
9742         select()+connect() on a blocking socket is not like it should
9743         be, so we proceed to connect() in that case, wasting the I/O
9744         threadpool thread until connect succeedes. Fixes bug #75436.
9745
9746 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9747
9748         * threadpool.c: fix typo when setting file descriptor states.
9749
9750 2005-11-28  Raja R Harinath  <rharinath@novell.com>
9751
9752         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
9753         * metadata.c (mono_metadata_parse_method_signature_full): Don't
9754         create a temporary signature container.
9755         (mono_metadata_parse_generic_param): Update to changes.
9756         (mono_type_create_from_typespec_full): Update to changes.
9757         * loader.c (method_from_memberref): Don't use a
9758         MonoGenericContainer while parsing a memberref signature.
9759         (method_from_methodspec): Remove dead-store of the 'container'
9760         variable.  It's overwritten before use.
9761
9762         * metadata.c (mono_type_create_from_typespec_full): Make debugging
9763         checks tighter.
9764         (mono_metadata_parse_generic_param): Likewise.
9765         * loader.c (find_method_in_class): Does not need a
9766         MonoGenericContainer.  Use 'mono_method_signature' rather than
9767         'mono_method_signature_full'.
9768         (find_method, mono_get_method_constrained, method_from_memberref):
9769         Update to changes.
9770
9771         * metadata.c (mono_type_create_from_typespec_full): Ensure that
9772         owner-less generic-parameters are never evicted from the typespec
9773         cache.
9774
9775         * loader.c (method_from_memberref): Don't use the current context
9776         when parsing signatures.
9777         (method_from_methodspec, mono_get_method_from_token): Update to changes.
9778
9779         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
9780         side-effects in g_assert.
9781         * loader.c (mono_get_method_from_token): Resolve klass earlier so
9782         that we don't potentially lose information.
9783
9784 2005-11-26  Dick Porter  <dick@ximian.com>
9785
9786         * icall.c:
9787         * threads.c: icalls to implement basic (ie, not named)
9788         System.Threading.Semaphore.
9789
9790 2005-11-24  Dick Porter  <dick@ximian.com>
9791
9792         * process.c
9793         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
9794         Use GetProcessId() if it's available.
9795
9796 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
9797
9798         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
9799
9800 2005-11-23  Raja R Harinath  <rharinath@novell.com>
9801             Ankit Jain  <jankit@novell.com>
9802
9803         * loader.c (mono_get_method_from_token): Initialize 'method' field
9804         of all generic parameters before parsing the signature.  Remove
9805         code that "fixed"-up MVAR references.
9806
9807 2005-11-23  Ankit Jain  <jankit@novell.com>
9808
9809         * metadata.c (mono_metadata_has_generic_params):
9810         (mono_metadata_load_generic_param_constraints):
9811         (mono_metadata_load_generic_params): Move duplicate code ...
9812         (mono_metadata_get_generic_param_row): ... here. Returns the
9813         first row-id in GenericParam table for a given owner (token).
9814         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
9815         prototype.
9816
9817 2005-11-23  Raja R Harinath  <rharinath@novell.com>
9818             Ankit Jain  <jankit@novell.com>
9819
9820         * metadata.c (mono_metadata_class_equal): Pass signature_only when
9821         comparing VARs too.
9822         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
9823         type->data.generic_param only if the type is an MVAR.
9824         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
9825         leak owner-less VARs and MVARs into managed space.
9826
9827 2005-11-21  Martin Baulig  <martin@ximian.com>
9828
9829         * class-internals.h
9830         (MonoMethod): Moved the `generic_container' here from
9831         `MonoMethodNormal' since we now also need it for
9832         `MonoMethodPInvoke';
9833         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
9834         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
9835         an union containing both `MonoMethodNormal' and
9836         `MonoMethodPInvoke'.
9837
9838         * loader.c
9839         (mono_get_method_from_token): Allow implementing generic methods
9840         as interncalls.
9841
9842         * threads.c
9843         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
9844         icall.
9845
9846 2005-11-17  Dick Porter  <dick@ximian.com>
9847
9848         * icall.c: 
9849         * process.h: 
9850         * process.c: Split the Process Start_internal icall into
9851         ShellExecuteEx_internal and CreateProcess_internal, which are
9852         called depending on whether UseShellExecute is true.  Fixes bug
9853         76670.
9854
9855         * appdomain.c (MONO_CORLIB_VERSION): Incremented
9856
9857 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
9858
9859         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
9860         'msize' parameters, use the information in 'mspec' instead.
9861         (emit_object_to_ptr_conv): Ditto.
9862
9863         * marshal.c (emit_struct_conv): Handle explicit layout structs with
9864         fields out of order. Fixes #76733.
9865
9866 2005-11-17  Ankit Jain  <jankit@novell.com>
9867
9868         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
9869
9870 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9871
9872         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
9873           bug #76575.
9874
9875 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
9876
9877         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
9878         for types with non-auto layout. Fixes #76717.
9879
9880 2005-11-16  Ankit Jain  <jankit@novell.com>
9881
9882         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
9883         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
9884         if generic_context is null.
9885           (mono_metadata_generic_param_equal): param->owner can be null.
9886           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
9887         null.
9888
9889 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
9890
9891         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
9892         the correct value.
9893
9894 2005-11-15  Martin Baulig  <martin@ximian.com>
9895
9896         * object.c (set_value): Use mono_class_from_mono_type() instead of
9897         the hack for generic instances; fixes #76136.
9898
9899 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
9900
9901         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
9902         fields.
9903
9904         * image.c (load_metadata_ptrs): Initialize the new fields.
9905
9906         * reflection.c (create_dynamic_mono_image): Ditto.
9907
9908         * reflection.c (build_compressed_metadata): Use the new fields.
9909
9910         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
9911         icall.
9912
9913         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
9914         icall.
9915         
9916 2005-11-15  Ankit Jain  <jankit@novell.com>
9917             Raja R Harinath  <harinath@gmail.com>
9918
9919         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
9920         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
9921         new per-generic_container cache if the cached MonoType's context matches
9922         the current context.
9923           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
9924         to the expected context.
9925           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
9926
9927 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9928
9929         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
9930         we changed the signature of an icall.
9931         * icall.c: Modify to mono_double_ParseImpl return true/false 
9932         depending on the success, instead of throwing the exception. This will
9933         help us in Double.TryParse methods.
9934         
9935 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
9936
9937         * marshal.c (emit_marshal_object): Throw an exception when
9938         marshalling 'object' instead of crashing. Fixes #76696.
9939
9940 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
9941
9942         * class-internals.h: Add prototype for mono_type_get_full_name ().
9943
9944 2005-11-11  Dick Porter  <dick@ximian.com>
9945
9946         * threads.c (mono_thread_manage): Make sure the main thread has
9947         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
9948
9949 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
9950
9951         * loader.c (mono_loader_set_error_type_load): Log a warning to the
9952         console about the missing type.
9953         (mono_loader_set_error_method_load): Ditto.
9954
9955 2005-11-09  Miguel de Icaza  <miguel@novell.com>
9956
9957         * mono-config.c (mono_get_config_dir): Set the system defaults if
9958         none is specified.
9959
9960         * assembly.c (mono_set_dirs): New API entry point to set the
9961         assembly and the config directory in one call
9962
9963 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
9964
9965         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
9966         the ftnptr was created from a delegate in a domain other than the
9967         current domain. Fixes #75377.
9968
9969         * exception.h exception.c: Add mono_get_exception_not_supported ().
9970
9971 2005-11-08  Martin Baulig  <martin@ximian.com>
9972
9973         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
9974
9975 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
9976
9977         * security-manager.h: Added definitions to deal with strongname key 
9978         pairs bigger (and smaller) than 1024 bits.
9979         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
9980         adjust wrt the public key length being used.
9981
9982 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
9983
9984         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
9985           Windows build (r51396-51397).
9986
9987 2005-11-03  Martin Baulig  <martin@ximian.com>
9988
9989         * class.c (mono_class_setup_vtable_general): Also add generic
9990         methods to the vtable; fixes #76581.
9991
9992 2005-11-01  Miguel de Icaza  <miguel@novell.com>
9993
9994         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
9995         sure that we lookup GetString method from the System.Text.Encoding
9996         class, not the derived class or we get an empty method.
9997
9998         Fixed class #76612.
9999
10000 2005-10-25  Miguel de Icaza  <miguel@novell.com>
10001
10002         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
10003         if it has been previously set (embedders). 
10004
10005         Make mono_set_rootdir available also on Unix.
10006
10007 005-10-24  Robert Jordan  <robertj@gmx.net>
10008
10009         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
10010
10011 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
10012
10013         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
10014         only calls which are made to native code use this flag.
10015
10016         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
10017
10018 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
10019
10020         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
10021         Add support for FieldBuilders.
10022
10023 2005-10-29  Martin Baulig  <martin@ximian.com>
10024
10025         * mono-debug.c
10026         (mono_debug_using_mono_debugger): New public method; returns
10027         whether we're running inside the debugger.
10028
10029 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
10030
10031         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
10032         for Method/Constructor/FieldBuilders.
10033
10034 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
10035
10036         * reflection.c (module_add_cattrs): Save custom attributes for global methods
10037         and fields as well.
10038
10039 2005-10-26  Martin Baulig  <martin@ximian.com>
10040
10041         * mono-debug-debugger.c
10042         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
10043
10044 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10045
10046         * icall.c (base64_to_byte_array): Don't pass an out-of-range
10047         integer to isspace.
10048
10049 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
10050
10051         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
10052         when passing valuetypes byref. Fixes #76502.
10053
10054 2005-10-19  Jackson Harper  <jackson@ximian.com>
10055
10056         * profiler.c: Don't put a . in front of types that are not in a
10057         namespace.
10058
10059 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
10060
10061         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
10062
10063 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
10064
10065         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
10066         #76436.
10067         (mono_marshal_get_ldflda_wrapper): Fix a warning.
10068
10069 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10070
10071         * assembly.c metadata-internals.h icall.c: Define an additional
10072         parameter for mono_assembly_name_parse_full, so we can avoid creating
10073         S.R.AssemblyName.Version when no version info wasn't passed.
10074         
10075 2005-10-09  Miguel de Icaza  <miguel@novell.com>
10076
10077         * class.c (mono_type_get_full_name): Reimplement method that was
10078         removed. 
10079
10080         * image.c: Some docs
10081
10082 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
10083
10084         * profiler.c (output_newobj_profile): Fix printing of Total memory
10085         on x86.
10086
10087 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
10088
10089         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
10090
10091 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
10092
10093         * threads.c: remove debug output.
10094
10095 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
10096
10097         * threads.c (mono_thread_manage): Fix crashes if more than 64
10098         threads need to be aborted. Hopefully fixes #75899.
10099
10100         * assembly.c (mono_stringify_assembly_name): New helper function.
10101
10102         * class.c: Use mono_stringify_assembly_name instead of the similar
10103         static function.
10104
10105         * assembly.h assembly.c: Add support for calling a postload search 
10106         hook if an assembly cannot be loaded.
10107
10108         * appdomain.c: Register new search hooks which call the AssemblyResolve
10109         events in AppDomain. Fixes #75231
10110
10111 2005-10-07  Martin Baulig  <martin@ximian.com>
10112
10113         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
10114         methods without debug info.
10115
10116 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
10117
10118         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
10119         wrappers.
10120
10121 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10122
10123         * file-io.c: now that we return symlinks, use lstat and, when the file
10124         is a symbolic link, stat, to get the file attributes. Also avoid the
10125         conversion to/from utf16/external.
10126
10127 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
10128
10129         * class.c (mono_class_layout_fields): Compute klass->has_references
10130         correctly if an embedded valuetype is not yet initialized. Fixes
10131         #76331.
10132
10133 2005-10-04  Martin Baulig  <martin@ximian.com>
10134
10135         * metadata.c
10136         (mono_metadata_load_generic_param_constraints): New public
10137         function; splitted the constraints loading out from
10138         mono_metadata_load_generic_params().
10139
10140         * class.c (mono_class_create_from_typedef): Call
10141         mono_metadata_load_generic_param_constraints() after setting up
10142         the type and creating our parent; fixes #75329.
10143
10144 2005-10-04  Martin Baulig  <martin@ximian.com>
10145
10146         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
10147         non-dynamic parent classes.
10148
10149 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
10150
10151         * file-io.c : win32 build fix (ETXTBSY seems not found).
10152
10153 2005-10-04  Martin Baulig  <martin@ximian.com>
10154
10155         * reflection.c
10156         (mono_image_get_methodspec_token): Make the cache actually work;
10157         fixes #75974.
10158
10159 2005-10-04  Martin Baulig  <martin@ximian.com>
10160
10161         * class.c (mono_class_name_from_token): Removed the unneccessary
10162         `MonoGenericContext *' argument.
10163
10164 2005-10-04  Martin Baulig  <martin@ximian.com>
10165
10166         * loader.c
10167         (method_from_methodspec): Make the caching work again; fixes the
10168         performance regression from #76262.
10169
10170 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10171
10172         * file-io.c:
10173         * file-io.h:
10174         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
10175         GetFileSystemEntries that performs the same work but without going
10176         into io-layer, locking, etc.
10177
10178 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
10179
10180         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
10181         ThreadState_Stopped as well. Fixes #76047.
10182
10183 2005-09-29  Martin Baulig  <martin@ximian.com>
10184
10185         * class.c
10186         (inflate_generic_context): If the new context has a `gmethod', set
10187         its `container' that that gmethod's `container'.
10188
10189         * metadata.c
10190         (mono_metadata_parse_generic_param): Simplify things;
10191         `generic_container = generic_context->container;' is just fine.
10192
10193         * loader.c (method_from_methodspec): Code cleanups.
10194
10195 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
10196
10197         * decimal.c: fix warning (and let gcc generate correct
10198         code on ARM with optimizations).
10199
10200 2005-09-28  Martin Baulig  <martin@ximian.com>
10201
10202         * loader.c
10203         (method_from_memberref): Added `MonoGenericContext *class_context'
10204         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
10205         (method_from_methodspec): If we're a memberref, use the enclosing
10206         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
10207
10208 2005-09-28  Martin Baulig  <martin@ximian.com>
10209
10210         * object.c (mono_runtime_invoke_array): Added support for
10211         MONO_TYPE_GENERICINST; fixes #75917.
10212
10213 2005-09-27  Martin Baulig  <martin@ximian.com>
10214
10215         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
10216         `k->byval_arg.type' to determine the actual type.
10217
10218         * loader.c (method_from_methodspec): Removed some hacks.
10219
10220 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
10221
10222         * class-internals.h (mono_field_is_deleted): Do the test for
10223         rtspecialname before we check the actual name of the field. This
10224         prevents us from dereferencing a pointer into the string table,
10225         saving us from accessing a few pages
10226
10227         * *.c: Replace the use of {Enter,Leave}CriticalSection with
10228         macros. This will allow a deadlock debugger to easily be plugged
10229         in.
10230
10231 2005-09-27  Martin Baulig  <martin@ximian.com>
10232
10233         * loader.c (method_from_methodspec): Create a "signature"
10234         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
10235
10236 2005-09-27  Martin Baulig  <martin@ximian.com>
10237
10238         * class.c
10239         (inflate_generic_class): Correctly set the new context's
10240         container.
10241
10242         * loader.c
10243         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
10244         instead of a `MonoGenericContext *'.
10245         (mono_method_signature_full): Take a `MonoGenericContainer *'
10246         instead of a `MonoGenericContext *'.
10247
10248         * metadata.c
10249         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
10250         instead of a `MonoGenericContext *'.
10251         (mono_metadata_parse_method_signature_full): Likewise.
10252
10253 2005-09-26  Martin Baulig  <martin@ximian.com>
10254
10255         * class.c
10256         (mono_class_from_generic_parameter): Set `klass->generic_container'
10257         (mono_class_from_generic_parameter): Likewise.
10258         (mono_bounded_array_class_get): We inherit the generic container
10259         from the element class.
10260
10261         * loader.c
10262         (find_method, find_method_in_class): Take a `MonoGenericContext *'
10263         argument rather than computing it here.
10264         (method_from_memberref): Correctly set the generic context before
10265         parsing the signature.  Fixes #75681.
10266
10267 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
10268
10269         * object.c (mono_class_has_special_static_fields): Fix warnings.
10270
10271 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10272
10273         * assembly.c: Add parse_public_key function, to
10274         par the public keys. Also added mono_assembly_name_parse_full,
10275         to define it the parsed key should be freed or not.
10276         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
10277         to parse a long format assembly name.
10278         * metadata-internals.h: Keep mono_assembly_name_parse_full as
10279         private, since calling it to preserve the key requires
10280         freeing it manually.
10281         
10282 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
10283
10284         * locales.c : removed HAVE_ICU part.
10285
10286 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
10287
10288         * object.c (mono_class_create_runtime_vtable): Avoid calling 
10289         field_is_special_static if the klass has no special static fields.
10290
10291         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
10292         (MonoCachedClassInfo): Likewise.
10293
10294         * object.c (mono_class_has_special_static_fields): New helper function.
10295
10296 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
10297
10298         * class.c (mono_class_create_from_typedef): Don't call 
10299         interfaces_from_typedef_full for enums.
10300         (mono_class_create_from_typedef): Compute the base types of enums directly
10301         without calling mono_class_setup_fields ().
10302         (mono_class_find_enum_basetype): New helper function.
10303
10304         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
10305         one place inside the string heap.
10306         
10307 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
10308
10309         * class.c: locking fixes, code cleanups, some docs added.
10310         Allocate some data structures in the image mempool.
10311
10312 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
10313
10314         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
10315         the example code.
10316         
10317 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
10318
10319         * class-internals.h, class.c, reflection.c: reduce memory taken by
10320         MonoClass.
10321
10322 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
10323
10324         * metadata.c, metadata.h, loader.h: documentation updates, code and
10325         API cleanups.
10326
10327 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
10328
10329         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
10330         the example code.
10331
10332         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
10333         page faults caused by the runtime while reading metadata.
10334
10335 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10336
10337         * socket-io.c: the field names were changed 3 months ago and no one
10338         realized until bug #76077 got filed!
10339
10340 2005-09-20  Martin Baulig  <martin@ximian.com>
10341
10342         * icall.c (assembly_icalls): Removed some unused debugger icalls.
10343
10344 2005-09-20  Martin Baulig  <martin@ximian.com>
10345
10346         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
10347         write the rank into the class entry.
10348
10349 2005-09-20  Martin Baulig  <martin@ximian.com>
10350
10351         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
10352
10353 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
10354
10355         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10356
10357         * icall.c (custom_attrs_defined_internal): New icall.
10358
10359         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
10360         function.
10361         (mono_custom_attrs_construct_by_type): New helper function.
10362
10363 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
10364
10365         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
10366         terminate the resulting string. Fixes #76123.
10367
10368 2005-09-16  Martin Baulig  <martin@ximian.com>
10369
10370         * mono-debug.c
10371         (mono_debug_add_method): Ignore inflated methods for the moment.
10372
10373 2005-09-14  Martin Baulig  <martin@ximian.com>
10374
10375         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
10376
10377 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
10378
10379         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
10380         return a success/failure indication.
10381         (mono_metadata_interfaces_from_typedef_full): Ditto.
10382         (get_constraints): Ditto.
10383
10384 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
10385
10386         * marshal.c (emit_marshal_array): Fix handling of null arrays.
10387         
10388         * marshal.c (emit_marshal_array): Add support for returning string
10389         arrays from delegates. Fixes #76063.
10390
10391         * marshal.c: Use the emit_ldloc/stloc macros where possible.
10392
10393 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
10394
10395         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
10396         icall.
10397
10398 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
10399
10400         * reflection.c icall.c: Fix after mono_get_exception_type_load
10401         signature change.
10402
10403         * assembly.c (mono_assembly_get_assemblyref): New helper function.
10404         (mono_assembly_load_reference): Use the new helper.
10405
10406         * class-internals.h (MonoLoaderError): New structure containing 
10407         information about type loading errors.
10408
10409         * class-internals.h loader.c: Add APIs to store per-thread loader
10410         error information.
10411
10412         * loader.c class.c: Set the loader error if needed.
10413
10414         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
10415
10416 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
10417
10418         * decimal.c: fixed to handle the broken ARM fp format.
10419
10420 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
10421
10422         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
10423         broken.
10424
10425 2005-09-06  Martin Baulig  <martin@ximian.com>
10426
10427         * domain.c (supported_runtimes): Added v2.0.50727.
10428
10429 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
10430
10431         * culture-info.h: reduce the size of some structures.
10432
10433 2005-09-05  Martin Baulig  <martin@ximian.com>
10434
10435         Reflect latest API changes in the August CTP.
10436
10437         * icall.c
10438         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
10439         ("MonoType.HasGenericArguments"): Removed.
10440         ("MonoMethod.BindGenericParameters"): Renamed to
10441         "MakeGenericMethod".
10442         ("MethodBuilder.BindGenericParameters"): Renamed to
10443         "MakeGenericMethod".    
10444
10445 2005-09-05  Martin Baulig  <martin@ximian.com>
10446
10447         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
10448
10449 2005-09-05  Martin Baulig  <martin@ximian.com>
10450
10451         Applying a patch from Michal Moskal <malekith@nemerle.org>.
10452
10453         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
10454         generic_container is non-NULL.
10455
10456 2005-09-05  Martin Baulig  <martin@ximian.com>
10457
10458         Applying a patch from Michal Moskal <malekith@nemerle.org>.
10459
10460         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
10461
10462 2005-08-29  Michal Moskal  <malekith@nemerle.org>
10463
10464         * reflection.c (encode_locals,
10465         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
10466         for large generic types.
10467
10468 2005-09-05  Martin Baulig  <martin@ximian.com>
10469
10470         Applying a patch from Michal Moskal <malekith@nemerle.org>.
10471
10472         * class.c (mono_dup_array_type): New public method.
10473         (mono_metadata_signature_deep_dup): New public method.
10474         (dup_type): Correctly duplicate array and function types.
10475
10476 2005-09-05  Martin Baulig  <martin@ximian.com>
10477
10478         Applying a patch from Michal Moskal <malekith@nemerle.org>.
10479
10480         * reflection.c (get_default_param_value_blobs): Handle generic types
10481         and generic methods.
10482
10483 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
10484
10485         * class.c: Fixed error reporting (method/class were inversed) for 
10486         inheritance demands.
10487         * security-manager.c|h: Added the AppDomain when calling the managed
10488         System.Security.SecurityManager.InheritanceDemand method.
10489
10490 2005-09-01  Raja R Harinath  <rharinath@novell.com>
10491
10492         * reflection.c (encode_marshal_blob): 'marshaltype' and
10493         'marshaltyperef' are alternate sources for the custom marshaler
10494         name.
10495
10496 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
10497
10498         * class.c: fix creation of array classes with rank == 1
10499         (patch by Ankit Jain <jankit@novell.com>).
10500
10501 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
10502
10503         * object.c: fix check for creating the bound data for arrays vs
10504         szarrays.
10505
10506 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10507
10508         * object.c: configuration file name is now based on the executable name,
10509         not the image name. Fixes bug #75931.
10510
10511 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
10512
10513         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
10514         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
10515
10516 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
10517
10518         * rand.c: Use wincrypt.h instead of WinCrypt.h.
10519
10520 2005-08-24  Ankit Jain  <jankit@novell.com>
10521             Raja R Harinath  <rharinath@novell.com>
10522
10523         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
10524           called by it recursively.
10525           (mono_class_init): Remove special case in pending_init handling, since it's
10526           superseded by the fix to mono_class_from_typeref.
10527
10528 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
10529
10530         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
10531         BROKEN_THREAD_START stuff.
10532
10533 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
10534
10535         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
10536         trampoline.
10537
10538         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
10539         
10540         * object.c (mono_delegate_ctor): Replace the original function address with
10541         a delegate trampoline.
10542
10543 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
10544
10545         * icall.c: add boolean argument to base64_to_byte_array and 
10546         InternalFromBase64String to control whether a whitespace-only string
10547         is allowed (or should casue a FormatException to be thrown). We need
10548         this as the behavior has changed between MS.NET 1.x and 2.0, and we
10549         to match the MS behaviour in both profiles.
10550         * appdomain.c: Bump corlib version.
10551
10552 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10553
10554         This patch implements a big portion of publisher policy
10555         support, used to bind assembly versions and redirect
10556         one assembly from version A to version B.
10557
10558         * assembly.c:
10559         New GSList loaded_assembly_bindings, for storing the cached
10560         assembly bindings.
10561         (assembly_binding_maps_name): New static function for checking if a 
10562         assembly binding information maps an assembly name.
10563         (mono_assembly_binding_info_free): New function for freeing
10564         assembly binding information resources.
10565         (get_publisher_policy_info): New static function for retrieving 
10566         assembly binding information from a MonoImage.
10567         (compare_versions): New static function for comparing an assembly
10568         binding information data and the version of an assembly name.
10569         (check_policy_versions): New static function for checking if an
10570         assembly binding info mapping an assembly name is valid for it.
10571         (mono_assembly_load_publisher_policy): New static function for
10572         loading the 'policy.major.minor.MyAssembly' image for an assembly
10573         with an assembly name 'aname'.
10574         (mono_assembly_bind_version): New static function for updating
10575         assembly redirection.
10576         (mono_assembly_apply_binding): New static function for applying
10577         assembly binding.
10578         (search_binding_loaded): New static function for searching 
10579         loaded assembly binding infos in the cache domain.
10580         (mono_assembly_load_full): Don't apply assembly binding for
10581         reflection only assemblies.
10582
10583         * metadata-internals.h: Add MonoAssemblyBindingInfo,
10584         which contains information about assembly binding. Also
10585         declare signature for mono_config_parse_publisher_policy ()
10586         function, used to retrieve pub policy info.
10587         
10588         * mono-config.c:
10589         (publisher_policy_start): New static function used to parse publisher 
10590         policy config files.
10591         (publisher_policy_parser): New static MonoParseHandler containing 
10592         the functions used when parsing config files.
10593         (mono_config_parse_publisher_policy): New function for parsing
10594         publisher policy files.
10595         
10596 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
10597
10598         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
10599
10600         * marshal.c (mono_delegate_free_ftnptr): Ditto.
10601
10602         * object.c (mono_get_addr_from_ftnptr): New helper function.
10603
10604         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
10605
10606         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10607
10608 2005-08-19  Dick Porter  <dick@ximian.com>
10609
10610         * threads.c, threads.h, appdomain.c, appdomain.h,
10611         profiler-private.h, monitor.c, object.c, object-internals.h,
10612         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
10613         store the thread ID, so it can hold a 64 bit value if needed.
10614
10615 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
10616
10617         * reflection.c (mono_reflection_create_dynamic_method): Store the
10618         handle class into the method references as well so ldtoken works in
10619         dynamic methods.
10620
10621         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
10622         types.
10623
10624 2005-08-19  Ankit Jain <jankit@novell.com>
10625
10626         Fix #75847.
10627         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
10628           here rather than using the method signature of a arbitrary function
10629           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
10630           two arguments.
10631           Hack done with Harinath.
10632
10633 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10634
10635         * threadpool.c: disable printing stack traces when we get a exception
10636         in a threadpool thread. I need to do more testing to figure out which
10637         cases actually print this. Fixes bug #75828.
10638
10639 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10640
10641         * icall.c: there might be ignored whitespace after the last '='. This
10642         fixes length computation and bug #75840.
10643
10644 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
10645
10646         * assembly.c (mono_assembly_load_full): Consider .exe extension as
10647         well. Fixes #75809.
10648
10649         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
10650         #75784.
10651         
10652         * reflection.c (create_custom_attr_data): Ditto.
10653
10654 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
10655
10656         * locales.c, culture-info.h : removed RegionLCIDMap.
10657         * culture-info-tables.h : regenerated.
10658
10659 2005-08-16  Martin Baulig  <martin@ximian.com>
10660
10661         * class.c (mono_type_get_name_recurse): Small fix.
10662
10663 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
10664
10665         * locales.c : indentation fixie.
10666
10667 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
10668
10669         * object-internals.h,
10670           locales.h,
10671           locales.c,
10672           culture-info.h,
10673           icall.c : added RegionInfo table support.
10674         * culture-info-table.h : regenerated for region support.
10675
10676 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
10677
10678         * reflection.c (resolve_object): handle all kinds of MonoMethod
10679         including generic ones
10680
10681 2005-08-12  Ankit Jain <jankit@novell.com>
10682
10683         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
10684           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
10685
10686 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
10687
10688         * process.c: Don't close a thread handle when it's NULL. This is a
10689         workaround for bug #75733.
10690
10691 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
10692
10693         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
10694
10695 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
10696
10697         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
10698
10699 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10700
10701         * threadpool.c: if a work item in the thread pool has a callback that
10702         catches a exception, don't propagate it after invoking the callback.
10703         Fixes bug #75336.
10704
10705 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
10706
10707         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
10708
10709         * class-internals.h (MonoCachedClassInfo): Add some new fields.
10710
10711         * class.c (mono_class_init): Load field info lazily in the AOT case.    
10712
10713         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
10714
10715 2005-08-03  Ankit Jain  <jankit@novell.com>
10716
10717         Fix #75683.
10718         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
10719           PInvoke calling convention is 0.
10720
10721 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
10722
10723         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
10724         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
10725
10726 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
10727
10728         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
10729         to handle threads not started by the GC (patch by Michael Meeks
10730         <michael.meeks@novell.com>).
10731
10732 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
10733
10734         * reflection.c: Make buffer used in emitting types larger for some
10735         big generic types (patch by Michal Moskal).
10736
10737 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
10738
10739         * mono-debug.c: Fix some (not all) alignment problems.
10740
10741 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10742
10743         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
10744         Invoke mono_image_load_from_data_full passing the refonly
10745         parameter.
10746
10747         * assembly.c
10748         (mono_assembly_open_from_bundle): Add the refonly argument, 
10749         in order to pass it to other methods it calls to.
10750         (do_mono_assembly_open): Add the refonly argument, in order 
10751         to pass it to other methods it calls to.
10752         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
10753         the refonly parameter to it.
10754
10755         * image.c: Add loaded_images_refonly_hash and
10756         loaded_images_refonly_guid_hash to cache the reflection
10757         only loaded images.
10758         (mono_images_init): Initialize the hash tables used for
10759         caching the reflection only images.
10760         (load_modules): Invoke mono_image_open_full passing the refonly
10761         parameter to load the modules the correct way.
10762         (build_guid_table): Add the refonly argument, to re-build the 
10763         correct hash table.
10764         (do_mono_image_open): Added the refonly argument, in order to
10765         define it for the loaded image.
10766         (mono_image_loaded_full): New function, which receives an
10767         additional parameter to look for the image in the refonly or
10768         non-refonly section.
10769         (mono_image_loaded): Updated, using mono_image_loaded_full.
10770         (mono_image_loaded_by_guid_full): The same case that happens
10771         with mono_image_loaded_full.
10772         (mono_image_loaded_by_guid): Likewise.
10773         (register_image): Use the ref_only variable inside MonoImage
10774         to decide in which hash table store the current image.
10775         (mono_image_open_from_data_full): Rename
10776         mono_image_open_from_data to mono_image_open_from_data_full,
10777         adding the refonly argument, to define the ref_only variable 
10778         inside MonoImage.
10779         (mono_image_open_from_data): Return 
10780         mono_image_open_from_data_full.
10781         (mono_image_open_full): Rename mono_image_open to
10782         mono_image_open_full, receiving the new refonly argument,
10783         to pass it to inner methods.
10784         (mono_pe_file_open): Update this function, to open
10785         a MonoImage as a non-refonly image.
10786         (mono_image_close): Use the refonly variable inside
10787         MonoImage to remove the image from the correct caches.
10788
10789         * image.h: Add the signatures of mono_image_open_full,
10790         mono_image_open_from_data_full, mono_image_loaded_full,
10791         mono_image_loaded_by_guid_full.
10792
10793         * metadata-internals.h: Add the ref_only field to 
10794         MonoImage.
10795         
10796 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10797
10798         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
10799         Fix the last behavior, which used to load the assemblies and
10800         extract MonoReflectionAssemblyName information, instead of
10801         extract it from the metadata tables. Needed for Reflection
10802         Only assemblies.
10803         
10804 2005-07-29  Martin Baulig  <martin@ximian.com>
10805
10806         * mono-debug-debugger.c
10807         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
10808         not initialized.
10809
10810         * mono-debug.c
10811         (mono_debug_address_from_il_offset): Check whether we have
10812         debugging support before attempting to take the lock.
10813         (mono_debug_source_location_from_address): Likewise.
10814         (mono_debug_source_location_from_il_offset): Likewise.
10815         (mono_debug_il_offset_from_address): Likewise.
10816         (mono_debug_address_from_il_offset): Likewise.
10817
10818 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
10819
10820         * class.c (mono_class_from_name_case): Add support for dynamic images.
10821         Fixes #75650.
10822
10823         * object.c (mono_class_compute_gc_descriptor): Add a workaround
10824         for #75479.
10825
10826 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
10827         
10828         * reflection.c (mono_method_get_object): Fix warning.
10829
10830 2005-07-28  Martin Baulig  <martin@ximian.com>
10831
10832         * mono-debug.c
10833         (mono_debug_add_wrapper): Also write the wrapper type.
10834
10835 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
10836
10837         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
10838         
10839         * class.c (mono_class_init): Avoid reading nested classes if the AOT
10840         data indicates the class has none.
10841
10842 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
10843
10844         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
10845         loader lock with the debugger lock. Prevents deadlocks for beagle.
10846
10847         Beagle can now run on an smp box for a weekend without any
10848         issues. Woohoo!
10849
10850 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
10851
10852         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
10853         in a module. Fixes #75629.
10854
10855 2005-07-26  Martin Baulig  <martin@ximian.com>
10856
10857         * mono-debug.c (mono_debug_add_wrapper): New static method.
10858         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
10859         interncall or a wrapper.
10860
10861         * mono-debug.h (MonoDebugWrapperData): New public typedef.
10862         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
10863         (MONO_DEBUGGER_VERSION): Bump to 51.
10864
10865         * mono-debug-debugger.c
10866         (mono_debugger_add_type): Removed this empty function.
10867         (mono_debugger_add_method): Likewise.
10868
10869 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
10870
10871         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
10872         before accessing method->slot.
10873
10874 2005-07-21  Jb Evain  <jbevain@gmail.com>
10875
10876         * reflection.c (method_encode_clauses/class): Handle filters clauses.
10877         Fixes #75010.
10878
10879 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
10880
10881         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
10882         #75587.
10883
10884 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
10885
10886         * image.h image.c: Add mono_image_get_guid () API function.
10887
10888 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
10889
10890         There were issues when multiple threads tried to load
10891         assemblies. A deadlock was created between assemblies_mutex and
10892         mono_domain_assemblies_lock. This fixes the issue by making the
10893         assembly ref counting be lock free. See bug 75586.
10894         
10895         * image.c (mono_image_close): The add ref function here was using
10896         Interlocked operations while the unref was using a mutex and a
10897         --. I don't think this was ever a bug that would be exposed in a
10898         non-pendantic way (ie, by an embedder doing a ref on one thread
10899         and an unref on another), but for the sake of correctness, this is
10900         now Interlocked.
10901
10902         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
10903         (mono_assembly_load_reference): Call mono_assembly_addref rather
10904         than touching the refcount ourselves.
10905         (mono_assembly_close): Use InterlockedDecrement to unref the
10906         assembly. Don't acquire the lock unless it is actually needed.
10907
10908 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
10909
10910         * class.c (mono_class_layout_fields): Fix calculation of has_references
10911         for generic types.
10912
10913 2005-07-12  Martin Baulig  <martin@ximian.com>
10914
10915         Applying a patch from Michal Moskal <malekith@nemerle.org>.
10916
10917         * metadata.c
10918         (mono_type_hash): Provide better hashing for generic instances.
10919         (mono_generic_inst_hash): Improve hashing.
10920         (mono_generic_class_hash): Likewise.
10921
10922         * reflection.c (mymono_metadata_type_hash): Improve hashing for
10923         generic instances.
10924
10925 2005-07-12  Martin Baulig  <martin@ximian.com>
10926
10927         * reflection.c (mono_reflection_create_runtime_class): Remove the
10928         hack for generic type definitions and non-`Run' assemblies.
10929         (mono_reflection_bind_generic_parameters): Also use
10930         `klass->wastypebuilder' to check for TypeBuilders.
10931
10932 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
10933
10934         * class.c (mono_class_layout_fields): Fix calculation of has_references
10935         for generic types.
10936
10937         * class.c (inflate_generic_class): Fix a leak.
10938         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
10939         for generic types.
10940
10941 2005-07-11  Martin Baulig  <martin@ximian.com>
10942
10943         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
10944         on error.
10945
10946 2005-07-11  Martin Baulig  <martin@ximian.com>
10947
10948         * loader.c (find_method): Also lookup in
10949         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
10950
10951 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
10952
10953         * appdomain.c (mono_domain_unload): Don't free the error message
10954         before passing it to mono_get_exception_...
10955
10956         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
10957         
10958 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
10959
10960         * threads.c: try to better guess an available RT signal (bug #75387).
10961
10962 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
10963
10964         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
10965         and CACHE_OBJECT.
10966
10967 2005-07-07  Martin Baulig  <martin@ximian.com>
10968
10969         * class.c (mono_type_get_name_full): Return NULL for
10970         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
10971         fixes #75408.
10972
10973 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
10974
10975         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
10976         exit the appdomain as well being aborted.
10977
10978         * threadpool.c: Create all threadpool threads inside the root appdomain, and
10979         change back to the root domain after calling managed code. This enables
10980         appdomains using threadpools to be unloaded.
10981
10982 2005-07-07  Martin Baulig  <martin@ximian.com>
10983
10984         * class-internals.h
10985         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
10986         into `MonoDynamicGenericClass' since we only need it for dynamic
10987         types.
10988
10989         * reflection.c (mono_class_bind_generic_parameters): We don't need
10990         to compute the `parent' here.
10991
10992 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
10993
10994         * culture-info-table.h : regenerated.
10995
10996 2005-07-06  Martin Baulig  <martin@ximian.com>
10997
10998         * icall.c
10999         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
11000
11001         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
11002
11003 2005-07-06  Martin Baulig  <martin@ximian.com>
11004
11005         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
11006         we're doing a signature-only comparision; fixes #74945.
11007
11008 2005-07-06  Martin Baulig  <martin@ximian.com>
11009
11010         * class-internals.h (MonoGenericClass): Moved some things out into
11011         a new `MonoInflatedGenericClass' type.  
11012         (MonoInflatedGenericClass): New type; the `klass' of a
11013         `MonoGenericClass' is now computed lazyly in
11014         mono_get_inflated_generic_class().      
11015
11016         * class.c (mono_get_inflated_generic_class): New public function.
11017         (mono_class_inflate_generic_method): Removed the unused
11018         `MonoClass *' argument.
11019         (setup_generic_vtable): Don't call mono_get_inflated_method() on
11020         all the methods.
11021         (mono_class_create_generic): Make this static and merge it with
11022         mono_class_create_generic_2(); we're now called automatically from
11023         mono_get_inflated_generic_class().
11024
11025         * loader.c (mono_method_signature): Call
11026         mono_get_inflated_method() here.
11027
11028 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
11029
11030         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
11031         type of fields with RVA.
11032
11033         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
11034         for this pseudo class.
11035         (my_mono_class_from_generic_parameter): Likewise.
11036         (mono_class_init): Allow interfaces to have cctors.
11037
11038 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
11039
11040         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
11041         lazily for AOT methods.
11042
11043 2005-07-05  Martin Baulig  <martin@ximian.com>
11044
11045         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
11046         returns FALSE for a successful match, not TRUE.
11047
11048 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
11049
11050         * loader.c (mono_method_get_index): Optimize this a bit.
11051
11052 2005-07-04  Martin Baulig  <martin@ximian.com>
11053
11054         * class.c
11055         (class_compute_field_layout): Move the check for generic type
11056         definitions into mono_class_layout_fields().  Fixes #74684.
11057         (mono_class_from_generic_parameter): Correctly compute
11058         `klass->parent'; fixes #75457.
11059
11060         * reflection.c (register_assembly, register_module): Make sure
11061         `domain->rejobject_hash' is already created.
11062
11063 2005-07-02  Martin Baulig  <martin@ximian.com>
11064
11065         * class-internals.h
11066         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
11067         `MonoDynamicGenericClass'.      
11068
11069 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
11070
11071         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
11072         returned by a field getter is null, since null is a valid value.
11073
11074 2005-07-01  Martin Baulig  <martin@ximian.com>
11075
11076         * reflection.c (mono_reflection_generic_class_initialize): Update
11077         the `dgclass->fields [i].parent' to the correct class.
11078         (mono_image_get_fieldref_token): Use the declaring type, not the
11079         reflected type.
11080
11081 2005-07-01  Martin Baulig  <martin@ximian.com>
11082
11083         * loader.c (find_method): Also look in the interfaces; fixes #75429.
11084
11085 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
11086
11087         * threads.c (thread_cleanup): assert that thread != NULL
11088         (wait_for_tids_or_state_change): We were using the wrong variable
11089         when accessing wait->threads. `i' was always out of the bounds of
11090         the array.
11091
11092 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11093
11094         * loader.c: map user32 and kernel32 to libMonoSupportW
11095
11096 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
11097
11098         * appdomain.c (unload_thread_main): Mark this as WINAPI.
11099
11100 2005-06-28  Martin Baulig  <martin@ximian.com>
11101
11102         * loader.c (method_from_methodspec): Fix #75334.
11103
11104 2005-06-28  Martin Baulig  <martin@ximian.com>
11105
11106         Fix #74953 - Arrays now implement the generic IList<T> interface
11107         on the 2.0 platform.
11108
11109         * class-internals.h (MonoDefaults): Added `generic_array_class'.
11110
11111         * reflection.c (mono_class_bind_generic_parameters): New public
11112         function; similar to mono_reflection_bind_generic_parameters(),
11113         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
11114
11115         * domain.c (mono_init_internal): Try to initialize.
11116         `mono_defaults.generic_array_class' here; this'll only succeed if
11117         we're using the 2.0 corlib.
11118
11119         * icall.c
11120         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
11121         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
11122         (mono_lookup_internal_call): Added support for nested classes.
11123
11124         * loader.c
11125         (mono_get_method_from_token): Set `result->signature->pinvoke' if
11126         we're an interncall and have generic arguments.
11127
11128         * class.c
11129         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
11130         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
11131         instance of System.Array.InternalArray<T> for arrays, so they
11132         implement the generic IList<T> interface.
11133
11134 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
11135
11136         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
11137         (chastamar@yahoo.com). Fixes #75374.    
11138
11139 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
11140
11141         * culture-info-table.h: regenerated.
11142
11143 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11144
11145         * icall.c: handle spaces correctly for base64 strings.
11146
11147 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
11148
11149         * *.c: Kill some warnings.
11150
11151 2005-06-23  Duncan Mak  <duncan@novell.com>
11152
11153         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
11154         that this builds on Solaris 10 (x86).
11155
11156 2005-06-23  Martin Baulig  <martin@ximian.com>
11157
11158         * class.c
11159         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
11160         generic type definitions.
11161
11162 2005-06-23  Martin Baulig  <martin@ximian.com>
11163
11164         Fix #75331.
11165
11166         * metadata.c (mono_class_get_overrides): Renamed to
11167         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
11168         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
11169         pass it to mono_get_method_full().
11170
11171 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
11172
11173         * reflection.c (mono_reflection_create_runtime_class): take the
11174         mono_domain_lock in this method. Prevents deadlocks
11175
11176 2005-06-22  Martin Baulig  <martin@ximian.com>
11177
11178         * loader.c (method_from_methodspec): Fix #75330.
11179
11180 2005-06-22  Martin Baulig  <martin@ximian.com>
11181
11182         * reflection.c (type_get_qualified_name): Use
11183         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
11184         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
11185         argument; use it if we don't have an assembly name.
11186
11187 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
11188
11189         * object.c: In mono_message_init, set "copy out" flag for in
11190         parameters with the [Out] flag.
11191
11192 2005-06-21  Martin Baulig  <martin@ximian.com>
11193
11194         * class.c
11195         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
11196         and MONO_TYPE_PTR.
11197
11198 2005-06-21  Martin Baulig  <martin@ximian.com>
11199
11200         * class.c (mono_class_init): Don't initialize `class->fields' for
11201         generic instances since they're initialized again in
11202         compute_field_layout(). 
11203         (compute_field_layout): Set the field's `generic_info' here; fix
11204         #75320. 
11205
11206 2005-06-21  Martin Baulig  <martin@ximian.com>
11207
11208         * class-internals.h
11209         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
11210
11211         * metadata.c (mono_metadata_generic_method_equal): Also
11212         distinguish the `generic_class'; fixes #75334.
11213
11214 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11215
11216         * domain.c:
11217         * appdomain.c:
11218         * domain-internals.h:
11219         * reflection.c: 'domain_assemblies' field is now protected by its own
11220         lock. Don't call into managed code to run the AssemblyLoad event if we
11221         now there are no registered delegates for it.
11222
11223 2005-06-20  Martin Baulig  <martin@ximian.com>
11224
11225         * class.c (mono_class_is_assignable_from): Use a custom version of
11226         mono_class_has_parent() to make things work for generic instances;
11227         fix #75300.
11228
11229 2005-06-20  Martin Baulig  <martin@ximian.com>
11230
11231         * loader.c (method_from_methodspec): Apply a patch from
11232         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
11233
11234 2005-06-20  Martin Baulig  <martin@ximian.com>
11235
11236         * class.c (mono_class_init): Reverted Zoltan's last change; it
11237         breaks generics.
11238
11239 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
11240
11241         * threads.c (wait_for_tids_or_state_change): Add missing locking.
11242
11243 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11244
11245         * socket-io.c: fix the index in the socket array for writable/error
11246         sockets. Fixes bug #75306.
11247
11248 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
11249
11250         * class.c (mono_class_init): Allow interfaces to have static ctors.
11251
11252 2005-06-17  Martin Baulig  <martin@ximian.com>
11253
11254         * loader.c (method_from_methodspec): Use `context->container' when
11255         parsing the `gmethod->inst'.
11256
11257 2005-06-17  Martin Baulig  <martin@ximian.com>
11258
11259         * class.c (mono_type_get_name_recurse): Don't add the assembly
11260         name for type arguments.
11261
11262 2005-06-15  Martin Baulig  <martin@ximian.com>
11263
11264         * reflection.c (mono_image_get_inflated_method_token): Encode
11265         correct klass; fixes #75260.
11266
11267 2005-06-13 Michal Moskal <malekith@nemerle.org>
11268
11269         * icall.c: Make GetCorrespondingMethod/Constructor take
11270         MonoReflectionMethod method not MonoMethod. Removed
11271         MonoType.GetCorrespondingField, and make
11272         MonoGenericType.GetCorrespondingField take name not
11273         MonoClassField.
11274
11275 2005-06-13  Michal Moskal <malekith@nemerle.org>
11276
11277         * reflection.c (field_encode_signature, encode_locals):
11278          Make sizes of buffers for types larger (for big generic types).
11279          (create_generic_typespec,
11280          mono_reflection_sighelper_get_signature_local,
11281          mono_reflection_sighelper_get_signature_field):
11282          Add asserts for too small buffers.
11283
11284 2005-06-15  Martin Baulig  <martin@ximian.com>
11285
11286         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
11287         if our parent is not a dynamic type.
11288
11289 2005-06-15  Martin Baulig  <martin@ximian.com>
11290
11291         * class-internals.h (MonoTypeNameFormat): New enum.
11292
11293         * class.c
11294         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
11295         (mono_type_get_full_name): Removed.
11296         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
11297         argument instead of the boolean's.
11298
11299         * icall.c (ves_icall_System_MonoType_getFullName):
11300         Added `gboolean assembly_qualified'.    
11301
11302         * reflection.h
11303         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
11304
11305         * reflection.c (mono_reflection_parse_type): Parse the new type
11306         name format.
11307
11308 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11309
11310         * icall.c: no need to convert from utf16 to utf8 and then back again
11311         after the call to GetLogicalDrives.
11312
11313 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11314
11315         * icall.c: frombase64. Fix problems exposed by new tests.
11316
11317 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11318
11319         * icall.c: added internal calls for converting char [] and strings in
11320         base64 into byte [].
11321
11322 2005-06-10  Martin Baulig  <martin@ximian.com>
11323
11324         * class.c (mono_class_create_generic_2): Read the nested classes
11325         from the metadata rather than from `gklass->nested_classes' since
11326         `gklass' might not be initialized yet.
11327
11328 2005-06-09  Duncan Mak  <duncan@novell.com>
11329
11330         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
11331         all public headers. Fixes #74919.
11332
11333 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
11334
11335         * domain.c: The key for proxy_vtable_hash is now a pointer
11336         array. Added new GHashFunc and GCompareFunc functions for this.
11337
11338         * class.h: The list of interfaces in MonoRemoteClass is known in
11339         advance and can't grow (we create a new MonoRemoteClass if needed),
11340         so now the interface array can be allocated together with
11341         MonoRemoteClass.
11342         
11343         * object.c: Added a new method create_remote_class_key.
11344         Fixed mono_remote_class so it does not depend on
11345         mono_upgrade_remote_class.
11346         Removed extend_interface_array.
11347         Added new method clone_remote_class(), which makes a copy of a remote
11348         class and adds a new interface or class to it.
11349         mono_upgrade_remote_class() now creates a new remote class (or gets
11350         it from the cache) if an vtable upgrade is needed. In this way
11351         we make sure that other objects sharing the same remote class
11352         don't get the new vtable with unwanted interfaces.
11353         
11354         * object-internals.h:
11355         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
11356         
11357         * marshal.c: Track changes in mono_upgrade_remote_class().
11358
11359 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
11360         * icall.c: Add runtime methods for obtaining members of inflated
11361         class, which were created from supplied non-inflated members. It
11362         is used in internal Get{Method,Constructor,Field} methods in
11363         System.Type
11364
11365 2005-06-09  Martin Baulig  <martin@ximian.com>
11366
11367         * reflection.c
11368         (mono_reflection_bind_generic_method_parameters): Fix #75169.
11369
11370 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11371         * reflection.c (mono_image_basic_init): Define
11372         Version in MonoDynamicAssembly. 
11373         
11374 2005-06-08  Martin Baulig  <martin@ximian.com>
11375
11376         Fix #75136.
11377
11378         * loader.c
11379         (mono_method_signature_full): New public method; takes a
11380         `MonoGenericContext *'.
11381         (find_method): Use mono_method_signature_full() and pass the
11382         klass'es context to it.
11383
11384         * class.c (mono_class_is_inflated_method): Use
11385         mono_method_signature_full() and pass the context to it.
11386
11387 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
11388
11389         * object.c: add proper locking in mono_remote_class_vtable(),
11390         fixes possible memory corruption.
11391
11392 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
11393
11394         * marshal.c (mono_remoting_marshal_init): set
11395         initialized after initialization.
11396
11397 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
11398
11399         * locales.c : hush.
11400
11401 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
11402
11403         * object.c (extend_interface_array): fix really silly
11404         memory corrupting / comparison bug.
11405
11406 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11407
11408         * reflection.c: Functions added to support the creation
11409         of CustomAttributeData, which includes Attribute data
11410         used by ReflectionOnly methods.
11411
11412         * reflection.h:  mono_reflection_get_custom_attrs_data and
11413          mono_custom_attrs_data_construct added (functions exposed).
11414
11415          * icall.c: Added mono_reflection_get_custom_attrs_data
11416          as icall.
11417         
11418 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
11419
11420         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
11421         lupus's request.
11422
11423 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
11424
11425         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
11426
11427         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
11428         dynamic DllImportAttribute.
11429
11430         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
11431         dynamic DllImportAttribute.
11432
11433         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
11434         Fixes #75162.
11435
11436 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11437
11438         * threads.c: avoid segfault when an unstarted thread is aborted.
11439
11440 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
11441
11442         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
11443         Returns the name and version of the runtime for reporting.
11444
11445 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11446
11447         * appdomain.c: bump corlib version.
11448         * object-internals.h: new field in MonoReflectionAssembly.
11449
11450 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11451
11452         * object-internals.h: Carlos forgot to add this field.
11453
11454 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11455
11456         * icall.c: Added create_version to create instances
11457         of Version of MonoReflectionAssemblyName. This change helps
11458         the AssemblyName tests to keep running fine.
11459         
11460 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
11461   
11462         * object.c (mono_method_return_message_restore): A somehow less
11463         intrusive fix for #75138.
11464
11465 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11466
11467         * object.c (mono_method_return_message_restore): Fix computation
11468         of expected number of out args.
11469
11470 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
11471
11472         * reflection.c (mono_image_get_method_info): Fix the case when the
11473         charset is empty.
11474
11475 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
11476
11477         * object.c: Added missing null check in
11478           mono_method_return_message_restore.
11479
11480 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
11481
11482         * reflection.c (mono_image_get_method_info): Handle the case when
11483         dllentry is empty.
11484
11485 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
11486
11487         * object.c: When creating the vtable for a proxy, take into account
11488         all inherited interfaces, not only the ones registered in
11489         iclass->interfaces. This fixs bug #74996.
11490         Also, in mono_method_return_message_restore, verify that the array
11491         of out args has the expected lengh.
11492
11493 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11494
11495         * socket-io.c: update the timeout in Poll when the call is interrupte.
11496
11497 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11498
11499         * socket-io.c: support abort/suspend in Select_internal after last
11500         change.
11501
11502 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11503
11504         * threadpool.c: remove warning.
11505
11506 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11507
11508         * icall.c:
11509         * socket-io.[ch]: Select_internal uses poll() now when available, thus
11510         removing the 1024 limit from select(). Runtime part of the fix for
11511         bug #71203.
11512
11513 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11514
11515         * socket-io.c: when resolving the addresses for the same
11516         host returned by gethostname(), get the local IPs from the interface
11517         list. Loopback addresses are discarded if the are interfaces up with
11518         non-loopback ones. Fixes bug #63265.
11519
11520 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11521
11522         * appdomain.c, verify.c, object-internals.h, reflection.c:
11523         bumped corlib number to 36, and added new extra_flags field
11524         to ReflectionMethodBuilder and friends.  Fixes #75060.
11525
11526 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
11527
11528         * gc.c: register a new weak link only if the object is non-null
11529         (fixes bug#75047).
11530
11531 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
11532
11533         * culture-info.h : short time pattern too.
11534
11535 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
11536
11537         * culture-info.h : expand long time pattern string length.
11538
11539 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
11540
11541         * culture-info-table.h : update (more French date format; #72788).
11542
11543 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
11544
11545         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
11546         the method is static. Fixes #75029.
11547
11548 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
11549
11550         * reflection.c: Update the table_idx field of method builders after
11551         saving the module, since it can change. This is a workaround for
11552         bug #74914. 
11553
11554 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
11555
11556         * culture-info-table.h : update (additional French date format).
11557
11558 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
11559
11560         * icall.c (ves_icall_type_Equals): Revert last change.
11561         
11562         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
11563
11564         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
11565
11566 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
11567
11568         * class-internals.h: Added executioncontext_class field to 
11569         MonoDefaults structure.
11570         * domain.c: Cache System.Threading.ExecutionContext class in 
11571         mono_defaults.
11572         * object.c: Capture the ExecutionContext for asynchroneous calls in
11573          mono_async_result_new.
11574         * object-internals.h: Added execution_context and original_context 
11575         fields to MonoAsyncResult. Added execution_context to MonoThread.
11576         * security-manager.c|.h: Added mono_get_context_capture_method to 
11577         return the capture method (if required by the security manager or by
11578         the framework version used).
11579         * threadpool.c: Apply capture (if present) ExecutionContext in 
11580         mono_async_invoke and revert to original context after it completes.
11581
11582 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
11583
11584         * culture-info-table.h : updated (real hacky solution for zh-CHT).
11585
11586 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
11587
11588         * culture-info-table.h : zh-CHT related workaround.
11589
11590 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
11591
11592         * marshal.c (emit_marshal_custom): Add some error checking and call the
11593         methods in the ICustomMarshaler interface. Fixes #74875.
11594         
11595         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
11596         native->managed wrappers.
11597
11598 2005-05-12  Martin Baulig  <martin@ximian.com>
11599
11600         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
11601         here and use the loader lock.
11602
11603         * mono-debug.c: Properly lock when the debugger is not attached.
11604         (mono_debug_init): Release the initial lock if we're not running
11605         in the debugger.
11606
11607 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
11608
11609         * marshal.c (emit_marshal_custom): Pass through NULL values without
11610         calling the custom marshalling routines.
11611
11612         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
11613         conversion in structures. Fixes #74882.
11614
11615 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
11616
11617         * culture-info-table.h : zh-* cultures were missing.
11618
11619 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
11620
11621         * threads.c: Added a new event background_change_event which is signaled
11622         when a thread changes its background mode.
11623         Moved here several checks previously done in managed code. The checks
11624         require the thread lock, and using the thread lock in managed code
11625         can result in deadlocks.
11626         Merged Start_internal and Thread_internal into a single method. Now 
11627         Thread_internal does all work of creating and starting a thread.
11628         Added icalls for setting and getting the state of the object. Moved from
11629         managed code to avoid locking there.
11630         Added wait_for_tids_or_state_change() which is called instad of
11631         wait_for_tids when waiting for non-backround threads to end. This method
11632         will return if one of the threads ends or the background_change_event
11633         is signaled.
11634         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
11635         the background mode. This method signals the background_change_event
11636         event.
11637         * icall.c:
11638         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
11639         removed Start_internal.
11640         
11641 2005-05-11  Martin Baulig  <martin@ximian.com>
11642
11643         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
11644         to order of some fields to get proper alignment on 64-bit machines.
11645
11646 2005-05-11  Martin Baulig  <martin@ximian.com>
11647
11648         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
11649         changes as they're broken and completely fuck up the debugger.
11650
11651         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
11652
11653 2005-05-10  Martin Baulig  <martin@ximian.com>
11654
11655         * reflection.c (mono_reflection_generic_class_initialize): Don't
11656         call mono_class_setup_parent() here.
11657
11658 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11659
11660         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
11661         send/receive timeout use an integer in milliseconds. We were using a
11662         struct timeval.
11663
11664 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11665
11666         * locales.c:
11667         (internal_get_cultures): reserve the first slot of the array for the
11668         InvariantCulture, which will be filled in managed code.
11669
11670 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
11671
11672         * reflection.c (mono_image_fill_module_table): Initialize the
11673         GENERATION field as well.
11674
11675 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11676
11677         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
11678         Monitor.Enter on the object.
11679
11680 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
11681
11682         * threads.c: Enable the wait for running threads when exiting.
11683         * icall.c: Suspend all threads before exiting.
11684
11685 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
11686
11687         * assembly.c (mono_assembly_load_reference): Fix warning.
11688
11689 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11690
11691         * threadpool.c: changed the default number of threads per cpu. From now
11692         on, the default will be 20 + (5 * number of cpus) instead of 50.
11693
11694 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
11695
11696         * loader.c (mono_method_get_signature_full): Add locking here.
11697
11698 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
11699
11700         * appdomain.c: Moved methods for parsing and freeing assembly
11701         names to assembly.c.
11702         * assembly.c, domain-internals.h: Created public methods for parsing
11703         assembly names. Fixed mono_assembly_load_with_partial_name:
11704         it now finds the best match, taking into account the version,
11705         token and culture specified in the partial name. Also return
11706         the latest version if no version information is specified.
11707
11708 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
11709
11710         * threadpool.c: replace check for SocketAsyncCall class.
11711
11712 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11713
11714         * threadpool-internals.h:
11715         * Makefile.am: added threadpool-internals.h
11716
11717         * threadpool.c: call mono_unhandled_exception on exceptions not handled
11718         that happen in threadpool threads (tested on MS).
11719         (mono_thread_pool_remove_socket): new function that dispatch any pending
11720         AIO call on a socket that is closing. By now only epoll really needs it,
11721         as select/poll wake up when the socket closes.
11722
11723
11724         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
11725
11726 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
11727
11728         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
11729
11730 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
11731
11732         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
11733
11734 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
11735
11736         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
11737         has an abort request, convert it into a suspend request.
11738
11739 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
11740
11741         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
11742         warning for the usage of `UnmanagedFunctionPointerAttribute' which
11743         is not supported yet.
11744
11745 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11746
11747         * image.c: register assemblies loaded from data (bundles) in the loaded
11748         assemblies hash. Fixes bug #74772.
11749
11750 2005-04-29  Martin Baulig  <martin@ximian.com>
11751
11752         * class.c (mono_type_get_name_recurse): Update to the new naming
11753         schema from the latest .NET 2.x beta2.
11754         (mono_class_setup_vtable_general): If we're a generic instance,
11755         copy the vtable from our generic type definition and inflate all
11756         the methods in it.
11757
11758         * loader.c (find_method): Update to the new naming schema from the
11759         latest .NET 2.x beta2.
11760
11761 2005-04-29  Raja R Harinath  <harinath@gmail.com>
11762
11763         * class.c (mono_class_init): Add a mono_loader_unlock to the
11764         #74734 fix.
11765
11766 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
11767
11768         * icall.c (ves_icall_System_Environment_Exit): Remove the 
11769         suspend_all_other_threads () call for the time being, since it can hang.
11770
11771         * threads.c (mono_thread_manage): Similarly, disable the waiting for
11772         the background threads to exit, since it can also hang.
11773
11774         * class.c (mono_class_init): Applied patch from Ankit Jain 
11775         (radical@gmail.com). Avoid pending init errors when a field refers
11776         to a nested class using a typeref. Fixes #74734.
11777
11778         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
11779         this for dynamic modules.
11780
11781 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11782
11783         * threads.c: don't wait for threads that are in the process of aborting
11784         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
11785         and waiting for background threads to finish. This makes xsp and
11786         mod-mono-server exit without random length delays and/or hangs.
11787
11788 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11789
11790         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
11791
11792 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
11793
11794         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
11795         dynamic types to prevent infinite loops. Fixes #74727.
11796
11797         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
11798         ..._is_assignable_to.
11799
11800 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
11801
11802         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
11803
11804 2005-04-25  Martin Baulig  <martin@ximian.com>
11805
11806         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
11807
11808         * domain.c
11809         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
11810
11811         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
11812
11813         * reflection.c (build_compressed_metadata): Set metadata header
11814         version to 2.0.
11815
11816 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
11817
11818         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
11819         number into an integral and a decimal part. Fixes #70473.
11820
11821         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
11822
11823 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
11824
11825         * culture-info-table.h : reflected the latest locale-builder output.
11826
11827 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11828
11829         * threadpool.c: check for SuspendRequested too when deciding if
11830         mono_thread_interruption_checkpoint should be called.
11831
11832 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11833
11834         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
11835         * threads.c: remove interruption_mutex and use Interlocked instead. When
11836         suspending all the threads, wait for all the suspended events at once.
11837         If we're shutting down and get an APC that is going to be queued,
11838         call mono_thread_execute_interruption immediately, as the thread might
11839         be sleeping on a pthread condition or mutex.
11840
11841         * icall.c: call mono_runtime_set_shutting_down before suspending the
11842         threads.
11843
11844         Fixes bug #74693. And now xsp is happier when exiting.
11845
11846 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
11847
11848         * loader.c (mono_stack_walk): Fix #74690.
11849
11850 2005-04-22  Martin Baulig  <martin@ximian.com>
11851
11852         * mono-debug.h (MonoDebugMethodJitInfo): Added
11853         `MonoDebugMethodJitInfo *jit'.
11854
11855         * mono-debug.c (mono_debug_read_method): Cache the
11856         MonoDebugMethodJitInfo in `address->jit'.
11857         (mono_debug_free_method_jit_info): New public method.
11858
11859 2005-04-22  Martin Baulig  <martin@ximian.com>
11860
11861         * class.c (mono_class_is_assignable_from): Disallow
11862         type parameter -> interface.
11863
11864 2005-04-21  Dick Porter  <dick@ximian.com>
11865
11866         * threads.c (mono_thread_create): Turn an assertion into an error.
11867
11868 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
11869
11870         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
11871         
11872         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
11873         Fix some gcc 4.0 warnings.
11874
11875 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
11876
11877         * file-io.c: fix alt dir separator char on unix systems
11878         and cleanup (fixes bug #71214).
11879
11880 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
11881
11882         * marshal.c: Use CALLVIRT instead of CALL when dispatching
11883         a call to a remote domain, since the method may be an
11884         interface method in the client domain. This fixes bug #74192.
11885
11886 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11887
11888         * threadpool.c: recv/send are now performed before going back to managed
11889         code to save one transition.
11890
11891 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11892
11893         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
11894
11895         * metadata/threadpool.c: removed hack to workaround the bug above.
11896
11897         Fixes bug #74618.
11898
11899 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
11900
11901         * reflection.c reflection.h: Fix handling of parameter defaults in
11902         dynamic methods. Also fixes handling of parameter attributes.
11903         Fixes #74609.
11904
11905         * mono-debug.c (mono_debug_close_image): Fix warning.
11906
11907 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11908
11909         * socket-io.h: replaced old unused field with new 'blocking'.
11910         * threadpool.c: restore socket blocking state on windows(tm).
11911
11912 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
11913
11914         * icall.c: don't return the codebase in the AssemblyName[] returned by
11915         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
11916         * object-internals.h: Removed FIXME (fields were presents) and fixed
11917         versioncompat declaration.
11918
11919 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11920
11921         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
11922         not closed, so don't cleanup when it happens.
11923
11924 2005-04-13  Chris Toshok  <toshok@ximian.com>
11925
11926         * mono-debug-debugger.h: change prototype for
11927         mono_debugger_lookup_type.
11928
11929         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
11930         this function, although it should probably be named
11931         mono_debugger_init_type.
11932
11933 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11934
11935         * threadpool.c: fix non-AIO case.
11936
11937 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
11938
11939         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
11940         the built-in profiler to measure just JIT compilation times.
11941
11942 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11943
11944         * threadpool.c: the epollfd might be closed by another thread at
11945         any time, so ignore EBADF at treat it as a "we're closing" sign.
11946
11947 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11948
11949         * threadpool.c: release the semaphores with a count equals to the number
11950         of working threads in both IO and regular pools. Fixed typo that messed
11951         up the count of IO pool threads. Don't initialize the pipe handles if
11952         we're using epoll.
11953
11954 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11955
11956         * threadpool.c: some systems don't like a NULL when deleting the socket
11957         from epoll.
11958
11959 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11960
11961         * threadpool.c: fix semaphore allocation.
11962
11963 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11964
11965         * threadpool.c: added epoll() based implementation for asynchronous IO
11966         that is used instead of the default poll() when available.
11967         It can be disabled by setting MONO_DISABLE_AIO.
11968
11969 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11970
11971         * threadpool.c: windows needs 'closesocket' and instead of returning
11972         0 when the stream is closed while in select, it returns -1. Fixes bug
11973         #74573.
11974
11975 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
11976
11977         * class.c (class_compute_field_layout): Fix the regression caused by
11978         the previous try.
11979
11980 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11981
11982         * threadpool.c: separate pool for socket async. IO.
11983         * threadpool.h: mono_max_worker_threads is not a global any more.
11984
11985 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
11986
11987         * class.c (class_compute_field_layout): Fix #74549.
11988
11989 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11990
11991         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
11992         use 2 connected sockets instead.
11993
11994 2005-04-08  Miguel de Icaza  <miguel@novell.com>
11995
11996         * mono-config.c: Add new entry point for mkbundle
11997         mono_config_parse_memory. 
11998
11999 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12000
12001         * threadpool.c: removed another unused function.
12002
12003 2005-04-08  Ankit Jain  <radical@corewars.org>
12004
12005         * reflection.c (get_default_param_value_blobs): Add 'types'
12006         parameter to get the types encoded in the constant table.
12007         (mono_param_get_objects): Use the type from the constant table,
12008         not the type of the parameter, when creating default values.
12009         Handle null default values correctly.
12010
12011 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12012
12013         * file-io.c:
12014         * file-io.h:
12015         * threadpool.c:
12016         * threadpool.h:
12017         * icall.c:
12018         * socket-io.c: removed dead code for async IO.
12019
12020 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12021
12022         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
12023
12024         * threadpool.c: intercept socket async. calls and pass them to a thread
12025         that is polling and dispatching the job items to the threadpool as
12026         socket become ready. Fixes bugs #71217, #71933.
12027
12028         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
12029         between char and short/ushort arrays.
12030
12031         * socket-io.c: remove dead code.
12032
12033 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
12034
12035         * locales.c,
12036           icall.c : removed InternalToUpper_Comp() and
12037           InternalToLower_Comp().
12038
12039 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
12040
12041         * char-conversions.h : The tables were incorrectly generated. Should
12042           be generated against invariant culture.
12043
12044 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
12045
12046         * object.c (mono_runtime_invoke_array): Fix return value when 
12047         passing pre-created valuetype objects to ctors.
12048
12049         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
12050         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
12051         Fixes #74338.
12052
12053 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12054
12055         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
12056         only used with --security and hides the wrong corlib version error.
12057
12058 2005-03-30  Joshua Tauberer  <tauberer@for.net>
12059
12060         * class.c: Changed mono_class_name_from_token so that types
12061         outside of a namespace don't have an initial period.  Improved
12062         the g_warning message used in _mono_class_get when loading
12063         fails.
12064         * assembly.c: In mono_assembly_load_reference, when an assembly
12065         can't be found, "No such file or directory" is misleading and
12066         unhelpful because a few paths were checked for the presence of
12067         the assembly.  When that happens (ENOENT), display a nicer
12068         message indicating the directories that were searched.  In all
12069         cases, the warning is made easier to read for non-hackers.
12070
12071 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
12072
12073         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
12074         project/solution.
12075         * appdomain.h|domain.c: Removed inline from functions.
12076         * appdomain.c: Reduced warnings when compiling on windows.
12077         * icall.c: Fixed output_debug declaration to gunichar2*.
12078         * mono-config.c: Reduced warnings when compiling on windows.
12079         * rand.c: Added missing "windows.h". Added missing return value.
12080         * rawbuffer.c: Added missing winsock2.h for windows.
12081         * sysmath.h: Added mono-compiler.h header to allow/ease 
12082         compilation with non-GCC compilers.
12083         * threads.c: Fixed declarations to compile with VS.NET C compiler.
12084         Removed cast warnings.
12085
12086         Adapted from the work of J Lothian (for VC6).
12087
12088 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
12089
12090         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
12091         from default_path.
12092
12093 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
12094
12095         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
12096         the 2.0 profile.
12097
12098 2005-03-27  Raja R Harinath  <harinath@gmail.com>
12099
12100         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
12101         has to be in $(exec_prefix).  $(prefix) is for arch-independent
12102         stuff, and it would probably use $(prefix)/share rather than
12103         $(prefix)/lib.
12104
12105 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12106
12107         * console-io.c: added 2 includes that might be missing.
12108
12109 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
12110
12111         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
12112         profile.
12113
12114         * reflection.c (create_custom_attr): Allocate the params array using
12115         alloca so it gets GC tracking.
12116
12117 2005-03-23  Chris Toshok  <toshok@ximian.com>
12118
12119         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
12120         out some spew.
12121
12122 2005-03-24  Raja R Harinath  <rharinath@novell.com>
12123
12124         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
12125         changes to pick up any changes in prefix, etc.
12126
12127 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
12128
12129         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
12130         
12131         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
12132         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
12133
12134 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
12135
12136         * class-internals.h object-internals.h class.c reflection.c: Extend the
12137         mono_lookup_dynamic_token () function to return the class of the
12138         token as well. 
12139
12140         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
12141         well. Fixes #73848.
12142
12143 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
12144
12145         * security-manager.c: Skip inheritance checks for intra-corlib
12146         class inheritance and method overrides. This skips a lot of checks
12147         and (anyway) permissions cannot work until corlib is loaded.
12148
12149 2005-03-23  Martin Baulig  <martin@ximian.com>
12150
12151         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
12152         MONO_TYPE_GENERICINST.  
12153
12154 2005-03-23  Martin Baulig  <martin@ximian.com>
12155
12156         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
12157
12158 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
12159
12160         * class.c: added locking comments to some functions.
12161         Cache the interface offsets arrays (saves about 20 KB
12162         of runtime memory in a typical app).
12163         Reduce the time overhead in mono_class_setup_supertypes ().
12164
12165 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
12166
12167         * icall.c: speedup and fix leaks in GetMethodsByName and
12168         GetPropertiesByName.
12169
12170 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
12171
12172         * reflection.c: some locking fixes.
12173
12174 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
12175
12176         * metadata.c: added missing break in case statement.
12177
12178 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
12179
12180         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
12181         typedbyref return values. Fixes #73941.
12182
12183 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
12184
12185         * security-manager.c|h: Added demandunmanaged method and 
12186         suppressunmanagedcodesecurity class to MonoSecurityManager.
12187         Renamed aptc class to allowpartiallytrustedcallers.
12188
12189 2005-03-17  Martin Baulig  <martin@ximian.com>
12190
12191         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
12192
12193 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12194
12195         * file-io.c: disabled file async. IO using aio_*. It uses the
12196         threadpool now. Workaround for bug #73718.
12197
12198 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
12199
12200         * assembly.h, mono-config.c: added code to deal with bundled configs
12201         for bundled assemblies.
12202
12203 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
12204
12205         * *.c, private.h: cleanup, removing old private.h header file.
12206
12207 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12208
12209         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
12210         and throw_on_unmappable_char attributes.
12211
12212 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
12213
12214         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
12215         _ProcessName_internal.
12216
12217 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
12218
12219         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
12220         #73631.
12221
12222         * icall.c threads.c threads-types.h: Remove slothash icalls as they
12223         are no longer used.
12224
12225 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12226
12227         * object.c (compute_class_bitmap): Add support for generics. Fixes
12228         #73527.
12229
12230 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
12231
12232         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
12233
12234 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12235
12236         * filewatcher.c: commented out the code for windows watcher, as we don't
12237         use it (we use the managed implementation instead).
12238
12239 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
12240
12241         * object-internals.h (MonoThread): Remove 'unused1' field.
12242
12243         * appdomain.c: Bump corlib version.
12244
12245         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
12246
12247         * reflection.c (mono_reflection_create_runtime_class): Remove the
12248         AssemblyBuilder.Save optimization since it causes too many problems.
12249
12250 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
12251
12252         * exception.c|h: Added mono_get_exception_reflection_type_load to
12253         create a ReflectionTypeLoadException object.
12254         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
12255         to return NULL is a InheritanceDemand fails during reflection. Updated
12256         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
12257         ReflectionTypeLoadException if an InheritanceDemand fails during 
12258         reflection. Added icall mapping for GetLinkDemandSecurity.
12259         * security-manager.c|h: Added ves_icall_System_Security_
12260         SecurityManager_GetLinkDemandSecurity internal call to return the
12261         class and methods permissions set for a LinkDemand. Removed unused
12262         fields in MonoSecurityManager.
12263
12264 2005-03-10  Martin Baulig  <martin@ximian.com>
12265
12266         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
12267         it's a generic instance.
12268
12269 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
12270
12271         * reflection.c (mono_get_object_from_blob): Applied patch from
12272         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
12273
12274         * class.c (mono_class_is_assignable_from): Another try at fixing 
12275         #73469 without breaking anything.
12276
12277 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
12278
12279         * class.c: (mono_class_is_assignable_from): Revert the last changes
12280         since they don't work with generics.
12281         
12282         * class.c (mono_class_is_assignable_from): Fix build bustage.
12283
12284         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
12285         the managed IsAssignableFrom method. Fixes #73469.
12286
12287         * reflection.c (mono_reflection_call_is_assignable_from): New helper
12288         function.
12289
12290 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
12291
12292         * object.c (mono_load_remote_field_new): Fix returning uninitialized
12293         memory when the remoting callback does not sets the out arguments.
12294         Fixes #73007.
12295
12296         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
12297         by mistake.
12298
12299         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
12300
12301         * object-internals.h (MonoStackFrame): Sync with managed object layout.
12302
12303         * appdomain.c: Bump corlib version.
12304
12305 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
12306
12307         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
12308         function.
12309
12310         * threads.c (mono_thread_attach): Detect threads which are not started
12311         by the GC pthread wrappers.
12312
12313 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
12314
12315         * icall.c: Added new icall for RNG.
12316         * rand.c|h: Added new icall to open the RNG. This allows to share a 
12317         single handle on Linux to access /dev/urandom and fix #73183.
12318
12319 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
12320
12321         * object.c: setting the new vtable in a transparent proxy object must
12322         not change the GC descriptor.
12323
12324 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
12325
12326         * object.c: fixed compilation without GCJ support.
12327         * reflection.c: for runtime-created types ensure klass->has_references
12328         is correct (bug #73215).
12329
12330 2005-03-02  Martin Baulig  <martin@ximian.com>
12331
12332         * class.c (mono_class_is_assignable_from): Make this work if
12333         `oklass' is a generic instance; fixes #72831.
12334
12335 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12336
12337         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
12338         with hasthis set.
12339         
12340         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
12341
12342         * marshal.c: Reorganize native->managed marshalling code to also use
12343         the emit_marshal_... functions.
12344
12345 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
12346
12347         * object.c: typed allocs have issues with bitmap sizes > 30,
12348         so check for max_set >= 30.
12349
12350 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12351
12352         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
12353         managed code. Fixes #73012.
12354
12355         * metadata.h (MonoMarshalSpec): Add elem_mult field.
12356
12357         * metadata.c reflection.c: Load/Emit elem_mult as well.
12358         
12359         * metadata.h (MonoMarshalSpec): Add comment.
12360
12361         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
12362
12363         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
12364         num_elem to -1 if not given.
12365
12366         * object-internals.h (MonoReflectionMarshal): Add has_size field.
12367
12368         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
12369         given values.
12370
12371 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12372
12373         * null-gc.c (mono_gc_free_fixed): Was not compilable.
12374
12375 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12376
12377         * reflection.c (encode_marshal_blob): Encode param_num field as well.
12378
12379         * object-internals.h (MonoReflectionMarshal): Add param_num field.
12380
12381 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
12382
12383         * object.c: generalized the reference bitmap creation
12384         and added hooks for the new GC.
12385         * class-internals.c: removed the gc_bitmap field from MonoClass.
12386
12387 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
12388
12389         * domain.c: help the compiler to produce better code
12390         in mono_jit_info_table_find ().
12391
12392 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
12393
12394         * object.c: make all allocations look typed.
12395
12396 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
12397
12398         * socket-io.c: load Mono.Posix if it's not loaded already
12399         (fixes bug#73033).
12400
12401 2005-02-24  Martin Baulig  <martin@ximian.com>
12402
12403         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
12404         * reflection.c (dup_type): Likewise.
12405
12406 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
12407
12408         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
12409         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
12410
12411 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
12412
12413         * domain.c, threads.c, object-internals.h: make the critical thread
12414         local vars use the fast access mode (even when we're compiled in
12415         a lib). Provide accessors to be used by the jit during codegen.
12416
12417 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12418
12419         * appdomain.c: Changed hook functios behavior to include
12420         support for the reflection only assemblies. Some icalls were changed
12421         to support the mentioned assemblies too. Signatures of static methods
12422         try_assembly_resolve and real_load now have an additional parameter:
12423         refonly.
12424
12425         * assembly.c: General changes to mono_assembly_ methods to support
12426         reflection only api. Functions mono_assembly_open, mono_assembly_load,
12427         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
12428         suffix, to support an additional gbool parameter to specify whether
12429         the assembli is reflection only or not. Created some new hook functions 
12430         to add support for reflection only assemblies. Signatures of static 
12431         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
12432         have now an additional parameter: refonly.
12433
12434         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
12435         indicating whether the assembly is reflection only or not.
12436
12437         * exception.c: Add mono_get_exception_invalid_operation.
12438
12439         * icall.c: Throw an InvalidOperationException when trying to invoke
12440         a property/method/event, or trying to set/get the value of a field.
12441         Also add an icall to retrieve the ref_only flag to the
12442         MonoReflectionAssembly.
12443
12444 2005-02-23  Chris Toshok  <toshok@ximian.com>
12445
12446         Part of fix for #72827.
12447         * mono-debug.c (mono_debug_add_method): add lexical block data to
12448         the info we write.  Kind of a hack at the moment - we copy the
12449         lexical block info from the MonoDebugMethodInfo to the
12450         MonoDebugMethodJitInfo here, before writing it.
12451         (mono_debug_read_method): read the lexical block info.
12452
12453         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
12454
12455         * debug-mono-symfile.h: add lexical block support.
12456
12457         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
12458         support.
12459
12460 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
12461
12462         * loader.c (mono_lookup_pinvoke_call): Fix warning.
12463
12464         * object.c (mono_runtime_free_method): Call mono_free_method () and
12465         put the TODOs there.
12466
12467         * loader.c (mono_free_method): Free up most memory allocated for 
12468         dynamic methods.
12469
12470 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
12471
12472         * reflection.c: properly flag a Type argument to a
12473         named custom attr value (bug #72248).
12474
12475 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
12476
12477         * reflection.c: reduce code duplication in named custom
12478         attribute encoding.
12479
12480 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
12481
12482         * reflection.c: properly encode custom attrs of type object
12483         (bug #72649).
12484
12485 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
12486
12487         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
12488
12489 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
12490
12491         * socket-io.c: load System.dll if it's not loaded already
12492         (bug #72850 and #70477).
12493
12494 2005-02-21  Martin Baulig  <martin@ximian.com>
12495
12496         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
12497         generic instances.
12498
12499 2005-02-21  Martin Baulig  <martin@ximian.com>
12500
12501         * reflection.c (mono_image_build_metadata): We also need to
12502         "fixup" the MethodImpl table after we computed the final method
12503         indices.  Call fixup_methodimpl() to do that.
12504         (fixup_methodimpl): New private method.
12505
12506 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
12507
12508         * assembly.c: special case mscorlib.dll (bug#72536),
12509         patch from Carlos Alberto Cortez.
12510
12511 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
12512
12513         * threads-types.h threads.c: Fix build bustage.
12514
12515         * threads.c: Use a union for long<->double conversions.
12516
12517         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
12518         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
12519
12520         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
12521         containing the checkpoint call with NOT_TAKEN.
12522         
12523         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
12524         checkpoint before pushing the arguments, so they won't have to be
12525         spilled to stack.
12526
12527 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
12528
12529         * domain.c, assembly.c, domain-internals.h: make some data
12530         const and relocation-free.
12531
12532 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
12533
12534         * object.c, appdomain.c, class-internals.h: introduce the
12535         MonoClassRuntimeInfo structure to hold the info needed to
12536         use a class at runtime. Made mono_class_vtable() lock-free
12537         for all the appdomains.
12538
12539 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
12540
12541         * metadata-internals.h, image.c: introduce a per-image mempool to
12542         be used for memory that has the same lifetime as the image.
12543
12544 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
12545
12546         * domain.c: In mono_init_internal(), instead of selecting the first
12547         runtime version supported by an executable, get a list of all
12548         supported versions and select the one for which an mscorlib exists
12549         (since even if the runtime supports a given version, it doesn't mean
12550         that the framework for that version is installed).
12551         Modified get_runtimes_from_exe to support this behavior.
12552         In supported_runtimes, added information about additional system
12553         assembly versions.
12554         
12555         * assembly.c: Added support for more than one system assembly version
12556         per runtime version. Updated the assembly list.
12557         In mono_assembly_remap_version, removed the initial version check,
12558         since we don't know to which version we need to compare until we
12559         get the version set on which the assembly is based.
12560         Moved the code for loading corlib into the new method
12561         mono_assembly_load_corlib(), so it can be used by the initialization
12562         code.
12563         
12564         * domain-internals.h: Updated data structures and added declaration
12565         for mono_assembly_load_corlib.
12566
12567 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
12568
12569         * reflection.c (resolve_object): Fix the creation of the signature in 
12570         the SignatureHelper case.
12571
12572         * assembly.c (mono_assembly_remap_version): Fix binary search.
12573         
12574 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
12575  
12576         * class.c: Added inheritance check when a method is overloaded (from a
12577         virtual method or when implementing an interface) and when a class is
12578         inherited. Added functions to set a failure for a class and to 
12579         retreive the exception from a failure.
12580         * class-internals.h: Added fields to MonoClass to keep the exception
12581         information status for inheritance (or other exceptions) to be thrown
12582         later (i.e. not at load time).
12583         * object.c: Throw the inheritance SecurityException when a type is to 
12584         be created with either class or method inheritance violations.
12585         * reflection.c|h: Fix when getting declsec from a class. Removed 
12586         unrequired code for class. Improved sanity in parameter naming.
12587         * security-manager.c|h: Added functions to check for class and method
12588         inheritance.
12589
12590 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
12591
12592         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
12593         and has_finalize in dynamic types as well.
12594
12595 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
12596
12597         * culture-info-table.h : fixed currency format for en-GB (and so on).
12598
12599 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
12600
12601         * gc.c: ensure the GC handles never have 0 as a value.
12602
12603 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
12604
12605         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
12606         a pointer to a struct to unmanaged code. Fixes #72625.
12607
12608 2005-02-16  Martin Baulig  <martin@ximian.com>
12609
12610         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
12611
12612 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
12613
12614         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
12615
12616 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
12617
12618         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
12619
12620         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
12621         UnmanagedFunctionPointerAttribute, use it for determining calling convention
12622         etc. Fixes #71471.
12623
12624         * reflection.c (mono_custom_attrs_get_attr): New helper function.
12625
12626         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
12627
12628 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
12629
12630         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
12631         changes to make the current context a field in MonoThread.
12632
12633 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
12634
12635         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
12636         the last change.
12637         
12638         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
12639         extracted from mono_marshal_get_native_wrapper.
12640
12641         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
12642         to create wrappers around native functions.
12643
12644         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
12645         delegates for arbitrary function pointers. Fixes #71472.
12646
12647 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
12648
12649         * threads.c: cleaned up the code a little.
12650
12651 2005-02-15  Martin Baulig  <martin@ximian.com>
12652
12653         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
12654         the data table.
12655
12656         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
12657         allocate larger chunks if needed.
12658
12659 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
12660
12661         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
12662         in by mistake.
12663
12664 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
12665
12666         * domain.c: keep the domains in an array and ensure the domain ids
12667         are kept small, so they can be used as indexes to domain-specific data
12668         with a small memory overhead.
12669
12670 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
12671
12672         * icall.c: Handle byref types in Type icalls. Fixes #72544.
12673
12674 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
12675
12676         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
12677
12678 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
12679
12680         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
12681
12682         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
12683         values.
12684
12685         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
12686         
12687 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
12688
12689         * domain-internals.h: add the hashtable here.
12690
12691         * class-internals.h: Remove `info' from MonoMethod
12692
12693         * domain.c: Add a new hashtable, jit_trampoline_hash
12694
12695 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
12696
12697         * object.c: don't set the value of static fields
12698         (fixes bug#72494).
12699
12700 2005-02-11  Martin Baulig  <martin@ximian.com>
12701
12702         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
12703         (mono_debug_add_method): Silently ignore the method if it's too big.
12704         (mono_debug_add_type): Likewise.
12705
12706 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
12707
12708         * threads.c, appdomain.c: remove #ifdefs from the code.
12709
12710 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
12711
12712         * metadata-internals.h: Added flags to MonoAssembly to cache the most
12713         common security informations. This allows us to stay in unmanaged code
12714         when doing LinkDemand and it's special cases (except for the first 
12715         time for initialization). The flags a very much used with --security.
12716         * reflection.c|h: Added code to get declarative security attributes 
12717         for LinkDemand and InheritanceDemand. This required to refactor the
12718         existing code for Demand.
12719         * security-manager.c|h: Added new method fields for the special cases
12720         of LinkDemand.
12721
12722 2005-02-10  Martin Baulig  <martin@ximian.com>
12723
12724         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
12725         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
12726
12727 2005-02-10  Martin Baulig  <martin@ximian.com>
12728
12729         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
12730         debugging code; this is almost a complete rewrite.
12731
12732         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
12733
12734 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
12735
12736         * domain.c, object.h: expose mono_string_equal () and 
12737         mono_string_hash ().
12738         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
12739         it's implemented in managed code.
12740
12741 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
12742
12743         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
12744         lo leak objects between appdomains.
12745
12746 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
12747
12748         * assembly.c: old compilers compilation fix from 
12749         robertj@gmx.net (Robert Jordan).
12750
12751 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
12752
12753         * class-internals.h: Little reminder for the future.
12754
12755         * debug-helpers.c: Fix up wrapper_type_names
12756
12757 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
12758
12759         * image.c, metadata-internals.h: when loading an image from a file,
12760         mmap all of it and use the same codepaths as when using a
12761         in-memory image: the code is simpler and we use less memory
12762         (both writable and readonly).
12763
12764 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
12765
12766         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
12767         API to alloc runtime data structures that need to be tracked by the
12768         GC and contain pointers.
12769         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
12770         make the code more readable and eventually use a different GC.
12771
12772 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
12773
12774         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
12775         for out arguments.
12776         
12777 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
12778
12779         * object.c: In release_type_locks(), don't release the cctor lock
12780         if it has already been released. This fixes a crash in the
12781         thread5 test.
12782
12783 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
12784
12785         * gc.c, marshal.c, icall.c: register a delegate for finalization
12786         only when the native function pointer has been allocated for it.
12787
12788 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
12789
12790         * object.c: cleaned up some code, allocate objects that are
12791         pointer free with the atomic malloc variant. Allocate memory
12792         for static data from the mempool if it's pointer-free.
12793         Allocate the bounds array at the end of the array data, when needed.
12794         * object-internals.h, object.h: move a private function in a private
12795         header.
12796         * class.c: handle missing case in tracking references in fields.
12797
12798 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
12799
12800         * class.c, class-internals.h: keep track if a type has
12801         reference fields in either the instance or static fields.
12802
12803 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
12804
12805         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
12806         and renamed to MonoRuntimeInfo. Added fields to store the expected
12807         framework assembly version. Changed mono_get_framework_version and
12808         mono_get_runtime_version for a single mono_get_runtime_info method.
12809         
12810         * assembly.c: Added method to remap system assembly versions to the
12811         current executing runtime version. Removed old mapping code.
12812         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
12813         
12814         * icall.c, reflection.c: Track api changes.
12815
12816 2005-02-06  Miguel de Icaza  <miguel@novell.com>
12817
12818         * loader.c (method_from_memberref): Improve error reporting,
12819         produce the class name instead of the typeref/typedef index. 
12820
12821 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
12822
12823         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
12824
12825 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
12826
12827         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
12828         stdcall and charset name mangling.  Reorganize the code and add
12829         some tracing stuff.
12830
12831 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
12832
12833         * monodiet.c: More iters!
12834
12835         * marshal.c: Iter usage.
12836
12837         * icall.c: Iter usage.
12838
12839         * object.c: Use iters.
12840
12841         * debug-helpers.c: More iters
12842
12843 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
12844
12845         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
12846         under win32.
12847
12848 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
12849
12850         * mono-debug-debugger.c: use iters
12851
12852         * class.c, class-internals.h: mono_class_setup_events is static
12853         now
12854
12855         * All callers: use iters
12856
12857 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
12858
12859         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
12860         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
12861
12862 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
12863
12864         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
12865
12866         * marshal.h: Add prototypes for ldfld/stfld_remote.
12867
12868         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
12869         this is called during startup.
12870         
12871 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
12872
12873         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
12874         MonoThreadsSync struct private in monitor.c. Changed the way
12875         MonoThreadsSync is allocated so it's faster and there is no
12876         need to keep track of it with a finalizer and it uses less memory.
12877         This also finally allows us to allocate mono objects as ptrfree when
12878         there are no reference fields.
12879
12880 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
12881
12882         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
12883         disappearing link to the GC interface and use them to simplify
12884         the gchandles code.
12885
12886 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
12887
12888         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
12889         stfld_remote which call mono_load/store_field_new. This allows methods
12890         calling ldfld/stfld wrappers to be AOTed.
12891
12892         * console-io.c: Include sys/filio.h under solaris.
12893         
12894         * console-io.c: Include curses.h if needed correctly.
12895
12896 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
12897         
12898         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
12899         method->klass as well.
12900
12901         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
12902
12903         * class.c (mono_class_init): Switch on lazy initialization of 
12904         methods.
12905
12906         * class.c (mono_class_get_finalizer): Handle the case when the 
12907         finalizer is inherited.
12908
12909 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12910
12911         * console-io.c: <curses.h> is needed by term.h on solaris.
12912
12913 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
12914
12915         * icall.c, class-internals.h, monodiet.c, class.c: Remove
12916         mono_class_setup_properties where possible. Remove this ftn from
12917         the header file, and make it static.
12918
12919 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
12920
12921         * loader.c: Add missing setup_... call.
12922
12923         * class.c: Add missing setup_... calls.
12924
12925         * class.c (mono_class_init): Switch on lazy initialization of 
12926         the generic vtable.
12927         
12928         * class.c (mono_class_init): Fix generics broken by the recent changes.
12929
12930         * monodiet.c (handle_type): Add missing setup_... calls.
12931
12932         * class.c: Back out garbage in previous patch.
12933         
12934         * class.c: Add missing setup_... calls.
12935
12936         * class.c (mono_class_get_method_from_name_flags): Avoid calling
12937         mono_class_setup_methods () if possible.
12938
12939         * class-internals.h (MonoClass): Add 'has_cctor' flag.
12940
12941         * class-internals.h (MonoCachedClassInfo): New structure.
12942
12943         * class.c: Initialize properties and events fields of MonoClass lazily.
12944
12945         * class.c: Add infrastructure for lazily initializing the methods and
12946         vtable fields of MonoClass. Not yet used.
12947
12948         * class.c (mono_class_get_finalizer): New helper function.
12949
12950         * class.c: Add infrastructure for loading some class related data from
12951         an AOT file.
12952
12953         * object.c: Add infrastructure for initializing the vtable from data
12954         in the AOT file.
12955
12956         * gc.c (run_finalize): Use mono_class_get_finalizer ().
12957
12958         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
12959         appropriate initialization function before accessing parts of the
12960         MonoClass structure.
12961
12962         * marshal.c: Fix warnings.
12963         
12964         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
12965
12966         * mono-debug-debugger.c (get_exception_message): Use 
12967         mono_class_get_method_from_name_flags ().
12968
12969 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
12970
12971         * reflection.c, appdomain.c: Replace a few manual searches that
12972         Zoltan missed. (Paolo approved this part of my initial patch).
12973
12974 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
12975
12976         * profiler.c: disable recording statistical events at report time.
12977
12978 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
12979
12980         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
12981         to byteswap arrays of enum values, too (bug #72080).
12982
12983 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
12984
12985         * appdomain.c (set_domain_search_path): Allow this to be called if
12986         domain->setup is not yet set.
12987
12988         * loader.c (mono_method_get_index): New helper function.
12989
12990         * loader.c reflection.c: Use mono_method_get_index ().
12991
12992         * class.c (mono_class_get_method_from_name_flags): New helper method.
12993
12994         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
12995         this.
12996
12997         * class.c (mono_class_get_cctor): New helper method.
12998
12999         * string-icalls.c object.c class.c marshal.c reflection.c: Use
13000         mono_class_get_method () to look up methods.
13001
13002 2005-02-01  Miguel de Icaza  <miguel@novell.com>
13003
13004         * console-io.c: Fix the build, this should work on Windows.
13005
13006 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
13007
13008         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
13009         be set to null to keep things valid
13010
13011 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13012
13013         * icall.c: added Console 2.0 icalls.
13014         * Makefile.am: added console-io.[ch]
13015         * console-io.[ch]: internal calls for Console 2.0 API.
13016
13017 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
13018
13019         * class.c: make sure we consider all the interfaces
13020         when calculating max_interface_id (bug found by
13021         Jeroen Frijters running ikvm).
13022
13023 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
13024
13025         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
13026         valuetype fields to null.
13027
13028         * object.c (set_value): Ditto. Fixes #71669.    
13029
13030 2005-01-31  Martin Baulig  <martin@ximian.com>
13031
13032         * metadata.c (mono_metadata_has_generic_params): New public
13033         function; checks whether something is a generic method.
13034
13035 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
13036
13037         * appdomain.c: fix infinite recursion when adding assemblies.
13038
13039 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
13040
13041         * object.c: Fix small typo to return all items for Environment.
13042         GetCommandLineArgs.
13043
13044 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
13045
13046         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
13047         reflection.c: more domain and assembly-unload related fixes
13048         and memory leaks plugs.
13049
13050 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
13051
13052         * class.c loader.c security.c loader.h process.c threads.c mono-debug-debugger.c profiler.c marshal.c rand.cpedump.c: Fix 64 bit warnings.
13053
13054 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
13055
13056         * loader.c (mono_method_signature): Make this method lazy
13057         (mono_get_method_from_token): Don't computate the signature here.
13058
13059         Doing this saves quite a bit of memory. I got 90 kb on starting up
13060         monodoc. It should also save some disk reads on startup.
13061
13062         * *: MonoMethod->signature might be NULL now. You *MUST* use
13063         mono_method_signature.
13064
13065 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
13066
13067         * object.c (mono_runtime_get_main_args): Return an array from the
13068         current domain here. Fixes #71938.
13069
13070 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
13071
13072         * monitor.c: formatting changes to comply with the
13073         mono coding style and remove #ifdefs from the code.
13074
13075 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
13076
13077         * metadata.c, private.h: remove some unneeded data
13078         and use a more compact representation for table schemas.
13079
13080 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
13081
13082         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
13083         to get a better distribution in hash tables.
13084         * *.c: use mono_aligned_addr_hash() where appropriate.
13085         * assembly.c: make var static.
13086
13087 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
13088
13089         * domain-internals.h: Put MonoJitInfo on a diet.
13090
13091         * domain.c: Fix a warning.
13092
13093 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
13094
13095         * gc.c: rework the gc handles code to reuse handles
13096         when freed.
13097
13098 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
13099
13100         * domain.c: fixed long standing bug in mono_string_equal() which
13101         was brought to light with the ldstr changes.
13102
13103 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
13104
13105         * reflection.c: Remove warning by adding missing include for marshal.h
13106
13107 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
13108
13109         * domain.c, object.c: change the ldstr_table to hold
13110         MonoString* as keys: makes the runtime isinterned lookup
13111         faster and simplifies memory management.
13112
13113 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
13114  
13115         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
13116         possible to add imperative security checks before calling the icall.
13117         * reflection.c: Return security attributes on the original MonoMethod
13118         (and not the wrapped one). This fix permissions on icalls.
13119
13120 2005-01-25  Dick Porter  <dick@ximian.com>
13121
13122         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
13123         the check for mktime() support actually test the mktime() return
13124         value.  "Fixes" bug 71682, though the output is still different to
13125         MS.
13126
13127 2005-01-25  Martin Baulig  <martin@ximian.com>
13128
13129         * class.c (mono_class_is_assignable_from): Make this work for
13130         generic instances.
13131
13132 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
13133
13134         * marshal.c (mono_string_utf8_to_builder)
13135         (mono_string_builder_to_utf16): We might not have ownership of the
13136         string. In thise case, we need to create a new buffer.
13137
13138         * object-internals.h (mono_stringbuilder_capacity): sb->str might
13139         be null, in which case, use the default capacity.
13140
13141 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
13142
13143         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
13144         GC events to the profiler.
13145
13146 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
13147
13148         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
13149         if you don't want the GC to run.
13150
13151 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
13152
13153         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
13154         start providing a GC API and keeping different implementations in
13155         their own file.
13156         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
13157
13158 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
13159
13160         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
13161         mmap rather than allocating a huge buffer.
13162         (mono_debug_close_mono_symbol_file): Free the buffer allocated
13163         above.
13164
13165 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
13166
13167         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
13168         and CheckExecutionRights.
13169         * reflection.c|h: Keep the index of the declarative security to be 
13170         used, instead of the pointer, when AOT compiler is used. Also add 
13171         class initialization when requesting demands.
13172         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
13173         CheckExecutionRights. Both properties are now FALSE by default, and
13174         unmodifiable, unless the --security option is used.
13175
13176 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
13177
13178         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
13179         reflection.c: properly refcount images and assemblies, many leaks fixed.
13180
13181 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13182
13183         * threadpool.c: increase the timeout for threads in the thread pool to
13184         10s.  Fixes bug #67159.
13185
13186 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
13187
13188         * class-internals.h: Sun's compiler insists on explicit
13189         signed on bit fields to handle then correctly.
13190
13191 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
13194         Make the size of the array fit only the number of invalid path
13195         chars that we have.
13196
13197         * class.c (_mono_class_get): Improve the error reporting when a
13198         class referenced is not found, to assist debugging. 
13199
13200 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
13201
13202         * threads.c: fix off-by-one error.
13203         * domain.c: free data allocated in the domain.
13204
13205 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
13206
13207         * reflection.c (mono_method_body_get_object): Fill out exception info
13208         as well.
13209
13210         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
13211         structure.
13212         
13213 2005-01-19  Martin Baulig  <martin@ximian.com>
13214
13215         * loader.c (mono_get_method_constrained): Make this work again.
13216
13217 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
13218
13219         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
13220         guint16 to match the managed side.
13221
13222         * reflection.c (mono_reflection_body_get_object): Fill out local
13223         variables array.
13224
13225         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
13226         as well.
13227
13228         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
13229         'local_var_sig_token'.
13230
13231 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
13232
13233         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
13234         System.Drawing.
13235
13236         * reflection.c (mono_method_body_get_object): Handle abstract and
13237         runtime methods.
13238
13239 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
13240
13241         * marshal.c, loader.c, class-internals.h, reflection.c:
13242         store the emthod data for a wrapper in an array instead of a list.
13243
13244 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
13245
13246         * marshal.c: change the code to allocate memory more
13247         conservatively for method wrappers.
13248
13249 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
13250
13251         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
13252         fields from MonoClass to the marshal info structure where they belong.
13253
13254 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
13255
13256         * class.c, object.c, class-internals.h, marshal.c: rearrange
13257         some fields and tweak some types to lower memory usage.
13258
13259 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
13260
13261         * threads.c (signal_thread_state_change): Handle the case when the
13262         target thread is the current thread.
13263
13264         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
13265
13266         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
13267         emit_ptr_to_object_conv. 
13268
13269         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
13270         marshalling. Fixes #71352.
13271
13272 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
13273
13274         * metadata.h, blob.h: move table enum to blob.h so it can be included
13275         in any header.
13276         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
13277         cut the size of MonoImage/MonoDynamicImage.
13278
13279 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
13280
13281         * profiler.c (mono_profiler_install_simple): Fix default arguments.
13282
13283 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
13284
13285         * reflection.c, reflection.h, icall.c: add a function to check
13286         if an attribute type is defined for a metadata object.
13287
13288 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
13289
13290         * object-internals.h: Added some needed fields from StringBuilder class.
13291         * marshal.c: Set the maxCapacity when creating a StringBuilder.
13292
13293 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
13294
13295         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
13296         threads before shutting down the runtime.
13297
13298         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
13299
13300 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
13301
13302         * object-internal.h, threads.c: implement stacksize and 
13303         parameterized thread start functionality (requires
13304         matching corlib). Marked broken code for later removal.
13305
13306 2005-01-12  Martin Baulig  <martin@ximian.com>
13307
13308         * class-internals.h (MonoGenericClass): Moved the `initialized'
13309         flag to MonoDynamicGenericClass, removed `init_pending'.
13310         (MonoGenericInst): Added `is_reference' flag.
13311
13312 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
13313
13314         * reflection.c (mono_image_create_pefile): Only set the pe_offset
13315         inside the MSDOS header. Fixes #71201.
13316
13317         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
13318         gc thread.
13319         (mono_domain_finalize): Ditto.
13320
13321 2005-01-12  Martin Baulig  <martin@ximian.com>
13322
13323         * class.c (mono_get_shared_generic_class): Use the cache for
13324         non-dynamic generic classes.
13325
13326         * class-internals.h (mono_class_create_generic_2): Removed
13327         function prototype, this function is now static inside class.c.
13328
13329         * class.c (mono_class_create_generic_2): Made this static, only
13330         call it from mono_class_init() and mono_class_setup_parent().
13331         (collect_implemented_interfaces_aux): Call mono_class_init() on
13332         the interfaces we collect.
13333         (mono_class_setup_vtable): Call mono_class_init (class->parent).
13334
13335 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
13336
13337         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
13338         it a real thread handle.
13339
13340         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
13341         MonoJitExceptionInfo, since each catch clause needs its own variable.
13342         
13343 2005-01-11  Dick Porter  <dick@ximian.com>
13344
13345         * image.c (mono_pe_file_open): New variant on mono_image_open()
13346         that does not set up the CLI metadata; used for FileVersionInfo so
13347         it can get the data for windows binaries too.
13348         
13349         * process.c (process_read_string_block): Don't read off the end of
13350         the StringTable block.
13351
13352         These both fix bug 70766.
13353
13354 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
13355
13356         * gc.c: set some fields to NULL at GC cleanup time.
13357         * threads.c: if we quit the main thread, call exit ().
13358
13359 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
13360
13361         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
13362
13363 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
13364
13365         * threads.h, threads.c, object.c: added accessor and settor for
13366         main_thread. Handle it specially when exiting from it: wait
13367         for other foreground threads to exit.
13368
13369 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
13370
13371         * process.c, verify.c: remove some bloat.
13372
13373 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
13374
13375         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
13376         the calling convention to cdecl under win32.
13377
13378 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
13379
13380         * object.c (mono_object_get_size): New function to get the size of
13381         an object instance.
13382
13383         * profiler.c (simple_allocation): Use above.
13384
13385 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
13386
13387         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
13388         ves_icall_System_AppDomain_getRootDomain (as it's not required to
13389         get an appdomain by it's id and we can't assume the root's id is 0).
13390         * domain-internals.h: Change the function prototype to match.
13391         * icall.c: Change the icall table for AppDomain.
13392
13393 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13394
13395         * locales.c (string_invariant_compare_char): Only compute
13396         GUnicodeTypes in the case where we need them.  Test for ordinality
13397         first and return if so.
13398
13399         From the commit:
13400
13401                 /*
13402                  * FIXME: here we must use the information from c1type and c2type
13403                  * to find out the proper collation, even on the InvariantCulture, the
13404                  * sorting is not done by computing the unicode values, but their
13405                  * actual sort order.
13406                  */
13407
13408 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
13409
13410         * loader.c: for P/Invoke methods, allow the "Internal" shared
13411         library name to refer to the calling process symbol namespace.
13412
13413 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
13414
13415         * Makefile.am: Add the security manager to the build.
13416         * security-manager.c|h: New. Initialization of the security manager.
13417
13418 2005-01-07  Dick Porter  <dick@ximian.com>
13419
13420         * threads.c: 
13421         * monitor.c: Update thread state during Monitor and WaitHandle
13422         waits.  Fixes bug 71031.
13423
13424 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
13425
13426         * reflection.c (property_encode_signature): Correctly handle when the
13427         property has no methods.
13428
13429 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
13430
13431         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
13432         
13433         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
13434         fields from mb, not rmb. Fixes #71017.
13435
13436         * marshal.c (emit_ptr_to_str_conv): Add support for 
13437         ByValTStr -> string conversion. Fixes #71015.
13438
13439         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
13440
13441         * mempool.c (mono_mempool_contains_addr): New helper function.
13442
13443 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
13444
13445         * metadata.c (mono_metadata_compute_size): Fix size calculation of
13446         HasSematics encoded fields.
13447         
13448         * metadata.c (mono_type_to_unmanaged): Improve error message for 
13449         invalid string marshalling.
13450
13451         * metadata.c: Fix warnings.
13452         
13453 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
13454
13455         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
13456         profiler support.
13457
13458 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
13459
13460         * domain.c object.c domain-internals.h: Revert part of r38077 since the
13461         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
13462         tests.
13463
13464 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
13465
13466         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
13467         so methods containing these can be AOTed.
13468
13469 2005-01-03  Martin Baulig  <martin@ximian.com>
13470
13471         * loader.c (find_method): Removed the hack for generic instances.
13472         (method_from_memberref): If our parent is a generic instance, pass
13473         its generic type definition to find_method() and then inflate the
13474         method.
13475         (mono_get_method_constrained): Pass the generic type definition to
13476         find_method() and inflate the method later.
13477
13478         * class-internals.h (MonoStats): Added `generic_class_count'.
13479
13480         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
13481         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
13482
13483         * reflection.c (mono_custom_attrs_from_params): Don't ignore
13484         generic type definitions.
13485
13486 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
13487
13488         * loader.c icall.c: Fix warnings.
13489
13490 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
13491
13492         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
13493         blittable types. Fixes #70864.
13494
13495 2004-12-29  Martin Baulig  <martin@ximian.com>
13496
13497         * icall.c
13498         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
13499
13500         * reflection.c (mono_method_get_object): Create a
13501         "System.Reflection.MonoGenericMethod" for inflated methods; don't
13502         call mono_get_inflated_method().
13503
13504         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
13505
13506 2004-12-27  Martin Baulig  <martin@ximian.com>
13507
13508         * class-internals.h (MonoMethod): Added `is_inflated' flag.
13509         (MonoMethodInflated): Added `inflated' field.
13510
13511         * class.c (mono_class_inflate_generic_method): Don't really
13512         inflate the method here; just set the `is_inflated' flag in the
13513         MonoMethod.
13514         (mono_class_get_inflated_method): Actually inflate the method here
13515         if it's not already inflated; we use the MonoMethodInflated's new
13516         `inflated' field as a cache.
13517
13518 2004-12-26  Martin Baulig  <martin@ximian.com>
13519
13520         * class.c
13521         (inflate_generic_class): Moved some code out of inflate_generic_type().
13522         (mono_class_inflate_generic_method): If we're already inflated,
13523         inflate the context and use the declaring method; ie. make sure
13524         the declaring method of an inflated method is always the generic
13525         method definition.
13526         (mono_class_create_from_typedef): Create
13527         `class->generic_container->context->gclass'.
13528
13529 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
13530
13531         * metadata-internals.h, marshal.c, reflection.c: More
13532         MonoGHashTable->GHashTable.
13533
13534         * domain-internals.h, class.c: Change MonoGHashTable's into
13535         GHashTables for some cases where no gc stuff is used
13536
13537         All users: update apis
13538
13539 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
13540
13541         * metadata.c (builtin_types): Make this `const'. Makes this get
13542         put into the shareable section.
13543         (mono_metadata_init): Casts to make gcc happy.
13544
13545 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
13546
13547         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
13548
13549 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
13550
13551         * icall.c: Added an internal call to retrieve the position and length
13552         of assembly-level declarative security attributes (RequestMinimum, 
13553         RequestOptional and RequestRefuse). This is used by the Assembly class
13554         to re-create the corresponding permission sets.
13555
13556 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
13557
13558         * marshal.c: fix the stelemref wrapper to be type correct
13559         (and faster).
13560
13561 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
13562
13563         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
13564         to do key & 0x7fffffff. Hashtable already does this. It just
13565         results in longer code.
13566
13567 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
13568
13569         * appdomain.c: Bump corlib version.
13570         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
13571         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
13572         * reflection.c|h: Add functions to get declarative security infos
13573         (blob position and length) for assemblies, classes and methods.
13574
13575 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
13576
13577         * reflection.c: sort the constant table (bug #70693).
13578
13579 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
13580
13581         * object-internals.h, threads.c, domain.c: add accessors for
13582         the MonoThread and MonoDomain tls keys.
13583
13584 2004-12-18  Martin Baulig  <martin@ximian.com>
13585
13586         * class.c (inflate_generic_type): If we're inflating a generic
13587         instance, set `ngclass->context->container = context->container';
13588         ie. the container we inflated into.
13589
13590         * metadata.c (mono_metadata_parse_generic_param): Reflect above
13591         inflate_generic_type() changes.
13592
13593 2004-12-17  Martin Baulig  <martin@ximian.com>
13594
13595         * class-internals.h
13596         (MonoGenericClass): Replaced `MonoType *generic_type' with
13597         `MonoClass *generic_class'.  Removed `dynamic_info'; if
13598         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
13599         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
13600
13601 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
13602
13603         * exception.c (mono_exception_from_token): New helper function.
13604
13605 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
13606
13607         * assembly.c (mono_assembly_load_with_partial_name): Call 
13608         mono_assembly_loaded before invoking the preload hooks. Fixes
13609         #70564.
13610
13611         * object-internals.h (MonoThread): Change culture_info and 
13612         ui_culture_info into an array.
13613
13614         * threads.c: Cache culture info objects from more than one appdomain.
13615
13616         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
13617         current UI culture.
13618
13619 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
13620
13621         * threads.h threads.c appdomain.c: Clear the culture_info field of
13622         all threads during unloading if they point to an object in the dying
13623         appdomain.
13624
13625 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
13626
13627         * culture-info.h (TextInfoEntry): New struct
13628         * object-internals.h: sync with managed
13629         * locales.c: fill the `text_info_data' field
13630         * culture-info-tables.h: update
13631
13632 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
13633
13634         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
13635         collector.
13636
13637 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
13638
13639         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
13640         (ves_icall_ModuleBuilder_getMethodToken): Ditto
13641
13642 2004-12-12  Martin Baulig  <martin@ximian.com>
13643
13644         * mono-debug-debugger.c (write_type): If we're an enum and the
13645         builtin types have already been initialized, call mono_class_init().
13646
13647 2004-12-11  Martin Baulig  <martin@ximian.com>
13648
13649         * metadata.c (mono_metadata_load_generic_params): Added
13650         `MonoGenericContainer *parent_container' argument; automatically
13651         compute `container->is_method'; pass the correct owner to
13652         get_constraints().      
13653
13654         * reflection.c (compare_genericparam): Sort the GenericParam table
13655         according to increasing owners. 
13656
13657 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
13658
13659         * profiler.c: allow disabling the default profiler.
13660
13661 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
13662
13663         * decimal.c, icall.c: allow disabling System.Decimal support.
13664
13665 2004-12-09  Marek Safar <marek.safar@seznam.cz>
13666
13667         * reflection.c: Add support for null attribute arguments.
13668
13669 2004-12-09  Martin Baulig  <martin@ximian.com>
13670
13671         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
13672         names to get rid of compiler warnings.
13673
13674 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
13675
13676         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
13677         mono_marshal_load_type_info (). Fixes #69625.
13678         (mono_marshal_get_ptr_to_struct): Likewise.
13679
13680 2004-12-08  Martin Baulig  <martin@ximian.com>
13681
13682         * mono-debug.h: Bumped version number to 47.
13683
13684         * mono-debug-debugger.c
13685         (mono_debugger_event_handler, mono_debugger_event): Take two
13686         guint64 arguments insteed of a gpointer and a guint32.  
13687
13688 2004-12-08  Martin Baulig  <martin@ximian.com>
13689
13690         * debug-mono-symfile.h
13691         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
13692         `address' to `native_offset'.
13693
13694 2004-12-08  Martin Baulig  <martin@ximian.com>
13695
13696         * class.c (mono_class_create_from_typespec): Only inflate if we
13697         either have `context->gclass' or `context->gmethod'.
13698
13699 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
13700
13701         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
13702
13703         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
13704
13705         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
13706
13707         * reflection.c (mono_assembly_get_object): Remove the workaround put
13708         in for the release.
13709         
13710         * appdomain.c: Use the corlib_internal field from MonoAssembly.
13711
13712         * appdomain.c: Bump corlib version.
13713
13714         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
13715         be visible in other appdomains.
13716
13717 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
13718
13719         * threads.c: Interlocked inc and dec for longs were messed up,
13720         use a KISS based impl for this. Fixes 70234
13721
13722 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
13723
13724         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
13725
13726 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
13727
13728         * icall.c: fix to follow policy not to allow struct
13729         arguments in icalls.
13730
13731 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13732
13733         * process.c: make the patch that handles spaces in file paths work
13734         on mono/windows too.
13735
13736 2004-12-06  Martin Baulig  <martin@ximian.com>
13737
13738         * class.c (mono_class_create_generic): Call
13739         mono_class_setup_supertypes() if we're dynamic.
13740         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
13741
13742 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
13743
13744         * object-internals.h: Add new fields to MonoThread.
13745
13746         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13747
13748         * icall.c threads-types.h threads.c: Add new icalls.
13749
13750         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
13751
13752         * object-internals.h (MonoReflectionAssembly): Sync object layout with
13753         managed side.
13754
13755         * appdomain.c: Bump corlib version.
13756
13757         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
13758         internal assemblies. Fixes #69181.
13759
13760 2004-12-05  Martin Baulig  <martin@ximian.com>
13761
13762         * class.c (mono_class_inflate_generic_signature): Make this a
13763         no-op if `context' is NULL or we don't have any type parameters;
13764         also copy `sentinelpos'.        
13765
13766 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
13767
13768         * image.c: Add unbox_wrapper_cache.
13769
13770         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
13771
13772         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
13773         function generator.
13774         
13775         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
13776         Fixes #70173.
13777
13778         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
13779         
13780 2004-12-04  Martin Baulig  <martin@ximian.com>
13781
13782         * loader.c (mono_method_get_signature_full): New public function;
13783         like mono_method_get_signature(), but with an additional
13784         `MonoGenericContext *' argument.
13785
13786         * class.c (mono_class_inflate_generic_signature): Formerly known
13787         as inflate_generic_signature(); make this public.
13788
13789 2004-12-04  Martin Baulig  <martin@ximian.com>
13790
13791         * metadata.c
13792         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
13793         instead of a `MonoGenericContainer *'.  
13794         (mono_metadata_parse_array_full): Likewise.
13795         (mono_metadata_parse_signature_full): Likewise.
13796         (mono_metadata_parse_method_signature_full): Likewise.
13797         (mono_metadata_parse_generic_inst): Likewise.
13798         (mono_metadata_parse_generic_param): Likewise.
13799         (mono_metadata_parse_mh_full): Likewise.
13800         (mono_type_create_from_typespec_full): Likewise.
13801
13802 2004-12-03  Martin Baulig  <martin@ximian.com>
13803
13804         * class-internals.h (MonoGenericContainer): Replaced the
13805         `MonoGenericContext * pointer with a `MonoGenericContext'
13806         structure and made it the first element.
13807
13808 2004-12-03  Martin Baulig  <martin@ximian.com>
13809
13810         * class.c
13811         (inflate_generic_type): Set the `context->container' when creating
13812         a new MonoGenericContext.
13813         (mono_class_inflate_generic_method): Likewise.
13814         (mono_class_create_from_typespec): Just use `context->container'
13815         to get the container.
13816
13817         * loader.c (method_from_methodspec): Set `context->parent' from
13818         `context->container' - and if that's a method container, use its
13819         parent.  Also set the `context->container' when creating a new
13820         MonoGenericContext.
13821         (mono_get_method_from_token): Use just `context->container' to get
13822         the container.
13823
13824         * metadata.c (do_mono_metadata_parse_generic_class): Also set
13825         `gclass->context->container'.
13826
13827         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
13828         the `context->container' when creating a new MonoGenericContext.
13829
13830 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
13831
13832         * reflection.c (compare_genericparam): Sort params with identical
13833         owner by their number. Fixes gen-111 on sparc.
13834
13835 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
13836
13837         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
13838         around the domain changes.
13839
13840         * appdomain.c (mono_domain_unload): Handle the case when the thread
13841         calling Unload is itself being aborted during unloading. Fixes #70022.
13842
13843         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
13844
13845         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
13846         checkpoint_func as an icall so it gets a wrapper.
13847         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
13848         in the cross-appdomain wrappers too.
13849
13850         * threads.c (mono_thread_has_appdomain_ref): Make this public.
13851
13852         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
13853
13854         * reflection.c: Fix some memory leaks.
13855         
13856 2004-12-02  Martin Baulig  <martin@ximian.com>
13857
13858         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
13859
13860         * metadata.c (generic_class_cache): New static hashtable.
13861         (mono_metadata_lookup_generic_class): New public method.
13862
13863 2004-12-02  Martin Baulig  <martin@ximian.com>
13864
13865         * class.c (mono_class_create_from_typedef): Call
13866         mono_class_setup_parent() and mono_class_create_mono_type() before
13867         parsing the interfaces.
13868
13869 2004-12-02  Martin Baulig  <martin@ximian.com>
13870
13871         * metadata.c (generic_inst_cache): New static hashtable.
13872         (mono_metadata_lookup_generic_inst): New public function.
13873         (mono_metadata_inflate_generic_inst): New public function.
13874         (mono_metadata_parse_generic_inst): New public function.
13875         (do_mono_metadata_parse_generic_class): Use the new
13876         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
13877         since this'll also use the cache.
13878
13879         * reflection.c (mono_reflection_bind_generic_method_parameters):
13880         Use mono_metadata_lookup_generic_inst() to use the new cache.
13881
13882         * class.c (inflate_mono_type): Use
13883         mono_metadata_inflate_generic_inst() to inflate a generic
13884         instance; this'll also use the new cache.
13885
13886         * loader.c (method_from_methodspec): Use
13887         mono_metadata_parse_generic_inst() and
13888         mono_metadata_inflate_generic_inst() rather than parsing it
13889         manually, so we can use the new cache.
13890
13891 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
13892
13893         * threads.c (wait_for_tids): Do not incorrectly free threads when 
13894         the wait times out.
13895
13896 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
13897
13898         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
13899         iter->args based on whether parameters are passed in registers (i.e.
13900         MONO_ARCH_REGPARMS is defined)
13901
13902 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
13903
13904         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
13905         the exception message. Fixes #70070.
13906         (method_from_methodspec): Fix warnings.
13907
13908 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13909
13910         * process.c: (complete_path) return the path quoted
13911
13912 2004-12-01  Martin Baulig  <martin@ximian.com>
13913
13914         * class-internals.h (MonoGenericInst): New structure.
13915         (MonoGenericClass): Replaced `type_argc', `type_argv' and
13916         `is_open' with `MonoGenericInst *inst'.
13917         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
13918         `is_open' with `MonoGenericInst *inst'.
13919
13920 2004-11-30  Martin Baulig  <martin@ximian.com>
13921
13922         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
13923
13924         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
13925         to `generic_class_cache'.
13926
13927         * metadata.c
13928         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
13929         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
13930         (mono_generic_inst_is_valuetype): Renamed to
13931         mono_generic_class_is_valuetype().
13932
13933         * class-internals.h
13934         (MonoGenericInst): Renamed to MonoGenericClass.
13935         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
13936         (MonoClass): Renamed `generic_inst' to `generic_class'.
13937         (MonoGenericContext): Renamed `ginst' to `gclass'.
13938
13939         * object-internals.h
13940         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
13941
13942         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
13943         mono_reflection_generic_class_initialize().
13944
13945         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
13946         now known as "System.Reflection.MonoGenericClass".
13947         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
13948
13949 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
13950
13951         * class-internals.h: Added a flag field to MonoClass to cache the
13952         declarative security attributes actions associated with the class.
13953         * domain-internals.h: Added booleans to MonoJitInfo to cache the
13954         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
13955         applicable to the JITted method.
13956         * reflection.c|h: Added functions to extract (as flags) which security
13957         actions are available (declaratively) for a method, class or assembly.
13958         * metadata.c|h: Added functions to search the declarative security
13959         table in the metadata.
13960         
13961 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
13962
13963         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
13964         EXPORTEDTYPES are already in the class name cache, so there is no
13965         need to add extra code here to look at them. Just removes a bit of
13966         cruft.
13967
13968         (ves_icall_System_Environment_get_TickCount): No need for #if
13969         WINDOWS. We already have the code in io-layer.
13970
13971 2004-11-28  Martin Baulig  <martin@ximian.com>
13972
13973         * loader.c
13974         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
13975         Fixes gen-112.cs.
13976
13977 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
13978
13979         * assembly.c (do_mono_assembly_open): Instead of having a
13980         conditional WITH_BUNDLE, incorporate support for bundles here, by
13981         having a global `bundles' variable holding a pointer to the actual
13982         bundles. 
13983
13984         (mono_register_bundled_assemblies): New API call used by the
13985         bundle code. 
13986
13987         See mkbundle.1 for details.
13988         
13989 2004-11-27  Martin Baulig  <martin@ximian.com>
13990
13991         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
13992         the vtable for generic methods.
13993
13994 2004-11-26  Martin Baulig  <martin@ximian.com>
13995
13996         * metadata.c
13997         (mono_metadata_generic_method_hash): New public function.
13998         (mono_metadata_generic_method_equal): Likewise.
13999
14000         * class-internals.h
14001         (MonoGenericContainer): Added `GHashTable *method_hash'.
14002
14003         * reflection.c (ReflectionMethodBuilder): Added
14004         `MonoGenericContainer *generic_container'.
14005         (reflection_methodbuilder_to_mono_method): Don't create a new
14006         MonoGenericContainer each time we're called.
14007         (mono_reflection_bind_generic_method_parameters): Use
14008         `container->method_hash' to cache the results so we don't create a
14009         different method if we're called several times with the same
14010         arguments.
14011
14012         * loader.c (method_from_methodspec): Use the new
14013         `container->method_hash' here, too.
14014
14015 2004-11-26  Martin Baulig  <martin@ximian.com>
14016
14017         * class.c (inflate_generic_signature): Correctly compute
14018         `res->has_type_parameters'.
14019         (mono_class_vtable): Use the `has_type_parameters' flag to
14020         determine whether we're a generic method.
14021
14022         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
14023
14024 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
14025
14026         * object.c (mono_runtime_run_main): Fix a small memory leak.
14027
14028 2004-11-25  Martin Baulig  <martin@ximian.com>
14029
14030         * class.c (set_generic_param_owner): Fixed the loop.
14031
14032 2004-11-25  Martin Baulig  <martin@ximian.com>
14033
14034         * object.c (mono_class_vtable): Don't create any JIT wrappers for
14035         generic methods.
14036
14037 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
14038
14039         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
14040         names. Fixes #69787.
14041
14042 2004-11-24  Martin Baulig  <martin@ximian.com>
14043
14044         * class.c (mono_class_create_generic_2): If we don't have a
14045         `ginst->parent', inflate `gklass->parent' to get our parent.
14046
14047 2004-11-24  Martin Baulig  <martin@ximian.com>
14048
14049         * reflection.c (compare_genericparam): Correctly sort the
14050         GenericParam table; fixes #69779.
14051
14052 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
14053
14054         * reflection.c: When writing a PE file, don't create a huge
14055         buffer in memory. Just write the arrays we have to the file.
14056         This reduces memory usage.
14057
14058         * metadata-internals.h: MonoDynamicStream pefile is no longer used
14059         globally.
14060
14061 2004-11-17  Martin Baulig  <martin@ximian.com>
14062
14063         * class.c (mono_class_init): Don't setup `class->parent' for
14064         dynamic instances; moved this to mono_class_generic_2().
14065         (mono_class_create_generic): Also set `klass->inited' for dynamic
14066         generic instances.
14067         (mono_class_create_generic_2): Don't do anything for dynamic
14068         generic instances.  Set `klass->parent' here and also call
14069         mono_class_setup_parent() here. 
14070
14071         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
14072         `MonoType *parent' argument; set `ginst->parent' before calling
14073         mono_class_create_generic_2(), so we set the correct parent.
14074
14075 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
14076
14077         * reflection.c: allow getting attributes from ModuleBuilder
14078         (used by ikvm).
14079
14080 2004-11-17  Martin Baulig  <martin@ximian.com>
14081
14082         * class.c (mono_class_create_from_typedef): If a type parameter is
14083         inherited from an outer class, set its owner to that class.
14084
14085 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
14086
14087         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
14088           for (int*) written size. This fixes bug #69592.
14089
14090 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
14091
14092         * icall.c: Added IsAuthenticodePresnet internal call.
14093         * image.c|h: New function that check a MonoImage for an Authenticode
14094         signature in the certificate PE data directory.
14095         * security.c|h: New internal call to ask the runtime if an 
14096         Authenticode signature seems referenced in the PE header.
14097
14098 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
14099
14100         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
14101
14102         * reflection.c (mono_image_create_pefile): Free the assembly streams
14103         after writing out the assembly file.
14104
14105         * object.c (mono_runtime_run_main): Fix small memory leak.
14106
14107         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
14108         property access modifiers. Fixes #69389.
14109
14110 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
14111
14112         * domain.c, object.c, object-internals.h, domain-internals.h,
14113         object.h, marshal.c: keep dynamic code info per domain.
14114
14115 2004-11-15  Martin Baulig  <martin@ximian.com>
14116
14117         * class.c (mono_type_get_name_recurse): Put type arguments in
14118         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
14119         see bug #68387.
14120
14121 2004-11-15  Martin Baulig  <martin@ximian.com>
14122
14123         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
14124         (mono_class_setup_vtable): When computing `the_cname' for a
14125         generic instance, don't include the namespace since we'd otherwise
14126         add it twice.
14127
14128 2004-11-15  Martin Baulig  <martin@ximian.com>
14129
14130         * class.c (mono_class_create_generic): Changed return type to void.
14131         (mono_class_create_generic_2): New public function; setup
14132         `class->method', `class->field' and `class->interfaces' here
14133         instead of in mono_class_init().
14134
14135         * class.h (mono_class_create_generic): Moved to class-internals.h.
14136
14137 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14138
14139         * reflection.c (mono_image_create_pefile): take a file HANDLE.
14140         rather than writing to memory, write to this file. Right now,
14141         we are just writting into a buffer, and copying that. However
14142         we can avoid the buffer later.
14143
14144         (mono_dynamic_stream_reset): new function
14145
14146         * icall.c, object-internals.h: update for the above.
14147
14148 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
14149
14150         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
14151         have been using gc'd memory. First it is slower, unlikely
14152         the comment in the source code said, secondly, it increases
14153         our footprint to do it in the gc.
14154
14155         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
14156         the method so that it does not have to copy to managed code.
14157
14158 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
14159
14160         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
14161
14162 2004-11-12  Martin Baulig  <martin@localhost>
14163
14164         * reflection.c (mono_image_create_token): Allow generic method
14165         definitions here, since they may appear in an `.override'; see
14166         gen-98/gen-99 for an example.
14167
14168 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
14169
14170         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
14171         #69365.
14172
14173         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
14174         descriptive.
14175
14176 2004-11-11  Martin Baulig  <martin@ximian.com>
14177
14178         * class.c (mono_class_setup_vtable): In an explicit interface
14179         implementation, the method name now includes the arity.
14180
14181 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
14182
14183         * object.c (mono_array_full_copy): Fix warning.
14184
14185 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
14186
14187         * appdomain.c: Removed look_for_method_by_name(). Use the new method
14188         mono_class_get_method_from_name() instead.
14189         
14190         * class-internals.h: Added two new types of wrappers. 
14191         Added MonoRemotingTarget enum. Added new trampoline function type, which
14192         takes an additional MonoRemotingTarget value as parameter, so it is
14193         possible to request a trampoline for a specific target.
14194         
14195         * class.c: Added new mono_class_get_method_from_name() method.
14196         
14197         * class.h: In MonoRemoteClass, we can have now to vtables, one for
14198         general remoting sinks and one specific for cross domain calls.
14199         
14200         * debug-helpers.c: Added new wrapper names.
14201         
14202         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
14203         of a remote class.
14204         
14205         * image.c: Porperly delete value objects form the remoting invoke hashtable.
14206         
14207         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
14208         with several other methods (mono_marshal_get_xappdomain_dispatch,
14209         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
14210         and others) can generate a fast remoting wrapper for cross domain calls.
14211         More information can be found in docs/remoting.
14212         Other changes: Removed mono_find_method_by_name, and used
14213         mono_class_get_method_from_name instead.
14214         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
14215         is stored in the remoting invoke hashtable.
14216         
14217         * marshal.h: published the new method for getting the xdomain wrapper,
14218         and also added a method for getting the adequate wrapper for a given
14219         method and target.
14220         
14221         * object-internals.h, object.c: Added a couple of methods for capying and
14222         cloning arrays.
14223         Modified mono_install_remoting_trampoline, which takes the new remoting
14224         trampoline that has a remoting target as parameter.
14225         mono_class_proxy_vtable now also takes a remoting target as parameter, and
14226         will return the most suitable vtable for the target.
14227         Added mono_remote_class_vtable, which returns the vtable of a remote class
14228         (which can be the normal remoting vtable or the xdomain vtable).
14229         
14230         * threads.c: the xdomain invoke and dispatch wrappers must also be
14231         protected against interruptions.
14232
14233 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14234
14235         * icall.c: use memmove in BlockCopyInternal when the source and
14236         destination arrays are the same.
14237
14238 2004-11-09  Martin Baulig  <martin@ximian.com>
14239
14240         * class-internals.h (MonoGenericContainer): Removed `method' and
14241         `signature', replaced them with `is_method' and `is_signature'
14242         flags.  Added `context'.
14243
14244         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
14245         instead of a `MonoGenericContainer *'.
14246
14247         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
14248         for dynamic type parameters.
14249         (mono_metadata_load_generic_params): Setup `container->context'.
14250
14251         * reflection.c (mono_reflection_setup_generic_class): Setup
14252         `tb->generic_container->context'.
14253         (do_mono_reflection_bind_generic_parameters): Use
14254         mono_class_inflate_generic_type() to correctly inflate types,
14255         rather than using our own hack just for MONO_TYPE_VAR.
14256
14257 2004-11-09  Martin Baulig  <martin@ximian.com>
14258
14259         * class.c (mono_class_inflate_generic_method): Small fix; don't
14260         crash here.
14261
14262         * icall.c
14263         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
14264         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
14265         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
14266         (ves_icall_Type_BindGenericParameters): Likewise.
14267         (ves_icall_Type_get_IsGenericInstance): Likewise.
14268         (ves_icall_Type_GetGenericParameterPosition): Likewise.
14269         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
14270         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
14271         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
14272
14273 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
14274
14275         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
14276         assembly versions and public key tokens. Fixes #69113.
14277
14278 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
14279
14280         * metadata.c: fix bug introduced with the type cache changes
14281         on 2004-11-06.
14282
14283 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
14284
14285         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
14286         the MonoClass pointer instead of the token in exception clauses.
14287         * reflection.c: updates for the above and make the code not depend
14288         on the structure of MonoExceptionClause.
14289
14290 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
14291
14292         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
14293         Add support for dynamic assemblies. Fixes #69114.
14294
14295         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
14296
14297 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
14298
14299         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
14300         since most only those methods use it. the code member of
14301         MonoMethodPInvoke was dead, so that can be removed too. Also,
14302         remove inline_count (again, not used), and move slot so that it
14303         can share bits with some other flags. This saves 8 bytes in the
14304         structure and gives us about 50 kb back for mcs helloworld.cs
14305
14306         * *.[ch]: Do naming changes for the above.
14307
14308         * loader.c (mono_method_get_header): Lazily init the header
14309         on first access.
14310         (mono_get_method_from_token): don't init the header here
14311         (mono_free_method): the header may never be allocated
14312
14313         Overall, this saves 150 kb of unmanaged allocations
14314         for mcs helloworld.cs. That accounts for 10% of the unmanaged
14315         memory at runtime.
14316         
14317         * loader.c, loader.h (mono_method_get_header): new accessor.
14318
14319         * *.[ch]: use the above method. Prepares us to lazily load
14320         the header.
14321
14322         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
14323         three warnings, which are actual bugs (see 69206).
14324
14325         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
14326         unused. Saves a cool 4 bytes / method.
14327
14328 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
14329
14330         * metadata.c (builtin_types): Add types for System.Object here.
14331         (mono_metadata_parse_type_full): Cache MonoType*'s that are
14332         for a class or valuetype from klass->this_arg or klass->byval_arg.
14333
14334         On mcs for a hello world, this gets us down from 21836 MonoType's
14335         to 14560.
14336
14337         (mono_metadata_free_type): Account for the above change.
14338
14339 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
14340
14341         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
14342         exception instead of asserting if name is null.
14343         (ves_icall_System_AppDomain_GetData): Ditto.
14344
14345 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
14346
14347         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
14348         EnumBuilder.
14349
14350         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
14351         Return NULL when the domain does not have entry_assembly set.
14352
14353         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
14354         Add a 'resource_modules' argument.
14355         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
14356
14357         * reflection.c (mono_reflection_create_runtime_class): Move setting
14358         of wastypebuilder here, so mono_get_type_object () returns a MonoType
14359         for enums too.
14360
14361         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
14362         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
14363         Throw an ArgumentNullException if 'ptr' is null.
14364
14365         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
14366         assemblies here. Fixes #69020.
14367
14368 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
14369
14370         * reflection.c (build_compressed_metadata): Fix the previous patch for
14371         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
14372         the stack.
14373
14374 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14375
14376         * assembly.c (mono_assembly_names_equal): Allow a match if one of
14377         the cultures is false. Fixes #69090.
14378
14379         * reflection.c (build_compressed_metadata): Fix invalid memory read 
14380         detected by valgrind.
14381         
14382         * reflection.c (mono_reflection_get_type): Avoid triggering a 
14383         TypeResolve multiple times for the same type. Fixes #65577.
14384
14385 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
14386
14387         * marshal.c: Avoid using ldftn to call managed functions. It is
14388         much slower than just a call.
14389
14390         * reflection.c (mono_module_get_object): free the basename we
14391         allocate here from glib.
14392         
14393         * reflection.c (ensure_runtime_vtable): make sure to free
14394         overrides.  Also, we were allocating an array of MonoMethod not an
14395         array of MonoMethod*.
14396
14397         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
14398
14399         * image.c (mono_image_close): free image->guid here.
14400
14401 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
14402
14403         * reflection.c: Fix some spec conformance issues with the PE file
14404         structures so mcs compiled apps run on the Net 2.0 beta.
14405
14406 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
14407
14408         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
14409         Implement this. Fixes #67264.
14410
14411         * debug-helpers.h debug-helpers.c marshal.c: Move 
14412         mono_find_method_by_name to debug-helpers.c.
14413
14414 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
14415
14416         * object.c (mono_release_type_locks): type_initialization_hash is
14417         a GHashTable.
14418
14419         * reflection.c object.c object-internals.h: Fix warnings.
14420
14421         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
14422         without accessors. Fixes #61561.
14423
14424         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
14425         application base from the root domain if not set. Fixes #65641.
14426         (mono_runtime_init): Fix warning.
14427
14428 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14429
14430         * appdomain.c: call mono_thread_pool_init.
14431         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
14432         of worker threads based on the number of CPUs and the environment
14433         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
14434         for non-windows (windows) systems.
14435
14436 2004-10-27  Chris Toshok  <toshok@ximian.com>
14437
14438         * mono-debug-debugger.c (write_class): don't call mono_class_init
14439         here, as even with the check for (!klass->init_pending), we get
14440         into a situation where we're hitting cycles in class
14441         initialization.  Fixes #68816.
14442
14443 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
14444
14445         * image.c: Avoid overwriting values in the loaded_images_hash when an
14446         assembly is loaded multiple times. Fixes #61152.
14447
14448         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
14449         so multiple satellite assemblies for the same name can be loaded.
14450         Fixes #68259.
14451
14452         * mono_domain_assembly_preload: Actually return the loaded assembly, 
14453         not NULL.
14454
14455         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
14456         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
14457
14458         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
14459         pending finalizers are not invoked after the appdomain has been 
14460         unloaded. Fixes #67862.
14461
14462 2004-10-22  Martin Baulig  <martin@ximian.com>
14463
14464         * mono-debug-debugger.c
14465         (mono_debugger_runtime_invoke): Don't box valuetypes.
14466
14467 2004-10-22  Chris Toshok  <toshok@ximian.com>
14468
14469         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
14470         don't hide private methods.
14471
14472 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
14473
14474         * icall.c: Allows the runtime to "share" (when known) the public key
14475         token of an assembly. This avoid the need to recalculate the token 
14476         (from the public key) in managed code.
14477
14478 2004-10-21  Chris Toshok  <toshok@ximian.com>
14479
14480         * debug-helpers.c (append_class_name): argh, revert last patch.
14481         
14482 2004-10-21  Chris Toshok  <toshok@ximian.com>
14483
14484         * debug-helpers.c (append_class_name): use '+' as the delimiter,
14485         not '/', so that it matches what the debugger uses to look up
14486         methods.
14487
14488 2004-10-21  Martin Baulig  <martin@ximian.com>
14489
14490         * mono-debug-debugger.c (mono_debugger_throw_exception): New
14491         public method; this is called each time an exception is thrown and
14492         allows the debugger to use exception catch points.
14493
14494 2004-10-21  Martin Baulig  <martin@ximian.com>
14495
14496         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
14497         the stack pointer and the exception object in some struct and pass
14498         that to the debugger.
14499
14500 2004-10-21  Chris Toshok  <toshok@ximian.com>
14501
14502         * mono-debug-debugger.c (do_write_class): add instance/static
14503         event support.  We don't expose "raise" or "other" yet.
14504         (event_is_static): new method.
14505
14506 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
14507
14508         * mono-debug-debugger.c
14509         (mono_debugger_handle_exception): Remove
14510         bogus return value for fussy compilers.
14511
14512 2004-10-20  Martin Baulig  <martin@ximian.com>
14513
14514         * mono-debug-debugger.c
14515         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
14516         (mono_debugger_handled_exception): Likewise.
14517
14518 2004-10-20  Martin Baulig  <martin@ximian.com>
14519
14520         * mono-debug-debugger.h (MonoDebuggerEvent): Added
14521         MONO_DEBUGGER_EVENT_EXCEPTION.
14522
14523         * mono-debug-debugger.c (mono_debugger_handle_exception): New
14524         public function to send the debugger a notification for an
14525         exception and inform it about a catch/finally clause.
14526
14527 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
14528
14529         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
14530         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
14531         fix 2.95 build. 
14532
14533         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
14534
14535 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
14536
14537         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
14538         marshalled as [In,Out]. Fixes #58325.
14539
14540 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
14541
14542         * reflection.c (mono_method_body_get_object): Implement some fields.
14543
14544 2004-10-12  Martin Baulig  <martin@ximian.com>
14545
14546         * reflection.c (mono_reflection_bind_generic_parameters): Small
14547         fix, correctly retrieve our parent from a generic instance.
14548
14549 2004-10-12  Martin Baulig  <martin@ximian.com>
14550
14551         * metadata.c (mono_metadata_generic_param_equal): We always have
14552         an owner.
14553
14554         * class.c
14555         (mono_class_from_generic_parameter): We need to have an owner.
14556         (my_mono_class_from_generic_parameter): Likewise.
14557
14558         * reflection.c (mono_reflection_setup_generic_class): Renamed to
14559         mono_reflection_create_generic_class() and added a new
14560         mono_reflection_setup_generic_class().  
14561         (mono_reflection_initialize_generic_param): If we're a nested
14562         generic type and inherited from the containing class, set our
14563         owner to the outer class.
14564
14565 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
14566
14567         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
14568
14569         * reflection.c (mono_method_body_get_object): New function to create
14570         a MethodBody object.
14571
14572         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
14573
14574 2004-10-11  Martin Baulig  <martin@ximian.com>
14575
14576         * metadata.c (_mono_metadata_type_equal): Renamed to
14577         do_mono_metadata_type_equal() and made static.
14578
14579 2004-10-11  Martin Baulig  <martin@ximian.com>
14580
14581         * appdomain.c: Bump corlib version number to 28.
14582
14583 2004-10-10  Martin Baulig  <martin@ximian.com>
14584
14585         * class-internals.h
14586         (MonoGenericInst): Added `MonoGenericContainer *container'.
14587         (MonoGenericMethod): Likewise.
14588         (MonoGenericContext): Likewise.
14589         (MonoGenericParam): Added `MonoGenericContainer *owner'.
14590
14591         * metadata.c
14592         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
14593         (do_mono_metadata_parse_generic_inst): Likewise.
14594         (mono_metadata_parse_type_full): New public method.  This is the actual
14595         mono_metadata_parse_type() implementation - with an additional
14596         `MonoGenericContainer *' argument.
14597         (mono_metadata_parse_array_full): Likewise.
14598         (mono_metadata_parse_signature_full): Likewise.
14599         (mono_metadata_parse_method_signature_full): Likewise.
14600         (mono_metadata_parse_mh_full): Likewise.
14601         (mono_type_create_from_typespec): Likewise.
14602         (mono_metadata_interfaces_from_typedef_full): New public method;
14603         this is similar to the other _full() methods, but we take a
14604         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
14605         (mono_metadata_parse_generic_param): Take an additional
14606         `MonoGenericContainer *' argument and lookup the MonoGenericParam
14607         from that container.
14608         (mono_metadata_generic_param_equal): New static method to compare
14609         two type parameters.
14610         (_mono_metadata_type_equal): New static method; takes an
14611         additional `gboolean signature_only' argument - if true, we don't
14612         compare the owners of generic parameters.
14613         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
14614         with a TRUE argument - do a signature-only comparision.
14615
14616         * loader.c: Use the new _full() methods and pass the
14617         MonoGenericContainer to them.
14618
14619         * object-internals.h (MonoReflectionTypeBuilder): Added
14620         `MonoGenericContainer *generic_container' field.
14621         (MonoReflectionMethodBuilder): Likewise.
14622
14623 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
14624
14625         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
14626         case initial images of dynamic assemblies.
14627
14628         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
14629
14630         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
14631
14632         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
14633         length of event->other array.
14634         (typebuilder_setup_events): Ditto.
14635
14636         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
14637         'assembly_by_name' and add an 'assemblies' list.
14638
14639         * assembly.h assembly.c: Add a new search hook for determining whenever
14640         an assembly is already loaded. Use this instead of searching in the
14641         loaded_assemblies list.
14642
14643         * domain.c appdomain.c: Implement the new search hook so loaded 
14644         assemblies are now scoped by appdomain. Fixes #67727.
14645
14646 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
14647
14648         * threads.c (mono_thread_attach): Initialize synch_lock field so
14649         mono_thread_detach works again.
14650
14651         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
14652         'lib' too. Fixes #63130.
14653
14654 2004-10-06  Jackson Harper  <jackson@ximian.com>
14655
14656         * culture-info-tables.h: regenerated.
14657
14658 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
14659
14660         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
14661         implemented by other interfaces in the result. Fixes #65764.
14662         
14663         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
14664         Handle unloadable modules without crashing.
14665
14666         * image.c (load_modules): Revert the previous patch since modules must
14667         have a fixed index inside the array.
14668         
14669         * image.c (load_modules): Don't include native modules in the modules
14670         array.
14671
14672 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
14673
14674         * reflection.h: Add param_defaults field.
14675
14676         * reflection.c: Add support for parameter defaults in dynamic methods.
14677         Fixes #64595.
14678
14679         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
14680         an empty string when a type has no namespace. Fixes #64230.
14681
14682 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
14683
14684         * tabledefs.h: Added "internal" security actions to support non-CAS
14685         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
14686         Note: they do not seems to be used anymore in 2.0 (new metadata format)
14687
14688 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
14689
14690         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
14691         constructor of abstract class. Fixes #61689.
14692
14693 2004-10-04  Martin Baulig  <martin@ximian.com>
14694
14695         * class-internals.h (MonoGenericContainer): New type.
14696         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
14697         `MonoGenericContainer *generic_container'.
14698         (MonoClass): Replaced `gen_params' and `num_gen_params' with
14699         `MonoGenericContainer *generic_container'.
14700
14701         * metadata.c (mono_metadata_load_generic_params): Return a
14702         `MonoGenericContainer *' instead of a `MonoGenericParam *';
14703         removed the `num' argument.
14704
14705 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
14706
14707         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
14708         for dynamic images.
14709
14710         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
14711         machine fields.
14712
14713         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
14714
14715         * reflection.c: Save pe_kind and machine values into the generated
14716         image file.
14717
14718         * appdomain.c: Bump corlib version number.
14719
14720         * object-internals.h: Reorganize layout of LocalBuilder.
14721
14722         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
14723         New helper function.
14724
14725         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
14726         created MonoType for dynamic types. Fixes #66180.
14727
14728 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
14729
14730         * threadpool.c: the ares hashtable needs a critical section around it.
14731         this prevents some nasty segfaults
14732
14733 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
14734
14735         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
14736         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
14737         bug 67324).
14738         
14739 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
14740
14741         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
14742         
14743 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
14744
14745         * image.c: Always canonicalize image file names, to avoid loading
14746         the same assembly twice when referenced using a relative path.
14747
14748 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
14749
14750         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
14751
14752         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
14753
14754         * marshal.c: Fix warnings.
14755
14756 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
14757
14758         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
14759         attempting to marshal the delegate_trampoline as the method_addr.
14760         This patch has a static hashtable of marshalled delegates so that 
14761         we can map delegate_trampoline addresses back to delegates.  This
14762         allows a delegate passed to managed code to be passed back into native
14763         code.  Fixes #67039
14764
14765 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
14766
14767         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
14768
14769         * reflection.c (method_encode_code): Align method headers properly.
14770         Fixes #66025.
14771
14772 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
14773
14774         * marshal.c: In the runtime invoke wrapper, reset the abort
14775         exception if it is cached. This avoids the automatic rethrowal of 
14776         the exception after the catch of the wrapper. Also check for pending
14777         interruptions before calling the managed method. This is done using
14778         the new method emit_thread_force_interrupt_checkpoint, since the
14779         normal checkpoint method is ignored when running the invoke wrapper.
14780         * object.c: If the abort exception is rethrown, set the abort_exc
14781         field of the thread, so it will be rethrown aftere every catch.
14782         * threadpool.c: Only run an interruption checkpoint if what has been
14783         requested is a stop of the thread (aborts will be ignored).
14784         * threads.c: By default, a thread will now never be interrumped while
14785         running the runtime invoke wrapper (this ensures that runtime_invoke
14786         will always return to the caller if an exception pointer is provided).
14787         There is a new special method mono_thread_force_interruption_checkpoint()
14788         to force an interruption checkpoint even if running a protected
14789         wrapper, which is used by the same runtime invoke wrapper to do a check
14790         at a safe point.
14791
14792 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
14793
14794         * object.c, object-internals.h: Implemented mono_release_type_locks,
14795         which releases the cctor locks held by a thread.
14796         * threads.c, threads.h: In thread_cleanup, release cctor locks held
14797         by a thread. Added mono_thread_exit() method to be used to safely stop
14798         a thread.
14799
14800 2004-09-28  Raja R Harinath  <rharinath@novell.com>
14801
14802         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
14803         Move null check before dereference.  Avoid indexing beyond the end
14804         of the 'modules' array.
14805
14806 2004-09-28  Raja R Harinath  <rharinath@novell.com>
14807
14808         * metadata-internals.h (MonoImage): Add module_count field.
14809         * image.c (load_modules): Set image->module_count.
14810         (mono_image_load_file_for_image): Use image->module_count.
14811         * reflection.c (mono_image_load_module): Append to image->modules array 
14812         of dynamic assembly.
14813         (mono_module_get_object): Fix loop to actually increment index.
14814         Use image->module_count.
14815         * assembly.c (mono_assembly_load_references): Use image->module_count.
14816         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
14817         Likewise.
14818
14819 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
14820
14821         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
14822         Avoid assert on generic types.
14823
14824 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
14825
14826         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
14827
14828         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
14829
14830         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
14831         function to convert a MarshalSpec structure to its managed counterpart.
14832
14833         * reflection.c: Fix warnings.
14834         
14835         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
14836         field.
14837
14838         * icall.c (mono_create_icall_signature): Fix build.
14839
14840 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
14841
14842         * icall.c: Add MakePointType icall.
14843
14844         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
14845         warnings.
14846
14847 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14848
14849         * threadpool.c: reuse allocated slots in the queue.
14850
14851 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
14852
14853         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
14854
14855         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
14856
14857         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
14858         previous change.
14859
14860         * tabledefs.h: Add constants for pinvoke attributes BestFit and
14861         ThrowOnUnmappableChar.
14862
14863         * icall.c (ves_icall_Type_GetPacking): New icall.
14864
14865 2004-09-24  Martin Baulig  <martin@ximian.com>
14866
14867         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
14868
14869 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14870
14871         * appdomain.c:
14872         (mono_domain_set): allow setting a domain that is being unloaded.
14873         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
14874         being unloaded.
14875
14876 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
14877
14878         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
14879         the GetCustomAttributes icall.
14880
14881 2004-09-23  Martin Baulig  <martin@ximian.com>
14882
14883         * object-internals.h (MonoReflectionGenericParam): Replaced
14884         'has_ctor_constraint', `has_reference_type' and `has_value_type'
14885         with `guint32 attrs'.
14886
14887 2004-09-23  Martin Baulig  <martin@ximian.com>
14888
14889         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
14890
14891 2004-09-23  Martin Baulig  <martin@ximian.com>
14892
14893         * object-internals.h (GenericParameterAttributes): New enum.
14894
14895 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
14896
14897         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
14898         
14899         * class.c (init_events): Fill out event->other field.
14900
14901         * class.c: Fix warnings.
14902
14903         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
14904
14905 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
14906
14907         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
14908         walk which doesn't supply the IL offset.
14909
14910 2004-09-22  Martin Baulig  <martin@ximian.com>
14911
14912         * reflection.c (mono_reflection_setup_internal_class): If we're
14913         System.ValueType, System.Object or System.Enum, set
14914         `klass->instance_size' and create the vtable.
14915         (mono_reflection_create_internal_class): If we're an enum type,
14916         get the base class from our current corlib.
14917
14918 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
14919
14920         * reflection.h (MonoResolveTokenError): New type.
14921
14922         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
14923         icall.
14924
14925         * icall.c: Add an 'error' argument to the ResolveToken icalls.
14926
14927 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
14928
14929         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
14930         Support also calling constructors, but only for already allocated objects.
14931
14932 2004-09-17  Geoff Norton <gnorton@customerdna.com>
14933
14934         * reflection.c (type_get_qualified_name): If the klass is null
14935         return the typename to avoid a NullRefEx.
14936         (encode_cattr_value): Get the qualified name of the boxed type,
14937         not the underlying enumtype.  Fixes #62984.
14938
14939 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
14940
14941         * marshal.c: Fix problems with previous checkin.
14942
14943 2004-09-21    <vargaz@freemail.hu>
14944
14945         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
14946         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
14947
14948         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
14949
14950 2004-09-21  Geoff Norton <gnorton@customerdna.com>
14951
14952         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
14953         should only return a type for pointers, arrays, and passbyref types.
14954         Fixes bug #63841.
14955
14956 2004-09-21  Martin Baulig  <martin@ximian.com>
14957
14958         * domain.c (mono_debugger_check_runtime_version): New public
14959         function.
14960
14961         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
14962
14963 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
14964
14965         * reflection.c: Added missing sort to the declarative security 
14966         attributes table. MS implementation stops seeing the attributes if the
14967         token number regress in the table (as shown by ildasm and permview).
14968
14969 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
14970
14971         * object-internals.h (MonoReflectionModule): Add 'token' field.
14972         
14973         * reflection.c (mono_reflection_get_token): Add support for Module
14974         and Assembly.
14975         (mono_module_get_object): Set 'token' field.
14976         (mono_module_file_get_object): Set 'token' field.
14977
14978         * icall.c: Add new Assembly and Module icalls.
14979
14980         * appdomain.c: Bump corlib version.
14981
14982 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
14983
14984         * loader.h loader.c class.h class.c: Add helper functions for obtaining
14985         tokens of metadata objects.
14986
14987         * reflection.h reflection.c (mono_reflection_get_token): New function
14988         to obtain the token of a metadata object.
14989
14990         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
14991
14992 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
14993
14994         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
14995         
14996         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
14997
14998 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
14999
15000         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
15001         * object-internals.h: Added 3 MonoArray* members to MonoReflection
15002         AssemblyBuilder to access the permissions set in the class lib.
15003         * reflection.c: Added security attributes encoding step in 
15004         mono_image_build_metadata.
15005         * tabledefs.h: Added new security actions defined in 2.0:
15006         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
15007
15008 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
15009
15010         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
15011         macro parameter.
15012
15013 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
15014  
15015         * locales.c: nullify the ICU_collator member of CompareInfo when it is
15016           finalized. There where random SIGSEVs at program termination, when
15017           an object being finalized was trying to do a string comparison and
15018           the current culture was already finalized.
15019  
15020 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15021
15022         * threads.c: call thread_cleanup before finishing the thread if we get
15023         there.
15024
15025 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
15026
15027         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
15028         assemblies from the parent. Fixes #65665.
15029
15030 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
15031
15032         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
15033         modifiers.
15034
15035 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
15036
15037         * reflection.h: add prototype for mono_get_dbnull_object
15038         * reflection.c: add prototypes for get_default_param_value_blobs 
15039         and mono_get_object_from_blob for fussier compilers
15040
15041 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
15042  
15043         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
15044         false deadlock checks in class initialization.
15045  
15046 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
15047
15048         * image.c (mono_image_addref): Fix comment.
15049
15050         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
15051         possible.
15052
15053 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
15054
15055         * reflection.c (mono_param_get_objects): Modified to return
15056         ParameterInfo.DefaultValue object.
15057
15058         (get_default_param_value_blobs):
15059         (mono_get_object_from_blob):
15060         (mono_get_dbnull_object): New helper routines. 
15061
15062         * object.c (mono_get_constant_value_from_blob): New helper routine
15063         carved out from get_default_field_value ()
15064
15065         * object-internals.h (mono_get_constant_value_from_blob): Added
15066         function declaration.
15067
15068 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
15069
15070         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
15071         referenced assemblies. Fixes #62135.
15072
15073         * exception.h exception.c (mono_get_exception_file_not_found2): New
15074         helper function.
15075
15076 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
15077
15078         * class.h class.c: Add mono_type_get_underlying_type ().
15079
15080 2004-09-09  Geoff Norton <gnorton@customerndna.com>
15081
15082         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
15083         Fix GetTypes() to support dynamically created assemblies.
15084
15085 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
15086
15087         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
15088         
15089         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
15090         previous patch.
15091
15092         * reflection.h reflection.c loader.c: Allow dynamic construction of
15093         pinvoke methods. Fixes #65571.
15094         
15095         * reflection.c (mono_reflection_get_type): Revert previous change since
15096         it causes regressions.
15097
15098 2004-09-08  Martin Baulig  <martin@ximian.com>
15099
15100         * class.c (class_compute_field_layout): Don't call
15101         mono_class_layout_fields() for open generic instances.
15102
15103 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
15104         * threads.c appdomain.c: fix typo in GC macro
15105
15106 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15107
15108         * threads.c: don't call mono_thread_detach() in start_wrapper(),
15109         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
15110
15111 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
15112
15113         * image.c (mono_image_close): Applied patch from 
15114         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
15115         assembly is loaded multiple times from data.
15116         
15117         * image.c (mono_image_open): Fix warning.
15118
15119 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
15120
15121         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
15122         once. Fixes #58334.
15123         
15124         * reflection.c (mono_reflection_create_runtime_class): Initialize
15125         klass->nested_classes. Fixes #61224.
15126
15127 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
15128
15129         * threads.c: sched_yield() on exit, to allow threads to quit.
15130
15131 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
15132
15133         * object.c (mono_unhandled_exception): Remove leftover debug code.
15134
15135 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
15136
15137         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
15138
15139 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
15140
15141         * marshal.c (emit_marshal_array): Really null terminate string arrays.
15142         
15143         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
15144
15145 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
15146
15147         * marshal.c (emit_marshal_array): Null terminate string arrays.
15148         
15149         * marshal.c (raise_auto_layout_exception): Fix warning.
15150
15151         * reflection.c (mono_param_get_objects): Initialize the default value
15152         with DBNull.Value, not null. Fixes #62123.
15153
15154 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
15155
15156         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
15157         throw an exception with a cute explanation.
15158
15159 2004-09-06  Dick Porter  <dick@ximian.com>
15160
15161         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
15162         Close the new process's thread handle, as we don't use it.  The
15163         handle stays around forever otherwise.
15164
15165 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
15166
15167         * object.c (arith_overflow): Fix warning.
15168
15169         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
15170         calling conventions in method refs. Fixes #65352.
15171
15172         * reflection.c: Fix warnings.
15173
15174 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15175
15176         * icall.c: Add a new icall for Array.Clear
15177
15178 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15179
15180         * object.c: When allocating an array, we have to throw
15181         an overflow exception if any of the lengths are < 0.
15182
15183 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
15184
15185         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
15186         properly. Also move implementation of string array marshalling to 
15187         managed code. Fixes #42316.
15188
15189 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15190
15191         * assembly.c: provide more information when loading an assembly fails.
15192
15193 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15194
15195         * filewatcher.c: don't expect the development fam package to be
15196         installed.
15197
15198 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
15199
15200         * marshal.c: Make a copy of the signature cookie since it will be
15201         freed by the caller.
15202         
15203         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
15204
15205         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
15206
15207         * metadata.c (mono_metadata_free_marshal_spec): New function to free
15208         marshal specs.
15209
15210         * marshal.c: More refactoring.
15211         
15212         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
15213         smaller functions.
15214
15215 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
15216
15217         * object.c: In mono_message_invoke, fill the output parameter array after
15218           calling the managed method (it was done before the call). This fixes
15219           bug #59299.
15220
15221 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
15222
15223         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
15224         as well.
15225
15226 2004-09-02  Martin Baulig  <martin@ximian.com>
15227
15228         * class.c (mono_class_instance_size): Don't allow generic type
15229         definitions or open generic instances.
15230         (mono_class_array_element_size): If we're a value type, call
15231         mono_class_instance_size() on the original class.
15232
15233         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
15234         handle generic instances.
15235
15236         * mono-debug-debugger.c (write_type): Handle generic instances
15237         like classes.
15238
15239 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
15240
15241         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
15242         the allocation request fails. Fixes #65089.
15243
15244         * object.c (mono_runtime_free_method): Do not call mono_free_method.
15245         
15246         * object.c (mono_runtime_free_method): New function to free a dynamic
15247         method.
15248
15249         * marshal.c (mono_delegate_free_ftnptr): New function to free the
15250         delegate trampoline.
15251
15252         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
15253         with hasthis as dynamic,
15254
15255         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
15256
15257         * domain.c (mono_jit_info_table_remove): New function to remove an
15258         entry from the jit info table.
15259
15260         * class-internals.h (MonoMethod): Add 'dynamic' field.
15261
15262         * loader.c: Fix warnings.
15263
15264 2004-09-01  Martin Baulig  <martin@ximian.com>
15265
15266         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
15267         instead of mono_debugger_lock() because the latter one is a no-op
15268         unless running in the debugger.
15269
15270 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
15271
15272         * class.c (class_compute_field_layout): Classes with auto-layout or
15273         reference fields are not blittable.
15274         
15275 2004-09-01  Dick Porter  <dick@ximian.com>
15276
15277         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
15278         mono_image_get_filename() to get the assembly location.
15279
15280         * icall.c:
15281         * metadata.h: Fix compile warnings
15282
15283 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
15284
15285         * class.c (class_compute_field_layout): System.Object is blittable.
15286
15287         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
15288         as in/out. Fixes #59909.
15289
15290 2004-09-01  Martin Baulig  <martin@ximian.com>
15291
15292         * metadata.h (MONO_TYPE_ISREFERENCE): Call
15293         mono_metadata_generic_inst_is_valuetype() if we're a generic
15294         instance to check whether our underlying type is a reference type.
15295
15296 2004-09-01  Martin Baulig  <martin@ximian.com>
15297
15298         * metadata.c (mono_type_size): If we're a generic instance, call
15299         mono_class_value_size() for value types.
15300
15301 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
15302
15303         * marshal.c: Implement more custom marshalling functionality. Fixes
15304         #64915.
15305
15306 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
15307
15308         * mono-debug.c, debug-mono-symfile.c: add some locking love.
15309
15310 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
15311
15312         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
15313
15314         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
15315
15316         * icall.c: Fix some warnings.
15317
15318         * threads.c (abort_appdomain_thread): Fix unref errors.
15319         (mono_thread_current): Fix THREAD_DEBUG define.
15320
15321 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
15322
15323         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
15324
15325         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
15326
15327 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
15328
15329         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
15330         string arrays.
15331
15332 2004-08-28  Martin Baulig  <martin@ximian.com>
15333
15334         * metadata.c
15335         (mono_metadata_generic_inst_is_valuetype): New public function.
15336
15337         * metadata.h (MONO_TYPE_ISSTRUCT): Call
15338         mono_metadata_generic_inst_is_valuetype() if we're a generic
15339         instance to check whether our underlying type is a valuetype.
15340
15341 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
15342
15343         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
15344         #63768.
15345
15346 2004-08-25  Martin Baulig  <martin@ximian.com>
15347
15348         * loader.c (mono_get_method_from_token): Abstract methods can also
15349         be generic and thus have type parameters.
15350
15351         * metadata-internals.h
15352         (MonoDynamicImage): Added `GPtrArray *gen_params'.
15353
15354         * reflection.c (mono_image_get_generic_param_info): Don't create a
15355         metadata row, just add an entry to the `gen_params' array.
15356         (build_compressed_metadata): Sort the `gen_params' array and then
15357         actually create the metadata.
15358
15359 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15360
15361         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
15362
15363 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
15364
15365         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
15366
15367 2004-08-24  Martin Baulig  <martin@ximian.com>
15368
15369         * class.cs (mono_class_is_subclass_of): Like an interface, a
15370         generic instance also derives from System.Object.
15371
15372 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
15373
15374         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
15375         custom modifiers to be in any order. Fixes #61990.
15376
15377 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
15378
15379         * object.c: Register mono_object_new_fast icall.
15380         
15381         * object.c (mono_class_get_allocation_ftn): Return to calling
15382         mono_object_new_fast, since it seems faster to compute the object 
15383         size in unmanaged code than passing it as a parameter.
15384
15385         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
15386
15387         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
15388         this function with Boehm as the oom handler, so we don't have to check
15389         the result of GC_malloc.
15390
15391         * object.c: Remove checks for oom.
15392
15393         * object.h object.c (mono_class_get_allocation_ftn): New function to
15394         return the icall which can be used to allocate an instance of a given
15395         class. 
15396
15397         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
15398
15399         * class-internals.h: Add 'enabled' field.
15400
15401 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
15402
15403         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
15404
15405 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
15406         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
15407         value 0x0010.
15408
15409 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
15410
15411         * appdomain.c: use the Tls function for appdomain too,
15412         at Zoltan's request. Actually return in mono_context_get
15413
15414         * appdomain.c, profiler.c, threads.c: use __thread
15415
15416 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
15417
15418         * appdomain.c threads.c: Call GC_CreateThread on windows.
15419
15420         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
15421         multiple libraries since this don't work on windows.
15422
15423 2004-08-18  Martin Baulig  <martin@ximian.com>
15424
15425         * class-internals.h
15426         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
15427         MonoMethodHeader.
15428
15429         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
15430         MonoMethodNormal since we also need it for abstract and interface
15431         methods.
15432
15433         * reflection.c
15434         (build_compressed_metadata): Sort the GenericParam table.
15435         (mono_image_create_token): Added `gboolean create_methodspec'
15436         argument; this is false when generating a MethodImpl token.
15437         (reflection_methodbuilder_to_mono_method): Abstract and interface
15438         methods may also have generic parameters.
15439
15440 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
15441
15442         * appdomain.c: thread local alloc
15443
15444 2004-08-17  Martin Baulig  <martin@ximian.com>
15445
15446         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
15447
15448         * icall.c
15449         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
15450         argument.
15451
15452         * class.c (mono_type_get_full_name): New public function.
15453         (mono_type_get_name): Don't include the type arguments.
15454
15455 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
15456
15457         * Makefile.am: Build static versions of libmetadata and libmonoruntime
15458         for inclusion into the mono executable.
15459
15460 2004-08-16  Martin Baulig  <martin@ximian.com>
15461
15462         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
15463         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
15464
15465 2004-08-14  Martin Baulig  <martin@ximian.com>
15466
15467         * class.c (dup_type): Also copy the `byref' field.
15468
15469 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
15470
15471         * reflection.c (create_dynamic_mono_image): Revert the last change 
15472         since it breaks bootstrap.
15473
15474 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
15475
15476         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
15477
15478         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
15479         not free them with g_free.
15480
15481 2004-08-11  Martin Baulig  <martin@ximian.com>
15482
15483         * reflection.c (mono_reflection_setup_internal_class): Also call
15484         mono_class_setup_mono_type() if we already have a `tb->type.type'.
15485
15486 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
15487
15488         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
15489         called during default (first) AppDomain creation. Keep track of
15490         Evidence when loading assemblies.
15491
15492 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
15493
15494         * opcodes.c, opcodes.h: reduce runtime relocations.
15495
15496 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
15497
15498         * culture-info.h, locales.c: fixes and chages to sue the new
15499         optimized format of the locale data.
15500         * culture-info-tables.h: regenerated.
15501
15502 2004-08-06  Geoff Norton <gnorton@customerdna.com>
15503         
15504         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
15505
15506 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
15507
15508         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
15509         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
15510         * domain-internals.h: icall declaration.
15511         * icall.c: icall registration.
15512         * object-internals.h: New fields in MonoAssembly for CAS.
15513
15514 2004-08-05  Duncan Mak  <duncan@ximian.com>
15515
15516         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
15517         CEE_LDELEM_ANY.
15518
15519 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
15520
15521         * reflection.c: fix to deal with object[] arrays in custom ctors
15522         (bug #62550).
15523
15524 2004-08-05  Martin Baulig  <martin@ximian.com>
15525
15526         * class.c (mono_class_array_element_size): Added support for
15527         generic instances and correctly handle "recursive" types.
15528
15529 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
15530
15531         * assembly.c: Fix warnings.
15532
15533 2004-08-04  Martin Baulig  <martin@ximian.com>
15534
15535         * class.c
15536         (mono_type_get_name_recurse): Added `gboolean include_arity'
15537         argument specifying whether or not we should include the generic
15538         arity in the type name.
15539         (_mono_type_get_name): New static function.
15540         (mono_class_setup_vtable): If we're a generic instance, don't
15541         include the generic arity in the names of explicit method
15542         implementations.        
15543
15544 2004-08-03  Martin Baulig  <martin@ximian.com>
15545
15546         * class.c (mono_type_get_name_recurse): Enclose the generic type
15547         arguments in `<', '>'.
15548
15549 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
15550
15551         * gc.c: make GC warning messages use the trace API, they are just
15552         noise to most of the users.
15553
15554 2004-08-03  Martin Baulig  <martin@ximian.com>
15555
15556         * debug-mono-symfile.c (read_string): Correctly read the string.
15557
15558 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
15559
15560         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
15561         
15562         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
15563         icalls.
15564         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
15565
15566 2004-07-30  Martin Baulig  <martin@ximian.com>
15567
15568         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
15569         Reflect latest symbol writer changes.   
15570
15571 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
15572
15573         * object.c: always create an object if null is passed
15574         to Invoke() where a valuetype is expected.
15575
15576 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
15577
15578         * marshal.c (mono_marshal_init): make managed
15579         signatures match native ones better for 64bits.
15580
15581 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15582
15583         * appdomain.c: hack to build correctly the private bin path on windows.
15584         Fixes bug #61991.
15585
15586 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15587
15588         * assembly.c: Load mscorlib from the correct framework directory
15589           (mono/<version>/mscorlib.dll).
15590         * appdomain.h: Added prototypes for new functions.
15591         * internals.h: Added some prototypes.
15592         * domain.c: When initializing the runtime, get from the executable and
15593           the configuration files the runtime version that the app supports.
15594           Added support methods for reading app.exe.config. Added list of versions
15595           supported by the JIT. Added two new methods: mono_init_from_assembly,
15596           which initializes the runtime and determines the required version from
15597           the provided exe file, and mono_init_version, which initializes
15598           the runtime using the provided version.
15599         * icall.c: Get machine.config from version-specific directory.
15600         * reflection.c: When generating an image, embed the version number
15601           of the current runtime.
15602
15603 2004-07-28  Dick Porter  <dick@ximian.com>
15604
15605         * socket-io.c
15606         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
15607         returned sockaddr size before creating the remote address object.
15608         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
15609         61608.
15610
15611 2004-07-28  Dick Porter  <dick@ximian.com>
15612
15613         * locales.c (string_invariant_compare_char): Fix invariant char
15614         compares between upper and lower cases.  Fixes bug 61458.
15615
15616 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
15617         
15618         * marshal.c: actually cache stelem.ref wrappers.
15619         
15620 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
15621
15622         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
15623         sections and remove the mono_cli_rva_map () function.
15624
15625 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
15626
15627         * debug-mono-symfile.c: fix one more endianess issue, from a patch
15628         by Geoff Norton (<gnorton@customerdna.com>).
15629
15630 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
15631
15632         * class.c: fix class loads for pointer types (typeof(int) !=
15633         typeof(int*)).
15634
15635 2004-07-27  Martin Baulig  <martin@ximian.com>
15636
15637         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
15638         reading the debugging information from an external ".mdb" file.
15639
15640 2004-07-24  Martin Baulig  <martin@ximian.com>
15641
15642         * reflection.c (mono_image_get_type_info): Only write a class
15643         layout entry if we actually have a size or a packing size.
15644
15645 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
15646
15647         * reflection.c (type_get_fully_qualified_name): 
15648         insert cast to get type checking of ?: with non-gcc compilers
15649
15650 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
15651
15652         * rand.c: use g_getenv for both lookups of
15653         MONO_EGD_SOCKET
15654
15655 2004-07-17  Martin Baulig  <martin@ximian.com>
15656
15657         * reflection.c (mono_reflection_bind_generic_method_parameters):
15658         Set `gmethod->reflection_info'.
15659
15660 2004-07-17  Martin Baulig  <martin@ximian.com>
15661
15662         * class.c (mono_class_create_from_typedef): Insert the newly
15663         created class into the hash table before computing the interfaces
15664         since we could be called recursively.
15665
15666 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
15667
15668         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
15669         function to implement stelem.ref in managed code
15670         * class-internals.h, debug-helpers.c: a new wrapper type
15671         for the above.
15672
15673 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
15674
15675         * gc.c: allow GC handles to work even when no GC is compiled in.
15676         Fix part of bug #61134 (GetAddrOfPinnedObject).
15677
15678 2004-07-13  Peter Williams  <peter@newton.cx>
15679  
15680         * process.c (complete_path): Make sure we don't attempt to execute
15681         directories.
15682  
15683 2004-07-12  Geoff Norton <gnorton@customerdna.com>
15684
15685         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
15686           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
15687           and will add/subtract the hour if needed
15688
15689 2004-07-12  Martin Baulig  <martin@ximian.com>
15690
15691         * reflection.c (mono_field_get_object): If we have
15692         `field->generic_info', take the attributes from
15693         `field->generic_info->generic_type'.    
15694
15695 2004-07-12  Martin Baulig  <martin@ximian.com>
15696
15697         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
15698         This function must be called before initializing the runtime.
15699         (mono_debug_init_1): New function; call this after initializing
15700         the runtime, but before loading the assembly.  It tells the
15701         debugger to load corlib and the builtin types.
15702
15703         * mono-debug-debugger.c: Did some larger changes in the debugging
15704         code; support recursive class declarations, make sure we actually
15705         add all classes.
15706
15707 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15708
15709         * debug-helpers.c: undo my previous patch and fixed the real issue in
15710         ../mini/exceptions-x86.c
15711
15712 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15713
15714         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
15715         when no HOME env. variable was set and a NullRef was thrown in a .cctor
15716         called from other .cctors.
15717
15718 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * loader.c: Removed the mono_loader_wine_init hack now that we are
15721         doing a managed version of Windows.Forms.
15722
15723 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
15724
15725         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
15726         threadpool.c, threads.c: remove static data from rootset.
15727
15728 2004-07-09  Dick Porter  <dick@ximian.com>
15729
15730         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
15731         Don't do any more processing if the matched length was 0.  It was
15732         increasing the size of the string before.  Fixes bug 61167.
15733
15734 2004-07-09  Dick Porter  <dick@ximian.com>
15735
15736         * socket-io.h:
15737         * socket-io.c
15738         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
15739         Add support for SO_PEERCRED if its available.
15740
15741 2004-07-09  Peter Bartok <pbartok@novell.com>
15742         * loader.c: winelib.exe.so error message is now only displayed if
15743         MONO_DEBUG is set. To help us avoid questions when people are trying
15744         out the new Managed.Windows.Forms.
15745
15746 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
15747
15748         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
15749         for isinst and castclass wrappers.
15750
15751         * class-internals.h icall.c: Move registration and lookup of JIT icalls
15752         to libmetadata from the JIT, so they could be used by the marshalling
15753         code and the interpreter.
15754
15755         * marshal.c: Register marshalling related JIT icalls here instead of
15756         in mini.c. Use CEE_MONO_ICALL instead of the family of 
15757         CEE_MONO_PROC<x> opcodes to call marshalling functions.
15758
15759         * metadata.h: Remove unneeded marshalling conversions.
15760
15761         * opcodes.c: Update for new opcodes.
15762         
15763 2004-07-08  Martin Baulig  <martin@ximian.com>
15764
15765         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
15766         (mono_debug_get_domain_data): Make this function static.
15767
15768 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
15769
15770         * gc.c, object.h: add nice GC handle API for embedders.
15771
15772 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
15773
15774         * reflection.c: more changes for the new api
15775
15776         * object.c: When we reflect on a field w/ a constant value, it
15777         will not have a memory location, so we must access metadata. Also,
15778         allow easier reading of strings so that we can read them from
15779         the constant data.
15780
15781         * class.c (mono_class_layout_fields): no need for literal fields here.
15782
15783         * class-internals.h: api changes for const fields
15784
15785         * icall.c (ves_icall_get_enum_info): use new apis for const fields
15786
15787 2004-07-06  Martin Baulig  <martin@ximian.com>
15788
15789         * mono-debug.h: Increment version number to 44.
15790
15791         * mono-debug.c (mono_debug_add_wrapper): The second argument is
15792         now a gpointer, rewrote this whole method.
15793
15794         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
15795         function.  Add information about the wrapper in a new "misc table".
15796
15797         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
15798         for the new misc table.
15799
15800 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
15801
15802         * metadata-internals.h image.c: Add a cache for helper signatures.
15803
15804         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
15805
15806 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
15807
15808         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
15809         delegates from a delegate. Fixes #61033.
15810         
15811         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
15812         marshalling of stringbuilder arrays. Fixes #59900.
15813
15814 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
15815
15816         * icall.c: Add EnumBuilder:setup_enum_type icall.
15817
15818 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
15819
15820         * icall.c: Added a new icall for the property version of
15821         OffsetOfStringData.
15822
15823 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
15824
15825         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
15826         it has a constant size across platforms.
15827
15828         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
15829         stack trace.
15830
15831 2004-06-29  Martin Baulig  <martin@ximian.com>
15832
15833         * mono-debug.c (mono_debug_add_method): Protect the whole function
15834         in mono_debugger_lock(), not just parts of it.
15835
15836 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
15837
15838         * reflection.c: make sure padding bytes in heaps are zeroed.
15839
15840 2004-06-24  David Waite  <mass@akuma.org>
15841
15842         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
15843         image.c, loader.c, locales.c, marshal.c, metadata.c,
15844         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
15845         string-icalls.c, threads.c: change to C90-style comments from C99 /
15846         C++ -style
15847
15848 2004-06-24  Dick Porter  <dick@ximian.com>
15849
15850         * threads.c
15851         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
15852         return createdNew.  Fixes bug 60412.
15853
15854         * threads-types.h: 
15855         * icall.c: Add createdNew parameter to CreateMutex icall
15856
15857 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
15858
15859         * reflection.c, object-internals.h: save default value in params.
15860
15861 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15862
15863         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
15864         no need to build a new path combining that with the application base.
15865         Fixes bug #60442.
15866
15867 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
15868
15869         * reflection.c: fixed minor standard compliance issues.
15870
15871 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
15872
15873         * reflection.c: fixed issue with encoding some custom attributes
15874         (arrays in properties and fields, bug #60411).
15875
15876 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15877
15878         * reflection.c: fix start address when copying the public key token.
15879
15880 2004-06-23  Martin Baulig  <martin@ximian.com>
15881
15882         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
15883         the `exc' object in a static object to put it into the GC's root set.
15884
15885 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
15886
15887         * reflection.c: make mono_reflection_setup_internal_class ()
15888         callable a second time to setup a new parent class.
15889
15890 2004-06-23  Dick Porter  <dick@ximian.com>
15891
15892         * threads.c: Check for WAIT_IO_COMPLETION return values.
15893
15894 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
15895
15896         * appdomain.c: Removed the g_free on the public key token. Now copy 
15897         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
15898         * assembly.c: Added public key token string value when loading 
15899         assemblies. Fix bug #60439.
15900         * icall.c: Added missing informations (like public key) in 
15901         GetReferencedAssemblies. Fix #60519.
15902         * image.h: Changed definition for public key token from const char*
15903         public_tok_value to guchar public_key_token [17];
15904         * reflection.c: Updated for changes to public key token.
15905
15906 2004-06-22  Lluis Sanchez Gual
15907
15908         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
15909         for the field in base classes.
15910
15911 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
15912
15913         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
15914         mark headers as not supported, they are installed only for use by the
15915         debugger.
15916
15917 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
15918
15919         * *.c, *.h: avoid namespace pollution in public headers.
15920
15921 2004-06-21  Martin Baulig  <martin@ximian.com>
15922
15923         * exception.c (mono_get_exception_security): It's in
15924         "System.Security", not in "System".
15925
15926         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
15927         the exception classes.
15928
15929 2004-06-21  Martin Baulig  <martin@ximian.com>
15930
15931         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
15932         Protect the exception object from being finalized.
15933
15934 2004-06-21  Martin Baulig  <martin@ximian.com>
15935
15936         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
15937         public function.
15938
15939 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
15940
15941         * reflection.c: Load the assembly in mono_reflection_type_from_name,
15942         if it was not loaded before. Fix parts of #60439.
15943
15944 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
15945
15946         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
15947         code that was broken since Ben's change: wrappers are now
15948         dependent on the method signature only again.
15949
15950 2004-06-21  Martin Baulig  <martin@ximian.com>
15951
15952         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
15953         added interface support.
15954
15955 2004-06-21  Martin Baulig  <martin@ximian.com>
15956
15957         * class.c (mono_vtable_get_static_field_data): New public method.
15958
15959 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
15960
15961         * filewatcher.c : Windows build fix to be compliant with API changes.
15962
15963 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
15964
15965         * class.h, class.c: more accessors.
15966         * metadata.h, metadata.c: prepare for hiding MonoType and
15967         MonoMethodSignature: people should use the accessors from now on
15968         outside of the tree.
15969
15970 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
15971
15972         * *.c, *.h: more API cleanups.
15973
15974 2004-06-18  Jackson Harper  <jackson@ximian.com>
15975
15976         * assembly.c: Trace loading assemblies.
15977         * loader.c: Trace loading native libraries.
15978         * mono-config.c: Trace loading config files.
15979         
15980 2004-06-18  Dick Porter  <dick@ximian.com>
15981
15982         * locales.c: Tell ICU the lengths of strings, it can cope with
15983         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
15984
15985 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
15986
15987         * image.c: swapped name/filename;
15988
15989 2004-06-18  Martin Baulig  <martin@ximian.com>
15990
15991         * mono-debug-debugger.c (write_class): Write the parent class at
15992         the end of the header.
15993
15994 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
15995
15996         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
15997
15998 2004-06-17  Raja R Harinath  <rharinath@novell.com>
15999
16000         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
16001         (bundle_obj): New conditional define.
16002         (BUILT_SOURCES): Remove.
16003         ($(bundle_srcs)): Make parallel-make safe.
16004         (libmonoruntime_la_LIBADD): Make unconditional.
16005         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
16006         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
16007
16008 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
16009
16010         * culture-info-tables.h: It was inconsistent with the latest
16011           supp info files.
16012
16013 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
16014
16015         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
16016         be loaded.
16017
16018         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
16019         with gcc 2.95.
16020
16021 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
16022
16023         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
16024         cleaned up public header threads.h.
16025
16026 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
16027
16028         * Makefile.am, *.c, *.h: more API cleanups.
16029
16030 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
16031
16032         * Makefile.am: removed monosn from compilation.
16033         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
16034         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
16035         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
16036         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
16037         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
16038         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
16039
16040 2004-06-15  Jackson Harper  <jackson@ximian.com>
16041
16042         * assembly.c: Make locales lower case when searching the GAC for
16043         assemblies. gacutil will always make locales lowercase when
16044         installing so this effectively makes them case insensitive.
16045         
16046 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
16047
16048         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
16049         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
16050           parameter which allows to choose whether the wait can be interrupted or 
16051           not. Also added the method mono_monitor_enter(), which locks the monitor
16052           using an infinite wait and without allowing interruption.
16053           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
16054           interrupted.
16055         * object.h: Added new fields in MonoThread. suspend_event holds the event
16056           used to susped/resume the thread. synch_lock is the lock object to use for
16057           modifying the thread state.
16058         * threads.c: Use the new synch_lock object for locking, instead of "this",
16059           which can generate deadlocks.
16060           Moved thread state change in Thread.Sleep and Thread.Join from managed
16061           to unmanaged code. This avoids a deadlock when the thread was suspended
16062           just after acquiring the thread lock.
16063           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
16064           Implemented Thread.Suspend using an event instead of ThreadSuspend,
16065           which is not fully implemented in the io-layer.
16066         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
16067
16068 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
16069
16070         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
16071         threads-types.h: more API cleanups.
16072
16073 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
16074
16075         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
16076         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
16077         threadpool.c, threads.c: first pass at the exported API cleanup.
16078
16079 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
16080
16081         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
16082
16083 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16084
16085         * icall.c: added internalGetHome.
16086
16087 2004-06-14  Dick Porter  <dick@ximian.com>
16088
16089         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
16090         possible to return successfully when '.' or '..' were the only
16091         entries in a directory, but were skipped.  The MonoIOStat was not
16092         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
16093         Fixes bug 59574.
16094
16095 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
16096
16097         * reflection.c: make binaries run on .Net 1.1 by default.
16098
16099 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
16100
16101         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
16102
16103 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
16104
16105         * marshal.c: keep track of struct size with explicit layout
16106         (bug #59979).
16107
16108 2004-06-12  Martin Baulig  <martin@ximian.com>
16109
16110         * mono-debug-debugger.c: Comment out a debugging g_message().
16111
16112 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
16113
16114         * reflection.c, reflection.h: do not free custom attrs that are cached.
16115         * icall.c: use braces to make code clearer.
16116
16117 2004-06-11  Martin Baulig  <martin@ximian.com>
16118
16119         * class.h (MonoInflatedField): New type.
16120         (MonoClassField): Replaced `MonoType *generic_type' with
16121         `MonoInflatedField *generic_info'.
16122
16123         * icall.c
16124         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
16125
16126 2004-06-11  Martin Baulig  <martin@ximian.com>
16127
16128         * reflection.c (mono_image_create_method_token): Correctly encode
16129         varargs methods.
16130
16131 2004-06-11  Martin Baulig  <martin@ximian.com>
16132
16133         * metadata.c (mono_metadata_parse_method_signature): When parsing
16134         a MethodDef which has VarArgs, also set sentinelpos if we don't
16135         have any parameters.
16136
16137 2004-06-11  Martin Baulig  <martin@ximian.com>
16138
16139         * verify.c (mono_method_verify): In CEE_CALL, use
16140         mono_method_get_signature() to get the method's signature, unless
16141         we're a PInvoke method.
16142
16143 2004-06-10  Jackson Harper  <jackson@ximian.com>
16144
16145         * assembly.c: Use <path>/lib/mono/gac for the extra paths
16146         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
16147         logical name as the supplied path is just a prefix to the gac not
16148         the direct path to it.
16149         
16150 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
16151
16152         * reflection.c: make the token for a created method match
16153         the token of the MethodBuilder it was created from
16154         (IKVM requires this behaviour now).
16155
16156 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
16157
16158         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
16159         reflection.c, socket-io.c: leak fixes.
16160
16161 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
16162
16163         * icall.c: handle sentinel pos in vararg methods in position different
16164         from 0.
16165
16166 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16167
16168         * culture-info-tables.h: freshly generated.
16169
16170 2004-06-09  Martin Baulig  <martin@ximian.com>
16171
16172         * loader.c (mono_get_method_constrained): Call `mono_class_init
16173         (constrained_class)'.   
16174
16175 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
16176
16177         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
16178         any methods. Fixes #59629.
16179
16180 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
16181
16182         * culture-info-tables.h: reflecting locale-builder updates.
16183
16184 2004-06-08  Dick Porter  <dick@ximian.com>
16185
16186         * object.h:
16187         * locales.c: Fixed compile warnings, including a real bug in
16188         CompareInfo_internal_compare.
16189         
16190 2004-06-08  Dick Porter  <dick@ximian.com>
16191
16192         * locales.c
16193         (ves_icall_System_Globalization_CompareInfo_internal_index):
16194         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
16195         Double-check the resuls of usearches, because ICU currently
16196         ignores most of the collator settings here.  Fixes bug 59720.
16197         
16198 2004-06-08  Dick Porter  <dick@ximian.com>
16199
16200         * locales.c
16201         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
16202         Fix memory leak and segfault-causing typo.  No idea how this one
16203         lasted so long without being noticed.
16204
16205 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
16206
16207         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
16208         any methods. Fixes #59629.
16209
16210 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16211
16212         * assembly.c:
16213         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
16214         own the critical section before). Removed dead code (that's done
16215         in the preload hook).
16216
16217         (mono_assembly_load_with_partial_name): call the preload hook.
16218
16219 2004-06-08  Martin Baulig  <martin@ximian.com>
16220
16221         * metadata.c (mono_metadata_signature_alloc): Default
16222         `sentinelpos' to -1.
16223
16224         * reflection.c (mono_image_get_array_token): Likewise.
16225
16226 2004-06-08  Martin Baulig  <martin@ximian.com>
16227
16228         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
16229
16230         * metadata.c (mono_metadata_parse_method_signature): When parsing
16231         a MethodDef which has VarArgs, set sentinelpos.
16232
16233         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
16234         `gint16' since we're using -1 for non-varargs methods.
16235
16236         * reflection.c
16237         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
16238         (method_encode_signature): Added varargs support.
16239         (method_builder_encode_signature): Likewise.
16240         (mono_image_get_varargs_method_token): New static method.
16241         (mono_image_create_method_token): New public method; this is
16242         called via an icall instead of mono_image_create_token() when
16243         calling a varargs method.       
16244
16245 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
16246
16247         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
16248
16249 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
16250
16251         * culture-info-tables.h : Reflecting the latest locale-builder that
16252           fixed empty array representation ({} to {0}).
16253
16254 2004-06-07  Jackson Harper  <jackson@ximian.com>
16255
16256         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
16257         looking up extra gac paths. This allows MONO_GAC_PATH to act
16258         exactly like a prefix.
16259         
16260 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
16261
16262         * reflection.c (mono_reflection_type_from_name): Make a copy of the
16263         type name before modifying it. Fixes #59405.
16264
16265 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
16266
16267         * culture-info.h: added fields for "all datetime patterns".
16268         * locales.c: (  ves_icall_System_Globalization_CultureInfo
16269           _construct_datetime_format ()): fill xxx_patterns fields.
16270         * object.h: added fields for "all datetime patterns" to
16271           MonoDateTimeFormatInfo.
16272         * culture-info-tables.h: reflecting locale-builder updates.
16273
16274 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
16275
16276         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
16277         the event has no add and remove methods. Fixes #59629.
16278
16279 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
16280
16281         * object.c: Fixed possible integer overflow when allocating large
16282         strings.
16283
16284 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
16285
16286         * culture-info-tables.h: reflecting locale-builder updates.
16287
16288 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
16289
16290         * culture-info-tables.h: reflecting locale-builder updates.
16291
16292 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
16293
16294         * culture-info-tables.h: reflecting locale-builder updates.
16295
16296 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
16297
16298         * threads.c: Made Thread.Sleep abortable.
16299
16300 2004-06-02  Martin Baulig  <martin@ximian.com>
16301
16302         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
16303
16304         * debug-mono-symfile.h: Bumped symbol file version number to 37.
16305
16306 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
16307
16308         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
16309
16310 2004-05-30  Jackson Harper  <jackson@ximian.com>
16311
16312         * reflection.c: Do not hardcode assembly versions or public key
16313         tokens anymore. All of this except the corlib section was dead
16314         code anyways.
16315         
16316 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
16317
16318         * object.c (mono_runtime_invoke_array): Automatically create boxed
16319         objects for byref valuetypes if needed. Fixes #59300.
16320         
16321         * object.c (mono_method_return_message_restore): Handle 
16322         MONO_TYPE_OBJECT as well.
16323
16324 2004-05-28  Jackson Harper  <jackson@ximian.com>
16325
16326         * reflection.c: The modified type encoding was causing build
16327         problems. Reverted for now.
16328         
16329 2004-05-28  Jackson Harper  <jackson@ximian.com>
16330
16331         * reflection.c/h: Take an assembly ref so that we dont create
16332         fully qualified names when encoding types in the same assembly as
16333         the custom attribute being emitted.
16334         * appdomain.c: Increment version number.
16335         
16336 2004-05-26  Duncan Mak  <duncan@ximian.com>
16337
16338         * icall.c
16339         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
16340         Set the full version number (major, minor, build, revision).
16341
16342 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
16343
16344         * marshal.c (emit_struct_conv): increment src/dst after blit
16345         (mono_marshal_get_managed_wrapper,
16346         mono_marshal_get_native_wrapper): make sure we have marshalling
16347         info before marshalling params (info computation affects
16348         blittable)
16349
16350         * class.c (class_compute_field_layout): correctly deal with
16351         blittable
16352         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
16353         value types (as per what windows dows by default)
16354         (mono_class_setup_mono_type): System.ValueType is blittable
16355         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
16356         blittable
16357
16358         * marshal.c (mono_marshal_load_type_info): flag types  as
16359         non-blittable if the native layout doesn't match the managed
16360         layout
16361
16362 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16363
16364         * appdomain.c: don't add stuff in the private search path that is
16365         above the application base. If application base is not set, there's
16366         no private search path.
16367
16368 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
16369
16370         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
16371         byref struct arguments in native->managed marshalling.
16372
16373 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
16374
16375         * marshal.c (mono_marshal_get_runtime_invoke): correctly
16376         cache methods using signature (special case for methods
16377         that are value type or string class)
16378         
16379         * image.c (mono_image_close): clean up allocated GSList's
16380         in runtime_invoke_cache.
16381
16382 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16383
16384         * mono-config.c: set the correct path for mono_cfg_dir on windows when
16385         there's no MONO_CFG_DIR environment variable defined.
16386
16387 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16388
16389         * threads.c: windows version must be >= 0x0500 to include OpenThread.
16390
16391 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
16392
16393         * threadpool.c: Really wait for 500ms after the async call, even if the wait
16394           is interrumped.
16395         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
16396           before waiting for it, and call CloseHandle after the wait to unref it.
16397           This will make sure that handles are not disposed too early.
16398
16399 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16400
16401         * appdomain.c:
16402         * appdomain.h:
16403         * icall.c: removed
16404         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
16405         needed now.
16406
16407         * object.c: se the application_base only for the domain that runs
16408         Main. Fixes bug #59216,
16409
16410 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16411
16412         * appdomain.c:
16413         * object.c: only the domain in which Main is run have
16414         SetupInformation.ConfigurationFile set, so moved a few lines from
16415         appdomain.c to object.c.
16416
16417 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16418
16419         * appdomain.c: we tried to load [name].(dll|exe), but according
16420         to bug #57710, we must also try [culture]/[name].(dll|exe) and
16421         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
16422         There's a test case attached to bug #58922.
16423
16424 2004-05-27  Dick Porter  <dick@ximian.com>
16425
16426         * icall.c:
16427         * file-io.c: Implemented icalls for locking and unlocking regions
16428         in a file.
16429         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
16430         FALSE on error (fixes both compiler warning and real bug.)
16431
16432 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
16433
16434         * culture-info-tables.h: reflecting locale-builder updates.
16435
16436           (Added missing ChangeLog entry for 05/26)
16437
16438 2004-05-27  Jackson Harper  <jackson@ximian.com>
16439
16440         * locales.c: Fix some cut and paste errors.
16441         
16442 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16443
16444         * mono-config.c: set the correct path for config. directory on windows.
16445
16446 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
16447
16448         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
16449           on win32.
16450
16451 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
16452
16453         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
16454         from pinvoke functions.
16455         
16456         * marshal.c (mono_ftnptr_to_delegate): Implement this.
16457
16458 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
16459
16460         * culture-info-tables.h: reflecting locale-builder updates.
16461
16462 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
16463
16464         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
16465         #59086.
16466
16467 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
16468
16469         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
16470         * icall.c: Modified icalls for RNG.
16471         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
16472         Windows (CryptoAPI).
16473
16474 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
16475
16476         * locales.c: Fix build.
16477
16478 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
16479
16480         * culture-info-tables.h: reflecting locale-builder updates.
16481
16482 2004-05-25  Jackson Harper  <jackson@ximian.com>
16483
16484         * locales.c: When creating the current culture use the $LANGs
16485         specific culture. So DateTimeFormat and NumberFormat entries are created.
16486         
16487 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
16488
16489         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
16490         a char array as parameter.
16491
16492 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
16493
16494         * image.c: In mono_image_open(), always use an absolute path name to
16495           look for already loaded images.
16496
16497 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
16498
16499         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
16500         missing in the windows build (like older cygwin include files).
16501
16502 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
16503
16504         * icall.c: Fixed check for possible integer overflow in Buffer_
16505         BlockCopy icall. Replaced comments style // by /* */.
16506
16507 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
16508
16509         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
16510         
16511         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
16512         check after MONO_VTADDR. Fixes pinvoke2.exe.
16513
16514         * marshal.h marshal.c metadata.h: Add beginnings of support for
16515         ftnptr -> delegate marshalling.
16516
16517 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
16518
16519         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
16520         * threads.c: Fix warnings.
16521
16522 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
16523
16524         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
16525         * icall.c: Registered icalls for Suspend and Resume.
16526         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
16527           Thread.Abort.
16528         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
16529         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
16530         * process.c: Use WaitForSingleObjectEx.
16531         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
16532           checkpoints.
16533         * threads.c, threads.h: Make use of new Ex wait methods. Improved
16534           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
16535           for Suspend and Resume. Added new mono_thread_stop, used for stoping
16536           background threads. Added basic support for Abort in Windows.
16537           Start new threads using a managed delegate invoke wrapper. This wrapper
16538           has an interruption checkpoint that is needed since an interruption
16539           can be requested before the thread leaves the unmanaged code that starts 
16540           the thread.
16541         * marshal.c: Added interruption checkpoint after every native call, and
16542           also before managed calls for wrappers called from unmanaged code to
16543           go into managed code.
16544         * object.h: Added new field in MonoThread to keep track of interruption
16545           requests.
16546
16547 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
16548
16549         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
16550         calls.
16551
16552 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16553
16554         * appdomain.c:
16555         * assembly.c:
16556         * gc.c:
16557         * locales.c:
16558         * mono-config.c:
16559         * rand.c: getenv -> g_getenv (windows!)
16560
16561         * process.c: complete_path is also used on non-windows platforms.
16562
16563 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16564
16565         * icall.c: new signature for Process_Start.
16566
16567         * process.[ch]: new signature for Process_Start. If we're on windows
16568         and UseShellExecute is false, we have to search for the program by
16569         ourselves if we don't get a full path.
16570
16571 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
16572
16573         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
16574         marshalling and call CleanUpNativeData if needed. Fixes #58646.
16575
16576 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16577
16578         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
16579         Fixes bug #58373.
16580
16581 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16582
16583         * process.c: use double quotes to quote program name and arguments on
16584         windows. Fixes bug #58575.
16585
16586 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16587
16588         * file-io.c: don't return "." and ".." when using windows Find*File.
16589
16590 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
16591
16592         * marshal.c: Don't pass wrappers to message init because method 
16593         addressed used to lookup metadata. part of remoting[2|3] fix.
16594
16595 2004-05-15  Jackson Harper  <jackson@ximian.com>
16596
16597         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
16598         path is essentially the same as MONO_PATH except that it points to
16599         GACs instead of lib directories.
16600         * loader.h: The user gac is gone so we dont need function to
16601         enable/disable it.
16602         * mono-config.c: user gac option is now gone.
16603         
16604 2004-05-15  Jackson Harper  <jackson@ximian.com>
16605
16606         * culture-info.h: Make defines more consistent, add calendar data
16607         to the culture info table.
16608         * culture-info-tables.h: Add basic calendar data. Basically
16609         everyone gets default gregorian until all the data is
16610         updated.
16611         * locales.c: Use the new consistent defines. Set calendar data for
16612         culture info objects.
16613         * object.h: add a field for calendar data to CultureInfo
16614         
16615 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
16616
16617         * image.c: image->runtime_invoke_cache is keyed on signatures now.
16618         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
16619         a signature.
16620         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
16621         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
16622         an extra param that is the pointer of the method to invoke. The IL for
16623         the invoke method is no longer specific to the method, but to the
16624         signature of the method. Thus, we can share the same code for multiple
16625         methods. This reduces the number of methods that have to be compiled.
16626
16627 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
16628
16629         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
16630
16631         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
16632
16633         * icall.c: Optimize Buffer.BlockCopy.
16634
16635 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16636
16637         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
16638         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
16639         quote). Changed them to "MMMM yyyy".
16640
16641 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
16642
16643         * rand.c
16644         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
16645
16646 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
16647
16648         * reflection.h: Updated after changes to managed structures.
16649
16650         * appdomain.c: Bump corlib version.
16651
16652 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16653
16654         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
16655         windows.
16656
16657 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16658
16659         * Makefile.am: link to ../os/libmonoos.la on windows.
16660
16661         * assembly.c:
16662                 -If MONO_DEBUG, warn about non-existing directories in
16663                 MONO_PATH.
16664                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
16665                 compile time variable.
16666                 -Removed init_default_path and call mono_set_rootdir from
16667                 libmonoos.a instead (windows only).
16668
16669         * assembly.h: declare mono_assembly_getrootdir().
16670
16671         * domain.c:
16672         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
16673
16674         * loader.c: s/getenv/g_getenv/
16675
16676 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
16677
16678         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
16679
16680         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
16681
16682         * metadata.h: Add new marshalling conversions.
16683
16684         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
16685         function.
16686
16687         * reflection.c (mono_reflection_get_type): Lookup the type in all
16688         modules of a multi-module assembly. Fixes #58291.
16689
16690 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
16691
16692         * threads.c: Before aborting a background, set the StopRequested
16693         state.  This avoids throwing the Abort exception.
16694         In mono_thread_manage, don't continue with the shutdown until all
16695         aborted threads have actually stopped.
16696
16697 2004-05-10  Jackson Harper  <jackson@ximian.com>
16698
16699         * locales.c: Remove the modifier from culture names.
16700         
16701 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16702
16703         * Makefile.am: monosn is not installed any more. It has been deprecated
16704         in favor of sn.
16705
16706 2004-05-07  Jackson Harper  <jackson@ximian.com>
16707
16708         * locales.c
16709         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
16710         Fix array construction, add bailout if the length is 0.
16711
16712 2004-05-07  Dick Porter  <dick@ximian.com>
16713
16714         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
16715         machine doesn't have a DNS entry.  Patch by Urs Muff
16716         (umuff@quark.com), fixes bug 57928.
16717
16718 2004-05-06  Jackson Harper  <jackson@ximian.com>
16719
16720         * reflection.c: Handle null PublicTokens properly. alloc mem for
16721         assembly names culture so we dont crash when freeing it.
16722         
16723 2004-05-06  Jackson Harper  <jackson@ximian.com>
16724
16725         * assembly.c: Check the usergac when loading with partial names.
16726         
16727 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
16728
16729         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
16730         does nothing for now (not required for Linux/Windows) but the class
16731         library can call it (and a newer or modified runtime could need it).
16732         * icall.c: Registred icall.
16733
16734 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16735
16736         * loader.c: prints a message on module loading error we set MONO_DEBUG
16737         environment variable.
16738
16739 2004-05-05  Jackson Harper  <jackson@ximian.com>
16740
16741         * appdomain.c: Handle PublicKeyToken=null properly.
16742         
16743 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
16744
16745         * environment.c|h: Added icall ves_icall_System_Environment_
16746         GetOSVersionString to get the current OS version as a string.
16747         * icall.c: Registred icall.
16748
16749 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
16750
16751         * object.c: in mono_object_get_virtual_method(), take into account that
16752         non-virtual methods don't have a slot in the vtable. Check needed when
16753         the object is a proxy.
16754
16755 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
16756
16757         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
16758         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
16759
16760         * object.c (mono_class_compute_gc_descriptor): Fix warning.
16761
16762         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
16763         passed when a valuetype is expected.
16764
16765         * object.c (mono_unhandled_exception): Only set the exit code if the
16766         exception happens in the main thread. Fixes thread5.exe.
16767
16768         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
16769         invalid names. Fixes #58047.
16770
16771 2004-05-03  Jackson Harper  <jackson@ximian.com>
16772
16773         * assembly.c: This line was committed accidently and is unneeded.
16774         
16775 2004-05-03  Jackson Harper  <jackson@ximian.com>
16776
16777         * icall.c: Add new icall for Assembly::LoadWithPartialName
16778         * assembly.c/.h: new function that probes the GAC to load partial
16779         assembly names by Paolo Molaro.
16780         
16781 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16782
16783         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
16784         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
16785         (type_get_fully_qualified_name): Added PublicKeyToken when building a
16786         full type name.
16787
16788 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16789
16790         * appdomain.c: fixed check for 'neutral' culture and removed warning.
16791         * reflection.c: fix bug when parsing a full type name and Version is not
16792         the last thing in the string.
16793
16794 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
16795
16796         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
16797         crashes when it is freed.
16798
16799 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16800
16801         * assembly.c: print the compat warning to stderr.
16802
16803 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
16804
16805         * assembly.c (mono_assembly_load_references): Add a compatibility
16806         hack to run old applications that might be still referencing the
16807         3300-based assemblies, only do this for System.xxx.
16808
16809 2004-05-01  Jackson Harper  <jackson@ximian.com>
16810
16811         * appdomain.c: If the culture is neutral we set it to "".
16812         
16813 2004-04-29  Jackson Harper  <jackson@ximian.com>
16814
16815         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
16816
16817 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
16818  
16819         * string-icalls.c: added low overhead function for copying chars
16820         * icall.c: added needed icall for the above function
16821  
16822 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16823
16824         * icall.c: fix return value of get_global_assembly_cache.  Implemented
16825         Environment.GetLogicalDrives.
16826
16827 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
16828
16829         * rand.c: try and talk to egd or prngd
16830         for random bytes if opening devices fail.
16831
16832 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
16833
16834         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
16835         alignment for the type using the native alignment of its members 
16836         instead of using klass->min_align.
16837
16838         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
16839
16840 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16841
16842         * file-io.c:
16843         * socket-io.c: added check for sys/aio.h.
16844
16845 2004-04-28  Dick Porter  <dick@ximian.com>
16846
16847         * threads.c: Don't abort a thread thats already aborting, when
16848         terminating everything.
16849
16850 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16851
16852         * icall.c: added 2 new async calls for Socket.
16853
16854         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
16855         IO on *nix systems.
16856
16857         * threadpool.c: removed unused variable.
16858
16859 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
16860
16861         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
16862
16863 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
16864
16865         * locales.c: put back string_invariant_tolower () and
16866         string_invariant_toupper ().
16867
16868 2004-04-26 David Waite <mass@akuma.org>
16869
16870         * file-io.h:
16871         * socket-io.h:
16872         * threads.h:
16873         * unicode.h: remove comma from end of enumeration declarations
16874
16875 2004-04-26 David Waite <mass@akuma.org>
16876
16877         * debug-mono-symfile.h:
16878         * decimal.c:
16879         * mono_debug.h:
16880         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
16881
16882
16883 2004-04-26  Jackson Harper  <jackson@ximian.com>
16884
16885         * appdomain.c: Increment version number.
16886         
16887 2004-04-26  Jackson Harper  <jackson@ximian.com>
16888
16889         * appdomain.c: Set assembly references public token value when
16890         PublicKeyToken is specified, not the hash_value. Free public token
16891         values when free assembly name data. Previously the public key
16892         token was hex decoded, however we are using hex encoded public key
16893         tokens, so this is not neccasary.
16894         * assembly.c: Lookup assemblies in the gac if their public token
16895         value is set. Add function to allow enabling user gac
16896         lookups. Specify whether or not the assembly was loaded from the
16897         GAC. Compare full assembly names when checking the cache for
16898         assemblies (Temporarily disabled see comment in code). Remove
16899         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
16900         specifies trace-loader they get extra info to stdout on the
16901         loading of assemblies.
16902         * image.h: Add a field for an assembly references public token
16903         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
16904         whether an assembly has been loaded from the GAC.
16905         * image.c: Remove a corlib -> mscorlib name mapping.
16906         * loader.h: Add function to enable/disable the user gac.
16907         * mono-config.c: Check if the usergac is enabled in the config
16908         file.
16909         * icall.c: New icall to determine whether or not an assembly has
16910         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
16911         * tabldefs.h: Add constant for assemblyref flag that specifies a
16912         full public key is used instead of a public token.
16913         * reflection.c: Remove mscorlib -> corlib mappings. Set
16914         PublicTokenValue instead of hash value. This value is a hex
16915         string so it does not need to be expanded.
16916
16917 2004-04-26  Martin Baulig  <martin@ximian.com>
16918
16919         * mono-debug-debugger.c (mono_debugger_initialize): Set
16920         `mono_debugger_initialized' before calling mono_debug_lock().
16921
16922 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
16923
16924         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
16925           InternalToUpper/InternalToLower.
16926         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
16927           removed invariant culture shortcut.  This is now done in managed code.
16928         * locales.c: (string_invariant_toupper/tolower) removed.
16929
16930 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16931
16932         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
16933         Added Poll internal call.
16934
16935         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
16936         call for Poll. Select was too heavy for polling a single socket.
16937
16938         * threadpool.[ch]: added mono_threadpool_cleanup.
16939         * threads.c: use it. Don't use Thread_Abort on windows.
16940
16941 2004-04-23  Martin Baulig  <martin@ximian.com>
16942
16943         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
16944
16945 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
16946
16947         * icall.c: Registred new icalls for key pair protection and added an
16948         icall for Environment.GetFolderPath on Windows.
16949         * security.c|h: Added new icalls for key pair protection.
16950
16951 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16952
16953         * socket-io.c: don't display the non-supported family warning for known
16954         families. Now this is not displayed on windows when checking support
16955         for IPv4/IPv6.
16956
16957 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16958
16959         * class.c: don't display the layout warning for static fields.
16960
16961 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
16962
16963         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
16964         * locales.c, locales.h: Added new icalls for culture-specific
16965         Char.ToLower and Char.ToUpper.
16966
16967 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16968
16969         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
16970         by David Waite.
16971
16972 2004-04-20  Martin Baulig  <martin@ximian.com>
16973
16974         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
16975         of the type name before passing it to mono_reflection_type_from_name().
16976
16977 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
16978
16979         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
16980         encodings here. Fixes #56965.
16981
16982 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
16983
16984         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
16985         fix test on strstr result not that I can see anything that
16986         relies on the result.
16987
16988 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
16989
16990         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
16991         Fixes #57081.
16992
16993         * marshal.c (mono_marshal_get_string_encoding): New helper function.
16994
16995         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
16996         function to determine which marshalling to use for strings. Fixes
16997         #56965.
16998
16999         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
17000
17001         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
17002
17003 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
17004
17005         * icall.c: #include mono-config.h
17006
17007 2004-04-15  Jackson Harper  <jackson@ximian.com>
17008
17009         * culture-info-tables.h: Fix date formats for en-US culture.
17010         
17011 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
17012
17013         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
17014         ThreadPool.SetMinThreads.
17015         * threadpool.c: Implemented ThreadPool.GetMinThreads and
17016         ThreadPool.SetMinThreads.
17017
17018 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
17019
17020         * mono-config.c: also load the .config file in the directory
17021         where the assembly was found.
17022
17023 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
17024
17025         * assembly.c: load per-assembly config files.
17026         * icall.c: decrapified code to get the config dir and moved to
17027         mono-config.c.
17028         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
17029         per-assembly config files. When doing a dll map lookup give precedence
17030         to the per-assembly data.
17031
17032 2004-04-14  Martin Baulig  <martin@ximian.com>
17033
17034         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
17035         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
17036         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
17037
17038         * mono-debugger-debugger.c: While the debugger is locked, remember
17039         whether the symbol tables have changes and send one single
17040         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
17041
17042 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
17043
17044         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
17045
17046         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
17047         function.
17048
17049         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
17050         account when marshalling string arrays. Fixes #56965.
17051
17052 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
17053
17054         * icall.c: Add new icalls mapping for security.
17055         * security.c|h: Add internal calls for WindowsIdentity,
17056         WindowsImpersonationContext and WindowsPrincipal.
17057
17058 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
17059
17060         * class.c: Added comment to ensure the System.MonoDummy class
17061         is removed when no longer necessary
17062
17063 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
17064
17065         * appdomain.c: Pass arguments to the bootstraping exceptions to
17066         minimize JITed methods at boot
17067
17068         * metadata.c (mono_exception_from_name_two_strings): Allow for the
17069         second string to be null.
17070
17071         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
17072         Change the protocol to minimize the JIT methods at startup.  Now
17073         it Returns the internal codepage, if the value of "int_code_page"
17074         is 1 at entry, and we can not compute a suitable code page
17075         number, returns the code page as a string.
17076
17077 2004-04-13  Jackson Harper  <jackson@ximian.com>
17078
17079         * culture-info-tables.h: Fix number of decimal digits for all
17080         english locales.
17081
17082 2004-04-13  Jackson Harper  <jackson@ximian.com>
17083
17084         * icall.c: Clairfy out of sync error message. It is not always
17085         your corlib that is out of sync.
17086
17087 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
17088
17089         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
17090         properties when only the set accessor is overriden. Fixes #55874.
17091
17092 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
17093
17094         * assembly.c (mono_assembly_load_references): Make this thread safe.
17095         Fixes #56327.
17096
17097 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
17098
17099         * monosn.c: Add missing initialization calls.
17100
17101 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
17102
17103         * locales.c:
17104         ves_icall_System_Globalization_CultureInfo_construct_number_format
17105         Fix g_assert so it compiles on fussier compilers re int/ptr
17106         mismatch
17107
17108 2004-04-08  Dick Porter  <dick@ximian.com>
17109
17110         * socket-io.h:
17111         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
17112         53992.  Also rearrange the code so that the internal calls return
17113         an error value and exceptions are thrown from managed code.
17114
17115         * icall.c: Add type info to the socket icalls.
17116
17117 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17118
17119         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
17120         owes me a beer.
17121
17122 2004-04-07  Martin Baulig  <martin@ximian.com>
17123
17124         * class.c (mono_class_from_generic_parameter): Don't default
17125         `klass->parent' to `mono_defaults.object_type'.
17126
17127 2004-04-07  Martin Baulig  <martin@ximian.com>
17128
17129         * reflection.c (mono_reflection_initialize_generic_parameter): Set
17130         `param->pklass->reflection_info'.       
17131
17132 2004-04-07  Jackson Harper  <jackson@ximian.com>
17133
17134         * culture-info-tables.h: Fix date separator symbol.
17135         
17136 2004-04-07  Martin Baulig  <martin@ximian.com>
17137
17138         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
17139         from System.Type to System.MonoType.
17140
17141 2004-04-07  Martin Baulig  <martin@ximian.com>
17142
17143         * reflection.h
17144         (MonoReflectionGenericParam): Added `has_reference_type' and
17145         `has_value_type' fields.
17146
17147         * reflection.c (mono_image_get_generic_param_info): Encode the
17148         correct flags if we have the `class' or `struct' constraint.
17149
17150 2004-04-07  Martin Baulig  <martin@ximian.com>
17151
17152         * reflection.h
17153         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
17154
17155 2004-04-07  Jackson Harper  <jackson@ximian.com>
17156
17157         * appdomain.c: Revert extra patches, just wanted to bump the
17158         version number.
17159         
17160 2004-04-07  Jackson Harper  <jackson@ximian.com>
17161
17162         * Makefile.am: Add culture-info private headers.
17163         * icall.c: Add new icalls for contructing locales.
17164         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
17165         * locales.h: Declare new culture info construction methods.
17166         * object.h: Add new fields used to avoid the CultureMap to
17167         MonoCultureInfo.
17168         * culture-info.h: Definition of structs used in the culture info
17169         tables.
17170         * culture-info-tables.h: Autogenerated tables that contain culture
17171         info data. This file was generated with the locale-builder tool.
17172         * appdomain.c: Incement corlib version number.
17173         
17174 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
17175
17176         * appdomain.c: (mono_runtime_init) move mono_thread_init
17177         to before mono_object_new calls so critical sections
17178         are initialized before use.
17179
17180 2004-04-07  Martin Baulig  <martin@ximian.com>
17181
17182         * icall.c
17183         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
17184         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
17185         (ves_icall_MonoGenericParam_initialize): Removed.
17186         (monogenericparam_icalls): Removed.
17187         (generictypeparambuilder_icalls): Added new table for
17188         System.Reflection.Emit.GenericTypeParameterBuilder.
17189
17190         * reflection.c
17191         (mono_reflection_define_generic_parameter): Removed.
17192         (mono_reflection_initialize_generic_parameter): This is now called
17193         from GenericTypeParameterBuilder's .ctor.
17194
17195 2004-04-06  Martin Baulig  <martin@ximian.com>
17196
17197         * class.c (mono_class_init): Don't inflate nested classes in a
17198         generic instance.
17199         (mono_type_get_name_recurse): Include the generic arguments for
17200         generic instances and generic type declarations.
17201         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
17202         (_mono_class_get_instantiation_name): Removed.
17203         (mono_class_create_generic): Always use `gklass->name' as our name.
17204
17205         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
17206
17207         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
17208         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
17209         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
17210         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
17211         closed generic methods here.
17212
17213         * reflection.c
17214         (mono_reflection_generic_inst_get_nested_types): Removed.
17215         (inflate_mono_method): Copy the generic parameters from the
17216         MonoMethodHeader into out MonoGenericMethod.
17217
17218 2004-04-06  Martin Baulig  <martin@ximian.com>
17219
17220         * row-indexes.h
17221         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
17222
17223         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
17224
17225         * reflection.c (build_compressed_metadata): If we have any entries
17226         in the GenericParam, MethodSpec or GenericParamConstraint tables,
17227         set the header version to 1.1.
17228
17229 2004-04-06  Martin Baulig  <martin@ximian.com>
17230
17231         * class.c (mono_class_init): If we're a generic instance,
17232         initialize our nested classes, too.
17233         (_mono_class_get_instantiation_name): Deal with the new `!%d'
17234         suffix. 
17235
17236 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17237
17238         * process.c: quote the argument passed to the shell on windows.
17239
17240 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
17241
17242         * threads.c (mono_alloc_special_static_data): Allow this to be
17243         called during startup.
17244
17245 2004-04-02  Martin Baulig  <martin@ximian.com>
17246
17247         * icall.c
17248         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
17249
17250 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
17251
17252         * icall.c: Fix build.
17253
17254 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
17255
17256         * Makefile.am: Added security.c|h.
17257         * icall.c: Added icall for get_UserName;
17258         * security.c: New file for security related icalls. Added function
17259         get_UserName for System.Environment (fix #56144).
17260         * security.h: New. Header file for security.c
17261
17262 2004-04-02  Dick Porter  <dick@ximian.com>
17263
17264         * icall.c: Deleted the icalls that were obsoleted some time ago
17265         by the ICU string code, and which were mixed into the icall
17266         rearranging.  Fixes bug 55969.
17267
17268         * string-icalls.h: 
17269         * string-icalls.c: Deleted the code that those icalls reference.
17270
17271 2004-04-01  Martin Baulig  <martin@ximian.com>
17272
17273         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
17274
17275         * class.c (mono_class_from_generic_parameter): Don't set 
17276         TYPE_ATTRIBUTE_INTERFACE.
17277         (my_mono_class_from_generic_parameter): Likewise.
17278
17279 2004-04-01  Martin Baulig  <martin@ximian.com>
17280
17281         * loader.c (find_method): Added an optional `MonoClass *ic'
17282         argument to search in a specific interface.
17283         (mono_get_method_constrained): New public function.
17284
17285 2004-04-01  Martin Baulig  <martin@ximian.com>
17286
17287         * reflection.c (mono_image_get_generic_field_token): Use the
17288         `handleref' cache here.
17289
17290 2004-04-01  Martin Baulig  <martin@ximian.com>
17291
17292         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
17293
17294         * reflection.c (create_generic_typespec): Use the `typespec' hash
17295         here, not the `typeref' one.    
17296
17297 2004-04-01  Martin Baulig  <martin@ximian.com>
17298
17299         * class.c (mono_class_inflate_generic_type): Moved the
17300         functionality into a new static inflate_generic_type() which
17301         returns NULL if it didn't do anything.  Only increment the
17302         `mono_stats.inflated_type_count' if we actually inflated
17303         something.
17304         (mono_class_get_full): Check the classes type to see whether we
17305         need to inflate it; also inflate MONO_TYPE_(M)VAR.
17306
17307 2004-04-01  Jackson Harper  <jackson@ximian.com>
17308
17309         * reflection.c: Set culture for assembly references.
17310         
17311 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17312
17313         * reflection.[ch], icall.[ch], Fix support for pinning variables.
17314
17315 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17316
17317         * assembly.c:
17318         (do_mono_assembly_open): the critical section also covers
17319         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
17320
17321 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17322
17323         * threads.c:
17324         (mono_manage_threads): abort the background threads when finishing.
17325         Fixes bug #47232.
17326
17327 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17328
17329         * gc.c: only close the done_event handle if there was no timeout.
17330         C-ified comments.
17331
17332 2004-03-30  Martin Baulig  <martin@ximian.com>
17333
17334         * icall.c (icall_entries): It's called "System.Activator", not
17335         "System.Activation".    
17336
17337 2004-03-30  Martin Baulig  <martin@ximian.com>
17338
17339         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
17340         (mono_class_create_from_typespec): Likewise.
17341
17342 2004-03-30  Martin Baulig  <martin@ximian.com>
17343
17344         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
17345         `has_ctor_constraint' and `initialized'.
17346
17347 2004-03-30  Martin Baulig  <martin@ximian.com>
17348
17349         * reflection.c (encode_new_constraint): New static function to add
17350         the constructor constraint attribute to a type parameter.
17351         (encode_constraints): Call encode_new_constraint() if necessary.
17352
17353         * reflection.h
17354         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
17355
17356         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
17357         
17358 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17359
17360         * reflection.c, icall.c: add support for pinning variables. 
17361
17362 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
17363
17364         * marshal.c (mono_marshal_get_managed_wrapper):
17365         init bool local with zero rather than null.
17366
17367 2004-03-29  Martin Baulig  <martin@ximian.com>
17368
17369         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
17370         the "official" behavior here.
17371         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
17372
17373 2004-03-29  Martin Baulig  <martin@ximian.com>
17374
17375         * icall.c: Reflect latest API changes.
17376
17377 2004-03-29  Martin Baulig  <martin@ximian.com>
17378
17379         * loader.c (mono_get_method_from_token): Also call
17380         mono_metadata_load_generic_params () for abstract and interface
17381         methods; replace the type arguments in the method signature with
17382         the ones which are loaded from the metadata.
17383
17384 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
17385
17386         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
17387         of the lock is not the current thread. MS.NET don't do it, in spite of
17388         what the documentation says. See bug #56157.
17389
17390 2004-03-28  Martin Baulig  <martin@ximian.com>
17391
17392         * class.c (mono_class_init): Don't call init_properties() and
17393         init_events() for generic instances; set `prop->parent' when
17394         inflating properties.
17395
17396         * reflection.c (mono_generic_inst_get_object): Call
17397         `mono_class_init (ginst->klass)'.
17398         (mono_type_get_object): Only create a MonoGenericInst if your
17399         generic type is a TypeBuilder.
17400         (do_mono_reflection_bind_generic_parameters): Only set
17401         `ginst->is_dynamic' if our generic type is a TypeBuilder.
17402
17403 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
17404
17405         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
17406         Fixes #56091.
17407
17408 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17409
17410         * icall.c: added Kill_internal icall.
17411         * process.[ch]: added Kill_internal icall.
17412
17413 2004-03-25  Martin Baulig  <martin@ximian.com>
17414
17415         * class.h (MonoStats): Added `generic_instance_count',
17416         `inflated_method_count', `inflated_type_count' and
17417         `generics_metadata_size'.       
17418
17419 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17420
17421         * reflection.c: no warnings now.
17422
17423 2004-03-25  Martin Baulig  <martin@ximian.com>
17424
17425         * class.c (mono_class_get_full): New public function; does a
17426         mono_class_get(), but also takes a `MonoGenericContext *'.
17427
17428         * loader.c (mono_field_from_memberref): Renamed to
17429         `field_from_memberref', made static and added `MonoGenericContext *'
17430         argument.
17431         (mono_field_from_token): Added `MonoGenericInst *' argument.
17432         (method_from_memberef): Likewise.
17433         (mono_get_method_from_token): Likewise.
17434         (mono_get_method_full): New public function; does a
17435         mono_get_method(), but also takes a `MonoGenericContext *'.
17436
17437         * verify.c (mono_method_verify): Get the method's generic context
17438         and pass it to mono_field_from_token(), mono_get_method_full() and
17439         mono_class_get_full().
17440
17441 2004-03-25  Martin Baulig  <martin@ximian.com>
17442
17443         * class.c (mono_class_inflate_generic_type): Take a
17444         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
17445         `MonoGenericMethod *'.
17446
17447 2004-03-25  Martin Baulig  <martin@ximian.com>
17448
17449         * loader.h (MonoMethodInflated): Store the MonoGenericContext
17450         instead of the MonoGenericMethod here.
17451
17452 2004-03-25  Martin Baulig  <martin@ximian.com>
17453
17454         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
17455         each time we create a new MonoGenericInst, we also create a new
17456         context which points back to us.
17457
17458         * class.c (inflate_method): Use `ginst->context' instead of
17459         creating a new context.
17460
17461         * loader.c (method_from_memberref): Use
17462         `klass->generic_inst->context' instead of creating a new context.
17463
17464 2004-03-25  Martin Baulig  <martin@ximian.com>
17465
17466         * class.h (MonoGenericContext): New struct.
17467         (MonoGenericMethod): Removed `generic_inst'.
17468
17469         * class.c (mono_class_inflate_generic_method): Take a
17470         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
17471
17472 2004-03-25  Martin Baulig  <martin@ximian.com>
17473
17474         * loader.h (MonoMethodInflated): New typedef.
17475
17476         * metadata.h (MonoMethodSignature): Removed `gen_method', make
17477         `generic_param_count' consume just 30 bits, added `is_inflated'
17478         and `has_type_parameters' flags (one bit each).
17479
17480         * class.c (mono_class_inflate_generic_method): Create a
17481         MonoMethodInflated instead of a MonoMethodNormal and set
17482         `is_inflated' in the method signature.
17483
17484         * class.h (MonoGenericMethod): Removed `generic_method'.
17485
17486 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
17487
17488         * image.c: Make sure the name of a MonoImage is always an absolute path.
17489           This fixes bug #54415.
17490
17491 2004-03-24  Martin Baulig  <martin@ximian.com>
17492
17493         * class.c (mono_class_setup_vtable): If we're a generic instance,
17494         use our generic type's vtable size.
17495
17496 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
17497
17498         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
17499         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
17500         problems.
17501
17502 2004-03-23  Martin Baulig  <martin@ximian.com>
17503
17504         * class.h (MonoDynamicGenericInst): Added `int count_events' and
17505         `MonoEvent *events'.
17506
17507         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
17508         (typebuilder_icalls): Added "get_event_info"; calls
17509         mono_reflection_event_builder_get_event_info(). 
17510
17511         * reflection.c (mono_reflection_generic_inst_initialize): Added
17512         `MonoArray *events'.
17513         (mono_reflection_event_builder_get_event_info): New function.
17514
17515 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
17516
17517         * object.h: add mono_type_initialization_init
17518
17519         * object.c (mono_runtime_class_init): 
17520         implement class constructor synchronization rules
17521         to cope with threading issues.  
17522         add mono_type_initialization_init
17523
17524         * appdomain.c (mono_runtime_init): call 
17525         mono_type_initialization_init
17526
17527         * class.h: removing initializing field from MonoVTable
17528
17529 2004-03-23  Martin Baulig  <martin@ximian.com>
17530
17531         * class.c (my_mono_class_from_generic_parameter): Use
17532         `param->name' if it's not NULL. 
17533
17534 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17535
17536         * class.c: do not insert non-virtual methods in the vtable.
17537         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
17538         that means the method is non-virtual. This never would have
17539         happened before.
17540
17541 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
17542
17543         * profiler.c: Added lock for accessing coverage_hash.
17544
17545 2004-03-22  Martin Baulig  <martin@ximian.com>
17546
17547         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
17548         `method->method->signature->generic_param_count != 0' to make it
17549         work for interface methods.
17550
17551 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17552
17553         * process.c: quote the string passed to the shell using g_shell_quote.
17554
17555 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17556
17557         * threads.c:
17558         (mono_threads_manage): don't remove the finalizer thread and self
17559         from the threads hash table so that mono_thread_manage can be called
17560         more than once.
17561
17562 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17563
17564         * process.c: quote the arguments when UseShellExecute is true. Fixes
17565         bug #55790.
17566
17567 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17568
17569         * threads.c: set mono_thread_detach as a cleanup routine for every
17570         thread. This way it's always executed upon thread termination, either
17571         aborted or finished normally. No more xsp hangs!
17572
17573 2004-03-17  Martin Baulig  <martin@ximian.com>
17574
17575         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
17576         `int count_nested' and a `MonoType **nested'.
17577
17578         * reflection.c (mono_reflection_bind_generic_parameters): Moved
17579         most of the functionality into a new static
17580         do_mono_reflection_bind_generic_parameters() and don't take a
17581         `MonoType *nested_in' argument any more.  Don't compute nested
17582         types here.
17583         (mono_reflection_generic_inst_get_nested_types): New public method
17584         to get nested types.
17585
17586         * class.c (mono_class_create_generic): Set `klass->nested_in' if
17587         we're a nested class.
17588
17589         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
17590         mono_reflection_generic_inst_get_nested_types() to compute the
17591         nested types.
17592
17593 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
17594
17595         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
17596         descriptive error message under windows.
17597         
17598 2004-03-17  Martin Baulig  <martin@ximian.com>
17599
17600         * class.c (dup_type): Added `const MonoType *original' argument;
17601         copy the attrs from the original type.
17602
17603 2004-03-17  Martin Baulig  <martin@ximian.com>
17604
17605         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
17606         `m->generic_inst_cache' here.
17607
17608 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
17609
17610         * exception.h exception.c: Add stack_overflow_exception.
17611
17612 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17613
17614         * threadpool.c:
17615         (overlapped_callback): call SetEvent *after* invoking the callback.
17616         No need to call CloseHandle.
17617
17618 2004-03-16  Martin Baulig  <martin@ximian.com>
17619
17620         * reflection.c (mono_image_get_fieldref_token): Take a
17621         `MonoReflectionField *' instead of a `MonoClassField *' and a
17622         `MonoClass *'; store the `MonoReflectionField *' in the hash.
17623
17624 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17625
17626         * appdomain.c: don't add the culture to the filename we're looking for
17627         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
17628
17629 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17630
17631         * locales.c: don't ignore symbols when doing case insensitive compares.
17632         Thanks Dick! Fixes bug #54046.
17633
17634         * threads.c: surround 'threads' usage with enter/leave in
17635         mono_thread_manage.
17636
17637 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
17638
17639         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
17640         implicitly marshalled as [Out]. Fixes #55450.
17641
17642         (mono_marshal_get_runtime_invoke): Zero out the result if there is
17643         an exception.
17644
17645 2004-03-16  Martin Baulig  <martin@ximian.com>
17646
17647         * class.c (mono_class_from_generic_parameter): Use the actual
17648         parameter name. 
17649
17650 2004-03-16  Martin Baulig  <martin@ximian.com>
17651
17652         * reflection.c (type_get_signature_size): New static function.
17653         Compues the size of the type in a method signature.
17654         (method_get_signature_size): New static function; calls
17655         type_get_signature_size() to compute the actual size of the
17656         method's signature.
17657         (method_encode_signature): Use method_get_signature_size() to get
17658         the signature's size rather than using `nparams * 10'.
17659
17660 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17661
17662         * file-io.h: define here WapiOverlapped on windows. I don't want the
17663         regular OVERLAPPED one.
17664
17665         * file-io.c:
17666         * threadpool.c: somehow, BindIoCompletionCallback is not found.
17667         Disabling AIO on windows.
17668
17669 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17670
17671         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
17672         bug #55385.
17673
17674 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17675
17676         * appdomain.c: upgraded corlib version.
17677
17678         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
17679         and BeginWrite. Allow opening files for asynchrnous operations.
17680
17681         * file-io.h: new struct that maps FileStreamAsyncResult.
17682         * icall.c: added new icalls.
17683         * process.[ch]: support setting child process environment variables
17684         and use the SHELL or COMSPEC when UseShellExecute is true.
17685
17686         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
17687         callback for async. IO is here and also BindHandle.
17688
17689         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
17690         from here.
17691
17692 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
17693
17694         * reflection.c (create_custom_attr): Allow len == 0.
17695
17696         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
17697         computation on big-endian machines.
17698
17699 2004-03-13  Martin Baulig  <martin@ximian.com>
17700
17701         * class.h (MonoGenericInst): Added `int count_ifaces'.
17702
17703         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
17704         `ginst->count_ifaces' instead `klass->interface_count' since we
17705         may get called before the vtable is created.
17706
17707         * loader.c (mono_method_get_param_names): If we're a generic
17708         instance, return and don't initialize the class.
17709
17710         * reflection.c (mono_reflection_setup_generic_class): Don't call
17711         ensure_runtime_vtable().
17712         (mono_reflection_bind_generic_parameters): Set
17713         `ginst->count_ifaces'.
17714
17715 2004-03-11  Jackson Harper <jackson@ximian.com>
17716
17717         * icall.c:
17718         * unicode.c:
17719         * unicode.h: Remove unused System.Char icalls.
17720         
17721 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17722
17723         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
17724         code when we P/Invoke the first library in Windows.Forms, instead
17725         of when we first open the assembly.
17726
17727         * assembly.c: Drop the lookup from here.
17728
17729 2004-03-10  Martin Baulig  <martin@ximian.com>
17730
17731         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
17732         class for properties, fields and events.  Finally fixes #54945.
17733
17734 2004-03-10  Martin Baulig  <martin@ximian.com>
17735
17736         * metadata.c (mono_metadata_class_equal): New static function;
17737         checks whether two generic instances or two generic parameters are
17738         equal.
17739         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
17740         compare classes.        
17741
17742 2004-03-10  Martin Baulig  <martin@ximian.com>
17743
17744         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
17745
17746         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
17747         argument and write it into the `reflection_info' field.
17748
17749         * icall.c
17750         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
17751         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
17752
17753 2004-03-09  Jackson Harper  <jackson@ximian.com>
17754
17755         * char-conversions.h: use 8 bits for numeric data its all we need
17756         * icall.c: numeric data is only 8 bits now.
17757
17758 2004-03-09  Martin Baulig  <martin@ximian.com>
17759
17760         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
17761
17762         * class.c (init_properties, init_events): Initialize the new
17763         `parent' field.
17764
17765         * reflection.c (typebuilder_setup_properties): Likewise.
17766         (typebuilder_setup_events): Likewise.
17767
17768         * reflection.h (MonoEventInfo): Replaced `parent with
17769         `declaring_type' and `reflected_type'.
17770
17771         * icall.c (ves_icall_get_property_info): Distinguish between
17772         declaring and reflected type.
17773         (ves_icall_get_event_info): Likewise.
17774
17775 2004-03-09  Martin Baulig  <martin@ximian.com>
17776
17777         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
17778         (ves_icall_Type_GetField): Correctly set field->klass.
17779
17780 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
17781
17782         * loader.h: Fix warning.
17783
17784 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
17785
17786         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
17787         library routine if present.  Notice that it will still continue
17788         executing even if its missing, for those working on the Gtk#
17789         edition of Windows.Forms.
17790
17791         * assembly.c (do_mono_assembly_open): If loading the
17792         System.Windows.Forms call mono_loader_wini_init.
17793
17794 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
17795
17796         * class.h: Added MonoRemoteClass struct.
17797         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
17798         function for MonoStrings.
17799         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
17800         Added internal call for getting the proxy type.
17801         * marshal.c: Get the type of transparent proxies from its remote_class.
17802         Added methods that generate the IL for type checks and casts:
17803         mono_marshal_get_isinst, mono_marshal_get_castclass, 
17804         mono_marshal_get_proxy_cancast.
17805         * marshal.h: Declaration of the previous new methods.
17806         * object.c: Added new moethods for creating and updating MonoRemoteClass
17807         instances: mono_remote_class, mono_upgrade_remote_class, 
17808         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
17809         * verify.c: FIx transparent_proxy_fields layout.
17810         * appdomain.c: Bump corlib version.
17811
17812 2004-03-04  Jackson Harper  <jackson@ximian.com>
17813
17814         * icall.c: Add icall to access char conversion tables.
17815         * char-conversions.h: Character conversion tables.
17816         * Makefile.am: Add char-conversions.h private header file.
17817         
17818 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
17819
17820         * appdomain.c (unload_thread_main): Increase unloading timeout to
17821         10 sec as a temporary workaround for Nant problems.
17822
17823 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
17824
17825         * gc.c: Add checks for GC_enable and GC_disable.
17826
17827         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
17828         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
17829         (bug #54988).
17830         
17831 2004-02-27  Martin Baulig  <martin@ximian.com>
17832
17833         * reflection.c (mono_reflection_bind_generic_parameters): Take a
17834         `MonoReflectionType *' instead of a `MonoType *'.
17835
17836 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
17837
17838         * gc.c (run_finalize): Avoid finalizing the object representing the
17839         finalizer thread.
17840         (finalizer_thread): Fix warning.
17841
17842 2004-02-25  Martin Baulig  <martin@ximian.com>
17843
17844         * class.c (_mono_class_get_instantiation_name): Added `int offset'
17845         argument for nested types.
17846         (mono_class_create_generic): Added support for nested generictypes.
17847
17848         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
17849         `GList *nested'.
17850
17851         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
17852
17853         * reflection.c (method_encode_signature): Increase the minimum
17854         value of `size' from 10 to 11.
17855         (mono_reflection_bind_generic_parameters): Take `int type_argc'
17856         and `MonoType **types' arguments instead of the `MonoArray
17857         *types'; added `MonoType *nested_in'.  Recursively instantiate
17858         nested classes. 
17859
17860 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
17861
17862         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
17863         stack_overflow_ex members which are used by exception handling.
17864
17865         * appdomain.c (mono_runtime_init): Initialize the new members.
17866
17867         * gc.c (mono_gc_enable): New helper function.
17868         * gc.c (mono_gc_disable): New helper function.
17869
17870 2004-02-23  Martin Baulig  <martin@ximian.com>
17871
17872         * icall.c: I must have been really stupid - make it actually work
17873         this time ;-)
17874
17875 2004-02-23  Martin Baulig  <martin@ximian.com>
17876
17877         * loader.c (method_from_memberref): Only inflate the method if
17878         it's in another klass.
17879
17880 2004-02-23  Martin Baulig  <martin@ximian.com>
17881
17882         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
17883         (mono_class_init): If we're a generic instance and an interface,
17884         compute `class->interface_id'; also create `class->interfaces'
17885         here and inflate them.
17886
17887         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
17888         `ginst->is_open'.
17889         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
17890
17891         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
17892
17893 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
17894
17895         * reflection.c (method_encode_code): Improved the error message
17896         generated by the exception.
17897
17898 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17899
17900         * icall.c: Martin did not do what he said in the ChangeLog for
17901         2004-02-18, but put back the changes for properties and events.
17902         Commenting those changes out again and adding comment to bug #54518.
17903         
17904         * process.c: removed warning.
17905
17906 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
17907
17908         * marshal.c (emit_struct_conv): Print an error message instead of
17909         asserting when a type does not have the StructLayout attribute.
17910
17911 2004-02-20  Martin Baulig  <martin@ximian.com>
17912
17913         * reflection.c (mono_type_get_object): Also use the cache for
17914         generic instances.
17915         (mono_reflection_bind_generic_parameters): Always compute
17916         `ginst->ifaces'.        
17917
17918 2004-02-20  Martin Baulig  <martin@ximian.com>
17919
17920         * class.h (MonoGenericMethod): Removed `klass'.
17921
17922         * class.c (mono_class_inflate_generic_method): Added `MonoClass
17923         *klass' argument.
17924
17925 2004-02-20  Martin Baulig  <martin@ximian.com>
17926
17927         * reflection.c (method_encode_methodspec): Actually use the
17928         uninflated signature for the memberref.
17929
17930 2004-02-20  Martin Baulig  <martin@ximian.com>
17931
17932         * class.h (MonoGenericMethod): Removed `declaring'.
17933
17934         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
17935         is NULL, compute it here.
17936
17937 2004-02-20  Martin Baulig  <martin@ximian.com>
17938
17939         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
17940
17941         * metadata.c (mono_metadata_generic_inst_hash): New method.
17942         (mono_metadata_generic_inst_equal): New method.
17943
17944         * reflection.c (mono_reflection_bind_generic_parameters): Use the
17945         `klass->image->generic_inst_cache' cache to avoid creating
17946         duplicate MonoGenericInst's.
17947
17948         * class.c (mono_class_inflate_generic_type): Use the cache.
17949
17950 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
17951
17952         * object.c: fixed gc descriptor calculation for embedded valuetypes.
17953
17954 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17955
17956         * icall.c: added Socket.WSAIoctl icall.
17957
17958         * socket-io.[ch]: implemented
17959         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
17960
17961 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
17962
17963         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
17964
17965 2004-02-18  Urs C Muff  <umuff@quark.com>
17966
17967         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
17968         this work on PPC and other big-endian architectures.
17969
17970         * debug-mono-symfile.h: Prepended the names of all the `guint32'
17971         fields with an underscore to make sure they're only accessed by
17972         the read32() macro.
17973
17974 2004-02-18  Martin Baulig  <martin@ximian.com>
17975
17976         * icall.c: Put the klass->refclass changes back for methods and
17977         fields, but not for properties and events.  We're currently not
17978         distinguishing between DeclaringType and ReflectedType for
17979         properties and events, that's what caused the regressions.
17980
17981 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17982
17983         * object.c:
17984         (mono_async_result_new): the handle can be NULL.
17985
17986         * threadpool.c: Use an event instead of a semaphore, don't initialize
17987         it until needed. This saves quite a few semaphores from being created
17988         when using the threadpool.
17989
17990 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
17991
17992         * object.c (mono_string_is_interned_lookup): Fix interning of long
17993         strings. Fixes #54473.
17994
17995         * domain.c (ldstr_equal): Optimize if the two strings are equal.
17996
17997         * icall.c: Revert the klass->refclass changes since they introduce
17998         regressions (bug #54518).
17999
18000 2004-02-18  Martin Baulig  <martin@ximian.com>
18001
18002         * class.c (mono_class_init): If we're a generic instance and don't
18003         come from a TypeBuilder, inflate our members here.
18004         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
18005         (mono_class_create_generic): New public method.
18006         (mono_class_initialize_generic): Removed.
18007         (get_instantiation_name): Renamed to
18008         _mono_class_get_instantiation_name() and made it public.
18009
18010 2004-02-18  Martin Baulig  <martin@ximian.com>
18011
18012         * class.c (mono_class_inflate_generic_type): Clear the new
18013         instance's `nginst->klass' when inflating a generic instance.
18014         (mono_class_is_subclass_of): Added (basic) support for generic
18015         instances.
18016
18017 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
18018
18019         * appdomain.h, domain.c: use a MonoCodeManager instead of a
18020         MonoMempool to hold compiled native code.
18021
18022 2004-02-17  Martin Baulig  <martin@ximian.com>
18023
18024         * class.h (MonoDynamicGenericInst): Added `count_properties' and
18025         `properties'.
18026
18027         * reflection.c (mono_reflection_generic_inst_initialize): Added
18028         `MonoArray *properties' argument.
18029
18030         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
18031
18032 2004-02-17  Martin Baulig  <martin@ximian.com>
18033
18034         * icall.c (ves_icall_Type_GetFields): Renamed to
18035         ves_icall_Type_GetFields_internal() and added a
18036         `MonoReflectionType *rtype' argument; pass it to
18037         mono_field_get_object() to set the field's "reflected" type.
18038         (ves_icall_Type_GetConstructors): Likewise.
18039         (ves_icall_Type_GetEvents): Likewise.
18040         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
18041         argument; pass it to mono_method_get_object() to set the method's
18042         "reflected" type.       
18043
18044 2004-02-17  Martin Baulig  <martin@ximian.com>
18045
18046         * class.h (MonoDynamicGenericInst): New type.
18047         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
18048
18049         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
18050         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
18051         (ves_icall_MonoGenericInst_GetFields): New interncall.
18052
18053         * class.c (mono_class_from_generic): Don't call
18054         mono_class_initialize_generic() if this is a dynamic instance;
18055         ie. it's being created from a TypeBuilder.
18056         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
18057         `class->byval_arg.type'.
18058
18059         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
18060         to `inflate_method' and made static.
18061         (mono_reflection_inflate_field): Removed.
18062         (mono_reflection_generic_inst_initialize): New public method.
18063
18064         * reflection.h (MonoReflectionGenericInst): Removed `methods',
18065         `ctors' and `fields'; added `initialized'.
18066
18067 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
18068
18069         * debug-helpers.c (mono_method_full_name): Fix output for empty
18070         namespaces.
18071
18072 2004-02-12  Martin Baulig  <martin@ximian.com>
18073
18074         * class.h (MonoClassField): Added `MonoType *generic_type'.
18075
18076         * reflection.c (mono_image_get_fieldref_token): Added support for
18077         instantiated generic types.
18078         (field_encode_inflated_field): Removed.
18079         (mono_image_get_inflated_field_token): Removed.
18080         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
18081
18082         * reflection.h (MonoReflectionInflatedField): Removed.
18083
18084 2004-02-12  Martin Baulig  <martin@ximian.com>
18085
18086         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
18087         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
18088
18089         * reflection.c (mono_image_get_methodspec_token): Take a
18090         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
18091         (mono_image_create_token): Check whether we have a
18092         `method->signature->gen_method' and call
18093         mono_image_get_methodspec_token() if appropriate.
18094         (inflated_method_get_object): Removed.
18095         (mono_reflection_bind_generic_method_parameters): Return a
18096         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
18097         (mono_reflection_inflate_method_or_ctor): Likewise.
18098
18099         * reflection.h (MonoReflectionInflatedMethod): Removed.
18100
18101 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
18102
18103         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
18104         for custom valuetype marshalling.
18105
18106         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
18107
18108 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18109
18110         * icall.c: fixed WSAGetLastError_internal name.
18111
18112 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
18113
18114         * threads.c (mono_thread_attach): Allow this to be called multiple
18115         times for a thread.
18116         
18117         * threads.c (build_wait_tids): Do not wait for ourselves.
18118
18119         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
18120         appdomain list is empty.
18121
18122         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
18123         memory returned by mono_string_builder_to_utf16, since it points into
18124         managed memory. Thanks to Bernie Solomon for noticing this.
18125
18126         * icall.c: Add AppDomainSetup icalls.
18127
18128         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
18129
18130         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
18131         types.
18132
18133         * reflection.c (reflection_methodbuilder_to_mono_method): Save
18134         custom attributes to the method_aux struct. Also fix array indexes etc.
18135
18136         * loader.c (mono_method_get_param_names): Make dynamic case work again.
18137         
18138 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
18139
18140         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
18141         (both static and runtime) and reduce startup time.
18142
18143 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
18144
18145         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
18146         AsAny marshalling conversion instead of crashing.
18147
18148         * marshal.c: Fix warnings.
18149
18150 2004-02-09  Martin Baulig  <martin@ximian.com>
18151
18152         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
18153
18154         * reflection.h (MonoReflectionInflatedMethod): Removed the
18155         `declaring' field, it's now in the unmanaged MonoGenericMethod.
18156
18157         * reflection.c (method_encode_methodspec): Removed the `method'
18158         argument; we get it from `gmethod->declaring'.
18159         (inflated_method_get_object): Removed the `declaring' argument.
18160
18161 2004-02-09  Martin Baulig  <martin@ximian.com>
18162
18163         * class.h (MonoGenericMethod): New type.
18164         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
18165         `generic_method'.
18166
18167         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
18168         a `MonoGenericMethod *gen_method' one.
18169
18170         * class.c (mono_class_inflate_generic_type): Take an additional
18171         `MonoGenericMethod * argument.  This is only non-NULL if we're
18172         inflating types for a generic method.   
18173         (mono_class_inflate_generic_signature): Renamed to
18174         inflate_generic_signature() and made static; take a
18175         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
18176         (inflate_generic_header): Take a `MonoGenericMethod *' argument
18177         instead of a `MonoGenericInst *' one.
18178         (mono_class_inflate_generic_method): Likewise.
18179
18180         * reflection.c (encode_generic_method_sig): Take a
18181         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
18182         (method_encode_methodspec): Likewise.
18183         (inflated_method_get_object): Likewise. 
18184
18185         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
18186         field with a `MonoGenericMethod *gmethod' one.  
18187
18188 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
18189
18190         * class.h (mono_class_has_parent): add parens to expansion
18191         so you can ! this.
18192
18193 2004-02-08  Martin Baulig  <martin@ximian.com>
18194
18195         * image.h (MonoImage): Removed `generics_cache'.
18196
18197         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
18198         instead of a `MonoType *' argument; removed the `inflate_methods'
18199         argument.  Don't inflate methods here.
18200
18201         * loader.c (find_method): If it's a generic instance, call
18202         mono_class_init() on the `sclass->generic_inst->generic_type'.
18203
18204         * metadata.c (mono_type_size): Make this work on uninitialized
18205         generic instances; call it on the `ginst->generic_type's class.
18206
18207         * reflection.c (mono_reflection_bind_generic_parameters): Call
18208         mono_class_from_generic() to create the `ginst->klass'.
18209
18210 2004-02-08  Martin Baulig  <martin@ximian.com>
18211
18212         * class.h (MonoClass): Changed type of `generic_inst' from
18213         `MonoType *' to `MonoGenericInst *'.
18214
18215 2004-02-08  Martin Baulig  <martin@ximian.com>
18216
18217         * icall.c (ves_icall_Type_BindGenericParameters): Just call
18218         mono_type_get_object(), this is now creating a `MonoGenericInst'
18219         for MONO_TYPE_GENERICINST.
18220         (ves_icall_MonoGenericInst_GetParentType): Likewise.
18221         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
18222
18223         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
18224         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
18225         (inflated_method_get_object): Added `MonoClass *refclass' argument.
18226         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
18227         and reflected type.
18228
18229         * reflection.h (MonoReflectionInflatedMethod): Removed
18230         `declaring_type' and `reflected_type'.
18231
18232 2004-02-08  Martin Baulig  <martin@ximian.com>
18233
18234         * class.h (MonoGenericInst): Added `MonoType *parent' and
18235         `MonoType **ifaces'.
18236
18237         * reflection.h (MonoReflectionGenericInst): Removed `klass',
18238         `parent' and `interfaces'.
18239
18240         * reflection.c (mono_reflection_bind_generic_parameters): Take a
18241         `MonoType *' argument and return a `MonoType *'.
18242
18243         * icall.c
18244         (ves_icall_MonoGenericInst_GetParentType): New interncall.
18245         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
18246
18247 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
18248
18249         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
18250         valuetype marshalling.
18251
18252 2004-02-06  Martin Baulig  <martin@ximian.com>
18253
18254         * class.c
18255         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
18256         (my_mono_class_from_generic_parameter): Likewise.
18257
18258 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
18259
18260         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
18261         contents of the symbol files lazily.
18262
18263         * object.h (MonoThread): Add 'name' and 'name_len' fields.
18264
18265         * threads.h threads.c icall.c: New icalls for getting and setting the
18266         threads name.
18267
18268 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
18269
18270         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
18271         Raise an exception when the domain is not found.
18272
18273 2004-02-03  Martin Baulig  <martin@ximian.com>
18274
18275         * reflection.c (mono_image_get_methodspec_token): Use the
18276         uninflated signature; fixes gen-33.
18277
18278 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
18279
18280         * gc.c threads.c: Make the finalizer thread a normal managed thread so
18281         the finalizer code can use thread functionality.
18282
18283         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
18284         the finalizer thread.
18285
18286         * threads.c: Make some functions more robust.
18287
18288         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
18289
18290         * metadata.h: Add new marshalling conventions.
18291
18292         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
18293         stringbuilder marshalling. Fixes #53700.
18294
18295         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
18296
18297         * reflection.c (mono_image_get_type_info): Save declarative security
18298         info.
18299
18300         * reflection.c (mono_image_get_field_info): Handle uninitialized 
18301         unmanaged fields as well.
18302
18303         * appdomain.c: Bump corlib version.
18304
18305 2004-02-01  Martin Baulig  <martin@ximian.com>
18306
18307         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
18308         method type arguments.  
18309
18310 2004-01-30  Duncan Mak  <duncan@ximian.com>
18311
18312         * marshal.h: Add prototype for
18313         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
18314         and
18315         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
18316         fix the build.
18317
18318 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
18319
18320         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
18321         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
18322
18323 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
18324
18325         * marshal.c (mono_marshal_get_native_wrapper): Add support for
18326         custom marshalling of valuetypes.
18327
18328         * marshal.c: Fix some warnings.
18329
18330 2004-01-29  Martin Baulig  <martin@ximian.com>
18331
18332         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
18333         for generic method parameters.
18334
18335         * reflection.c (method_encode_methodspec): Write the uninflated
18336         signature into the methodspec table.
18337         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
18338         is always the uninflated method.
18339         (reflection_methodbuilder_to_mono_method): Copy the generic
18340         parameters from the MethodBuilder into `header->gen_params'.
18341
18342 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
18343
18344         * class.c (mono_class_from_generic_parameter): Fix warning.
18345
18346 2004-01-27  Martin Baulig  <martin@ximian.com>
18347
18348         * class.c (mono_class_from_generic_parameter): Don't create
18349         `klass->methods' here.  
18350
18351 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
18352
18353         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
18354         extension since it does not work with libraries named lib<FOO>.dll.so.
18355
18356 2004-01-25  Martin Baulig  <martin@ximian.com>
18357
18358         * class.c (mono_class_inflate_generic_type): Added support for
18359         MONO_TYPE_GENERICINST.
18360
18361         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
18362         inflate methods on open constructed types.      
18363
18364 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18365
18366         * object.c: fire ProcessExit event in the root AppDomain after running
18367         Main. Fixes bug #53299.
18368
18369 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
18370
18371         * socket-io.c: include the new socket-wrappers.h header.
18372         Use the wrappers instead of the unix socket functions to make the code
18373         more clear.
18374
18375 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
18376
18377         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
18378
18379         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
18380         Fixes #22532.
18381
18382 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
18383
18384         * reflection.c (mono_image_create_pefile): Handle the case when the
18385         entry point is not a MethodBuilder.
18386
18387         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
18388         field to ReflectionMethod since it is not allways a builder.
18389
18390         * reflection.c (type_get_fully_qualified_name): New helper function to
18391         return the fully qualified name of a type.
18392
18393         * reflection.c (encode_marshal_blob): Always emit the fully qualified
18394         type name for custom marshallers.
18395
18396         * reflection.c (mono_marshal_spec_from_builder): Ditto.
18397
18398         * class.c (mono_class_setup_vtable): If a parent class already 
18399         implements an interface, use the implementing methods from that class.
18400         Fixes #53148.
18401
18402 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18403
18404         * threadpool.c: just return instead of ExitThread to allow for thread
18405         clean up earlier.
18406
18407 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
18408
18409         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
18410         when closing resource modules.
18411
18412         * reflection.c (mono_image_create_pefile): Handle the case when the
18413         entry point is not a MethodBuilder.
18414
18415         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
18416         field to ReflectionMethod since it is not allways a builder.
18417
18418 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
18419
18420         * marshal.c (mono_marshal_get_managed_wrapper): 
18421         mono_marshal_alloc takes native int so CONV_I
18422         the arg for 64bits.
18423
18424 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
18425
18426         * reflection.c (fixup_cattrs): New function to fixup the methoddef
18427         tokens in the cattr table. Fixes #53108.
18428
18429 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18430
18431         * loader.c: don't trim ".dll" before looking up in the config file.
18432         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
18433
18434 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
18435
18436         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
18437         Return the module which contains the resource as well.
18438         (ves_icall_System_Reflection_Module_Close): New icall.
18439
18440         * appdomain.c: Bump corlib version number.
18441
18442         * image.c (mono_image_addref): New public function.
18443
18444         * assembly.c: Call mono_image_addref.
18445
18446         * reflection.c (mono_module_get_object): Increase reference count of 
18447         the image.
18448
18449         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
18450         Fixes #22532.
18451
18452         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
18453         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
18454         proper exceptions on DllImport problems.
18455
18456 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
18457
18458         * class.c, metadata.c: eliminate CSIZE macro.
18459
18460 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
18461
18462         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
18463         * object.h: Added async_callback field in MonoAsyncResult.
18464         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
18465         * verify.c: Added async_callback in MonoAsyncResult layout.
18466
18467 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
18468
18469         * reflection.c (mono_reflection_get_custom_attrs): Add support
18470         for Modules.
18471
18472 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
18473
18474         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
18475         marshalling.
18476         (mono_marshal_method_from_wrapper): Add null pointer check.
18477
18478 2004-01-16  Martin Baulig  <martin@ximian.com>
18479
18480         * debug-mono-symfile.h: Set version number to 36 and reflect
18481         latest symbol writer changes.
18482
18483 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
18484
18485         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
18486         multi-dimensional arrays.
18487         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
18488         (mono_class_from_mono_type): Use bounded_array_class_get.
18489         
18490         * class.c (mono_bounded_array_class_get): New function which takes
18491         a 'bounded' bool argument to distinguish vectors from one dimensional
18492         arrays.
18493
18494         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
18495         bounded_array_class_get if the array has bounds.
18496
18497         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
18498         Search modules loaded using AssemblyBuilder:AddModule as well.
18499
18500 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18501
18502         * appdomain.c: increased corlib version.
18503         * filewatcher.c: removed g_print.
18504         * icall.c:
18505         (get_property_info): only allocate what is actually requested.
18506         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
18507
18508 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18509
18510         * Makefile.am: added filewatcher.[ch]
18511         * filewatcher.[ch]: FileSystemWatcher runtime support.
18512         * icall.c: added new FSW icalls.
18513
18514 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
18515
18516         * string-icalls.c: fix stringbuilder regression as suggested by
18517         Iain McCoy <iain@mccoy.id.au>.
18518
18519 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
18520
18521         * process.c (process_read_stringtable_block): Recognize '007f' as
18522         a language neutral stringtable block.
18523
18524 2004-01-12  Patrik Torstensson
18525
18526         * object.h (MonoStringBuilder) : Changed layout to support our
18527         new stringbuilder class.
18528         * marshal.c: Change marshalling to support the new layout of 
18529         string builder.
18530         * appdomain.c: increased version number because new layout of
18531         string builder.
18532
18533 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
18534
18535         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
18536         assembly name as an string instead of an AssemblyName, since it is
18537         easier to extract info from it.
18538
18539         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
18540         the culture subdirectories too. Fixes #52231.
18541
18542 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18543
18544         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
18545         It takes 2 new parameters with an optional name for the method to look
18546         for and case ignoring info.
18547
18548         * threadpool.c: removed unused variable.
18549
18550 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18551
18552         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
18553         It takes 2 new parameters with an optional name for the property to look
18554         for and case ignoring info.
18555         Fixes bug #52753.
18556
18557 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18558
18559         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
18560         Fix #52451.
18561
18562 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18563
18564         * appdomain.c:
18565         * assembly.c: escape the uri before passing it to g_filename_from_uri.
18566         Fixes bug #52630.
18567
18568 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
18569
18570         * reflection.c: Add support for more than one unmanaged resource.
18571
18572         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
18573         in field->def_value, as done in all other cases.
18574
18575         * reflection.c (mono_reflection_get_custom_attrs): Add support for
18576         TypeBuilders.
18577
18578         * reflection.c (mono_reflection_create_runtime_class): Remove 
18579         errorneous assignment to klass->element_class, since it is already
18580         done in mono_reflection_setup_internal_class.
18581
18582 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18583
18584         * gc.c: added missing LeaveCriticalSection.
18585         * icall.c: indented a couple of lines.
18586         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
18587         if we call EndInvoke inside a callback. Fixes bug #52601.
18588
18589 2004-01-07  Martin Baulig  <martin@ximian.com>
18590
18591         * mono-debug-debugger.h
18592         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
18593
18594 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18595
18596         * appdomain.c: Use messages in NotImplementedException.
18597
18598         * exception.c (mono_get_exception_not_implemented): Now this takes
18599         a message argument.
18600
18601         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
18602         exception instead of g_asserting an aborting when something is not
18603         implemented.
18604
18605         Add some inline docs.
18606
18607 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
18608
18609         * reflection.h: Update after changes to object layout.
18610
18611         * reflection.c: Implement saving of unmanaged aka win32 resources.
18612
18613         * appdomain.c: Bump version number.
18614
18615         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
18616         Handle missing domains gracefully.
18617
18618 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
18619
18620         * file-io.c : On Windows, there are much more invalid_path_chars.
18621
18622 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
18623
18624         * class.h, object.c: prepare for GetType () speedup.
18625
18626 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
18627
18628         * profiler.c: workaround for --profile null reference exception on
18629           cygwin. Patch by Patrik Torstensson.
18630
18631 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
18632
18633         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
18634         make work for unaligned access.
18635
18636 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
18637
18638         * class.c: small cleanup (class->fields [i] -> field).
18639         * image.c: check address of metadata is valid.
18640
18641 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
18642
18643         * assembly.h assembly.c (mono_assembly_loaded): New public function to
18644         search the list of loaded assemblies.
18645
18646         * reflection.c (mono_reflection_type_from_name): Use 
18647         mono_assembly_loaded instead of mono_image_loaded.
18648
18649         * reflection.c: Fix warnings.
18650
18651 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18652
18653         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
18654         is dynamic. This is needed since an assembly can contain both dynamic and
18655         non-dynamic images.
18656
18657         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
18658         assembly->dynamic.
18659
18660         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
18661
18662         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
18663         to store modules loaded using AddModule.
18664
18665         * reflection.c (mono_image_fill_file_table): Generalize this so it works
18666         on Modules.
18667
18668         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
18669
18670         * reflection.c (mono_image_fill_export_table_from_module): New function to
18671         fill out the EXPORTEDTYPES table from a module.
18672
18673         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
18674         into a separate function. Also handle loaded non-dynamic modules.
18675
18676         * reflection.c (mono_image_basic_init): Fix memory allocation.
18677
18678         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18679
18680         * assembly.c (mono_assembly_load_references): Make this public.
18681
18682 2003-12-19  Martin Baulig  <martin@ximian.com>
18683
18684         * class.c (mono_class_initialize_generic): Made this static, take
18685         a `MonoGenericInst *' instead of a `MonoClass *'.
18686         (mono_class_from_generic): Call mono_class_initialize_generic()
18687         unless we're already initialized or being called from
18688         do_mono_metadata_parse_generic_inst().
18689
18690         * class.h (MonoGenericInst): Added `initialized' and
18691         `init_pending' flags.
18692
18693         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
18694         `mono_class_init (gklass)' or mono_class_initialize_generic()
18695         here; set `generic_inst->init_pending' while parsing the
18696         `type_argv'.
18697
18698 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
18699
18700         * locales.c: include string.h for memxxx prototypes
18701
18702 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18703
18704         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
18705         constructor when accessing literal fields.
18706
18707 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
18708
18709         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18710
18711         * reflection.c (assembly_add_resource_manifest): New function to fill
18712         the MANIFESTRESOURCE table.
18713
18714         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
18715
18716         * reflection.h: Update to changes in class layout.
18717
18718         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
18719         Reenable call to mono_runtime_is_shutting_down ().
18720
18721         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
18722         determine if the runtime is shutting down.
18723
18724 2003-12-16  Jackson Harper <jackson@ximian.com>
18725
18726         * icall.c: comment out call to mono_runtime_is_shutting_down to
18727         fix build.
18728         
18729 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
18730
18731         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
18732         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
18733
18734 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
18735
18736         * reflection.c: move definition of swap_with_size
18737         to before its first call
18738
18739 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
18740
18741         * appdomain.c (mono_runtime_is_shutting_down): New public function.
18742
18743         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
18744         icall.
18745
18746         * object.c: Fix warnings.
18747
18748         * icall.c (ves_icall_Type_Get...): Only consider inherited static
18749         members if FlattenHierarchy is set.
18750
18751         * reflection.c (mono_image_add_decl_security): New function to emit
18752         declarative security.
18753
18754         * reflection.h reflection.c: Add support for declarative security.
18755
18756         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
18757         
18758 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
18759
18760         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
18761         
18762         * appdomain.c verify.c: Moved corlib version checking into its own
18763         function in appdomain.c since it needs to create vtables etc.
18764
18765 2003-12-13  Patrik Torstensson <p@rxc.se>
18766
18767         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
18768         instead of unwrapped server.
18769
18770 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
18771
18772         * verify.c (check_corlib): Fix field index.
18773
18774 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18775
18776         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
18777         GetGacPath icall.
18778
18779 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
18780
18781         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
18782         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
18783         cope with sizeof(size_t) != sizeof(guint32).
18784
18785 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18786
18787         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
18788         in case of failure.
18789
18790 2003-12-10  Mark Crichton <crichton@gimp.org>
18791
18792         * icall.c: removed the GetNonZeroBytes.  We now handle this case
18793         in managed code.
18794
18795         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
18796
18797 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
18798
18799         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
18800         marked as deleted.
18801
18802 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
18803
18804         * verify.c (check_corlib): Handle the case when the version field is 
18805         initialized by a static constructor.
18806
18807 2003-12-08  Patrik Torstensson  <p@rxc.se>
18808
18809     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
18810
18811 2003-12-08  Martin Baulig  <martin@ximian.com>
18812
18813         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
18814         a MonoReflectionGenericParameter, also take the parameter index
18815         and name as arguments.
18816         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
18817         (ves_icall_MonoGenericParam_initialize): New interncall.
18818         (ves_icall_Type_make_byref_type): New interncall.
18819
18820         * reflection.h (MonoReflectionGenericParam): Derive from
18821         MonoReflectionType, not just from MonoObject.  Added `refobj' and
18822         `index' fields.
18823
18824         * reflection.c (mono_reflection_define_generic_parameter): Create
18825         and return a new MonoReflectionGenericParam; don't initialize the
18826         constraints here.
18827         (mono_reflection_initialize_generic_parameter): New public method;
18828         initializes the constraints and creates the `param->pklass'.
18829
18830 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18831
18832         * reflection.h reflection.c: Use the new fields 'num_types', 
18833         'num_fields' and 'num_methods' to track the number of types etc.
18834
18835         * verify.c (check_corlib): Check corlib version number.
18836
18837 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
18838
18839         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
18840         function works on all methods.
18841
18842 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
18843
18844         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
18845         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
18846         the custom_type_info flag of the transparent proxy.
18847         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
18848         objects that supports IRemotingTypeInfo.
18849         * object.h: Added custom_type_info field in transparent proxy.
18850
18851 2003-12-06  Martin Baulig  <martin@ximian.com>
18852
18853         * class.c (mono_class_create_from_generic): Removed.
18854         (mono_class_from_generic): Check `ginst->klass' before doing
18855         anything else.  This is important to fully support "recursive"
18856         generic types.
18857
18858         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
18859         empty `generic_inst->klass' before doing anything else.
18860
18861 2003-12-06  Dick Porter  <dick@ximian.com>
18862
18863         * verify.c: 
18864         * object.h:
18865         * icall.c:
18866         * locales.c: Use C structs to access class fields.  Don't do a
18867         conversion between MonoString and UChar because both are
18868         platform-endian UTF-16.  Compare now takes startindex and count
18869         parameters.  Add a char overload for IndexOf.  Speed up the
18870         invariant string IndexOf.
18871
18872 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
18873
18874         * Makefile.am (monosn_LDADD): Fix parallel build.
18875
18876 2003-12-04  Martin Baulig  <martin@ximian.com>
18877
18878         * icall.c
18879         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
18880         (ves_icall_Type_make_array_type): New interncall.       
18881
18882 2003-12-04  Martin Baulig  <martin@ximian.com>
18883
18884         * locales.c: also change it in the !HAVE_ICU case.
18885
18886 2003-12-04  Dick Porter  <dick@ximian.com>
18887
18888         * icall.c:
18889         * locales.c: construct_compareinfo is now in CompareInfo, not
18890         CultureInfo.
18891
18892 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
18893
18894         * image.c (mono_image_load_file_for_image): Cache loaded images in the
18895         image->files array.
18896
18897         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
18898         table as well.
18899
18900         * assembly.c (mono_assembly_load_references): Only load references
18901         once.
18902
18903         * class.c (mono_class_from_name): Avoid linear search of the 
18904         EXPORTEDTYPE table.
18905
18906         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
18907
18908 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
18909
18910         * image.h (MonoImage): Add 'field_cache' field.
18911
18912         * loader.c (mono_field_from_token): Cache field lookups.
18913         
18914         * reflection.c (mono_module_get_object): Fix name property.
18915
18916         * icall.c (ves_icall_get_enum_info): Update after changes to 
18917         mono_metadata_get_constant_index ().
18918
18919         * icall.c: Get rid of get_type_info icall, use a separate icall for
18920         each type property to avoid needless memory allocations. Fixes #51514.
18921
18922         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
18923         to avoid needless binary searches.
18924
18925         * class.c (class_compute_field_layout): Move the initialization of
18926         field->def_value to mono_class_vtable ().
18927
18928         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
18929         non-corlib types.
18930
18931         * object.c (mono_object_allocate): Make it inline.
18932
18933         * object.c (mono_object_allocate_spec): Make it inline.
18934         
18935 2003-12-02  Dick Porter  <dick@ximian.com>
18936
18937         * locales.c (create_NumberFormat): NumberFormatInfo construction.
18938         Patch by Mohammad DAMT (mdamt@cdl2000.com).
18939
18940 2003-12-01  Dick Porter  <dick@ximian.com>
18941
18942         * threads.c: Fix signature and call in CreateMutex and
18943         CreateEvent.
18944
18945 2003-12-01  Dick Porter  <dick@ximian.com>
18946
18947         * icall.c: 
18948         * locales.c: Implement string compares and searching
18949
18950         * object.h: Add extra Thread field
18951
18952 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18953
18954         * reflection.c (fixup_method): Add support for MonoCMethod.
18955
18956 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
18957
18958         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
18959
18960         * reflection.c (assembly_name_to_aname): Allow extra characters in
18961         assembly names. Fixes #51468.
18962
18963 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
18964
18965         * exception.c (mono_exception_from_name_domain): New helper function.
18966
18967         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
18968         exception object in the correct domain.
18969
18970         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
18971         formatting + make a copy a the input data.
18972
18973         * loader.c (mono_get_method_from_token): Methods which contain
18974         native code do not have entries in the ImplMap.
18975
18976         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
18977         Thanks to Gonzalo for spotting this.
18978         
18979         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
18980         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
18981
18982         * assembly.h (mono_assembly_load_from): Split the second part of 
18983         assembly loading into a new public function.
18984
18985         * exception.h (mono_get_exception_bad_image_format): New function.
18986
18987 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
18988
18989         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
18990         Enumerate all modules inside a dynamic assembly. Fixes #51293.
18991         
18992         * icall.c: Add new icall for creating dynamic methods.
18993
18994         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
18995
18996         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
18997
18998         * reflection.c (mono_reflection_create_dynamic_method): New icall to
18999         create a dynamic method.
19000
19001         * reflection.c (resolve_object): New helper function.
19002
19003         * reflection.c: Generalize ReflectionMethodBuilder and the functions
19004         which manipulate it so they can also work on dynamic methods.
19005
19006         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
19007         creating the MonoReflectionMethodAux structure if it is not needed.
19008         
19009         * reflection.h verify.c: Update after changes to object layout.
19010
19011         * reflection.c (method_builder_encode_signature): Fix compilation on
19012         gcc 2.95.x.
19013
19014 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
19015
19016         * appdomain.h: Added support for context static fields. Added static_data
19017           field to MonoAppContext and renamed thread_static_fields to a more
19018           generic special_static_fields in MonoAppDomain, since it can now contain
19019           context static fields.
19020         * domain.c: Updated hashtable name.
19021         * object.c: Replaced field_is_thread_static() for a more generic
19022           field_is_special_static() which also checks for context static attribute.
19023           In mono_class_vtable(), added support for static context fields.
19024         * threads.c: Changed methods that manage thread static fields to more
19025           generic methods so they can be reused both for thread and context static
19026           data.
19027         * threads.h: Declared some new methods.
19028
19029 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
19030
19031         * reflection.h: Update after changes to the managed types.
19032
19033         * reflection.c (encode_custom_modifiers): New helper function.
19034
19035         * reflection.c (method_encode_signature): Emit custom modifiers.
19036
19037         * reflection.c (field_encode_signature): Emit custom modifiers.
19038
19039 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
19040
19041         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
19042
19043         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
19044         implementation.
19045
19046         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
19047         icall.
19048
19049         * object.c (mono_field_get_value_object): New function.
19050
19051         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
19052         specific.
19053
19054 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
19055
19056         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
19057         return a preallocated out-of-memory exception instance.
19058
19059         * object.c (out_of_memory): Use the new function.
19060
19061         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
19062         flag is before the custom modifiers. Fixes #49802.
19063
19064 2003-11-16  Martin Baulig  <martin@ximian.com>
19065
19066         * class.c (mono_class_is_open_constructed_type): Implemented the
19067         MONO_TYPE_GENERICINST case.
19068
19069 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
19070
19071         * assembly.c (mono_assembly_fill_assembly_name): New function to
19072         fill out the MonoAssemblyName structure.
19073         (mono_assembly_open): Use the new function.
19074
19075         * icall.c (fill_reflection_assembly_name): New helper function.
19076
19077         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
19078         new function.
19079
19080         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
19081
19082 2003-11-15  Martin Baulig  <martin@ximian.com>
19083
19084         * class.c (mono_class_is_open_constructed_type): New public
19085         function; checks whether a type is an open constructed type,
19086         ie. whether it still contains type parameters.
19087         (mono_class_inflate_generic_type): If we're a type parameter and
19088         the inflated type is also a MONO_TYPE_(M)VAR, return the original
19089         type.
19090
19091         * class.h (MonoGenericInst): Added `guint32 is_open'.
19092
19093         * loader.c (method_from_methodspec): Check whether we're an open
19094         or closed constructed type and set `ginst->is_open'.
19095
19096         * reflection.c (mono_reflection_bind_generic_parameters): Check
19097         whether we're an open or closed constructed type and set
19098         `ginst->is_open'.
19099         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
19100         from open constructed types.
19101
19102 2003-11-15  Martin Baulig  <martin@ximian.com>
19103
19104         * reflection.c (mono_reflection_bind_generic_parameters): If we're
19105         a generic instance (instead of a generic type declaration) with
19106         unbound generic parameters, bind them to our actual types.
19107
19108 2003-11-14  Martin Baulig  <martin@ximian.com>
19109
19110         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
19111
19112         * reflection.c (mono_reflection_bind_generic_parameters): If we're
19113         an interface type, populate `res->interfaces' with instantiated
19114         versions of all the interfaces we inherit.
19115
19116 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
19117
19118         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
19119         when MONO_PATH is set but doesn't contain the install dir.
19120
19121 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19122
19123         * icall.c:
19124         (ves_icall_Type_GetInterfaces): don't return an interface twice when
19125         it's also implemented in base classes. Fixes bug #50927.
19126
19127 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
19128
19129         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
19130         if this method is called from a finalizer. Fixes #50913.
19131
19132 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
19133
19134         * threads.c: Implement VolatileRead/VolatileWrite
19135
19136         * icall.c: Add new icalls for VolatileRead/VolatileWrite
19137
19138 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
19139
19140         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
19141         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
19142         2.95.3.
19143
19144         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
19145         from Peter Ross (pro@missioncriticalit.com).
19146         
19147 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
19148
19149         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
19150
19151 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
19152
19153         * assembly.c (mono_assembly_load_references): Disable check because it
19154         triggers on older corlibs which lots of people have.
19155
19156 2003-11-12  Jackson Harper  <jackson@ximian.com>
19157
19158         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
19159         load corlib.dll if mscorlib.dll is not found.
19160         * assembly.h: Remove corlib name define.
19161         * class.c:
19162         * domain.c:
19163         * image.c: Change corlib name to mscorlib.
19164         
19165 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
19166
19167         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
19168
19169 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * appdomain.h: Added loader_optimization here to sync with the C#
19172         code, and add disallow_binding_redirects field.
19173
19174 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
19175
19176         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
19177
19178         * reflection.c (mono_image_build_metadata): Fix crash on modules
19179         with no types.
19180
19181         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
19182
19183         * icall.c (ves_icall_get_method_info): Return callingConvention as
19184         well.
19185
19186         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
19187         namespaces from the EXPORTEDTYPE table as well.
19188
19189         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
19190         from all modules inside the assembly.
19191         
19192 2003-11-11  Martin Baulig  <martin@ximian.com>
19193
19194         * reflection.c (mono_reflection_bind_generic_parameters): Make
19195         this work for interfaces.
19196
19197 2003-11-11  Martin Baulig  <martin@ximian.com>
19198
19199         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
19200
19201 2003-11-11  Martin Baulig  <martin@ximian.com>
19202
19203         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
19204         "MonoInflatedMethod" and "MonoInflatedCtor".
19205
19206 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
19207
19208         * reflection.c (resolution_scope_from_image): Use the assembly table
19209         from the manifest module, since other modules don't have it.
19210
19211         * debug-helpers.c (mono_type_full_name): New helper function.
19212
19213         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
19214
19215         * image.c (mono_image_load_file_for_image): New public function which
19216         is a replacement for the load_file_for_image in class.c.
19217
19218         * assembly.c (mono_assembly_load_module): A wrapper for the function
19219         above which does assembly association and reference loading too.
19220
19221         * class.c (mono_class_from_name): Call mono_assembly_load_module.
19222
19223 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19224
19225         * appdomain.c: not all of the attributes for the full assembly name
19226         are required and the order doesn't matter. Fixes bug #50787.
19227
19228 2003-11-10  Dick Porter  <dick@ximian.com>
19229
19230         * locales.c: Use platform-endian UTF16
19231
19232 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
19233
19234         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
19235         
19236 2003-11-10  Martin Baulig  <martin@ximian.com>
19237
19238         * metadata.c
19239         (mono_metadata_load_generic_params): Make this actually work.
19240
19241         * reflection.c (mono_reflection_bind_generic_parameters): If our
19242         parent is a generic instance, pass all the `types' to it, no
19243         matter whether it has the same number of type parameters or not.
19244
19245 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
19246
19247         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
19248
19249         * assembly.c (mono_assembly_load_references): Move the image<->assembly
19250         assignment code to this function so it gets called recursively for all
19251         modules.
19252
19253         * image.c (load_modules): Remove the assembly assignment since it is
19254         now done by mono_assembly_load_references.
19255         
19256         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
19257         Add 'module' argument.
19258         (mono_module_get_types): New helper function.
19259         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
19260
19261 2003-11-08  Martin Baulig  <martin@ximian.com>
19262
19263         * class.c (mono_class_inflate_generic_method): Interface method
19264         don't have a header.
19265
19266         * reflection.c (mono_image_get_methodspec_token): Take an
19267         additional `MonoGenericInst *' argument instead of reading it from
19268         the header; this is necessary to support interfaces.
19269         (mono_image_create_token): Pass the `MonoGenericInst *' from the
19270         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
19271         (inflated_method_get_object): Take an additional `MonoGenericInst *'
19272         argument.
19273
19274         * reflection.h (MonoReflectionInflatedMethod): Added
19275         `MonoGenericInst *ginst'.
19276
19277 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
19278
19279         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
19280
19281 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
19282
19283         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
19284
19285 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
19286
19287         * reflection.c 
19288         (reflection_methodbuilder_from_method_builder):
19289         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
19290         initialize a ReflectionMethodBuilder structure.
19291         (mono_image_get_methodbuilder_token):
19292         (mono_image_get_ctorbuilder_token): New functions to emit memberref
19293         tokens which point to types in another module inside the same assembly.
19294
19295         * reflection.c: Use the new helper functions.
19296         
19297         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
19298
19299         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
19300         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
19301
19302         * reflection.c (resolution_scope_from_image): Emit a moduleref if
19303         neccesary.
19304
19305         * reflection.c (mono_image_build_metadata): Emit metadata only for the
19306         current module. Emit the manifest only for the main module.
19307
19308         * reflection.c (mono_image_create_token): Add assertion when a 
19309         memberref needs to be created.
19310
19311         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
19312
19313         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
19314         larger buffer for the custom attribute blob. Fixes #50637.
19315         
19316 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19317
19318         * threadpool.c: notify listener on async processing handles after
19319         invoking the async callback. Thanks to Zoltan.
19320
19321 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
19322
19323         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
19324         avoid code duplication.
19325
19326         * reflection.h (MonoDynamicImage): New type which is currently unused,
19327         but will be used through the ref.emit code in place of 
19328         MonoDynamicAssembly.
19329
19330         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
19331         object layout.
19332
19333         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
19334         a MonoDynamicImage instead of just a MonoImage.
19335         
19336         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
19337         icalls to ModuleBuilder but keep their semantics, so they will work
19338         with moduleb->assemblyb. This will change later.
19339         
19340 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
19341
19342         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
19343         object layout.
19344
19345         * reflection.c (mono_image_build_metadata): Avoid creation of a default
19346         main module, since it is now done by the managed code.
19347
19348 2003-11-03  Martin Baulig  <martin@ximian.com>
19349
19350         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
19351         `ginst->klass' here.
19352         (method_encode_methodspec): Don't use the `ginst->generic_method's
19353         klass if it's a generic instance, use `ginst->klass' in this case.
19354
19355 2003-11-03  Martin Baulig  <martin@ximian.com>
19356
19357         * reflection.c (mono_image_get_generic_method_param_info):
19358         Removed, use mono_image_get_generic_param_info() instead.
19359         (mono_image_get_type_info): Write the GenericParam table before
19360         the Method table.  This is neccessary because in the GenericParam
19361         table, type parameters of the class (ie. '!0' etc.) must come
19362         before the ones from its generic methods (ie. '!!0' etc).
19363
19364 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
19365
19366         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
19367
19368 2003-11-02  Martin Baulig  <martin@ximian.com>
19369
19370         * reflection.c (create_generic_typespec): Take a
19371         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
19372         the generic parameters from it.
19373
19374 2003-11-02  Martin Baulig  <martin@ximian.com>
19375
19376         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
19377         instead of a `MonoClassField *' since we just need the type.
19378         (create_generic_typespec): New static function.  Creates a
19379         TypeSpec token for a generic type declaration.
19380         (mono_image_get_generic_field_token): New static function.
19381         (mono_image_create_token): If we're a FieldBuilder in a generic
19382         type declaration, call mono_image_get_generic_field_token() to get
19383         the token.
19384
19385 2003-11-02  Martin Baulig  <martin@ximian.com>
19386
19387         * reflection.h
19388         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
19389         `MonoReflectionGenericInst *declaring_type' and
19390         `MonoReflectionGenericInst *reflected_type' fields.
19391
19392         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
19393         `MonoReflectionGenericInst *declaring_type' and a
19394         `MonoReflectionGenericInst *reflected_type' argument instead of a
19395         single `MonoReflectionGenericInst *type' one.  Set
19396         `res->declaring_type' and `res->reflected_type' from them.
19397         (mono_reflection_inflate_field): Likewise.      
19398
19399 2003-11-02  Martin Baulig  <martin@ximian.com>
19400
19401         * class.c (mono_class_setup_vtable): Don't store generic methods
19402         in the vtable.  
19403
19404 2003-11-02  Martin Baulig  <martin@ximian.com>
19405
19406         * reflection.h (MonoReflectionGenericInst): Added
19407         `MonoReflectionType *declaring_type'.
19408
19409         * reflection.c (mono_reflection_bind_generic_parameters): Use
19410         `if (tb->parent)' instead of `klass->parent'.
19411
19412 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
19413
19414         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
19415         with an empty ASSEMBLY table.
19416
19417         * reflection.c (mono_image_build_metadata): Avoid using the same loop
19418         variable in the inner and outer loops.
19419
19420 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
19421
19422         * metadata.h (mono_metadata_make_token): Put parentheses around macro
19423         argument.
19424
19425         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
19426         
19427         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
19428         icalls. Instead, do everything in managed code. This is needed since
19429         it is hard to restore the original domain etc. in unmanaged code in the
19430         presence of undeniable exceptions.
19431
19432         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
19433         New icalls to push and pop appdomain refs.
19434
19435 2003-10-31  Martin Baulig  <martin@ximian.com>
19436
19437         * class.c (inflate_generic_type): Renamed to
19438         mono_class_inflate_generic_type() and made it public.
19439
19440         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
19441         New interncall.
19442
19443         * loader.c (mono_field_from_memberref): Also set the retklass for
19444         typespecs.
19445
19446         * fielder.c (mono_image_get_inflated_field_token): New static
19447         method; creates a metadata token for an inflated field.
19448         (mono_image_create_token, fixup_method): Added support for
19449         "MonoInflatedField".
19450         (fieldbuilder_to_mono_class_field): New static function.
19451         (mono_reflection_inflate_field): New public function.
19452
19453         * reflection.h
19454         (MonoReflectionGenericInst): Added `MonoArray *fields'.
19455         (MonoReflectionInflatedField): New typedef.     
19456
19457 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
19458
19459         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
19460         for Solaris and other platforms without s6_addr16
19461
19462 2003-10-30  Martin Baulig  <martin@ximian.com>
19463
19464         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
19465         argument instead of two.
19466         (mono_class_inflate_generic_signature): Likewise.
19467         (inflate_generic_header): Likewise.
19468         (mono_class_inflate_generic_method): Likewise.  In addition, if
19469         `ginst->klass' is set, it becomes the new `method->klass'.
19470
19471         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
19472         field.
19473
19474         * reflection.c (encode_generic_method_sig): Write a 0xa as the
19475         first byte. [FIXME]
19476         (method_encode_methodspec): If we have generic parameters, create
19477         a MethodSpec instead of a MethodRef.
19478         (fixup_method): Added support for "MonoInflatedMethod" and
19479         "MonoInflatedCtor".
19480         (mono_image_create_token): Added support for "MonoInflatedMethod"
19481         and "MonoInflatedCtor".
19482         (inflated_method_get_object): New static function; returns a
19483         managed "System.Reflection.MonoInflatedMethod" object.
19484         (mono_reflection_bind_generic_method_parameters): Return a
19485         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
19486         (mono_reflection_inflate_method_or_ctor): Likewise.
19487         (mono_image_get_generic_method_param_info): Initialize unused
19488         fields to zero.
19489         (mono_image_get_generic_param_info): Likewise.
19490
19491         * reflection.h (MonoReflectionInflatedMethod): New public
19492         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
19493         "S.R.MonoInflatedCtor" classes.
19494
19495         * loader.c (method_from_memberref): If we're a TypeSpec and it
19496         resolves to a generic instance, inflate the method.
19497
19498 2003-10-28  Dick Porter  <dick@ximian.com>
19499
19500         * object.c (mono_runtime_run_main): Convert command-line arguments
19501         into utf8, falling back to the user's locale encoding to do so.
19502
19503 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
19504
19505         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
19506         at this time.
19507
19508         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
19509
19510         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
19511         up icalls at method definition time. Partially fixes #33569.
19512
19513 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
19514
19515         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
19516         marshalling of arrays. Fixes #50116.
19517
19518         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
19519
19520         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
19521         points to a vtable in the dying appdomain.
19522
19523         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
19524         listeners into unmanaged code inside the lock.
19525
19526         * object.c (mono_class_vtable): Turn off typed allocation in non-root
19527         domains and add some comments.
19528
19529 2003-10-25  Martin Baulig  <martin@ximian.com>
19530
19531         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
19532
19533         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
19534
19535         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
19536         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
19537         currently parsing.  Create the generic class and store it in
19538         `generic_inst->klass' before parsing the type arguments.  This is
19539         required to support "recursive" definitions; see mcs/tests/gen-23.cs
19540         for an example.
19541         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
19542         to support recursive typespec entries.
19543
19544         * class.c (mono_class_setup_parent): If our parent is a generic
19545         instance, we may get called before it has its name set.
19546         (mono_class_from_generic): Splitted into
19547         mono_class_create_from_generic() and mono_class_initialize_generic().
19548
19549 2003-10-25  Martin Baulig  <martin@ximian.com>
19550
19551         * icall.c (ves_icall_Type_BindGenericParameters): Return a
19552         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
19553         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
19554         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
19555
19556         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
19557         (create_typespec): Likewise.
19558         (mono_reflection_bind_generic_parameters): Return a
19559         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
19560         (mono_reflection_inflate_method_or_ctor): New public function.
19561
19562         * reflection.h (MonoReflectionGenericInst): New typedef.        
19563
19564 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
19565
19566         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
19567         inside the domain lock. Fixes #49993.
19568         
19569         * object.c (mono_class_vtable): When typed allocation is used, 
19570         allocate vtables in the GC heap instead of in the mempool, since the
19571         vtables contain GC descriptors which are used by the collector even
19572         after the domain owning the mempool is unloaded.
19573
19574         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
19575
19576         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
19577         reflect what it does. Also invalidate mempools instead of freeing
19578         them if a define is set.
19579
19580         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
19581         of the appdomain.
19582         
19583         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
19584         hold the finalizable objects in this domain.
19585
19586         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
19587         appdomain.
19588
19589         * appdomain.c (mono_domain_set): New function to set the current
19590         appdomain, but only if it is not being unloaded.
19591
19592         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
19593         appdomain which is being unloaded.
19594         
19595         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
19596         unloading of the root appdomain.
19597
19598         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
19599         icall to execute a method in another appdomain. Intended as a 
19600         replacement for InternalSetDomain, which can confuse the code 
19601         generation in the JIT.
19602
19603         * appdomain.c (mono_domain_is_unloading): New function to determine
19604         whenever an appdomain is unloading.
19605
19606         * appdomain.c (mono_domain_unload): New function to correctly unload
19607         an appdomain.
19608
19609         * assembly.c (mono_assembly_load_references): Check that an assembly
19610         does not references itself.
19611
19612         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
19613         domain manually, it asks the finalizer thread to do it, then waits for
19614         the result. Also added a timeout.
19615
19616         * icall.c: Register the new icalls.
19617
19618         * threads.h threads.c: Export the mono_gc_stop_world and 
19619         mono_gc_start_world functions.
19620         
19621         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
19622         function to fill out the mempool with 0x2a.
19623
19624 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
19625
19626         * reflection.h (MonoReflectionMethodAux): New structure to store
19627         information which is rarely used, thus is not in the MonoMethod
19628         structure.
19629
19630         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
19631         store the aux info.
19632
19633         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
19634         and marshalling info into the aux structure.
19635
19636         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
19637         from the aux structure.
19638
19639         * loader.c (mono_method_get_param_names): Retrieve the param names from
19640         the aux structure.
19641         
19642 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
19643
19644         * exception.h exception.c: Add AppDomainUnloadedException && fix 
19645         warning.
19646
19647 2003-10-21  Dick Porter  <dick@ximian.com>
19648
19649         * socket-io.c
19650         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
19651         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
19652
19653 2003-10-21  Martin Baulig  <martin@ximian.com>
19654
19655         * reflection.c (mono_reflection_bind_generic_parameters):
19656         `klass->parent' is NULL for interfaces.
19657
19658 2003-10-21  Martin Baulig  <martin@ximian.com>
19659
19660         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
19661
19662 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
19663
19664         * exception.c (mono_exception_from_name_msg): New helper function for
19665         creating exceptions and initializing their message field.
19666
19667         * exception.c: Simplify functions using the new helper.
19668
19669         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
19670         New function.
19671
19672         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
19673         mono_raise_exception, since otherwise gcc doesn't generate the function
19674         epilog for raise_exception, confusing the stack unwinding in the JIT.
19675         Fixes #45043.
19676
19677         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
19678         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
19679         Fixes #49499.
19680
19681 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19682
19683         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
19684         utf8.
19685
19686 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
19687
19688         * icall.c: Removed GetUninitializedObject method because
19689           AllocateUninitializedClassInstance does the same.
19690
19691 2003-10-18  Martin Baulig  <martin@ximian.com>
19692
19693         * class.c (inflate_generic_signature): Renamed to
19694         mono_class_inflate_generic_signature() and made it public.
19695         (my_mono_class_from_generic_parameter): New static function; if we
19696         don't already have the generic parameter's MonoClass, create a
19697         very simple one which is just used internally in the runtime and
19698         not passed back to managed code.
19699
19700         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
19701
19702         * metadata.h (MonoMethodSignature): Moved the
19703         `MonoGenericParam *gen_params' to the MonoMethodHeader.
19704         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
19705
19706         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
19707         ves_icall_MonoMethod_GetGenericArguments(); this is now an
19708         interncall on the MonoMethod class, not on MethodInfo.
19709         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
19710         calling mono_reflection_bind_generic_method_parameters() directly.
19711
19712         * loader.c (mono_method_get_signature): If this is a MethodSpec;
19713         return the already computed `method->signature'.
19714         (method_from_methodspec): New static function to load a method
19715         from a MethodSpec entry.
19716         (mono_get_method_from_token): Call the new method_from_methodspec()
19717         for MethodSpec tokens.  
19718         (mono_get_method_from_token): If we're a generic method, load the
19719         type parameters.
19720
19721         * reflection.c (mono_image_get_memberref_token): Allow
19722         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
19723         table.
19724         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
19725         (mono_image_create_token): First check whether it's a generic
19726         method (so we'd need to create a MethodSpec), then do the other
19727         two alternatives.
19728         (mono_reflection_bind_generic_method_parameters): Return a
19729         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
19730         called directly from the interncall.
19731
19732 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
19733
19734         * reflection.c (load_public_key): Move loading of the public key
19735         into managed code.
19736
19737         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
19738
19739         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
19740         fields.
19741
19742         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
19743         culture, hash_alg and public_key. Fixes #49555.
19744
19745 2003-10-17  Martin Baulig  <martin@ximian.com>
19746
19747         * class.h (MonoGenericInst): Moved this declaration here and added
19748         `MonoMethod *generic_method'.
19749
19750         * icall.c
19751         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
19752         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
19753
19754         * metadata.c (mono_metadata_type_equal): Two types of
19755         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
19756         index; ie. don't compare the address of the `MonoGenericParam'
19757         structure.
19758         (mono_metadata_load_generic_params): Removed the `MonoMethod
19759         *method' argument.
19760
19761         * metadata.h (MonoGenericInst): Moved declaration to class.h.
19762         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
19763
19764         * reflection.c (method_encode_signature): Encode the number of
19765         generic parameters.
19766         (encode_generic_method_sig): New static function.
19767         (method_encode_methodspec): New static function; creates an entry
19768         in the MethodSpec table for a generic method.
19769         (mono_image_get_methodspec_token): New static function.
19770         (mono_image_create_token): Call mono_image_get_methodspec_token()
19771         for generic methods.
19772         (mono_reflection_bind_generic_method_parameters): New public
19773         function.  Instantiates a generic method.
19774
19775 2003-10-16  Martin Baulig  <martin@ximian.com>
19776
19777         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
19778         *gen_params' here from MonoMethodHeader.
19779
19780         * metadata.c (mono_metadata_parse_method_signature): If we have
19781         generic parameters, initialize `method->gen_params' and then set
19782         the correct `type->data.generic_param' in all the parameters.
19783
19784 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
19785
19786         * threads.c (mono_threads_get_default_stacksize): New function to 
19787         return the default stacksize.
19788
19789         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
19790         termination of the finalizer thread, since the previous method had
19791         race conditions. Fixes #49628.
19792
19793         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
19794         as for the other managed threads.
19795
19796 2003-10-16  Martin Baulig  <martin@ximian.com>
19797
19798         * class.c (inflate_generic_signature): Copy `generic_param_count'
19799         and `gen_params'.
19800
19801         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
19802         New interncall.
19803
19804         * metadata.c (mono_metadata_parse_method_signature): Actually set
19805         the `method->generic_param_count' here.
19806         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
19807
19808 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
19809
19810         * object.h: Add a new field to TypedRef to simplify the implementation
19811         of the REFANY opcodes in the JIT.
19812
19813         * icall.c: Make use of the new field.
19814
19815         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
19816         dynamically.
19817
19818 2003-10-15  Martin Baulig  <martin@ximian.com>
19819
19820         * class.c (mono_class_from_gen_param): Renamed to
19821         mono_class_from_generic_parameter() and moved most of the
19822         functionality from mono_reflection_define_generic_parameter()
19823         here; ie. we create a "real" class here.
19824         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
19825         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
19826         previously been called.
19827
19828         * class.h (MonoGenericParam): Moved the declaration of this struct
19829         here from metadata.h and added `MonoMethod *method'.
19830
19831         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
19832         interncall.
19833
19834         * loader.c (mono_get_method_from_token): If we have any generic
19835         parameters, call mono_metadata_load_generic_params() to read them
19836         from the MONO_TABLE_GENERICPAR.
19837
19838         * metadata.c (mono_metadata_load_generic_params): Added
19839         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
19840
19841         * metadata.h (MonoMethodSignature): Replaced
19842         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
19843         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
19844
19845         * reflection.c (mono_reflection_define_generic_parameter): Moved
19846         most of the functionality into the new
19847         mono_class_from_generic_parameter(); set the `method' field if
19848         we're a method parameter.       
19849
19850 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
19851
19852         * marshal.c (emit_struct_conv): if native size is 0
19853         emit no code.
19854
19855 2003-10-14  Martin Baulig  <martin@ximian.com>
19856
19857         * icall.c: The generics API has changed in the spec since it was
19858         added to System.Type; these modifications make it match the spec
19859         again.
19860         (ves_icall_Type_GetGenericParameters): Renamed to
19861         `ves_icall_Type_GetGenericArguments'.
19862         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
19863         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
19864         `ves_icall_MonoType_get_HasGenericArguments'.
19865         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
19866         `ves_icall_MonoType_get_IsGenericParameter'.
19867         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
19868         this is no interncall anymore.
19869         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
19870         `ves_icall_TypeBuilder_get_IsGenericParameter'.
19871
19872 2003-10-14  Martin Baulig  <martin@ximian.com>
19873
19874         * reflection.c (mono_reflection_bind_generic_parameters): Also
19875         inflate generic methods if we're reading the class from IL.
19876
19877 2003-10-13  Martin Baulig  <martin@ximian.com>
19878
19879         * reflection.c (mono_reflection_define_generic_parameter): This
19880         method isn't called directly from the icall anymore; take a
19881         `MonoReflectionAssemblyBuilder *' so we can use this for type and
19882         method generic parameters.
19883         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
19884         (method_builder_encode_signature): Encode generic parameters.
19885         (mono_image_get_method_info): Write generic params to the
19886         MONO_TABLE_GENERICPARAM table.
19887
19888         * reflection.h (MonoReflectionMethodBuilder): Added
19889         `MonoArray *generic_params'.
19890
19891         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
19892
19893         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
19894         wrapper for mono_reflection_define_generic_parameter().
19895         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
19896
19897 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
19898
19899         * marshal.h: Add missing function to fix build.
19900
19901         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
19902         the SetLastError pinvoke attribute.
19903
19904         * marshal.c (mono_marshal_set_last_error): New helper function called
19905         by the generated code.
19906         
19907         * marshal.c (mono_mb_emit_branch): New helper function.
19908
19909         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
19910
19911         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
19912         classes as parameters and return values of delegates. Fixes #29256. 
19913
19914 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
19915
19916         * locales.c: use gint32 in non HAVE_ICU case
19917
19918 2003-10-11  Martin Baulig  <martin@ximian.com>
19919
19920         * mono-debug.c (mono_debug_add_method): Added a workaround for
19921         bug #48591.
19922
19923 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
19924
19925         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
19926         delegates passed to native code must use the STDCALL calling 
19927         convention. Fixes #35987.
19928
19929 2003-10-10  Martin Baulig  <martin@ximian.com>
19930
19931         * class.c (inflate_generic_type): If we're inflating for a generic
19932         type instance (and not for a generic method), return
19933         MONO_TYPE_MVAR unchanged.
19934
19935 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19936
19937         * string-icalls.c: Join ignores null strings in the source array.
19938         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
19939         * threads.c: GetAvailableTheads is slightly more accurate.
19940
19941 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
19942
19943         * threads.h threads.c : add mono_threads_set_default_stacksize
19944         and pass default to CreateThread calls.
19945
19946 2003-10-09  Dick Porter  <dick@ximian.com>
19947
19948         * icall.c:
19949         * locales.h:
19950         * locales.c: Internal calls for constructing CultureInfo and
19951         related objects from libicu (if its available.)
19952
19953 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
19954
19955         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
19956
19957 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19958
19959         * threadpool.c: added an argument to async_invoke_thread that is the
19960         item to process, pass the MonoAsyncResult to the thread start function
19961         when creating a new thread. This way we don't need to acquire any lock
19962         when we're creating a new thread. Readded a semaphore for faster
19963         response times (instead of that Sleep i added).
19964
19965 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
19966
19967         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
19968         get daylight change dates better on Windows, fix handling
19969         of platforms without tm_gmtoff.
19970
19971 2003-10-06  Martin Baulig  <martin@ximian.com>
19972
19973         * class.c (inflate_generic_method): Renamed to
19974         mono_class_inflate_generic_method() and made public.
19975         (mono_class_init): Don't inflate the generic methods here.
19976         (mono_class_from_generic): Added `gboolean inflate_methods'
19977         argument.  Inflate the methods here.
19978
19979         * loader.c (mono_method_get_param_names): Ignore instances of
19980         generic types for the moment.
19981
19982         * reflection.c (fixup_method): Added support for inflated methods.
19983         (mono_image_create_token): Use mono_image_get_methodref_token()
19984         for inflated methods.
19985         (mono_custom_attrs_from_param): Ignore instances of generic types
19986         for the moment.
19987         (mono_reflection_bind_generic_parameters): New public function.
19988         Moved all the functionality from
19989         ves_icall_Type_BindGenericParameters() here and added support for
19990         dynamic types.
19991         (mono_reflection_define_generic_parameter): Initialize
19992         `klass->methods' here.
19993
19994         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
19995         functionality into mono_reflection_define_generic_parameter().
19996         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
19997         TypeBuilder, return that TypeBuilder.
19998
19999 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20000
20001         * appdomain.c: removed mono_delegate_semaphore.
20002
20003         * threadpool.c:
20004         (mono_thread_pool_add): moved hash table creation inside and the thread 
20005         creation outside of the critical region.
20006         (mono_thread_pool_finish): removed obsolete code.
20007         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
20008         continue or exit the thread depending on the queue.
20009
20010 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
20011
20012         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
20013         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
20014         handle more bool marshalling options
20015
20016 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
20017
20018         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
20019         arrays of structs. Also add a more descriptive error message when
20020         a structure member is marshalled as LPArray.
20021
20022 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
20023
20024         * marshal.c (mono_marshal_get_native_wrapper): Add support for
20025         marshalling arrays of complex types. Fixes #29098. Also remove an
20026         usused and incomplete function.
20027
20028 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
20029
20030         * gc.c: report heap_size - free_bytes as total memory allocated
20031         (bug#49362).
20032
20033 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
20034
20035         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
20036         fix timezone handling problems on Windows.
20037         
20038         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
20039         asserts when the year is outside the range handled by ms the functions.
20040
20041         * class.c (setup_interface_offsets): If the class is an interface,
20042         fill out its interface_offsets slot.
20043
20044 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20045
20046         * threadpool.c: mark threadpool threads as background.
20047
20048 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
20049
20050         * decimal.c - define DECINLINE to nothing if not using GCC
20051
20052 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
20053
20054         * assembly.c: More refcount fixes.
20055
20056 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20057
20058         * string-icalls.c: if we're not trimming, return the same string.
20059         When not splitting, don't create a new string.
20060
20061 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20062
20063         * image.c:
20064         (mono_image_open): increment the ref_count inside the critical section.
20065
20066 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
20067
20068         * image.c (mono_image_open): Fix reference counting bug.
20069
20070 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
20071
20072         * marshal.c (mono_marshal_type_size) struct alignment changed for 
20073         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
20074         64bits. Avoid leak in mono_marshal_get_native_wrapper when
20075         mono_lookup_pinvoke_call throws.        
20076
20077 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
20078
20079         * reflection.c (mono_reflection_parse_type): Fix #49114.
20080
20081         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
20082         temporary workaround for cygwin header problem.
20083
20084         * object.c (mono_object_isinst): Synchronize this with the code
20085         generated by the JIT for casts.
20086
20087 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
20088
20089         * reflection.c (encode_type): Fix #38332.
20090
20091 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
20092
20093         * marshal.c (mono_marshal_method_from_wrapper): New function to return
20094         the original method from the wrapper method.
20095
20096 2003-09-25  Martin Baulig  <martin@ximian.com>
20097
20098         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
20099         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
20100         (ves_icall_Type_get_IsGenericInstance): New interncall.
20101
20102 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
20103
20104         * object.c: fix cast warning in big endian code.
20105
20106 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
20107
20108         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
20109         
20110 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20111
20112         * assembly.c: don't call check_env from mono_assembly_load. It's
20113         already done once in mono_assemblies_init and may cause headaches when
20114         multiple threads are loading assemblies.
20115
20116 2003-09-19  Martin Baulig  <martin@ximian.com>
20117
20118         * reflection.c (mono_reflection_define_generic_parameter): Don't
20119         allocate `klass->methods', set `klass->flags' to
20120         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
20121
20122 2003-09-18  Martin Baulig  <martin@ximian.com>
20123
20124         * class.c (mono_class_init): Don't create `class->methods' if it's
20125         already initialized.
20126
20127         * metadata.c (mono_metadata_load_generic_params): Make this
20128         actually work.
20129
20130         * reflection.c (mono_reflection_define_generic_parameter): Set
20131         parent class and interfaces from the constraints.
20132
20133         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
20134         to keep this struct in sync with the declaration in TypeBuilder.cs.
20135
20136 2003-09-17  Martin Baulig  <martin@ximian.com>
20137
20138         * metadata.h (MonoType): Replaced the data's `int type_param'
20139         field with `MonoGenericParam *generic_param'.
20140         (MonoGenericParam): Added `MonoClass *klass'.
20141
20142         * class.c (mono_class_from_gen_param): Removed the
20143         `MonoImage *image' and `int type_num' arguments.
20144
20145         * metadata.c (mono_metadata_parse_generic_param): New static
20146         method; creates a MonoGenericParam which just contains the index.
20147         (do_mono_metadata_parse_type): Call
20148         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
20149         MONO_TYPE_MVAR.
20150
20151         * reflection.c (mono_image_typedef_or_ref): Generic type
20152         parameters may be in the same assembly, but never use a typedef
20153         for them.
20154         (mono_reflection_define_generic_parameter): We're now creating a
20155         "real" class for the type parameter; it's now safe to call
20156         mono_class_from_mono_type() on the class'es type, it'll do the
20157         right thing.
20158
20159 2003-09-16  Martin Baulig  <martin@ximian.com>
20160
20161         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
20162         `symfile->range_entry_size' and `symfile->class_entry_size' here;
20163         the `symfile' data structure must be fully initialized before it
20164         gets added to the table.
20165
20166 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
20167
20168         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
20169
20170         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
20171         class init trampolines.
20172
20173 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
20174
20175         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
20176         to the built-in profiler to turn off time and allocation profiling
20177         respectively.
20178
20179 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
20180
20181         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
20182         g_direct_equal.
20183
20184         * debug-helpers.c (mono_method_full_name): Print the wrapper type
20185         in human readable form.
20186
20187 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
20188
20189         * reflection.c icall.c: Fixed warnings.
20190
20191         * image.c (load_class_names): Use a temporary hash table to hold the
20192         namespaces in order to avoid doing many string comparisons.
20193
20194         * image.h: Fix typo.
20195
20196         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
20197         Pass NULL instead of g_direct_equal to the GHashTable constructor 
20198         since the NULL case is short-circuited inside g_hash_table_lookup, 
20199         leading to better performance.  
20200
20201         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
20202         obtain the first custom attribute for a given index. Depends on the
20203         CustomAttribute table being sorted by the parent field.
20204
20205         * reflection.c (mono_custom_attrs_from_index): Use the new function 
20206         for better performance.
20207
20208 2003-09-07  Martin Baulig  <martin@ximian.com>
20209
20210         * class.c (mono_class_init): If we're a generic instance, inflate
20211         all our methods instead of loading them from the image.
20212         (mono_class_from_generic): Set `class->methods = gklass->methods'.
20213
20214 2003-09-07  Martin Baulig  <martin@ximian.com>
20215
20216         * mono-debug-debugger.c: Added support for constructors.
20217
20218 2003-09-06  Martin Baulig  <martin@ximian.com>
20219
20220         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
20221         New interncall.
20222
20223         * reflection.c (mono_reflection_setup_generic_class): Call
20224         ensure_runtime_vtable() to create the vtable.
20225
20226 2003-09-05  Martin Baulig  <martin@ximian.com>
20227
20228         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
20229         MONO_TYPE_MVAR.
20230
20231 2003-09-04  Martin Baulig  <martin@ximian.com>
20232
20233         * reflection.c (mono_reflection_define_generic_parameter): Generic
20234         parameters start with zero.
20235
20236 2003-09-04  Martin Baulig  <martin@ximian.com>
20237
20238         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
20239
20240         * reflection.h (MonoReflectionGenericParam): New typedef.
20241         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
20242         the generic parameters from the managed TypeBuilder.
20243
20244         * reflection.c (mono_reflection_define_generic_parameter): New function.
20245         (mono_reflection_create_runtime_class): Encode generic parameters.
20246         (mono_reflection_setup_generic_class): New function; this is
20247         called after adding adding all generic params to the TypeBuilder.
20248         (encode_type): Added MONO_TYPE_VAR.
20249
20250 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
20251
20252         * class.h class.c (mono_class_needs_cctor_run): Moved this method
20253         here from the JIT.
20254
20255         * assembly.h assembly.c: Moved the AOT loading code into an assembly
20256         load hook.
20257
20258 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
20259
20260         * reflection.h reflection.c class.h class.c: Delete duplicate 
20261         definition of mono_type_get_name () from reflection.c and export the
20262         one in class.c.
20263
20264         * class.c: Class loading fixes from Bernie Solomon 
20265         (bernard@ugsolutions.com).
20266
20267         * reflection.c: Endianness fixes from Bernie Solomon 
20268         (bernard@ugsolutions.com).
20269         
20270 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
20271
20272         * assembly.h assembly.c: Define a file format version for AOT
20273         libraries.
20274         
20275         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
20276
20277         * appdomain.h (MonoJitInfo): New field to determine whenever the
20278         code is domain neutral.
20279         
20280 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
20281
20282         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
20283
20284 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
20285
20286         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
20287         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
20288         Avoid caching the result since strings must be domain specific. Fixes
20289         #48050.
20290
20291 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
20292
20293         * marshal.c (mono_marshal_init): Make this callable multiple times
20294         since it is hard to find a correct place to call it.
20295
20296         * object.c (mono_runtime_class_init): Execute static constructors in
20297         the correct appdomain.
20298
20299         * image.c (build_guid_table): Handle the case when multiple images have
20300         the same GUID.
20301
20302 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20303
20304         * icall.c: added a couple of icalls for System.Web.
20305
20306 2003-08-28  Martin Baulig  <martin@ximian.com>
20307
20308         * icall.c (ves_icall_Type_BindGenericParameters): Use
20309         `klass->generic_inst' instead of `&klass->byval_arg' in the
20310         mono_type_get_object() call.  The returned type must be
20311         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
20312
20313 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
20314
20315         * NOTES: New file.
20316
20317         * object.c (mono_class_proxy_vtable): Make it thread safe.
20318
20319         * pedump.c: Fix warning.
20320
20321         * object.c appdomain.h: Get rid of metadata_section. 
20322         It is no longer needed and it was causing deadlocks with domain->lock.
20323
20324         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
20325
20326 2003-08-26  Martin Baulig  <martin@ximian.com>
20327
20328         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
20329
20330 2003-08-26  Martin Baulig  <martin@ximian.com>
20331
20332         * pedump.c (main): Call mono_metadata_init(),
20333         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
20334         and mono_loader_init().
20335
20336 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
20337
20338         * loader.h: Add missing include to fix build.
20339
20340         * image.h: mono_image_load_references is no more.
20341
20342         * assembly.c: Reworked assembly loading to make it really thread safe.
20343         After these changes, the assembly returned by mono_assembly_open is
20344         fully initialized, i.e. all its references assemblies are loaded.
20345
20346         * assembly.c (mono_image_load_references): Renamed to 
20347         mono_assembly_load_references, and made private, since clients no
20348         longer need to call it.
20349
20350         * class.c: Removed calls to mono_assembly_load_references, since it was
20351         a source of deadlocks.
20352
20353         * loader.h loader.c class.h class.c: Protect data structures using a 
20354         new lock, the loader lock.
20355
20356         * class.c (mono_class_setup_vtable): Create temporary hash tables and
20357         GPtrArrays only when needed.
20358
20359         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
20360         into empty structures by mcs. Fixes pinvoke7.cs.
20361         
20362         * domain.c (mono_init): Call a new initialization function.
20363
20364         * appdomain.c (mono_runtime_init): Call the new initializer function
20365         of the marshal module.
20366
20367         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
20368         inserted into empty structures by mcs. Fixes pinvoke7.cs.
20369
20370         * marshal.h marshal.c: Added locks around the wrapper caches to make
20371         this module thread safe.
20372
20373         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
20374         this argument. Fixes pinvoke1.exe.
20375
20376 2003-08-25  Lluis Sanchez <lluis@ximian.com>
20377
20378         * object.h: Added call_type field to MonoMethodMessage and the corresponding
20379         enumeration of values. Removed fields to store remote call output values in
20380         MonoAsyncResult. Not needed any more.
20381         * object.c: Initialize call_type and async_result fields in mono_message_init.
20382         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
20383         dispatching the message.
20384         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
20385         async call to finish. To do it use a message with EndInvoke call type.
20386
20387 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
20388
20389         * loader.h loader.c (mono_method_hash_marhal_info): New function which
20390         determines whenever a method has marshalling info.
20391
20392 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20393
20394         * assembly.c: fix the build on windows.
20395
20396 2003-08-22 Lluis Sanchez <lluis@ximian.com>
20397
20398         * object.cs: Fixed bug #47785.
20399
20400 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
20401
20402         * string-icalls.c (StringReplace): If their are no occurances of
20403         the old string found return a reference to the supplied
20404         string. This saves some memory and matches MS behavoir.
20405         
20406 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20407
20408         * socket-io.c: fixed compilation for systems that define AF_INET6
20409         and don't define SOL_IP/SOL_IPV6.
20410
20411 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
20412
20413         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
20414         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
20415
20416         * rawbuffer.c rawbuffer.h: Make this module thread safe.
20417
20418         * domain.c: Make this module thread safe.
20419
20420         * domain.c (mono_init): Call new initialization function.
20421
20422         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
20423         reference types too. Fixes #38812.
20424
20425         * image.c (mono_image_init): Fixed warnings.
20426
20427         * class.c (mono_class_from_typeref): Handle assembly load failure
20428         correctly.
20429
20430         * appdomain.c (add_assemblies_to_domain): Handle the case when
20431         the references of an assembly are not yet loaded.
20432
20433         * metadata.c image.c assembly.c: Moved initialization of global
20434         variables to a separate function called at startup since lazy 
20435         initialization of these variables is not thread safe.
20436         
20437         * image.c assembly.c: Made this module thread safe by adding locks in 
20438         the appropriate places.
20439
20440         * domain.c (mono_init): Call the new initialization functions of the
20441         three modules.
20442
20443 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
20444
20445         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
20446           make a direct call. It is proxy's work to make the call asynchronous.
20447           mono_delegate_end_invoke(): If the targe is a proxy, just collect
20448           the return values.
20449         * object.cs: mono_method_call_message_new(): read AsyncResult and
20450           state object from parameters list, if this info is requested.
20451         * object.h: Added fields to store remote call output values in
20452           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
20453
20454 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
20455
20456         * object.h: add needed fields to MonoThread.
20457         * threads.c, threads.h: allow registering a function to cleanup data
20458         allocated per thread by the JIT.
20459
20460 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20461
20462         * loader.h: portability fix by Bernie Solomon
20463         * <bernard@ugsolutions.com>.
20464
20465 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
20466
20467         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
20468         return a MonoArray. This simplifies the code and also ensures that
20469         the cache allways contains an object reference as a value.
20470
20471         * icall.c (ves_icall_get_parameter_info): Simplified using the new
20472         function.
20473
20474 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20475
20476         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
20477         fixes a problem with byte ordering when getting the address family for
20478         a socket.
20479
20480 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
20481
20482         * .cvsignore: Added monosn.
20483
20484         * reflection.h reflection.c loader.c: Added support for parameter
20485         marshalling to dynamically created types. Fixes #47295.
20486
20487 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
20488
20489         * rand.c: remove useless warnings.
20490
20491 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
20492
20493         * class.c: implemented ldtoken for methods and fieldrefs.
20494
20495 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20496
20497         * threadpool.c: when mono_async_invoke was called, no one took care of
20498         monitoring the queue. So if the method invoked took some time and we
20499         got new async invoke requests after 500 ms (the thread created waited
20500         that long in WaitForSingleObject), the new async invoke was not called
20501         until the previous one finished.
20502
20503         This is fixed now. Thanks to Totte for helping with it.
20504
20505 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20506
20507         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
20508
20509 2003-08-11  Martin Baulig  <martin@ximian.com>
20510
20511         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
20512
20513 2003-08-06  Martin Baulig  <martin@ximian.com>
20514
20515         * mono-debug-debugger.c: Added support for static fields,
20516         properties and methods.
20517
20518 2003-08-06  Martin Baulig  <martin@ximian.com>
20519
20520         * mono-debug-debugger.c: Don't store the MonoString's vtable to
20521         make this work for applications with multiple application domains.
20522
20523 2003-08-04  Martin Baulig  <martin@ximian.com>
20524
20525         * mono-debug-debugger.c: Completely reworked the type support; the
20526         most important thing is that we're now just using one single
20527         `MonoType' instance per type.
20528
20529 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
20530
20531         * mono-endian.h, mono-endian.c, icall.c: Added icall
20532         ves_icall_System_Double_AssertEndianity to assert double word endianity
20533         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
20534
20535 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
20536
20537         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
20538         support, icalls and fixes.
20539
20540 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
20541
20542         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
20543         classes that are a punctuation character in .NET is not the same a
20544         g_unichar_ispunct.
20545
20546 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20547
20548         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
20549
20550 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
20551
20552         * icall.c: Add new MemCopy internalcall.
20553         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
20554         Simplified code; It is not necessary to handle all the cases here,
20555         as the C# code takes care of it.  Only handle the case of the name
20556         resource embedded into the assembly.
20557
20558         Changed signature to return the data pointer and the size of the
20559         data. 
20560
20561 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
20562
20563         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
20564         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
20565
20566 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
20567
20568         * socket-io.c: ignore EINTR error in select.
20569
20570 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
20571
20572         * class.h, class.c: removed unused subclasses field in MonoClass.
20573
20574 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
20575
20576         * icall.c: improve fix of get_base_definition(). If the parent class
20577           doesn't have the mehod, look at the parent of the parent.
20578         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
20579           to check if a parameter is an in or out parameter
20580           (PARAM_ATTRIBUTE_IN is not set by default).
20581           mono_method_return_message_restore(): Use mono_class_value_size to
20582           get the size of a value type. mono_type_stack_size (parameterType)
20583           does not return the correct value if parameterType is byRef.
20584           mono_load_remote_field(), mono_load_remote_field_new(),
20585           mono_store_remote_field(), mono_store_remote_field_new():
20586           raise exception if the remote call returns an exception.
20587
20588 2003-07-28  Martin Baulig  <martin@ximian.com>
20589
20590         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
20591         method.  This is a wrapper around mono_runtime_invoke() which
20592         boxes the instance object if neccessary.
20593
20594 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
20595
20596         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
20597         metadata.h, row-indexes.h, verify.c: first cut of generics support.
20598
20599 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
20600
20601         * icall.c: disable mcs bug workaround.
20602
20603 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * object.c (mono_runtime_class_init): Take the metadata_section
20606         mutex before obtaining the domain mutex.
20607
20608         * appdomain.h: Added definition of metadata_section mutex here. 
20609
20610         * object.c: define metadata_mutex here.
20611
20612 2003-07-24  Ravi Pratap  <ravi@ximian.com>
20613
20614         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
20615         fixed.
20616
20617 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
20618
20619         * reflection.c: Fix bug #46669
20620
20621 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20622
20623         * exception.c:
20624         * exception.h:
20625         * icall.c:
20626         * object.h: fill in the type name for TypeLoadException.
20627
20628 2003-07-23  Ravi Pratap  <ravi@ximian.com>
20629
20630         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
20631         relationship between TypeBuilders while compiling corlib) and bug
20632         45993 (Array types returned from the runtime while compiling
20633         corlib were from the loaded corlib).
20634
20635 2003-07-22  Martin Baulig  <martin@ximian.com>
20636
20637         * mono-debug-debugger.c: Reworked the type support a bit more;
20638         distinguish between types and classes.
20639
20640 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
20641
20642         * icall.c: add IsArrayImpl icall.
20643
20644 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
20645
20646         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
20647         initializing real_size only once. Also fix bug #46602.
20648
20649 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
20650
20651         * object.c: Renamed mono_metadata_section to metadata_section.
20652
20653 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
20654
20655         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
20656           empty array if the type is an array. Fixed.
20657           ves_icall_MonoMethod_get_base_definition: if the base method
20658           is abstract, get the MethodInfo from the list of methods of
20659           the class.
20660         * reflection.c: ParameterInfo.PositionImpl should be zero-based
20661           and it was 1-based. Fixed in mono_param_get_objects.
20662
20663 2003-07-20  Martin Baulig  <martin@ximian.com>
20664
20665         * mono-debug.h: Set version number to 31.
20666         (mono_debug_init): Added `MonoDomain *' argument.
20667
20668         * mono-debug-debugger.c: Reworked the type support; explicitly
20669         tell the debugger about builtin types; pass the `klass' address to
20670         the debugger.
20671
20672 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
20673
20674         * image.c: Allow new metadata tables to be loaded without a
20675         warning. Also update the warning message to give the new constant value.
20676                 
20677 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
20678
20679         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
20680         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
20681         array type representation changes.
20682
20683 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
20684
20685         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
20686         on Environment.Exit () call.
20687
20688 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
20689
20690         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
20691         requires a matching corlib.
20692
20693 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
20694
20695         * Changelog: My editor decided to add a CR to each line. Sorry about that.
20696           Committed again without the CRs.
20697         
20698 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
20699
20700         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
20701           getting it from the "this" socket instance. Did not work
20702           if the socket is a subclass of Socket.
20703           Also fixed bug #35371.
20704
20705 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
20706
20707         * metadata.c: fixed size for TypedByRef.
20708         * loader.c: when searching for a method, consider the vararg amrker.
20709         * unicode.c, decimal.c: constify some arrays.
20710
20711 2003-07-15  Dick Porter  <dick@ximian.com>
20712
20713         * socket-io.c: Fixed compilation for gcc < 3.2.
20714
20715         Fixed compilation for machines that don't have AF_INET6 (thanks to
20716         Bernie Solomon <bernard@ugsolutions.com> for that part.)
20717
20718         Fixed compile warnings.
20719         
20720         Fixed formatting and line endings.
20721
20722 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
20723
20724         * socket-io.h:
20725         * socket-io.c: Added IPv6 support.
20726
20727 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
20728
20729         * class.c (mono_class_is_assignable_from): New function to implement
20730         the is_assignable_from logic. Used by mono_object_isinst, 
20731         Type::IsAssignableFrom () and the interpreter.
20732
20733         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
20734         Object, even interfaces.
20735         
20736         * object.c (mono_object_isinst): Implement in terms of 
20737         is_assignable_from.
20738
20739         * icall.c (ves_icall_type_is_assignable_from): New icall.
20740
20741 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
20742
20743         * domain.c (foreach_domain): fix compiler warning.
20744
20745 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
20746
20747         * image.c (load_metadata_ptrs): use g_strndup because strndup is
20748         not available on all plattforms
20749
20750 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
20751
20752         * image.h image.c: Store the metadata version string in MonoImage.
20753         * icall.c: New icall to retrieve the image version.
20754         * reflection.c (create_dynamic_image): Fill in the image version field
20755         * reflection.c (build_compressed_metadata): Use the image version
20756         from the image structure.
20757
20758 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20759
20760         * appdomain.c: modified comment.
20761         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
20762         That will be its last iteration when mono_gc_cleanup is called from
20763         mono_runtime_cleanup and before the domain is unloaded.
20764
20765         Fixes bug #45962.
20766
20767 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
20768
20769         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
20770         attributes.
20771
20772 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
20773
20774         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
20775         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
20776         Bernie Solomon <bernard@ugsolutions.com>.
20777
20778 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
20779
20780         * object.c, object.h: provide mono_object_new_fast() for faster
20781         allocation in some special cases.
20782
20783 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
20784
20785         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
20786         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
20787
20788 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
20789
20790         * threadpool.c: fix leaks.
20791
20792 2003-07-01  Dick Porter  <dick@ximian.com>
20793
20794         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
20795         using MonoGHashTables.  Fixes threadpool bug posted to list.
20796
20797 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
20798
20799         * image.h, image.c: added support to load an assembly from a byte array.
20800         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
20801         assembly bundle support.
20802
20803 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
20804
20805         * threadpool.c (mono_thread_pool_add): keep a reference to the
20806         AsyncResult to prevent GC
20807
20808 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
20809
20810         * class.c: leak fix.
20811
20812 2003-06-25  Dick Porter  <dick@ximian.com>
20813
20814         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
20815         for the async object, the WaitHandle object will close the handle.
20816         Fixes bug 45321.
20817
20818 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
20819
20820         * class.c: in mono_array_class_get (), lookup from the hash with the
20821         same type we insert: this works around a bug in
20822         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
20823         lluis. The real fix will have to wait for after the release.
20824
20825 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
20826
20827         * icall.c: fix memory leak when getting type members.
20828
20829 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
20830
20831         * reflection.c: added more pubtoken special cases.
20832
20833 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
20834
20835         * class.c: handle field offset correctly when class size
20836         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
20837
20838 2003-06-20  Martin Baulig  <martin@ximian.com>
20839
20840         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
20841         *image' field.
20842
20843 2003-06-20  Martin Baulig  <martin@ximian.com>
20844
20845         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
20846
20847 2003-06-20  Martin Baulig  <martin@ximian.com>
20848
20849         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
20850         just distinguish between variables in registers and variables at
20851         an offset relative to a register.
20852
20853 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20854
20855         * icall.c: #ifdef out latest changes until mcs is fixed.
20856
20857 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
20858
20859         * icall.c: return members in metadata order.
20860
20861 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
20862
20863         * icall.c: avoid infinite loop in GetTimeZoneData.
20864
20865 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
20866
20867         * icall.c: added Marshal.Prelink/All icalls.
20868
20869 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
20870
20871         * object.c, object.h: fix warnings and do some overflow checking
20872         when creating arrays.
20873
20874 2003-06-17  Dick Porter  <dick@ximian.com>
20875
20876         * file-io.h:
20877         * file-io.c: File attributes need to be tweaked slightly when
20878         passed from the managed to the w32 world.
20879
20880 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
20881         * profiler.h profiler-private.h profiler.c: Rework last patch
20882         based on suggestion by Paolo.
20883         
20884 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
20885
20886         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
20887         instruction level coverage data collection.
20888         * profiler.h profiler.c (: Added new callback function which can be
20889         used by the profiler to limit which functions should have coverage
20890         instrumentation.
20891         * profiler.c (mono_profiler_load): Call g_module_build_path to
20892         generate the file name of the profiler library.
20893
20894 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
20895
20896         * profiler.c, profiler.h, profiler-private.h: added basic block 
20897         coverage profiling API.
20898
20899 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
20900
20901         * reflection.c (mono_reflection_create_runtime_class): Add support
20902         for events in dynamically generated code.
20903
20904         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
20905         not allocated.
20906
20907 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
20908
20909         * icall.c: when getting timezone info, return reasonable values if we
20910         can't get the actual data.
20911
20912 2003-06-14  Dick Porter  <dick@ximian.com>
20913
20914         * threads.c (start_wrapper): Remove the reference to the thread
20915         object in the TLS data, so the thread object can be finalized.
20916         This won't be reached if the thread threw an uncaught exception,
20917         so those thread handles will stay referenced :-( (This is due to
20918         missing support for scanning thread-specific data in the Boehm GC
20919         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
20920
20921 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
20922
20923         * reflection.c: ensure streams and tables are first allocated with
20924         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
20925
20926 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
20927
20928         * icall.c: fixed GetElementType for byrefs (bug# 44792).
20929
20930 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
20931
20932         * reflection.c (mono_reflection_create_runtime_class): Add support for
20933         properties to dynamically created classes.
20934         * reflection.c: Fix a few places where non-MonoObjects were inserted
20935         into the tokens hashtable.
20936
20937 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
20938
20939         * object.c: some support to handle out of memory exceptions.
20940
20941 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
20942
20943         * marshal.c (mono_marshal_get_native_wrapper): support reference
20944         return types
20945
20946 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
20947
20948         * object.h, object.c: more portability stuff from Bernie Solomon.
20949         Unexport mono_object_allocate(). Added mono_object_unbox ().
20950         Set exitcode when an unhandled exception is thrown.
20951
20952 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
20953
20954         * marshal.c (mono_marshal_get_native_wrapper): use custom
20955         marshaler for return types.
20956
20957 2003-06-10  Dick Porter  <dick@ximian.com>
20958
20959         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
20960         ip_mreq is available
20961
20962 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
20963
20964         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
20965         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
20966         by Bernie Solomon <bernard@ugsolutions.com>.
20967
20968 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
20969
20970         * gc.c (mono_gc_init): Avoid error message on shutdown when
20971         GC_DONT_GC=1 is used.
20972
20973         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
20974         New icall to return the GUID of a module.
20975
20976 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
20977
20978         * class.c: ensure instance size always includes the parent's size
20979         even whem class size is set explicitly (fixes bug#44294).
20980
20981 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
20982
20983         * profiler.h, profiler.c: made the simple profiler thread-safe,
20984         get more accurate timing info. Allow the loading of an
20985         externally-developed profiler module.
20986
20987 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
20988
20989         * marshal.c (mono_marshal_get_native_wrapper): improved
20990         class/byref arguments.
20991         (mono_marshal_get_native_wrapper): better string marshaling support.
20992
20993 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
20994
20995         * class.c: ensure .pack and .size are handled correctly and
20996         simplified layout of static fields.
20997
20998 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
20999
21000         * appdomain.c
21001         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
21002
21003         * loader.c (mono_lookup_pinvoke_call): look for modules in the
21004         current directory (fix bug 44008)
21005
21006 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
21007
21008         * marshal.c (mono_marshal_get_native_wrapper): started support for
21009         custom marshalers.
21010         (mono_delegate_to_ftnptr): consider marshalling specifications
21011
21012 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
21013
21014         * reflection.c, reflection.h: emit custom marshal info.
21015
21016 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21017
21018         * object.c: free the GError.
21019         * icall.c: added CloseEvent_internal.
21020         * threads.[ch]:
21021         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
21022         call.
21023
21024 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
21025
21026         * loader.c (mono_method_get_signature): Add support for dynamic
21027         assemblies.
21028
21029 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
21030
21031         * reflection.c: fixed bug #43905.
21032
21033 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
21034
21035         * class.c, domain.c, icall.c, metadata.h, object.h: support for
21036         handling TypedReference and ArgIterator.
21037         * loader.c, loader.h: added function to get signature at call site.
21038
21039 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
21040
21041         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
21042         data readonly. Buglets and warning fixes. Some MethodSpec support.
21043
21044 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
21045
21046         * class.h, class.c, object.c: remove relative numbering support.
21047
21048 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
21049
21050         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
21051         free the string, until we get a chance to fix Gtk#
21052
21053 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21054
21055         * marshal.c: revert last patch.
21056
21057 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
21058
21059         * icall.c: updates for new mono_class_vtable() not calling
21060         the type constructor anymore.
21061
21062 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
21063
21064         * object.h, object.c: separate vtable creation from type
21065         initialization. Make running the .cctor thread safe.
21066
21067 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
21068
21069         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
21070
21071 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
21072
21073         * loader.c (mono_get_method): consider calling convention
21074
21075 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
21076
21077         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
21078         to return the invisible global type for a module.
21079
21080         * reflection.c (mono_image_build_metadata): Emit global fields too.
21081
21082 2003-05-20  Peter Williams  <peterw@ximian.com>
21083
21084         * loader.c (mono_lookup_internal_call): Add a few newlines.
21085
21086 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
21087
21088         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
21089         literal strings.
21090
21091         * appdomain.c (set_domain_search_path): Recalculate search path when
21092         AppDomainSetup.PrivateBinPath changes.
21093
21094         * object.c (mono_class_compute_gc_descriptor): It turns out some
21095         parts of the class libs (like System.Thread) holds pointers to
21096         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
21097         to treat native int a pointer type here.
21098         
21099 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
21100
21101         * appdomain.h, domain.c: add hashtable for jump target resolution.
21102
21103 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
21104
21105         * reflection.h reflection.c icall.c: Added new icalls 
21106         GetManifestResourceInfoInternal, GetModulesInternal and support
21107         infrastructure.
21108
21109 2003-05-16  Dick Porter  <dick@ximian.com>
21110
21111         * icall.c:
21112         * file-io.h:
21113         * file-io.c: Implement System.IO.MonoIO::GetTempPath
21114
21115 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
21116
21117         * object.c: mono_store_remote_field: little fix to previous patch.
21118
21119 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
21120
21121         * class.c: add constructors to array classes.
21122         * icall.c: special case array construction for InternalInvoke (),
21123
21124 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
21125
21126         * class.h class.c reflection.c object.c: Added support for field
21127         defaults in dynamically generated classes.
21128
21129 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
21130
21131         * reflection.c: properly encode charset for ddlimport.
21132
21133 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
21134
21135         * threads.c: allow compiling without GC.
21136
21137 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
21138
21139         * appdomain.h, object.c, object.h, threads.c, threads.h: added
21140         handling of thread static data.
21141
21142 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
21143
21144         * reflection.h, reflection.c: added mono_custom_attrs_free ().
21145
21146 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
21147
21148         * class.c (mono_array_class_get): always set the serializable flags
21149         (mono_array_class_get): always set the SEALED attribute for array types
21150
21151 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
21152
21153         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
21154         attributes (fix for bug 42021).
21155
21156 2003-05-12  Dick Porter  <dick@ximian.com>
21157
21158         * gc.c: Don't run finalizers when the finalizer thread is
21159         finishing up, because the default domain has already been
21160         destroyed.
21161
21162 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
21163
21164         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
21165         value is null, we should throw an exception.   This is slightly
21166         different than the other conventions used for the constructor.
21167
21168 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21169
21170         * socket-io.c: fixed windows build.
21171
21172 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21173
21174         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
21175
21176 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
21177
21178         * object.c (mono_string_new_wrapper): Compatibility fix for MS
21179         compilers.
21180
21181 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
21182
21183         * class.c (mono_class_layout_fields): Add experimental GC aware
21184         auto layout facility. Requires class library changes to work correctly.
21185
21186         (mono_class_setup_vtable): Avoid overriding explicit interface
21187         method implementations. Fixes iface3.exe test.
21188
21189         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
21190         object reference.
21191         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
21192         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
21193
21194         * metadata.h: Add new type classification macro which determines
21195         whenever the type holds an object reference.
21196
21197 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
21198
21199         * marshal.c (mono_marshal_get_native_wrapper): cleanups
21200
21201 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
21202
21203         * gc.c (finalizer_thread): Work around a GC bug.
21204
21205 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
21206
21207         * marshal.c (emit_struct_conv): allow unions
21208
21209         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
21210
21211 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
21212
21213         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
21214
21215 2003-05-06  Martin Baulig  <martin@ximian.com>
21216
21217         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
21218
21219 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21220
21221         * socket-io.c:
21222         (Select_internal): allow NULLs, don't create arrays if not needed.
21223         Coupled with Socket.cs changes.
21224
21225         * threadpool.c:
21226         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
21227         register a finalizer for it that will close the semaphore handle. This
21228         fixes the leak and make Lupus' test run with > 4080 loops.
21229
21230 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
21231
21232         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
21233         Jerome Laban (bug #42287)
21234
21235 2003-05-02  Martin Baulig  <martin@ximian.com>
21236
21237         * debug-mono-symfile.h
21238         (MonoSymbolFile): Moved declaration into mono-debug.h.
21239         (MonoDebugMethodJitInfo): Likewise.
21240         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
21241         argument.
21242         (_mono_debug_address_from_il_offset): Take a
21243         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
21244
21245         * mono-debug.h
21246         (MonoDebugDomainData): New struct.
21247         (mono_debug_get_domain_data): New function.
21248         (mono_debug_add_method): Take an additional `MonoDomain *'
21249         argument.
21250         (mono_debug_source_location_from_address): Likewise.
21251         (mono_debug_il_offset_from_address): Likewise.
21252         (mono_debug_address_from_il_offset): Likewise.
21253
21254 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
21255
21256         * reflection.c: one more check for null type in custom attrs.
21257
21258 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21259
21260         * reflection.c: avoid warning (comparison is always false due to limited
21261         range of data type).
21262
21263 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21264
21265         * icall.c: throw an exception in Type.GetField if the argument 'name'
21266         is NULL.
21267
21268 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
21269
21270         * reflection.c: fixed handling of enums in named arguments to custom
21271         attributes (bug #42123).
21272
21273 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
21274
21275         * reflection.c: use the right array element type and handle
21276         a null for a Type argument, too.
21277
21278 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
21279
21280         * reflection.c: handle arrays as arguments to custom attributes.
21281
21282 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
21283
21284         * reflection.c: handle a string value in a custom attr
21285         ctor that takes an object.
21286
21287 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
21288
21289         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
21290         (fix bug #42063)
21291
21292 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
21293
21294         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
21295
21296 2003-04-27  Martin Baulig  <martin@ximian.com>
21297
21298         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
21299         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
21300         MONO_DEBUGGER_EVENT_BREAKPOINT.
21301         (mono_breakpoint_trampoline_code): Removed.
21302         (mono_debugger_event_handler): The last argument is now a
21303         `guint32'.
21304         (mono_debugger_insert_breakpoint_full): Removed the
21305         `use_trampoline' argument.
21306         (mono_debugger_method_has_breakpoint): Likewise.
21307         (mono_debugger_trampoline_breakpoint_callback): Renamed to
21308         mono_debugger_breakpoint_callback(); take the method and
21309         breakpoint number as arguments.
21310
21311 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
21312
21313         * metadata.c: fix off by one when loading parameters attributes.
21314
21315 2003-04-24  Martin Baulig  <martin@ximian.com>
21316
21317         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
21318
21319 2003-04-24  Martin Baulig  <martin@ximian.com>
21320
21321         * mono-debug-debugger.c: Moved all code which interacts with the
21322         Mono Debugger here.
21323
21324         * debug-mono-symfile.c: This code now just deals with the symbol
21325         file itself, the debugger code is now in mono-debug-debugger.c.
21326
21327 2003-04-23  Martin Baulig  <martin@ximian.com>
21328
21329         * mono-debug.c (mono_debug_source_location_from_il_offset):
21330         New method; like mono_debug_source_location_from_address(), but
21331         takes an IL offset instead of a machine address.
21332
21333 2003-04-23  Martin Baulig  <martin@ximian.com>
21334
21335         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
21336         `line' field; this is now computed by the debugger.
21337
21338 2003-04-23  Martin Baulig  <martin@ximian.com>
21339
21340         * mono-debug.[ch]: New files.  This is the new debugging interface.
21341
21342         * mono-debug-debugger.[ch]: New files.  Moved all code which
21343         interacts with the Mono Debugger here.
21344
21345 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
21346
21347         * domain.c (mono_init): initialize mono_defaults.monitor_class
21348
21349 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
21350
21351         * reflection.c (method_encode_code): Add a spicy exception to help
21352         future compiler authors.
21353
21354 2003-04-21  Martin Baulig  <martin@ximian.com>
21355
21356         * icall.c
21357         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
21358         Make this work with relative pathnames; g_filename_to_uri() needs
21359         an absolute filename.
21360
21361 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
21362
21363         * icall.c: Track name changes in Object and ValueType.
21364
21365 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
21366
21367         * metadata.c (mono_type_stack_size): size should be a multiple of
21368         sizeof (gpointer)
21369
21370 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21371
21372         * gc.c:
21373         (internal_domain_finalize): moved into mono_domain_finalize. No need
21374         to create another thread because the finalizers will be run in the
21375         finalizer thread.
21376         
21377         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
21378         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
21379         to be run (MS does this too).
21380
21381 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
21382
21383         * object.c (mono_class_compute_gc_descriptor): Update comment.
21384
21385         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
21386
21387         * image.h: Add synchronized wrapper cache.
21388
21389         * image.c (do_mono_image_open): Initialize cache.
21390
21391         * reflection.c (create_dynamic_mono_image): Initialize cache.
21392
21393 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21394
21395         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
21396         ves_icall_System_Buffer_ByteLengthInternal.
21397
21398 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
21399
21400         * reflection.c: setup klass->nested_in earlier. Allow
21401         a dash in the assembly name.
21402
21403 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
21404
21405         * metadata.c (mono_type_to_unmanaged): dont access
21406         type->data.klass for MONO_TYPE_OBJECT
21407         (mono_type_to_unmanaged): consider System.Delegate class
21408
21409 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
21410
21411         * class.c: just setup supertypes in the proper place instead of
21412         initializing the full element class for arrays.
21413
21414 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
21415
21416         * class.c: ensure the element class of arrays is initialized.
21417         Setup the supertype info for array classes, too.
21418
21419 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
21420
21421         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
21422
21423 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21424
21425         * Makefile.am: re-added -m option when running cygpath. This way,
21426         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
21427         separator.
21428         * mono-config.c: same codepath for locating mono config file for WIN32
21429         and the rest.
21430         * assembly.c: if mono_assembly_setrootdir is called, don't override
21431         the value set.
21432
21433 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21434
21435         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
21436         MONO_ASSEMBLIES variable.
21437
21438 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
21439
21440         * icall.c: added Assembly::GetNamespaces() icall.
21441
21442 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21443
21444         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
21445
21446 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
21447
21448         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
21449         * object.c: fixed bug in the construction of vtable for proxies
21450
21451 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
21452
21453         * object.c (mono_array_new): Mark mono_array_new as an icall.
21454
21455 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21456
21457         * class.c: fixed test for public method when overriding interfaces.
21458         Closes bug #40970.
21459
21460 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
21461
21462         * appdomain.h, domain.c: added mono_domain_foreach() to
21463         be able to access the currently loaded appdomains.
21464         * object.c: make string interning work across sppdomains.
21465         Mark some functions for use as icalls.
21466
21467 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
21468
21469         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
21470
21471         * reflection.h reflection.c: Allocate long living data using 
21472         GC_MALLOC_ATOMIC so the collector does not need to scan it.
21473
21474         * reflection.c: Double the allocation size in streams instead of
21475         increasing it, to prevent unneccesary copying on large assemblies.
21476         
21477         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
21478         creation if the assembly does not have the Run flag set.
21479
21480 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
21481
21482         * class.h: avoid the C++ keywords in header files (Jerome Laban
21483         spotted and fixed this).
21484
21485 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21486
21487         * object.c:
21488         (mono_unhandled_exception): fill in the arguments for the
21489         UnhandledException event. Only trigger that event for the default
21490         domain (as MS does).
21491
21492 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
21493
21494         * object.c: Improve typed allocation stuff based on suggestions from
21495         Paolo. Also turn it on if the GC library supports it.
21496
21497 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
21498
21499         * object.c object.h class.h: Added experimental typed allocation
21500         facility using the interfaces in gc_gcj.h.
21501
21502         * os/gc_wrapper.h: Added new include files.
21503         
21504 2003-04-03  Martin Baulig  <martin@ximian.com>
21505
21506         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
21507         which is not yet enabled by default.
21508
21509         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
21510         functions.
21511         (mono_gc_lock, mono_gc_unlock): New static functions.
21512
21513         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
21514         functions; stop/start the world for the garbage collector.  This
21515         is using the windows API; we need to complete the SuspendThread()/
21516         ResumeThread() implementation in the io-layer to make this work on Unix.
21517         (mono_gc_push_all_stacks): New public function; tells the garbage
21518         collector about the stack pointers from all managed threads.
21519
21520 2003-04-03  Martin Baulig  <martin@ximian.com>
21521
21522         * object.h (MonoThread): Added `gpointer stack_ptr'.
21523
21524         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
21525
21526 2003-04-03  Martin Baulig  <martin@ximian.com>
21527
21528         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
21529
21530 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
21531
21532         * reflection.c (typebuilder_setup_fields): Initialize field.first and
21533         field.last.
21534
21535 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
21536
21537         * loader.c (mono_lookup_internal_call): Report the corlib that is
21538         out of sync.
21539
21540 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
21541
21542         * icall.c (ves_icall_type_GetTypeCode): fixed check for
21543         System.DBNull (it's class not valuetype).
21544
21545 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
21546
21547         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
21548         if the array method was already assigned a token (fixes bug#40646).
21549
21550 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
21551
21552         * reflection.c (mono_reflection_get_type): Attempt type resolve even
21553         if no assembly is given.
21554
21555 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
21556
21557         * metadata.h: Added the new tables.
21558
21559         * row-indexes.h: Added definitions for new tables.
21560
21561         * metadata.c: Add schemas for new tables, and add support for
21562         computing the sizes of them.
21563
21564         * class.c: Update for handling the new type cases.
21565
21566 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
21567
21568         * metadata.h (MONO_TYPE_IS_VOID): new macro
21569
21570 2003-03-31  Martin Baulig  <martin@ximian.com>
21571
21572         * threads.h (MonoThreadCallbacks): Added `thread_created'.
21573
21574         * threads.c (mono_thread_new_init): Call `thread_created' in the
21575         mono_thread_callbacks.
21576
21577 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
21578
21579         * loader.h: added marshalbyrefobject_class to mono_defaults
21580         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
21581         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
21582           generation of output parameters.
21583           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
21584         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
21585           contextbound and the target object belongs to the context of the caller.
21586         * object.h: added context and unwrapped_server variables in MonoRealProxy.
21587         * object.c: Implemented support for interfaces and abstract classes
21588           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
21589           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
21590
21591 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
21592
21593         * class.h class.c (mono_class_is_subclass_of): New function.
21594         
21595         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
21596         routines for most common case (calls from ArrayList::ToArray).
21597
21598         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
21599         routine so programs which call Environment::Exit() can be profiled.
21600
21601         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
21602         Added MONO_ARCH_SAVE_REGS.
21603
21604         * icall.c (ves_icall_type_is_subtype_of): Use new function.
21605
21606 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
21607
21608         * blob.h: Add a couple of new MonoType types definitions.
21609
21610         * tabledefs.h: Add a couple of new call convs.
21611
21612 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
21613
21614         * reflection.h (MonoReflectionDynamicAssembly): track changes in
21615         the layout of the class.
21616
21617         * reflection.c (alloc_table): double the size on overflow to avoid
21618         unnecessary copying.
21619
21620         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
21621         avoid filling out metadata tables and blobs. Also set mb->ilgen to
21622         null so it can be garbage collected.
21623         
21624 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
21625
21626         * reflection.c (mono_reflection_get_type): Return the resolved type
21627         only if it is in the assembly we searched.
21628
21629         * reflection.c (ensure_runtime_vtable): Initialize method slots.
21630
21631         * class.c (mono_class_setup_vtable): Set the slot of the overriding
21632         method.
21633
21634 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21635
21636         * appdomain.c:
21637         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
21638         the right one is 'file:///blah', but MS allows it.
21639         * assembly.c:
21640         (mono_assembly_open): allow 'file://blah'
21641
21642         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
21643
21644 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
21645
21646         * socket-io.c: fixes bug #40310.
21647
21648 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
21649
21650         * reflection.c (mono_reflection_parse_type): handle deeply nested
21651         types correctly.
21652
21653         * reflection.c (mono_image_create_token): Use unique token values
21654         since they will be put into a hash table.
21655
21656         * class.c (mono_class_setup_vtable): If a method occurs in more than
21657         one place in the vtable, and it gets overriden, then change the
21658         other occurances too.
21659
21660         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
21661         object as return type.
21662
21663 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
21664
21665         * icall.c: Deleted "ToString" implementation for double and float
21666         because they are full implemented in managed code.
21667
21668 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21669
21670         * reflection.c, reflection.h: implemented and exported functions
21671         to retrieve info about custom attributes.
21672
21673 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21674
21675         * appdomain.c: moved Uri handling to assembly.c
21676         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
21677         work when using a file Uri in *nix and windows.
21678
21679         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
21680         GetReferencedAssemblies.
21681
21682 2003-03-18  Dick Porter  <dick@ximian.com>
21683
21684         * icall.c: Rename a couple of internal calls
21685
21686         * threads.c: Set the thread state to Stopped when a thread exits.
21687         Fixes bug 39377.
21688
21689 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
21690
21691         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
21692         New icall.
21693
21694         * object.c (mono_class_vtable): fix warning.
21695
21696 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
21697
21698         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
21699
21700         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
21701         memory.
21702         (method_encode_clauses): Create exception info structures in the right
21703         order.
21704         (mono_reflection_setup_internal_class): Initialize supertypes field.
21705
21706         * class.c object.c: Handle interfaces which implement other interfaces 
21707         correctly.
21708
21709         * class.h class.c: Move the supertypes array initialization code into 
21710         a separate function so it can be used for dynamic types too. Also call
21711         it earlier, in mono_class_init(), since it can be used before the
21712         type is initialized.
21713
21714 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21715
21716         * Makefile.am:
21717         * assembly.c:
21718         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
21719
21720         * appdomain.c:
21721         * appdomain.h:
21722         * marshal.c:
21723         * object.c: remove warnings.
21724
21725 2003-03-13  Martin Baulig  <martin@ximian.com>
21726
21727         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
21728         (MonoDebugLexicalBlockEntry): New types.
21729
21730         * debug-mono-symfile.c
21731         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
21732
21733 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21734
21735         * process.c: ret can be any non-zero value accroding to MS doc.
21736
21737 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
21738
21739         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
21740         fixing a warning for a miss-used prototype, would have cause
21741         random memory corruption.
21742
21743 2003-03-07  Martin Baulig  <martin@ximian.com>
21744
21745         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
21746         getting really annoying ....
21747
21748 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
21749
21750         * reflection.c (fixup_method): added support for array methods.
21751
21752 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
21753
21754         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
21755         (pointed out by Michael Adams).
21756
21757 2003-03-04  Dick Porter  <dick@ximian.com>
21758
21759         * icall.c: Temporarily reverted the Double and Single ToString()
21760         change, because it broke nunit.
21761
21762 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
21763
21764         * object.h, threads.h: make include files compatible with C++
21765         (patch by Jerome Laban <jlaban@wanadoo.fr>).
21766
21767 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
21768
21769         * icall.c: Erased ToString helper functions for Double and Single.
21770         Now, that implementations ar all in managed code (Double and Single
21771         Formatters).
21772
21773 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
21774
21775         * appdomain.c: Added method for initializing the default context of
21776         a domain. Added internal call for getting the default context.
21777         * appdomain.h: Added context variable in MonoDomain struct.
21778         * domain.c: mono_domain_set also sets the default context of the domain
21779         * icall.c: Mapped internal method InternalGetDefaultContext.
21780         * object.c: mono_object_get_virtual_method returns always a remoting
21781         wrapper if the object is a transparent proxy.
21782         mono_runtime_invoke_array: when creating an object by calling the
21783         constructor, if the created object is a proxy, then the constructor should
21784         be called using the a remoting wrapper.
21785
21786 2003-03-03  Dick Porter  <dick@ximian.com>
21787
21788         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
21789         variable so it compiles on solaris.  Problem spotted by
21790         Christopher Taylor <ct@cs.clemson.edu>
21791
21792 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21793
21794         * appdomain.c:
21795         (get_info_from_assembly_name): don't leak value.
21796
21797         * icall.c:
21798         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
21799         result.
21800
21801 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
21802
21803         * assembly.c: export mono_image_load_references ().
21804         * class.c: handle function pointers. mono_class_from_name() now
21805         supports nested type names directly.
21806
21807 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
21808
21809         * reflection.h reflection.c: Encode already created dynamic methods 
21810         and fields correctly as a DEF instead of a REF.
21811
21812         * reflection.c: Get rid of the force_ref argument to 
21813         mono_image_typedef_or_ref since it was wrong in the first place.
21814
21815         * string-icalls.c: add error checking to string constructors according
21816         to the MSDN docs.
21817
21818         * reflection.c: Emit types in the order their TypeBuilders were 
21819         created. Previously, a new table index was assigned to each type before
21820         the tables were emitted. This was wrong because the signature blob
21821         might already refer to a type by its original table index.
21822
21823 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
21824
21825         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
21826         change.
21827         
21828 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21829
21830         * Makefile.am: make assemblies dir have \ instead of / on windows.
21831
21832 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
21833
21834         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
21835         iterate over the NESTEDCLASS table using a linear search since the
21836         table is not guaranteed to be sorted by the secondary key.
21837
21838         * class.c (mono_class_create_from_typedef): fixed up call to
21839         mono_metadata_nesting_typedef.
21840         
21841 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
21842
21843         * marshal.c (mono_string_to_byvalstr): clear the memory as
21844         suggested by Jerome Laban <jlaban@wanadoo.fr>
21845
21846 2003-02-26  Dick Porter  <dick@ximian.com>
21847
21848         * process.c: Cope with padding in .rsrc blocks
21849
21850 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
21851
21852         * metadata.h: reverted the filter_len change, it breaks reflection
21853         
21854 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
21855
21856         * metadata.h: added a new field to store the filter_len
21857         
21858
21859 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21860
21861         * reflection.c: handle custom attributes for types and members
21862         created with Reflection.Emit (bug#38422).
21863
21864 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
21865
21866         * reflection.c: define RTSpecialName automatically for constructors for
21867         compatibility with MS.NET.
21868
21869         * reflection.c (mono_reflection_create_runtime_class): initialize
21870         nested_in field of dynamically created classes.
21871
21872 2003-02-22  Martin Baulig  <martin@ximian.com>
21873
21874         * debug-mono-symfile.h: Incremented version number.
21875
21876 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
21877
21878         * object.h icall.c process.c: fix warnings.
21879
21880 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
21881
21882         * appdomain.h appdomain.c:
21883         (mono_domain_try_type_resolve): split the 
21884         name_or_tb argument into a name and a tb argument.
21885         (mono_domain_has_type_resolve): new function to check whenever the
21886         application has registered a TypeResolve event handler.
21887         
21888         * icall.c reflection.h reflection.c: move the type resolve logic into
21889         mono_reflection_get_type () so it will be invoked when 
21890         Assembly::GetType () is called.
21891
21892         * reflection.c:
21893         (mono_reflection_get_type): renamed to get_type_internal.
21894         (mono_reflection_get_type): fixed type name generation so it works 
21895         for nested types too.
21896         (mono_reflection_get_type): call has_type_resolve () to avoid the 
21897         costly type name generation if there is no resolve event handler.
21898
21899 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21900
21901         * class.c, image.c: load exported types from file references.
21902
21903 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
21904
21905         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
21906           used to cache the managed methods used to create proxies and make 
21907           remote invocation of methods.
21908         * class.h: Added in MonoVTable a flag to indicate that a class needs 
21909           to be remotely created.
21910         * object.c: Modified the method mono_class_vtable(). It now initializes 
21911           the remote flag of the vtable. Modified mono_object_new_specific(), 
21912           so now it checks the remote flag.
21913         * icall.c: Added a couple of internal methods, one for enabling instance 
21914           creation interception for a type, and one for creating objects bypassing
21915           the remote check.
21916
21917 2003-02-18  Martin Baulig  <martin@ximian.com>
21918
21919         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
21920         New interncall to get a method's metadata token.
21921
21922         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
21923         New interncall for the debugger.
21924
21925 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
21926
21927         * class.c (mono_class_setup_vtable): allocate supertype array
21928
21929 2003-02-18  Martin Baulig  <martin@ximian.com>
21930
21931         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
21932
21933 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21934
21935         * reflection.c:
21936         (assembly_name_to_aname): jump over unknown properties (i've found
21937         something like: 'type, assembly, version=xxx, custom=null, public...',
21938         so now will ignore custom=null and still get the rest of the values).
21939
21940 2003-02-17  Dick Porter  <dick@ximian.com>
21941
21942         * threads.c: Have Thread.Start() wait for a semaphore to signal
21943         that the thread has set up all its local data.  This fixes bug
21944         34323, where Abort() raced the new thread's TLS data.
21945
21946         Also removes the handle_store() call from start_wrapper, because
21947         threads are now always created suspended and there is no longer a
21948         race between the parent and child threads to store the info.
21949
21950 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
21951
21952         * image.c: explain the #- heap issue in a message, hopefully
21953         avoiding FAQs on mono-list.
21954
21955 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21956
21957         * icall.c:
21958         (GetEntryAssembly): if the domain has not invoked
21959         AppDomain.ExecuteAssembly yet, return the assembly of the default
21960         AppDomain.
21961
21962 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
21963
21964         * class.c (mono_ldtoken): make it work in dynamic assemblies.
21965
21966 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21967
21968         * metadata.c, reflection.c: simple speedup to type hash
21969         and equals code.
21970
21971 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
21972
21973         * image.c, image.h, class.c, assembly.c: move module loading
21974         to MonoImage. When loading metadata, consider alignemnet from
21975         the start of metadata, not from the metadata address in memory.
21976
21977 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
21978
21979         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
21980         AssemblyBuilder objects. Factored out custom attribute creation into
21981         a separate function.
21982         (create_custom_attr): new function to create custom attributes.
21983
21984 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
21985
21986         * Makefile.am: Got tired of typing the full pathname to pedump.
21987         Until there is another option, am installing this.
21988
21989 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
21990
21991         * class.c (class_compute_field_layout): always set field->parent 
21992         (mono_ldtoken): use mono_defaults.fieldhandle_class;
21993
21994 2003-02-11  Dick Porter  <dick@ximian.com>
21995
21996         * threads-types.h:
21997         * monitor.c: Rewrote Monitor, making lock much faster and
21998         Pulse/Wait work as specified.  Also uses much fewer handles, and only
21999         creates them as needed.
22000
22001         * exception.c: Added SynchronizationLockException
22002
22003         * threads.c: Deleted old Monitor implementation.  The new one is
22004         in a new file.
22005
22006 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
22007
22008         * class.c: handled TypedReference type code. Set the correct size for
22009         class data. Setup interface_offsets for interface classes, too.
22010
22011 2003-02-09  Martin Baulig  <martin@ximian.com>
22012
22013         * debug-mono-symfile.h: Reflect latest symbol writer changes.
22014
22015 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
22016
22017         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
22018         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
22019         * object.c: fixed mono_object_get_virtual_method () for interfaces.
22020         * verify.c: check for code that runs after the end of the method.
22021
22022 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
22023
22024         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
22025         "System.Math::Round2".
22026         * sysmath.h: Added Floor, Round and Round2 definitions.
22027         * sysmath.c: Modified certain functions that were not 100% compliant
22028         with MS.NET (math precision) and added the implementation of Floor,
22029         Round and Round2.
22030
22031 2003-02-07  Martin Baulig  <martin@ximian.com>
22032
22033         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
22034
22035 2003-02-07  Martin Baulig  <martin@ximian.com>
22036
22037         * debug-mono-symfile.c: Reflected latest symwriter changes.
22038         (mono_debug_create_mono_symbol_file): Removed.
22039         (mono_debug_open_mono_symbol_file): Take an argument which
22040         specifies whether to create a dynamic symbol file.
22041
22042 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
22043
22044         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
22045
22046 2003-02-05  Martin Baulig  <martin@ximian.com>
22047
22048         * reflection.c (mono_image_build_metadata): Make this public,
22049         protect it against being called multiple times, don't create
22050         resources and don't build the compressed metadata here.
22051         (mono_image_create_pefile): Do this here.
22052
22053         * icall.c
22054         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
22055
22056 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22057
22058         * socket-io.c: fixed bug #36322.
22059
22060 2003-02-06  Piers Haken <piersh@friskit.com>
22061
22062         * appdomain.[ch]:
22063         * class.h:
22064         * debug-mono-symfile.c:
22065         * icall.c:
22066         * loader.c:
22067         * mono-config.c:
22068         * monosn.c:
22069         * reflection.c:
22070         * socket-io.c: warning cleanups
22071
22072 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
22073
22074         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
22075         function. works like remoting invoke, but does a check for the Proxy first.
22076
22077 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
22078
22079         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
22080
22081 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
22082
22083         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
22084         array of pointers.
22085         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
22086         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
22087
22088         * object.c (mono_store_remote_field_new): used by the new jit
22089         instead of mono_store_remote_field
22090         (mono_load_remote_field_new): used by the new jit
22091         instead of mono_load_remote_field
22092
22093 2003-02-05  Patrik Torstensson
22094
22095         * appdomain.c: changed unload to take the domain id instead
22096         of domain
22097         
22098         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
22099
22100
22101 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22102
22103         * appdomain.c: don't look for assemblies in ApplicationBase if
22104         PrivateBinPathProbe is set.
22105
22106 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22107
22108         * object.c: make the first argument in main_args contain the absolute
22109         path to the assembly. Fixes bug #37511.
22110
22111 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22112
22113         * icall.c: get correct UTC offset for countries not using daylight
22114         time saving. Fixes bug #30030.
22115
22116 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22117
22118         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
22119         and 1 are the family).
22120
22121 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
22122
22123         * icall.c (ves_icall_InternalExecute): removed wrong assertion
22124
22125         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
22126
22127 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
22128
22129         * reflection.c: added support for SignatureHelper tokens, which is
22130         needed by the Calli opcode.
22131
22132         * reflection.h: track changes to SignatureHelper class.
22133
22134         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
22135
22136 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22137
22138         * appdomain.c: fixed loading assemblies from PrivateBinPath.
22139
22140 2003-02-03  Patrik Torstensson
22141         * appdomain.[c|h], domain.c : 
22142          - Added support for getting a domain via domain id
22143          - Support for setting and getting domain from System.AppDomain 
22144            (used in cross appdomain channel)
22145          - Added support for get/set for a MonoAppContext on a thread 
22146            (Context class in System.Runtime.Remoting.Contexts),
22147          - Removed hack in Get/SetData and ExecuteAssembly.
22148         
22149         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
22150         the managed world to get control when a proxy is created.
22151
22152         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
22153         
22154 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
22155
22156         * icall.c
22157         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
22158         Populate the codebase field as well.
22159
22160 2003-02-02  Martin Baulig  <martin@ximian.com>
22161
22162         * debug-mono-symfile.c
22163         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
22164         (mono_debug_symfile_add_method): Allow interncalls.
22165
22166 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22167
22168         * icall.c: throw parse exception if strtod fails or the string is empty.
22169
22170 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
22171
22172         * marshal.c: handle object type separately from defined
22173         class types.
22174
22175 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
22176
22177         * marshal.c: handle NATIVE_LPSTR for strings when it's
22178         explicitly specified.
22179
22180 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
22181
22182         * reflection.c, reflection.h, icall.c: setup the reflection
22183         handle cache for ModuleBuilders and AssemblyBuilders.
22184
22185 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
22186
22187         * reflection.c (reflection_methodbuilder_to_mono_method): set
22188         pinvoke flag
22189
22190 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22191
22192         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
22193
22194 2003-01-29  Dick Porter  <dick@ximian.com>
22195
22196         * threads.c: No need for the fake_thread kludge now that Thread
22197         doesn't run a class constructor
22198         
22199 2003-01-29  Dick Porter  <dick@ximian.com>
22200
22201         * threads.c: Use g_direct_hash instead of the rather bogus
22202         g_int_hash
22203
22204 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
22205
22206         * marshal.c (mono_marshal_get_native_wrapper): add check for null
22207         (fix pinvoke12.exe)
22208         (mono_marshal_get_struct_to_ptr): generate valid IL code
22209         (mono_marshal_get_ptr_to_struct): generate valid IL code
22210         (*): correctly set sig->pinvoke, we need to memdup the signature
22211         to do that
22212
22213 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
22214
22215         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
22216         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
22217
22218 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
22219
22220         * profiler.c: provide more callers information.
22221
22222 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
22223
22224         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
22225
22226         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
22227
22228         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
22229
22230 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
22231
22232         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
22233         exception instead of going into an infinite loop on dates which it 
22234         can't yet handle.
22235
22236         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
22237         out-of-range exception if needed.
22238
22239         * class.c (mono_class_setup_vtable): allow a virtual method to provide
22240         an implementation for an interface method and to override an inherited
22241         method at the same time. 
22242         Imagine a scenario when a virtual method is used to override a
22243         virtual abstract method in a parent class, and this same method 
22244         provides an implementation for an method inherited from an interface. 
22245         In this case, the interface resolution code will set im->slot, which 
22246         means that the virtual method override pass will skip this method 
22247         which means a pointer to the abstract method inherited from the parent
22248         will remain in the vtable of this non-abstract class.
22249
22250         * class.c: (mono_class_setup_vtable): continue search for a real 
22251         method if only an abstract method is found.     
22252
22253 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
22254
22255         * reflection.c: add size to encoding for ByValStr and ByValArray
22256         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
22257
22258 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
22259
22260         * class.c (mono_class_setup_vtable): pass the override info as an
22261         argument.
22262
22263         * class.c (mono_class_setup_vtable): set the slot of overriding methods
22264         correctly.
22265         
22266         * reflection.c (ensure_runtime_vtable); add support for method 
22267         overrides.
22268         
22269 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
22270
22271         * reflection.c (resolution_scope_from_image): Hack to work to work with
22272         dynamic assemblies.
22273
22274         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
22275         added a 'force_ref' argument to force this function to allways return 
22276         a TypeRef. This is needed by mono_image_get_memberref_token ().
22277         
22278 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
22279
22280         * reflection.c (mono_image_get_type_info): interfaces really don't have
22281         a parent.
22282
22283         * reflection.c (mono_image_basic_init): fill out missing fields of
22284         image structure.
22285
22286         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
22287         dynamic assemblies. This is required so dynamic assemblies show up in
22288         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
22289         Type::GetType() etc. This is consistent with MS behaviour.
22290
22291         * image.c image.h reflection.c: add newly created classes to the name 
22292         cache so mono_class_get () will find them.      
22293
22294 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
22295
22296         First part of changes to get IKVM.NET running under mono.
22297         
22298         * appdomain.h, appdomain.c: added new function 
22299         mono_domain_try_type_resolve() which will emit TypeResolve events. 
22300         This function will call AppDomain::DoTypeResolve to do the actual work.
22301
22302         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
22303         moved existing code dealing with dynamic tokens to a new function 
22304         called mono_reflection_lookup_dynamic_token (). This function will 
22305         raise TypeResolve events when appropriate. Since reflection.c is not 
22306         part of libmetadata, a new hook function called 
22307         mono_lookup_dynamic_token() is added to class.c which will call this.
22308
22309         * assembly.h assembly.c: make the invoke_load_hook function public,
22310         so it can be called for dynamic assemblies.
22311
22312         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
22313
22314         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
22315         type isn't found.
22316
22317         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
22318         MonoGHashTable, since it contains pointers to objects which the GC 
22319         needs to track.
22320
22321         * assembly.c (search_loaded): remove unused variable.
22322         
22323 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
22324
22325         * object.c: fixed issue exposed by gcc-generated IL programs
22326         that use RVA data for pointers.
22327
22328 2003-01-25  Martin Baulig  <martin@ximian.com>
22329
22330         * threads.c (start_wrapper): Moved the initialization of
22331         `start_func' above the mono_new_thread_init() call to which we
22332         pass it as argument.
22333
22334 2003-01-24  Martin Baulig  <martin@ximian.com>
22335
22336         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
22337         the MonoThread pointer.
22338
22339 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
22340
22341         * icall.c: Rename `PowImpl' to Pow.
22342
22343 2003-01-23  Dick Porter  <dick@ximian.com>
22344
22345         * threads.c (start_wrapper): Create a Thread object if needed, so
22346         the Main() thread can do the class initialisation in a subthread
22347         that has been set up to allow managed code execution.
22348
22349         Pass the thread ID instead of the MonoThread pointer to the thread
22350         start and attach callbacks.  This change is required, because the
22351         jit thread start callback must be called _before_ the Thread
22352         object can be created.
22353         
22354         (mono_thread_init): Removed much object creation code that is no
22355         longer needed.  No managed code is called from here now.
22356
22357         * object.c (mono_runtime_exec_managed_code): Create a subthread
22358         for Main, and call back to the runtime to use it.
22359         Set the exit code when Main exits.
22360
22361         * gc.c: Make sure domain finalisation happens in a subthread.
22362         Re-enable threaded GC, fixing bug 31333 (again).
22363
22364         * environment.c: System.Environment internall calls (so far just
22365         ExitCode is here, the others are still in icall.c)
22366
22367         * appdomain.c (mono_runtime_cleanup): All threads running managed
22368         code should have finished before mono_runtime_cleanup() is
22369         reached, so no need to clean up threads.
22370
22371 2003-01-22  Martin Baulig  <martin@ximian.com>
22372
22373         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
22374         `gpointer func' arguments.      
22375         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
22376         but added `MonoThread *thread' argument.
22377         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
22378
22379         * threads.c (mono_new_thread_init): Added `gpointer func' argument
22380         and pass it to the mono_thread_start_cb callback.
22381         (mono_install_thread_callbacks): New public function to install a
22382         set of callbacks which are set by the debugger.
22383         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
22384
22385 2003-01-22  Martin Baulig  <martin@ximian.com>
22386
22387         * Makefile.am: Install debug-mono-symfile.h.
22388
22389 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
22390
22391         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
22392
22393 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
22394
22395         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
22396         * class.c (mono_ptr_class_get): correctly set access levels of pointers
22397         (mono_array_class_get): correctly set access levels of arrays
22398
22399 2003-01-20      Patrik Torstensson
22400         * image.h (MonoAssemblyName): changed major, minor, build, revision
22401         from signed to unsigned.
22402
22403 2003-01-20  sean kasun <skasun@azstarnet.com>
22404
22405         * reflection.c (load_cattr_value): Now this handles
22406         MONO_TYPE_SZARRAY.  Fixes bug #35629
22407
22408 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
22409
22410         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
22411         integer value
22412
22413 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22414
22415         * decimal.c: fixed bug #26056.
22416
22417 2003-01-17  Martin Baulig  <martin@ximian.com>
22418
22419         * gc.c: Raise an ExecutionEngineException instead of using g_error().
22420
22421 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22422
22423         * exception.[ch]:
22424         (mono_get_exception_type_initialization): new function.
22425
22426         * object.c: throw a TypeInitializationException when an exception is
22427         thrown invoking the class constructor.
22428
22429 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22430
22431         * reflection.c: fixed attribute reading.
22432
22433 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22434
22435         * icall.c:
22436         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
22437         provided, look for the type in the calling assembly and then in
22438         mscorlib; if the assembly name is provided, only try that one.
22439
22440 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
22441
22442         * object.c: register the vtable before there is a chance it's
22443         queried again recursively.
22444
22445 2003-01-13  Duncan Mak  <duncan@ximian.com>
22446
22447         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
22448         gc-internal.h. 
22449         
22450 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
22451
22452         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
22453
22454 2003-01-11  Martin Baulig  <martin@ximian.com>
22455
22456         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
22457         this to 20 for the release.
22458
22459 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
22460
22461         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
22462
22463         * loader.c (mono_method_get_marshal_info): bug fix
22464
22465         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
22466         structures with explicit layout
22467
22468 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
22469
22470         * profiler.c: made the output more readable (and sorted). 
22471         Added caller information for the allocation profiler.
22472
22473 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
22474
22475         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
22476
22477 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22478
22479         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
22480         to get value types.
22481         
22482 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
22483
22484         * object.c, profiler.h, profiler.c, profiler-private.h:
22485         Added object allocation profiler.
22486
22487 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
22488
22489         * reflection.h, reflection.c: handle global methods.
22490         Compress blob entries.
22491
22492 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
22493
22494         * marshal.c: fix compilation.
22495
22496 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
22497
22498         * loader.c (mono_method_get_marshal_info): impl.
22499
22500         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
22501
22502 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22503
22504         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
22505         for reference types.
22506
22507 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
22508
22509         * loader.c: fixed off by one error in loaded parameter names.
22510
22511 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
22512
22513         * marshal.c (mono_marshal_get_icall_wrapper): like
22514         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
22515         instead of a MonoMethod.
22516
22517 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22518
22519         * decimal.c: fixed bug #36537.
22520
22521 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
22522
22523         * marshal.c: throw a missing method exception if a
22524         P/Invoke method is not found.
22525
22526 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
22527
22528         * icall.c: allow a null this for constructors.
22529
22530 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
22531
22532         * icall.c: raise the proper exceptions if the arguments to the
22533         internal Invoke are incorrect.
22534
22535 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
22536
22537         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
22538
22539 2003-01-03  Martin Baulig  <martin@ximian.com>
22540
22541         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
22542
22543 2002-12-31  Martin Baulig  <martin@ximian.com>
22544
22545         * debug-mono-symfile.c: Completely rewrote the type section.
22546         Instead of using individual malloc()ed fields, we use one big
22547         continuous memory area and offsets into this area.
22548         See the comments in the source code for details.
22549
22550 2002-12-30  Martin Baulig  <martin@ximian.com>
22551
22552         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
22553
22554 2002-12-30  Martin Baulig  <martin@ximian.com>
22555
22556         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
22557         line number table in this data blob instead of using an external
22558         pointer.
22559
22560 2002-12-28  Martin Baulig  <martin@ximian.com>
22561
22562         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
22563
22564 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
22565
22566         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
22567         as a boxed return type.
22568
22569 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
22570
22571         * appdomain.c
22572         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
22573         g_build_filename to properly get separators on the filename created.
22574
22575         * object.h: Small change, introduce MonoMarshalByRefObject to
22576         track the layout of that structure in the C# universe as we make
22577         changes there.
22578
22579 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
22580
22581         * object.c: removed assert to allow static fields on interfaces.
22582         * loader.c: a TypeSpec may be used for any type, not just arrays.
22583
22584 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
22585
22586         * class.c, class.h: added mono_class_array_element_size ().
22587         Ignore static methods in interfaces.
22588
22589 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22590
22591         * threads.c: fixed the build under cygwin.
22592
22593 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
22594
22595         * reflection.c: handle nullref constants. Allocate keys for
22596         reflection handles with the GC.
22597
22598 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
22599
22600         * threads.c, threads.h: added mono_thread_get_abort_signal()
22601         to get a suitable signal for thread abort.
22602
22603 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
22604
22605         * metadata.c: fix handling of ExportedType table.
22606
22607 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22608
22609         * icall.c: added WriteWindowsDebugString internal call.
22610
22611 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22612
22613         * reflection.h: added fields to match C# implementation.
22614
22615 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22616
22617         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
22618
22619 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
22620
22621         * gc.h, gc-internal.h: Rename header for GC internal calls to
22622         gc-internal.h from gc.h as to not clash with Boehm GC having its
22623         header installed as <gc.h> in outside include paths.
22624         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
22625         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
22626
22627 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22628
22629         * icall.c: assign minor, build and revision in FillName.
22630
22631 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
22632
22633         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
22634         Added support for running code generated by Reflection.Emit.
22635
22636 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22637
22638         * appdomain.c: check for NULL argument in LoadFrom.
22639
22640 2002-12-10  Dick Porter  <dick@ximian.com>
22641
22642         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
22643
22644 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22645
22646         * appdomain.c: fix buglet when building exe file name.  Handle full
22647         assembly name (needed after latest changes to AssemblyName).
22648         * image.c:
22649         (mono_image_close): free some hashtables.
22650
22651 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
22652
22653         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
22654         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
22655         on some systems (redhat 7.3) 
22656
22657 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22658
22659         * threads.c: delete the critical section of a sync block,
22660         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
22661
22662 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
22663
22664         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
22665
22666 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22667
22668         * appdomain.[ch]: handle the assembly preload event to try loading the
22669         assemblies using the paths we have in the current domain.
22670
22671         * assembly.[ch]: created an assembly preload hook that is called to try
22672         loading the assembly by other means that the ones provided here.
22673
22674         * domain.c: initialize the domain search path.
22675
22676         From now on, assemblies (TODO: except corlib and System) are loaded
22677         according to these rules when using mono_assembly_load ():
22678
22679                 1. It tries to load the assembly from the ApplicationBase
22680                 of the current domain appending .dll and .exe (TODO: have to
22681                 try loading from name/name.dll and name/name.exe).
22682
22683                 2. It tries the search path specified in PrivateBinPath for the
22684                 current domain (if any).
22685
22686                 3. Previous behavior.
22687
22688 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
22689
22690         * icall.c: implemented GetInterfaceMap() related icall.
22691         * domain.c, loader.h: load MethodInfo in mono_defaults.
22692
22693 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
22694
22695         * gc.c: disable the finalizer thread for now, untill all the issues
22696         with it are resolved.
22697
22698 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
22699
22700         * string-icalls.c: handle embedded nulls in string ctor when the
22701         length is specified.
22702
22703 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
22704
22705         * class.c: look for explicit interface implementation in parent
22706         classes, too.
22707
22708 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
22709
22710         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
22711
22712 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
22713
22714         * gc.c: protect handles with a critical section.
22715
22716 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22717
22718         * icall.c:
22719         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
22720         parameters. If no assembly specified, try getting the type from all
22721         the assemblies in the current domain, else, load the assembly and get
22722         the type from it.
22723
22724 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22725
22726         * marshal.c: applied patch from Aleksey Demakov that fixes
22727         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
22728
22729 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22730
22731         * icall.c: fixed get_location.
22732
22733 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
22734
22735         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
22736         declarations to make it work with older gcc. 
22737
22738         * loader.c (mono_get_method): set signature->pinvoke for native calls
22739
22740 2002-11-20  Dick Porter  <dick@ximian.com>
22741
22742         * threads.c (mono_thread_init): Set the main thread's handle
22743
22744 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
22745
22746         * gc.c: allow compilation without GC support. Changed to match the
22747         mono coding style.
22748
22749 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
22750
22751         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
22752
22753 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
22754
22755         * reflection.c: set a public key token on the core assemblies.
22756
22757 2002-11-18  Dick Porter  <dick@ximian.com>
22758
22759         * threads.c: Split out some thread initialisation so that other
22760         files can set the start callback function.
22761
22762         * gc.c: Run finalisers in a separate thread, to avoid stack
22763         overflow.  Fixes bug 31333.
22764
22765         * appdomain.c: Set up GC finalisation thread.
22766
22767         * reflection.c: 
22768         * object.c: 
22769         * domain.c: Use gc.h macros for GC_malloc
22770         
22771 2002-11-15  Dick Porter  <dick@ximian.com>
22772
22773         * threadpool.c: 
22774         * threads.c:
22775         * appdomain.c: Removed mono_runtime_init_with_attach(),
22776         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
22777         merging the extra parameter with the existing function.  Removed
22778         unneeded code in mono_thread_attach().
22779
22780 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
22781
22782         * image.c (mono_image_loaded_by_guid): a method to get loaded
22783         images by guid. 
22784         (load_metadata_ptrs): we store the guid as string.
22785
22786 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
22787
22788         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
22789
22790         * metadata.c (mono_guid_to_string): imported method form Zoltan
22791         Varga (slightly modified)
22792
22793         * assembly.c (mono_assembly_open): load precompiled code
22794
22795         * loader.h (MonoMethod): we store the method token for use in the
22796         aot compiler. 
22797
22798 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22799
22800         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
22801         the hook function called when an assembly is loaded.
22802         
22803         * domain.c: Modified file.
22804         (mono_domain_assembly_load): removed hash table insertion of assemblies.
22805
22806         Fixes bug #33196.
22807
22808 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
22809
22810         * reflection.c: Map PEFileKind to the value expected by the WinNT
22811         image loader. 
22812
22813 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22814
22815         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
22816         Read until the buffer is filled completely.
22817
22818 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22819
22820         * icall.c: implemented MonoType.InternalGetEvent ().
22821
22822 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22823
22824         * appdomain.c: implemented InitAppDomainSetup. Delayed
22825         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
22826         the entry_assembly.
22827
22828         * assembly.c: base_dir is now an absolute path ending with
22829         G_DIR_SEPARATOR.
22830
22831         * icall.c: modified get_location according to the above changes.
22832
22833         * object.c: init AppDomain.SetupInformation for the default domain after
22834         we have the entry assembly.
22835
22836         * domain.c: when unloading a domain, setup = NULL.
22837
22838 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
22839
22840         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
22841
22842 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
22843
22844         * object.h, object.c: introduced mono_object_get_virtual_method ()
22845         to lookup the method invoked on an object when a callvirt is done on
22846         a method.
22847         * icall.c: make MethodInfo::Invoke() always do a virtual call.
22848
22849 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22850
22851         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
22852         current domain when loaded an assembly and failed to load it.
22853
22854         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
22855
22856 2002-10-31  Dick Porter  <dick@ximian.com>
22857
22858         * icall.c: 
22859         * file-io.h: 
22860         * file-io.c: Return the error status in a parameter, as the
22861         GetLastError() value has long since been blown away if we try and
22862         look it up in a subsequent internal call invocation.  Delete the
22863         GetLastError() internal call, because it's useless.
22864
22865 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
22866
22867         * class.[ch]: added cast_class to fix bug 29517
22868
22869 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
22870
22871         * marshal.c: create valid IL code in the filter clause:
22872         the new JIT is less forgiving:-)
22873
22874 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22875
22876         * icall.c: removed get_property internal call.
22877
22878 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
22879
22880         * appdomain.h domain.c: Added an ID to appdomains.
22881         
22882         * threads.c threads.h icall.c: Implement icall
22883         Thread:GetDomainID(), and remove unused icall 
22884         CurrentThreadDomain_internal.
22885
22886 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22887
22888         * icall.c: Don't recurse through the base types in GetConstructor.
22889         Fixes bug #32063. 
22890
22891 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
22892
22893         * mempool.h, mempool.c: added mono_mempool_empty() and
22894         mono_mempool_stats().
22895
22896 2002-10-23  Dick Porter  <dick@ximian.com>
22897
22898         * file-io.c: 
22899         * file-io.h: 
22900         * icall.c: Added MonoIO.GetFileType internal call
22901
22902 2002-10-17  Dick Porter  <dick@ximian.com>
22903
22904         * appdomain.c (mono_runtime_cleanup): Don't signal the async
22905         delegate semaphore before waiting for all threads to finish,
22906         because new threads can also call async delegates.  Fixes bug
22907         32004.
22908
22909         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
22910         of 3 seconds, in case another async job is queued.  (This part is
22911         needed because the bug fix reintroduced the 3s exit lag.)  This
22912         makes the mono_runtime_shutdown flag superfluous.
22913
22914 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
22915
22916         * reflection.c: include ehader size in method section headers.
22917         Really check for suplicated modules entries.
22918
22919 2002-10-17  Martin Baulig  <martin@gnome.org>
22920
22921         * debug-mono-symfile.c: Added back support for locals.
22922
22923 2002-10-14  Martin Baulig  <martin@gnome.org>
22924
22925         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
22926         MONO_TYPE_VOID.
22927
22928 2002-10-14  Martin Baulig  <martin@gnome.org>
22929
22930         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
22931         mono_class_get() instead of looking in the class cache. 
22932
22933 2002-10-13  Martin Baulig  <martin@gnome.org>
22934
22935         * debug-mono-symfile.c: Set version number to 28, include the
22936         signature in method names.
22937
22938 2002-10-13  Martin Baulig  <martin@gnome.org>
22939
22940         * debug-mono-symfile.h: Set version number to 27.
22941
22942 2002-10-11  Martin Baulig  <martin@gnome.org>
22943
22944         * gc.c: Don't register/unregister NULL pointers as disappearing links.
22945
22946 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
22947
22948         * metadata.c, metadata.h: added helper function to allocate signatures.
22949
22950 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22951
22952         * icall.c: added internal call to get the location of machine.config.
22953
22954 2002-10-08  Martin Baulig  <martin@gnome.org>
22955
22956         * debug-mono-symfile.c: Ignore classes with a pending init for the
22957         moment.
22958
22959 2002-10-03  Dick Porter  <dick@ximian.com>
22960
22961         * threads.c: Freebsd pthread_t is a pointer
22962
22963 2002-10-03  Dick Porter  <dick@ximian.com>
22964
22965         * socket-io.c: Implemented GetHostName_internal
22966
22967 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22968
22969         * mono-config.c:
22970         (mono_config_parse_file): don't leak the text.
22971
22972 2002-10-02  Martin Baulig  <martin@gnome.org>
22973
22974         * debug-mono-symfile.c: Added support for methods.
22975
22976 2002-10-01  Martin Baulig  <martin@gnome.org>
22977
22978         * debug-mono-symfile.c: Don't emit methods and line numbers for
22979         the dynamic symbol file, just write the type table.  We can easily
22980         have an external helper program which creates a symbol file for an
22981         IL file.        
22982
22983 2002-10-01  Dick Porter  <dick@ximian.com>
22984
22985         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
22986         Only add the handle to the cleanup array when we're about to
22987         launch the thread.  Bug 31425 deadlocked when the test was run on
22988         mono under w32.
22989
22990 2002-10-01  Martin Baulig  <martin@gnome.org>
22991
22992         * debug-mono-symfile.c: Added support for properties.
22993
22994 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
22995
22996         * reflection.c: unaligned store fix from Mark Crichton
22997         <crichton@gimp.org>.
22998
22999 2002-09-27  Martin Baulig  <martin@gnome.org>
23000
23001         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
23002         New interncall.
23003
23004 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23005
23006         * assembly.h, assembly.c: use a sane API to hook into the assembly
23007         loading process instead of a useless special-purpouse hack
23008         (ngen needs a hook, too, for example).
23009
23010 2002-09-27  Dick Porter  <dick@ximian.com>
23011
23012         * threads.c (mono_thread_init): Call GetCurrentProcess() so
23013         io-layer can set up some process handle info.  Not needed on w32,
23014         but doesn't hurt either.
23015
23016         * process.c: Pass the program name in the second parameter to
23017         CreateProcess, so the path is searched.  Include the working
23018         directory. Implemented process name, process enumeration, and some
23019         process detail internal calls.
23020         
23021         * icall.c: Added internal calls for process lookup, and some
23022         process details
23023
23024 2002-09-26  Martin Baulig  <martin@gnome.org>
23025
23026         * assembly.c (mono_install_open_assembly_hook): New global
23027         function to install a function to be invoked each time a new
23028         assembly is loaded.
23029         (mono_assembly_open): Run this callback function if set.
23030
23031         * debug-mono-symfile.c: Put back line numbers for the dynamic
23032         symbol file and also record the .il file as source file.  This
23033         allows us to install the temporary symbol file as `file.dbg' just
23034         like a compiler-generated one.
23035
23036 2002-09-26  Nick Zigarovich <nick@chemlab.org>
23037
23038         * Corrected typo in gc.c (BOHEM vs BOEHM).
23039
23040 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23041
23042         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
23043         GetProperties. Also avoid calling g_slist_length in GetProperties and
23044         GetMethods.
23045
23046 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23047
23048         * reflection.c: avoid unaligned stores (bug spotted by
23049         Mark Crichton  <crichton@gimp.org>).
23050
23051 2002-09-25  Martin Baulig  <martin@gnome.org>
23052
23053         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
23054         instead of guint64 for addresses and added prologue/epilogue info.
23055
23056 2002-09-25  Martin Baulig  <martin@gnome.org>
23057
23058         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
23059         store line number info.  For the dynamic symbol file, we only need
23060         to provide the JIT generated dynamic line number info for the dynamic
23061         symbol file.
23062
23063 2002-09-25  Martin Baulig  <martin@gnome.org>
23064
23065         * debug-mono-symfile.h: Incremented version number.
23066
23067 2002-09-24  Martin Baulig  <martin@gnome.org>
23068
23069         * class.c (mono_debugger_class_init_func): New global function
23070         pointer variable.
23071         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
23072         call it.
23073
23074         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
23075         function.  This is called via the mono_debugger_class_init_func
23076         hook to add all types to the dynamic type table.
23077         (ves_icall_MonoDebugger_GetType): New interncall to get a class
23078         from its metadata token.
23079
23080         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
23081         New interncall for the debugger.
23082
23083 2002-09-24  Nick Drochak <ndrochak@gol.com>
23084
23085         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
23086         before using it in case it is null.
23087         
23088 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
23089
23090         * metadata.c: allow custom modifiers in local var signatures
23091         (bug spotted by Zoltan Varga).
23092
23093 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
23094
23095         * class.c: deal with the <Module> class that may have a NULL vtable.
23096         Eliminate warnings.
23097
23098 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
23099
23100         * image.c, image.h: more strong name helpers.
23101         * monosn.c: more work: convert pem keys to cryptoapi format.
23102
23103 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
23104
23105         * string-icalls.c: speedup IndexOf.
23106
23107 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
23108
23109         * icall.c: updates from Zoltan.2.Varga@nokia.com.
23110
23111 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
23112
23113         * icall.c: cleanup: use mono_object_domain ().
23114
23115 2002-09-23  Martin Baulig  <martin@gnome.org>
23116
23117         * debug-mono-symfile.c: Improved type support.
23118
23119 2002-09-22  Martin Baulig  <martin@gnome.org>
23120
23121         * debug-mono-symfile.c: Added support for reference types and strings.
23122
23123 2002-09-22  Martin Baulig  <martin@gnome.org>
23124
23125         * debug-mono-symfile.c: Started to work on the type table.
23126
23127 2002-09-21  Martin Baulig  <martin@gnome.org>
23128
23129         * debug-mono-symfile.c: Largely reworked the symbol table format.
23130         The symbol table is now incrementally updated each time a new
23131         method is added.  We're now also using our own magic and version
23132         so that you don't need to recompile all your classes if the
23133         dynamic table changes.
23134         (mono_debug_update_mono_symbol_file): Removed.
23135         (mono_debug_symfile_add_method): New function to add a method.
23136
23137 2002-09-21  Martin Baulig  <martin@gnome.org>
23138
23139         * icall.c
23140         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
23141         New interncall.
23142
23143         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
23144         New interncall to get a method from its metadata token.
23145
23146 2002-09-21  Martin Baulig  <martin@gnome.org>
23147
23148         * debug-mono-symfile.c: Create type table.
23149
23150 2002-09-20  Martin Baulig  <martin@gnome.org>
23151
23152         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
23153
23154 2002-09-20  Martin Baulig  <martin@gnome.org>
23155
23156         * debug-mono-symfile.c: Provide information about params and locals.
23157
23158 2002-09-20  Martin Baulig  <martin@gnome.org>
23159
23160         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
23161         New interncall.
23162
23163         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
23164         interncall to get a method from its metadata token.
23165
23166 2002-09-20  Martin Baulig  <martin@gnome.org>
23167
23168         * debug-mono-symfile.c: Added a few checks for method->header
23169         being non-NULL.  This should never happen, but for the moment
23170         let's use a g_warning() rather than a g_assert().
23171
23172 2002-09-19  Mark Crichton  <crichton@gimp.org>
23173
23174         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
23175         even if support for it isn't present.  Added an #ifdef to fix this.
23176
23177         * socket-io.c: Added checks back for Solaris support.
23178
23179 2002-09-19  Martin Baulig  <martin@gnome.org>
23180
23181         * debug-mono-symfile.c (read_string, write_string): Reflect latest
23182         changes in the symbol file format.
23183
23184 2002-09-18  Martin Baulig  <martin@gnome.org>
23185
23186         * debug-mono-symfile.c: Set version number to 21.
23187
23188 2002-09-18  Dick Porter  <dick@ximian.com>
23189
23190         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
23191         on netbsd.  Fixes bug 30051.
23192
23193 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23194
23195         * reflection.c:
23196         (set_version_from_string): little fix.
23197
23198 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
23199
23200         * monosn.c, Makefile.am: added strong name utility.
23201         * reflection.h, reflection.c: implemented delayed signing,
23202         locale, version and hash id assembly attributes.
23203
23204 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23205
23206         * loader.c, metadata.c: load param attributes in signatures.
23207
23208 2002-09-16  Martin Baulig  <martin@gnome.org>
23209
23210         * debug-mono-symfile.c: Added string table with all method names.
23211
23212 2002-09-14  Martin Baulig  <martin@gnome.org>
23213
23214         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
23215         fast method lookup.
23216
23217 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
23218
23219         * reflection.c: record the public key token of referenced assemblies.
23220
23221 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23222
23223         * image.c, image.h: added functions to get the strong name and the
23224         public key of an assembly.
23225         * pedump.c: use them.
23226
23227 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
23228
23229         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
23230
23231 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
23232
23233         * marshal.c (mono_marshal_get_managed_wrapper): Added
23234         MONO_TYPE_BOOLEAN 
23235
23236 2002-09-11  Martin Baulig  <martin@gnome.org>
23237
23238         * gc.c: Call GC_unregister_disappearing_link() on all links when
23239         finalizing them, this is necessary to aviod a crash in boehm's
23240         finalize handler.
23241
23242 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
23243
23244         * gc.c: handle GetTarget for finalized objects spotted and fixed by
23245         nick@chemlab.org.
23246
23247 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
23248
23249         * icall.c: implemented MonoType::Module.
23250         * reflection.c, reflection.h: mono_module_get_object () from
23251         Tomi Pakarinen <tomi.pakarinen@welho.com>.
23252
23253 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
23254
23255         * icall.c: ignore overridden methods in GetMethods ().
23256         Fix for FieldInfo::SetValue().
23257         * object.c: handle float/double in runtime invoke.
23258
23259 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23260
23261         * object.c: allow a constructor to be called again on an object.
23262
23263 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
23264
23265         * class.h, class.c: move field layout code to it's own function and
23266         export it. Get an interface id earlier. Move fields in MonoClass
23267         so they are more cache friendly and align the bitfields.
23268         * loader.c: temporary handle get_param_names() for a runtime method.
23269         * reflection.c, reflection.h: more code to handle runtime creation of
23270         types.
23271
23272 2002-09-09  Martin Baulig  <martin@gnome.org>
23273
23274         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
23275         signature with the pinvoke field being set for the actual call.
23276
23277 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23278
23279         * icall.c: removed some unused icalls. Start of map of glib charsets
23280         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
23281
23282 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
23283
23284         * debug-helpers.c: break infinite loop (found and fixed by
23285         Holger Arnold <harnold@gmx.de>).
23286
23287 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
23288
23289         * icall.c: target may be null in create_delegate.
23290
23291 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
23292
23293         * marshal.c: handle a boolean return type.
23294
23295 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
23296
23297         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
23298
23299 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
23300
23301         * gc.c: fix weakreferences.
23302
23303 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23304
23305         * icall.c: added icall to get default codepage.
23306
23307 2002-09-03  Dick Porter  <dick@ximian.com>
23308
23309         * threads.h: 
23310         * threads.c: Use MonoThread instead of MonoObject where
23311         apropriate.
23312
23313         Store running thread objects in a hash table, so that we have all
23314         the info to hand when waiting for them to finish
23315         (means we don't need OpenThread() any more, so mingw builds should
23316         be fully functional again.)
23317
23318         * verify.c:
23319         * object.h: Added thread ID to MonoThread
23320
23321 2002-09-03  Martin Baulig  <martin@gnome.org>
23322
23323         * icall.c (System.Reflection.Assembly::get_location): New interncall.
23324
23325 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23326
23327         * icall.c: fixed leak in get_temp_path. Thanks lupus.
23328
23329 2002-09-03  Martin Baulig  <martin@gnome.org>
23330
23331         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
23332         argument to store the end address of the disassembled instruction.
23333
23334         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
23335         here from debug-symfile.h.
23336         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
23337         JIT into this struct.
23338         (MonoSymbolFile): Added `char *image_file' field.
23339         (MonoDebugGetMethodFunc): Removed.
23340         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
23341         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
23342         (mono_debug_find_method): New method.
23343
23344         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
23345         create a full symbol file.
23346         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
23347         and static symbol files.
23348         (mono_debug_find_method): The symbol file keeps an internal method hash,
23349         call this to get a MonoDebugMethodInfo from a MonoMethod.
23350
23351         * debug-symfile.[ch]: Removed.
23352
23353 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
23354
23355         * image.c (do_mono_image_open): Remove linker version check.
23356
23357 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
23358
23359         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
23360         wrappers for instance methods.
23361         
23362 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23363
23364         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
23365
23366 2002-08-28  Dick Porter  <dick@ximian.com>
23367
23368         * Makefile.am: Export HOST_CC for w32 builds
23369
23370 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
23371
23372         * file-io.c process.c: MonoString are null terminated, no
23373         need for mono_string_to_utf16() anymore.
23374
23375 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
23376
23377         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
23378
23379 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23380
23381         * icall.c, reflection.h: speedup System.MonoType.
23382
23383 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
23384
23385         * reflection.c: allow null as the value of a string argument in
23386         custom attributes constructors.
23387
23388 2002-08-27  Martin Baulig  <martin@gnome.org>
23389
23390         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
23391         `trampoline_address' field.
23392
23393 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
23394
23395         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
23396         check (fixes bug #29486) 
23397
23398 2002-08-27  Martin Baulig  <martin@gnome.org>
23399
23400         * debug-mono-symfile.c: Changed the file format in a way that allows us
23401         open it read-only and to use a specially malloced area for all the
23402         dynamic data.  We can now also generate a symbol file on-the-fly if we're
23403         debugging IL code and there is no MCS generated symbol file for it.
23404
23405 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23406
23407         * object.c: added a define for a good string and array
23408         creation speedup (not enabled by default because we need to deal with
23409         the synch stuff).
23410
23411 2002-08-26  Martin Baulig  <martin@gnome.org>
23412
23413         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
23414         function to create a dynamic symbol file.  This is used by the
23415         debugger to create a symbol file for IL code on-the-fly.
23416
23417 2002-08-26  Martin Baulig  <martin@gnome.org>
23418
23419         * loader.c (mono_lookup_pinvoke_call): Include the error message
23420         from g_module_error() in the error message.
23421
23422 2002-08-24  Martin Baulig  <martin@gnome.org>
23423
23424         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
23425         function to update the symbol file.  The symbol file is mmap()ed
23426         writable, but private.  This allows us to install the symbol file
23427         together with the assembly.
23428
23429 2002-08-24  Martin Baulig  <martin@gnome.org>
23430
23431         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
23432         but they can read the new symbol file format which mcs is now creating.
23433
23434         * debug-symfile.c (mono_debug_find_source_location): Moved to
23435         debug-mono-symfile.c; this is now operating on the new symbol file.
23436
23437 2002-08-23  Martin Baulig  <martin@gnome.org>
23438
23439         * debug-helpers.c (mono_method_desc_from_method): New function to get
23440         a MonoMethodDesc from a MonoMethod.
23441
23442 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
23443
23444         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
23445         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
23446
23447 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
23448
23449         * string-icalls.[ch]: make helper methods static.
23450
23451 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23452
23453         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
23454         types to it and to SetValueInternal.
23455
23456         * object.c: Moved handle_enum label to its proper place. This was the
23457         f... bug! ;-)
23458
23459         This time i compiled mcs and gtk-sharp and they both work.
23460
23461 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23462
23463         * icall.c: reverted partially my previous patch until 
23464         object.c:set_value handles enums correcly.
23465
23466 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23467
23468         * icall.c:
23469         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
23470         (ves_icall_System_Environment_get_MachineName): removed warning when
23471         compiling under cygwin.
23472
23473 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
23474
23475         * object.c: fixed field_get_value() for reference types.
23476
23477 2002-08-22  Dick Porter  <dick@ximian.com>
23478
23479         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
23480         Don't free a buffer while it's still needed.  Patch from Jonathan
23481         Liger <Jonathan.liger@wanadoo.fr>
23482
23483 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
23484
23485         * icall.c (ves_icall_System_Environment_get_Platform): Add new
23486         internal call.
23487
23488 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
23489
23490         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
23491         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
23492
23493         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
23494         we call unmanaged code which throws exceptions.
23495
23496 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
23497
23498         * appdomain.h: added per-domain entry_assembly.
23499         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
23500         arguments.
23501         * icall.c: Assembly::GetEntryAssembly icall.
23502         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
23503         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
23504
23505 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
23506
23507         * appdomain.h, gc.c: added mono_domain_finalize ().
23508
23509 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23510
23511         * object.c:
23512         (mono_print_unhandled_exception): changed g_warning by g_printerr
23513         because g_log has a 1024 characters limit (yeah, i got a big stack
23514         trace). Don't print exception name, that should be in ToString 
23515         returned string.
23516
23517 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23518
23519         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
23520         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
23521
23522 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23523
23524         * object.c:
23525         (mono_print_unhandled_exception): after previous commit, i realized
23526         that MS calls ToString on the exception. I changed this function to
23527         do that. This way we get stack_trace for free.
23528
23529 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23530
23531         * object.c:
23532         (mono_print_unhandled_exception): invoke Message property instead of
23533         getting 'message' field from Exception. Don't allocate memory for
23534         'trace' and 'message' if not needed.
23535
23536 2002-08-18  Dick Porter  <dick@ximian.com>
23537
23538         * unicode.c: Fix asserts to match Encoder.cs checks
23539
23540 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23541
23542         * marshal.c: fix unaligned store issue and a few wrong
23543         opcode argument types.
23544
23545 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23546
23547         * icall.c: added GetUninitializedObjectInternal internal call.
23548
23549 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
23550
23551         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
23552         to the right domain.
23553
23554 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
23555
23556         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
23557
23558         * class.c (class_compute_field_layout): set blittable to false for Strings
23559
23560         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
23561
23562 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
23563
23564         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
23565         first chunk of code to create types at runtime. Code to
23566         handle ReflectedType/DeclaringType. Make reflection handles
23567         domain specific.
23568
23569 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
23570
23571         * class.c: set correct name in arrays.
23572
23573 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
23574
23575         * appdomain.c (mono_domain_transfer_object): make it work with
23576         valuetypes. bug fixes.
23577
23578 2002-08-12  Dick Porter  <dick@ximian.com>
23579
23580         * object.h: Rename some parameters to avoid c++ keywords (Patch
23581         from Joseph Wenninger <kde@jowenn.at>)
23582
23583 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
23584
23585         * icall.c: added icall to implement Assembly.GetFile*.
23586
23587 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
23588
23589         * reflection.h, reflection.c: code to embed managed resources.
23590
23591 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
23592
23593         * class.c: move all the type size stuff into
23594         class_compute_field_layout().
23595
23596 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
23597
23598         * class.c: ensure enums have always the correct instance size.
23599         * unicode.c: remove wrong assert.
23600
23601 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
23602
23603         * assembly.c: fix mem corruption issue.
23604         * image.h, image.c: added mono_image_get_resource () to access
23605         managed resources.
23606         * icall.c: implemented Assembly.EntryPoint property and some
23607         Managed Resources related internalcalls.
23608
23609
23610 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23611
23612         * image.c, image.h: impemented mono_image_get_entry_point ().
23613         * appdomain.c: use mono_image_get_entry_point.
23614
23615 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
23616
23617         * reflection.c: support the object type argument when loading
23618         custom attributes.
23619
23620 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
23621
23622         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
23623         String as return type.
23624
23625 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
23626
23627         * reflection.c: fix encoding of named args for custom attrs to match
23628         the ms implementation. Read them back when instantiating custom
23629         attributes.
23630
23631 2002-08-02  Radek Doulik  <rodo@ximian.com>
23632
23633         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
23634         by Dietmar as quick fix
23635         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
23636         16 as stack size, used on more places as quick fix before Dietmar
23637         will fix it properly
23638
23639 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
23640
23641         * object.h, object.c: added accessors for fields and properties.
23642
23643 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
23644
23645         * class.c, class.h: made mono_class_get_field_from_name ()
23646         loop on parent types.
23647         Added mono_class_get_property_from_name ().
23648
23649 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23650
23651         * class.c, class.h: move the code to setup the type vtable in its own
23652         function so that it can be reused also for types created at runtime.
23653         Eliminate the "class" identifier from the header file.
23654         * reflection.c: setup the vtable for enums so that we can create
23655         objects for use in SetConstant ().
23656
23657 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
23658
23659         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
23660         instead of the delegate itself as this pointer (bug #28383)
23661
23662 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
23663
23664         * marshal.c (mono_marshal_get_managed_wrapper): added return type
23665         conversions.
23666
23667 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
23668
23669         * loader.c: don't set the pinvoke bit on icalls.
23670
23671 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
23672
23673         * debug-helpers.c (mono_method_full_name): only print a number to
23674         indicate wrapper type (so that the output is more readable in traces).
23675
23676 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
23677
23678         * class.c (mono_class_init): include method override patch from Paolo
23679
23680 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
23681
23682         * icall.c: fixed GetTypeCode().
23683
23684 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
23685
23686         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
23687         use real delegate invoke function to make it work with multicast
23688         delegates (fix bug# 28291).
23689
23690 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23691
23692         * object.c: load constant strings.
23693
23694 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
23695
23696         * reflection.c: no magic numbers.
23697         * tabledefs.h: security action enum.
23698
23699 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
23700
23701         * assembly.c: fix possible memory corruption.
23702
23703 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
23704
23705         * reflection.h, reflection.c: added support for linking resources.
23706         * verify.c: check we have an updated corlib.
23707
23708 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
23709
23710         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
23711         string arrays.
23712         (mono_marshal_string_array): null terminate unmanaged string arrays.
23713         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
23714
23715 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
23716
23717         * icall.c: Type.GetType () can now return also types from the
23718         calling assembly.
23719
23720 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23721
23722         * loader.h, loader.c: stack walking support.
23723         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
23724         GetCallingAssembly.
23725
23726 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
23727
23728         * marshal.c: added optimisations for blittable types 
23729
23730         * class.c (mono_array_class_get): do not set blittable attribute on arrays
23731         (mono_class_setup_mono_type): set blittable attribute for single
23732         and double.
23733
23734         * marshal.c (mono_string_utf8_to_builder): impl.
23735         (mono_string_builder_to_utf8): impl.
23736         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
23737
23738 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
23739
23740         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
23741         (mono_marshal_get_managed_wrapper): impl. byref types
23742
23743 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23744
23745         * icall.c:
23746         (search_method): don't display debug message. 
23747
23748 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
23749
23750         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
23751
23752 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23753
23754         * appdomain.c: set the missing filename when throwing exception.
23755
23756 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
23757
23758         * metadata.c (mono_type_size): code cleanup
23759         (mono_type_stack_size): removed some test code
23760
23761 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
23762
23763         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
23764         mono_get_exception_file_not_found now.
23765
23766         * exception.c (mono_exception_from_name_two_strings): New version
23767         that will call a constructor with two string arguments. 
23768         (mono_get_exception_file_not_found): New helper routine, used to
23769         report file-not-found errors.
23770
23771 2002-07-20  Dick Porter  <dick@ximian.com>
23772
23773         * process.h:
23774         * process.c: Pass file handles to CreateProcess
23775         
23776         * icall.c:
23777         * file-io.h:
23778         * file-io.c: Implemented CreatePipe
23779
23780 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
23781
23782         * metadata.c (mono_get_param_info): set alignment for value types
23783
23784 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
23785
23786         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
23787         Constify mono_domain_assembly_open().
23788         * loader.c: handle null namespace in icalls.
23789
23790 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
23791
23792         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
23793         (emit_str_to_ptr_conv): marshal object as structs
23794
23795         * metadata.c (mono_type_to_unmanaged): marshal object as structs
23796
23797         * marshal.c (mono_marshal_get_runtime_invoke): support value types
23798
23799 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
23800
23801         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
23802         (mono_marshal_get_native_wrapper): we an now return value types
23803
23804 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
23805
23806         * verify.c: more checks implemented.
23807
23808 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
23809
23810         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
23811         (fix bug #27695)
23812         (mono_marshal_get_native_wrapper): allow byref arguments
23813         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
23814         impl. PtrToStringXXX methods
23815         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
23816         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
23817         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
23818         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
23819         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
23820
23821 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23822
23823         * reflection.c: fix buglet in parsing an assembly name.
23824
23825 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
23826
23827         * marshal.c (emit_ptr_to_str_conv): first impl.
23828
23829 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
23830
23831         * object.c, class.h: cache the vtable in the class as suggested by
23832         vargaz@freemail.hu (Zoltan Varga).
23833
23834 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23835
23836         * class.h, loader.c: added mono_field_from_token().
23837         * verify.c: first cut of type checking code.
23838
23839 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
23840
23841         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
23842
23843 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
23844
23845         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
23846         (fix bug #27782)
23847         (mono_marshal_get_remoting_invoke): impl.
23848         (mono_delegate_begin_invoke): impl.
23849         (mono_mb_emit_save_args): impl.
23850         (mono_delegate_end_invoke): impl.
23851         (mono_marshal_get_delegate_begin_invoke):
23852         (mono_marshal_get_delegate_end_invoke):
23853         (mono_marshal_get_delegate_invoke): generate a special name for
23854         those methods (including the signature) and associate them whith
23855         the delegate class. 
23856
23857 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23858
23859         * reflection.[ch]: 
23860         (mono_reflection_type_from_name): now it has a MonoImage parameter
23861         which is used as the default image to search the type in. If the image
23862         is NULL or getting the type from it fails, it defaults to corlib.
23863
23864         * icall.c: changed 1 call to mono_reflection_type_from_name to match
23865         new parameter.
23866
23867 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23868
23869         * reflection.c: update the parameter table index.
23870
23871 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
23872
23873         * domain.c: don't include the mark byte in the string hash.
23874
23875 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
23876
23877         * icall.cs: icall for Type.GetTypeCode ().
23878         * verify: a couple of fixes and disabled local initialization checks.
23879
23880 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
23881
23882         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
23883
23884         * debug-helpers.c (mono_method_full_name): print the type of the
23885         runtime wrapper
23886
23887         * metadata.c (mono_signature_hash): a hash function for signatures
23888         (mono_signature_hash): better hash algorithm
23889
23890         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
23891
23892         * debug-helpers.c (mono_method_full_name): this can now generate
23893         method names with signatures
23894
23895         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
23896         method dont have this pointers.
23897
23898 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23899
23900         * reflection.c: fixup typebuilder tokens.
23901         * image.c: fix buglet.
23902         * marshal.h: remove whitespace.
23903         * metadata.h, metadata.c: reinstate code that was removed.
23904         * verify.c: handle catch directives and fix another couple of bugs.
23905
23906 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
23907
23908         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
23909         (mono_marshal_get_native_wrapper): make it comp. with the old code
23910         (mono_marshal_get_native_wrapper): support boolean
23911         (mono_marshal_get_managed_wrapper): support more types
23912
23913 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
23914
23915         * class.c (class_compute_field_layout): compute class->blittable attribute.
23916
23917 2002-07-09  Dick Porter  <dick@ximian.com>
23918
23919         * threads.c: Make the thread cleaning up cope with threads that
23920         call ExitThread()
23921
23922 2002-07-08  Radek Doulik  <rodo@ximian.com>
23923
23924         * reflection.c (method_encode_code): use non-translated values to
23925         compute finally_start, this fixes exception handling on ppc, yay!
23926
23927         * decimal.h (struct signscale): fix endianess
23928
23929 2002-07-07  Radek Doulik  <rodo@ximian.com>
23930
23931         * reflection.c: swap box_val and not val
23932
23933 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23934
23935         * reflection.c, reflection.h: handle full assembly info in type name.
23936         Handle Type arguments when loading custom attributes.
23937         * icall.c: updated to use new mono_reflection_type_from_name () method.
23938
23939 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23940
23941         * loader.c:
23942         (method_from_memberref): also print assembly name when method not found.
23943
23944 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23945
23946         * icall.c:
23947         (ves_icall_TypeGetProperties): fixed bug #27473. 
23948
23949 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23950
23951         * reflection.c: display image name and token when cannot find the
23952         .ctor for an attribute.
23953
23954 2002-07-05  Martin Baulig  <martin@gnome.org>
23955
23956         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
23957
23958 2002-07-04  Dick Porter  <dick@ximian.com>
23959
23960         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
23961         compile on mingw.  This will cause mingw builds to not wait for
23962         subthreads to terminate after the main thread does.  I've lodged a
23963         bug with the mingw developers for them to wrap OpenThread().
23964
23965 2002-07-03  Dick Porter  <dick@ximian.com>
23966
23967         * threads.c: Store thread IDs instead of handles, because
23968         GetCurrentThread() returns a pseudohandle and therefore stores
23969         useless values.  mono_thread_cleanup() continues checking the
23970         array of threads until it is empty, to cope with subthreads
23971         spawning new threads after the main thread has finished.
23972
23973         * profiler.h:
23974         * profiler.c:
23975         * profiler-private.h: Pass the thread ID to thread profiler
23976         functions, instead of a handle
23977
23978 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
23979
23980         * verify.c: fixes to make it more usable.
23981         * pedump.c: added --verify code to verify IL code in an assembly.
23982
23983 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
23984
23985         * reflection.c: turn errors into warnings to allow compiling corlib.
23986
23987 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
23988
23989         * reflection.c: add special cases to compile corlib.
23990
23991 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23992
23993         * reflection.c: handle properties with only a set method.
23994
23995 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
23996
23997         * opcodes.h: add enum with opcodes in opval order.
23998
23999 2002-07-01  Dick Porter  <dick@ximian.com>
24000         
24001         * object.h:
24002         * object.c (mono_runtime_run_main): Removed unneeded argument
24003
24004 2002-06-28  Martin Baulig  <martin@gnome.org>
24005
24006         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
24007
24008 2002-06-27  Dick Porter  <dick@ximian.com>
24009
24010         * threads.c: Store the handle in both the parent thread and in the
24011         subthread, to minimise the time between starting a new thread and
24012         storing its ID.
24013
24014 2002-06-26  Dick Porter  <dick@ximian.com>
24015
24016         * appdomain.c (mono_runtime_cleanup): Close the socket library
24017         after all the threads have finished, not before
24018
24019 2002-06-26  Martin Baulig  <martin@gnome.org>
24020
24021         * debug-symfile.c (mono_debug_find_source_location): Added
24022         `guint32 *line_number' argument.  If it's not NULL, store the line number
24023         there and return the file name without the line number.
24024
24025 2002-06-25  Dick Porter  <dick@ximian.com>
24026
24027         * icall.c:
24028         * process.h:
24029         * process.c: Process forking and other support functions
24030
24031 2002-06-25  Dick Porter  <dick@ximian.com>
24032
24033         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
24034         things dont happen when the image is closed.
24035         (mono_image_lookup_resource): Walk the resource section looking
24036         for a particular entry
24037
24038         * cil-coff.h: PE resource section decoding
24039
24040 2002-06-25  Dick Porter  <dick@ximian.com>
24041         
24042         * assembly.h:
24043         * assembly.c: 
24044         (mono_assembly_foreach): Accessor functions to walk the list of
24045         loaded assemblies
24046         (mono_assembly_set_main):
24047         (mono_assembly_get_main): Process methods need to know which
24048         assembly is the "main" one
24049
24050         * object.c (mono_runtime_run_main): Record the main assembly
24051
24052         * debug-helpers.c: Fix typo
24053
24054 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
24055
24056         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
24057         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
24058
24059 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
24060
24061         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
24062
24063 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24064
24065         * image.c (do_mono_image_open): Initialize reference count,
24066         otherwise we leak the MonoImage.
24067
24068 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24069
24070         * reflection.c: small tweak to handle self-hosting.
24071
24072 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
24073
24074         * reflection.c: fix type name parse code.
24075
24076 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24077
24078         * reflection.c: break out of the loop.
24079         * image.c: special case corlib.
24080
24081 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
24082
24083         * reflection.c: add all the custom attrs at the end to ensure the
24084         ctors have been properly initialized when the attributes are defined
24085         in the current assembly.
24086
24087 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24088
24089         * reflection.c: handle correctly multiple-nested types.
24090
24091 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
24092
24093         * row-indexes.h: fix typos.
24094         * reflection.c: adjust for typos and fix method_def_or_ref
24095         encoding in MethodImpl table.
24096
24097 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
24098
24099         * reflection.c: fix entry point patching (thanks Serge!).
24100
24101 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
24102
24103         * verify.c: add check for System.Exception
24104
24105 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
24106
24107         * image.c, class.c: minifix for code just c&p'ed.
24108         * reflection.c: warning fix.
24109         * object.h, loader.h, domain.c: load also StringBuilder.
24110
24111 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24112
24113         * marshal.h, marshal.c: some support code to handle complex marshaling.
24114
24115 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24116
24117         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
24118         Better signatures with vtable error dump.
24119
24120 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
24121
24122         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
24123
24124 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
24125
24126         * icall.c (ves_icall_Type_GetField): impl.
24127
24128 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24129
24130         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
24131         to retrieve a marshal description blob for a field or param.
24132
24133 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24134
24135         * reflection.h, reflection.c: change order of nested type emission
24136         to avoid table corruption. The NestedTypes table is sorted.
24137         * icall.c: change order of GetConstructor results to workaround mcs bug.
24138
24139 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
24140
24141         * reflection.h, reflection.c: handle field and param marshal
24142         information.
24143
24144 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24145
24146         * icall.c, marshal.c marshal.h: more Marshal class implementation.
24147
24148 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24149
24150         * reflection.c: fix call convention.
24151
24152 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24153
24154         * reflection.h, reflection.c: mono_image_get_memberref_token()
24155         takes a type instead of a class, now. Added
24156         mono_image_get_array_token() to create tokens for the special
24157         multi-dim array methods.
24158
24159 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
24160
24161         * assembly.c: handle modules (no assembly table). Split
24162         loading references in its own function.
24163         * class.c: handle moduleref resolution scope.
24164         * image.c, image.h: cache module name in image.
24165
24166 2002-06-07  Martin Baulig  <martin@gnome.org>
24167
24168         * reflection.c (mono_image_get_type_info): Only add a class layout entry
24169         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
24170
24171 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
24172
24173         * icall.c: more signature fixes that used uint instead of int.
24174
24175 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24176
24177         * reflection.c: fixed signature of field refs.
24178
24179 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
24180
24181         * class.c, reflection.c: handle typerefs of nested types
24182         (both on read and when writing files).
24183
24184 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24185
24186         * icall.c: fix method signatures that tried to workaround the previous
24187         typo, d'oh!
24188
24189 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
24190
24191         * debug-helpers.c: fix typo.
24192
24193 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
24194
24195         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
24196         rewrote the PE/COFF writing code (our programs are understood by the
24197         ms runtime, now).
24198
24199 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24200
24201         * gc.c, gc.h, icall.c: weakreference support.
24202
24203 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24204
24205         * Makefile.am, mono-config.c: use $(sysconfdir).
24206
24207 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24208
24209         * icall.c: changed default precision of Double.ToString() to 15.
24210         Fixed memory leak. Unified with Single.ToString.
24211
24212 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
24213
24214         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
24215
24216 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
24217
24218         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
24219         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
24220         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
24221         and myself.
24222
24223 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
24224
24225         * debug-symfile.c, sysmath.c: yet more compilation fixes.
24226
24227 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24228
24229         * reflection.c, socket-io.c: more compilation fixes.
24230
24231 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24232
24233         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
24234         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
24235         unicode.c: warning and compiler compatibility fixes.
24236
24237 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24238
24239         * class.h, metadata.c: fixed warnings/compilation errors.
24240
24241 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
24242
24243         * Makefile.am, mono-config.c, mono-config.h: configuration file
24244         support routines.
24245         * loader.c, loader.h: make Dll mapping configurable at runtime in the
24246         config file. Export methods to insert and lookup mappings.
24247
24248 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
24249
24250         * reflection.c: handle types and boxed objects in custom attr
24251         constructors.
24252
24253 2002-05-30  Martin Baulig  <martin@gnome.org>
24254
24255         * debug-symfile.c
24256         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
24257
24258 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
24259
24260         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
24261         to lookup the implmap row for a P/Invoke method.
24262         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
24263         P/Invoke method from the runtime on an as needed basis.
24264
24265 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
24266
24267         * metadata.c (mono_metadata_parse_signature): impl.
24268
24269 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
24270
24271         * class.c: handle .pack directive.
24272
24273 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
24274
24275         * object.c: initialize static fields with RVA data.
24276
24277 2002-05-25  Martin Baulig  <martin@gnome.org>
24278
24279         * debug-symfile.c
24280         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
24281
24282 2002-05-24  Martin Baulig  <martin@gnome.org>
24283
24284         * debug-symfile.c
24285         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
24286         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
24287         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
24288
24289 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24290
24291         * object.c: special case string ctros in invoke.
24292         * gc.c: silly whitespace changes.
24293
24294 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
24295
24296         * threadpool.[ch]: impl. a threadpool that can
24297         be used by mint and mono.
24298
24299 2002-05-22  Martin Baulig  <martin@gnome.org>
24300
24301         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
24302         The first argument is now a `MonoReflectionModuleBuilder *', the return
24303         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
24304         `methods' field to get the method builder.  The `token' argument is the
24305         unfixed token.
24306
24307         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
24308         invalid characters instead of g_assert_not_reached()ing.  This seems
24309         to be the behaviour of mscorlib.
24310
24311 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
24312
24313         * object.c (mono_runtime_invoke_array): applied patch from Rachel
24314         Hestilow to fix bug #25104
24315
24316 2002-05-21  Martin Baulig  <martin@gnome.org>
24317
24318         * debug-symfile.c (mono_debug_find_source_location): New function.
24319         Looks up an IL offset in the line number table and returns the source
24320         location as a string.
24321
24322 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24323
24324         * icall.c:
24325         (mono_double_ToStringImpl): changed %f by %g until we have something
24326         better.
24327
24328 2002-05-21  Nick Drochak  <ndrochak@gol.com>
24329
24330         * icall.c : Use different name for Math.Pow's icall.  Needed to check
24331         parameters first in C#.
24332
24333 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
24334
24335         * icall.c, reflection.h: added icall to get info about an event.
24336
24337 2002-05-20  Radek Doulik  <rodo@ximian.com>
24338
24339         * object.c (mono_value_box): don't use memcpy for boxing on BIG
24340         endian
24341         (mono_value_box): don't use memcpy for small sizes on
24342         architectures with unaligned access
24343
24344 2002-05-20  Martin Baulig  <martin@gnome.org>
24345
24346         * reflection.c (mono_reflection_setup_internal_class): Don't crash
24347         if `tb->parent == NULL'.
24348         (mono_reflection_create_internal_class): New function.  This is
24349         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
24350         for enum types.
24351
24352         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
24353         New interncall.
24354
24355 2002-05-19  Martin Baulig  <martin@gnome.org>
24356
24357         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
24358         argument to get the length, don't default to the array length.
24359
24360 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24361
24362         * assembly.c (mono_assembly_setrootdir): New function used to
24363         override the MONO_ASSEMBLIES directory.
24364
24365 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24366
24367         * icall.c: ValueType_GetHashCode() initialize local var.
24368
24369 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24370
24371         * reflection.c: sort custom attributes table.
24372
24373 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
24374
24375         * reflection.c: support named args in custom attributes (write support).
24376
24377 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24378
24379         * reflection.c: fix finally position calculation.
24380
24381 2002-05-15  Radek Doulik  <rodo@ximian.com>
24382
24383         * reflection.c: fixed endianess at many places
24384
24385         * icall.c (ves_icall_InitializeArray): comment out debug msg
24386
24387 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
24388
24389         * object.c (mono_unhandled_exception): new function to handle
24390         unhandled exceptions.
24391         (mono_unhandled_exception): call the UnhandledException event.
24392         (mono_runtime_delegate_invoke): impl.
24393
24394 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
24395
24396         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
24397         returns the RVA, not the direct pointer to the data. Handle the case
24398         when the class size is fixed.
24399
24400 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
24401
24402         * reflection.c: fix some endianess issues.
24403
24404 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
24405
24406         * object.c (mono_runtime_invoke): is now able to catch exceptions.
24407
24408         * threads.c (mono_thread_init): added a callback which is invoked
24409         at thread start.
24410
24411 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
24412         
24413         * icall.c: make GetHashCode return non-negative values.
24414
24415 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
24416
24417         * object.c, icall.c, gc.c: revert to address-based hashcode.
24418
24419 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24420
24421         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
24422
24423 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
24424
24425         * icall.c, class.c: special case <Module>.
24426
24427 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
24428
24429         * icall.c: fix bug in GetNow().
24430
24431 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
24432
24433         * object.c (mono_runtime_class_init): make sure that we call all
24434         static class constructors.
24435
24436 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
24437
24438         * reflection.c: sort methodsemantics table.
24439
24440 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
24441
24442         * reflection.h, reflection.c: honour init locals setting.
24443
24444 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
24445
24446         * icall.c: copied Double ToStringImpl for Single ToStringImpl
24447
24448 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
24449
24450         * reflection.c: support ContructorBuilders in attribute blob creation.
24451
24452 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
24453
24454         * reflection.c: some changes to build a binary that can be run
24455         directly in windows.
24456
24457 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
24458
24459         * loader.c: print a big message when an icall can't be found.
24460
24461 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24462
24463         * string-icalls.c: fix bug 24248.
24464
24465 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
24466
24467         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
24468         icall.c, reflection.h: separate assembly loading by pathname and by
24469         assembly name. Use the MONO_PATH env var to search for assemblies.
24470
24471 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
24472
24473         * assembly.c, image.h: add some support for assemblies
24474         with multiple modules.
24475         * class.c, class.h: export mono_class_from_typeref().
24476         * loader.c: remove duplicated code and use mono_class_from_typeref(),
24477         instead.
24478
24479 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
24480
24481         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
24482         documentation says (the ECMA one is correct).
24483
24484 2002-05-02  Dick Porter  <dick@ximian.com>
24485
24486         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
24487         Don't name the synchronisation mutex.
24488
24489 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
24490
24491         * rand.c
24492         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
24493         Make the prototypes match.
24494         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
24495         Same.
24496
24497         * icall.c
24498         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
24499         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
24500         all systems have tm.tm_zone, so use strftime() with %Z to print
24501         the timezone abreviation into a temp string.
24502
24503         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
24504         rather than mono_array_addr() on a MonoString on Big Endian
24505         machines.
24506
24507 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
24508
24509         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
24510         fix bug 24041
24511
24512 2002-04-30  Dick Porter  <dick@ximian.com>
24513
24514         * socket-io.c: Cope with SOCKET being an integer rather than a
24515         pointer now.
24516
24517         * threads.c: Added Thread_free_internal, to deal with thread
24518         handle cleanup.  Moved calls to handle_store() and handle_remove()
24519         to start_wrapper(), so each can only be called once.  Allocate
24520         synchronisation blocks with GC_malloc(), and use GC finalisation
24521         to close the handles.
24522
24523         * icall.c: added System.Threading.Thread::Thread_free_internal
24524
24525 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
24526
24527         * icall.c: support Environment.Exit, CommandLineArgs().
24528
24529 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24530
24531         * object.c, object.h: added mono_runtime_run_main () and
24532         mono_runtime_get_main_args () for use in System.Environment.
24533
24534 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
24535
24536         * gc.c: fix thinko, enable actual finalization since the jit is now
24537         fixed.
24538
24539 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
24540
24541         * gc.c, object.c: take into account that an object may be offset wrt the address
24542         returned by GC_malloc().
24543
24544 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
24545
24546         * image.c: handle files without entries in the assembly table (modules).
24547
24548 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
24549
24550         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
24551         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
24552         allowed to be null when it's System.Object class setup.
24553
24554 2002-04-27  Martin Baulig  <martin@gnome.org>
24555
24556         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
24557         if `tb->parent == NULL' rather than crashing.
24558
24559 2002-04-28  Nick Drochak  <ndrochak@gol.com>
24560
24561         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
24562         calling acos() where asin() should have been called.
24563
24564 2002-04-26  Martin Baulig  <martin@gnome.org>
24565
24566         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
24567         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
24568         there's a subdirectory called `System', but we don't want to read that
24569         subdirectory as an assembly.
24570
24571 2002-04-25  Martin Baulig  <martin@gnome.org>
24572
24573         * debug-symfile.c: Reflect latest MonoString changes.
24574
24575 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
24576
24577         * rand.c, rand.h: instance method icalls need to have an explicit
24578         this pointer as first argument in the C implementation.
24579
24580 2002-04-25  Nick Drochak <ndrochak@gol.com>
24581
24582         * icall.c: Fix typo in map for GetNonZeroBytes
24583
24584 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
24585
24586         * string-icalls.c : String does now passes unit tests without any 
24587         errors, the following changes has been made:
24588         
24589         Implemented replace methods.
24590         Renaming of methods to (try) follow the standard.
24591         Fixed compare ordinal
24592         Made all memory allocated directly to function instead of via icall function.
24593         Small performance fix in is_in_array function
24594                         
24595  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
24596
24597         c (mono_string_Internal_ctor_charp_int_int):
24598         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
24599         sindex < 0, throw ArgumentOutOfRangeException instead of
24600         ArgumentNullException.
24601
24602         Added new check for length == 0, however
24603         I need to make it return String.Empty from the C code.
24604         
24605         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
24606         that calculate the length for us here.
24607         
24608         (mono_string_Internal_ctor_sbytep_int_int): Replaced
24609         mono_string_new_utf16 with mono_string_new, since value is utf8.
24610
24611 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
24612
24613         * object.c: register the object for finalization if needed.
24614         Allocate one more char in the string for the terminating 0 char.
24615
24616 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
24617
24618         * class.c, class.h, image.c: check if a type implemenst a destructor.
24619         Use the proper key for array class lookups.
24620         * icall.c: register the icalls in the System.GC class.
24621         * gc.c, gc.h: GC-related functions and icalls.
24622
24623 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24624
24625         * icall.c:
24626         * socket-io.c:
24627         * unicode.c: free some strings gotten from mono_string_to_utf8 and
24628         changed a couple of free () by g_free ().
24629
24630         * decimal.c: one-liner in the comments for decimal2string ().
24631
24632 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
24633
24634         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
24635
24636 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
24637
24638         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
24639         * object.c (mono_runtime_invoke_array) : handle null in params
24640
24641 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
24642
24643         * string-icalls.c: fixed bug in split (one off bug)
24644
24645 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
24646
24647         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
24648         * icalls.c: added String::Equals as internal method
24649
24650 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
24651
24652         * threads.c: fixed bug in the double interlocked functions
24653
24654 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
24655
24656         * threads.c: implemented all of the new interlocked icalls.
24657         * string-icalls.c: fix a bug in insert.
24658         * icalls.c: added the icalls for interlocked, removed old string functions.
24659         
24660 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
24661
24662         * loader.c: fix off-by-one error when reading argument names.
24663
24664 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
24665
24666         * profiler.c: win32 counter implementation (untested).
24667         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
24668         (the latter needs testing and more complete impl. from win32 folks).
24669
24670 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
24671
24672         * object.c: mono_array_new_full workaround mono_array_class_get
24673         problem.
24674
24675 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
24676
24677         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
24678         * object.h (mono_string_chars): Changed casting type.
24679
24680 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
24681
24682         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
24683                            method signatures to use gunichar2 instead of gint16.
24684
24685 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
24686
24687         * object.h, object.c: domain-specific versions of mono_object_new and
24688         mono_array_new.
24689
24690 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
24691
24692         * object.c: changed String layout
24693
24694         * string-icalls.c (mono_string_Internal_ctor_chara): added
24695         internal string constructors.
24696
24697 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
24698
24699         * threads.c: pass 'this' to the thread start routine.
24700
24701 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24702
24703         * string-icalls.c: fix IndexOf and LastIndexOf. Now
24704         InternalCompareStr don't call twice mono_string_cmp_char for the last
24705         character. Improved performance in mono_string_cmp_char.
24706
24707 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
24708
24709         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
24710         code into its own library: libmonoruntime.
24711
24712 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
24713
24714         * object.h, object.c: changed array format so that szarrays do not
24715         require a bounds structure.
24716         * icall.c, appdomain.c: support for new szarray format.
24717
24718 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
24719
24720         * metadata.c: compare also the retuns type when comparing signatures:
24721         we didn't do this as an optimization since really overloaded methods
24722         must differ also in the arguments, but this doesn't work with
24723         low-level IL code (or when using explicit conversion operators: see
24724         bug#23498 for an example).
24725
24726 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
24727
24728         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
24729
24730 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
24731
24732         * icall.c: make MonoType::GetElementType its own icall.
24733
24734 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
24735
24736         * icall.c: remove MonoMethod_get_Name().
24737         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
24738         object.
24739
24740 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
24741
24742         * string-icalls.c: optimized a few methods.
24743
24744 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
24745
24746         * icall.c: added all new string internal calls
24747         * string-icalls.c: added, new string internal call implementation.
24748         * object.c: added mono_string_new_size for allocating a string a size
24749
24750 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
24751
24752         * object.c (mono_object_isinst): use the same code as in the
24753         optimized x86 version.
24754
24755 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
24756
24757         * profiler.c: TSC-based timer code (faster and more accurate).
24758         Not hooked up in configure, yet (set USE_X86TSC to 1).
24759
24760 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
24761
24762         * profiler.c, profiler.h: track time spent compiling methods.
24763         * threads.c: track thread creation/destruction.
24764
24765 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
24766
24767         * profiler.c, profiler.h, profiler-private.h: profiling interface
24768         and sample implementation. Moved here so that it can be used also by
24769         the jit.
24770
24771 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24772
24773         * reflection.c, reflection.h: keep types and other handles separate in
24774         the hash tables for referred tokens. Add guid for modules.
24775
24776 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
24777
24778         * assembly.c: fix bugs found with valgrind.
24779         * metadata.h, metadata.c: added mono_metadata_guid_heap().
24780
24781 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
24782
24783         * threads: added icall support for getting current domain for
24784                    the thread.
24785  
24786 2002-04-13  Martin Baulig  <martin@gnome.org>
24787
24788         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
24789         (MonoDebugVarInfo): Added `index' field for register based addresses.
24790         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
24791         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
24792         `MonoDebugVarInfo *params' and `guint32 this_offset' with
24793         `MonoDebugVarInfo *this_var'.
24794
24795         * debug-symfile.c (relocate_variable): New static function to write
24796         a location description for a local variable or method parameter.
24797
24798 2002-04-12  Martin Baulig  <martin@gnome.org>
24799
24800         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
24801         stack offset and begin/end scope address of a local variable.
24802         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
24803         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
24804         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
24805
24806         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
24807         Added new relocation types for start/end scope of a local variable.
24808
24809 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
24810
24811         * object.h: add mono_object_domain() macro.
24812         * reflection.c: handle typespecs.
24813         * icall.c: MonoMethod::get_Name() implementation.
24814
24815 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
24816
24817         * icall.c: String::GetHashCode() icall implementation.
24818
24819 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24820
24821         * icall.c: String::IndexOfAny icall.
24822         * object.c, object.h: make array->max_length more useful.
24823         Intrduced mono_object_class() and mono_string_length() macros.
24824
24825 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24826
24827         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
24828         instead of g_unichar_isdigit.
24829
24830 2002-04-11  Nick Drochak  <ndrochak@gol.com>
24831
24832         * icall.c: Implement a simple Double.ToString().
24833
24834 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
24835
24836         * appdomain.h: only io-layer.h is supposed to be included.
24837         * icall.c: explicitly import environ. Fix warning.
24838
24839 2002-04-10  Nick Drochak  <ndrochak@gol.com>
24840
24841         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
24842                 return true even if it's not Daylight Savings time.
24843                 Only return false for the case where the function isn't
24844                 implemented for a plaform (read Windows).
24845
24846 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24847
24848         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
24849         data with a mutex.
24850
24851 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
24852
24853         * mempool.c (mono_mempool_alloc): only use g_malloc when
24854         absolutely necessary.
24855
24856 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
24857
24858         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
24859
24860         * class.c (mono_class_vtable): use domain mempool to allocate vtable
24861         (mono_class_proxy_vtable): use domain mempool
24862
24863 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
24864
24865         * appdomain.h, appdomain.c: split initialization that requires the
24866         execution engine support into mono_runtime_init().
24867
24868 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
24869
24870         * class.c (mono_class_init): don't include vtable inside MonoClass
24871         to save some memory, gather some statistics.
24872         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
24873
24874 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24875
24876         * icall.c: internalcall implementation for ValueType.Equals().
24877
24878 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
24879
24880         * object.c (mono_message_init): moved 
24881         (mono_runtime_exec_main): new arch. independent impl.
24882         (mono_runtime_invoke_array): new method - like
24883         mono_runtime_invoke, but you can pass an array of objects.
24884         (mono_remoting_invoke): new arch. independent impl.
24885         (mono_message_invoke): new arch. independent impl.
24886         (mono_runtime_class_init): new arch. independent impl.
24887         (mono_runtime_object_init): new arch. independent impl.
24888
24889 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
24890
24891         * metadata.c, object.c, reflection.c: documented the exported
24892         functions.
24893
24894 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24895
24896         * icall.c: simpler code to pass the assembly builder data to corlib.
24897         Implement GetNestedTypes() internalcall.
24898
24899 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24900
24901         * class.c: warn if a type can't be loaded.
24902
24903 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
24904
24905         * image.h: typedef MonoImageOpenStatus
24906         * types.h: removed unused file
24907         
24908 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
24909
24910         * icall.c: Enum_ToObject accepts enum value arguments.
24911
24912 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24913
24914         * class.c: move initialization of properties, events and nested
24915         classes, so that they happen for interfaces, too.
24916
24917 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24918
24919         * icall.c: cleanup some ugly casts in Array_SetValue*.
24920
24921 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24922
24923         * icall.c: the values array fro enums is of the correct type, now.
24924         Implement (correctly) getFullName instead of assQualifiedName for
24925         MonoType.
24926         * reflection.h, reflection.c: added mono_type_get_name ().
24927
24928 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24929
24930         * assembly.c, image.h: for each MonoImage, record from wich assembly
24931         it was loaded.
24932         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
24933         Make Type.Assembly work.
24934
24935 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
24936
24937         * debug-symfile.h: use char* instead of gpointer to avoid
24938         unnecessary casts.
24939
24940         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
24941
24942         * icall.c (ves_icall_InternalExecute): impl. FielSetter
24943         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
24944
24945 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
24946
24947         * icall.c (mono_message_init): impl. (code cleanup)
24948         (ves_icall_InternalExecute): impl. FieldGetter
24949
24950         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
24951         defined we call all (non-static)methods through the vtable. 
24952
24953 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
24954
24955         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
24956         finalizer even though the memory is still referenced (and the chunk of
24957         memory is not freed).
24958
24959 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
24960
24961         * assembly.c: fix brokeness.
24962
24963 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
24964
24965         * class.c: kill some warnings. Check explicit interface method
24966         implementation also without considering the namespace.
24967         Load also literal strings in static class data.
24968
24969 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
24970
24971         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
24972         (default_assembly_name_resolver): Make the resolver take the
24973         "base" directory where the assembly was originally defined, so we
24974         can load DLLs that are in the same directory as the assembly that
24975         is being referenced.
24976
24977 2002-03-28  Dick Porter  <dick@ximian.com>
24978
24979         * file-io.h: 
24980         * file-io.c:
24981         * socket-io.c: 
24982         * unicode.h: 
24983         * unicode.c: Warning cleanups
24984
24985 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
24986
24987         * object.h, reflection.h: use the correct type instead of MonoObject.
24988
24989 2002-03-28  Martin Baulig  <martin@gnome.org>
24990
24991         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
24992         (mono_debug_update_symbol_file): Initialize classes if necessary.
24993
24994 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
24995
24996         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
24997         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
24998
24999 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
25000
25001         * assembly.h: fix function prototype.
25002         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
25003         * mono-endian.h: use const cast.
25004
25005 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
25006
25007         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
25008
25009 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
25010
25011         * loader.c: don't assert when a typeref can't be loaded, give
25012         a chance to the runtime to trow an exception instead.
25013         * loader.h: fix warning.
25014
25015 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
25016
25017         * class.c (mono_class_proxy_vtable): added proxy support
25018
25019 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
25020
25021         * icall.c: removed last of PAL calls, added System.Environment
25022         * file-io.h, file-io.c: MonoIO implementation
25023         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
25024
25025 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
25026
25027         * appdomain.c: do not use the byte marker in ldstr table lookup.
25028         * debug-helpers.c: allow two ':' to separate class and method name.
25029         * object.c: allocate arrays bounds with the GC, too.
25030         * verify: add a few more checks.
25031
25032 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
25033
25034         * reflection.c: output also literal strings. Allocate parameter data
25035         with GC_malloc() (thanks, Martin, for catching this!).
25036
25037 2002-03-26  Martin Baulig  <martin@gnome.org>
25038
25039         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
25040         include the `this' offset in the `param_offsets'.
25041
25042 2002-03-25  Martin Baulig  <martin@gnome.org>
25043
25044         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
25045         mono_debug_get_class() function to get the classes. Added new
25046         relocation types for arrays and strings.
25047         (mono_debug_get_class): New static function to search in all
25048         referenced assemblies for a metadata token.
25049
25050         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
25051
25052 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
25053
25054         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
25055         hold gc-allocated objects. Make the string heap a stream like the
25056         others. Removed duplicated code when writing stream info.
25057         Added asserts to catch possible buffer overflows. Set the sorted map
25058         for tables that need sorting. Added some documentation.
25059
25060 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
25061
25062         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
25063         for interned strings and vtables.
25064
25065 2002-03-24  Martin Baulig  <martin@gnome.org>
25066
25067         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
25068         it in the array since it was created with g_slist_prepend().
25069
25070 2002-03-24  Martin Baulig  <martin@gnome.org>
25071
25072         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
25073         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
25074         (mono_debug_method_from_token): Renamed to
25075         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
25076         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
25077
25078         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
25079         relocation types.
25080
25081         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
25082
25083 2002-03-24  Martin Baulig  <martin@gnome.org>
25084
25085         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
25086         (mono_debug_method_from_token): New func.
25087
25088         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
25089         New interncall, calls mono_debug_local_type_from_signature().
25090         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
25091         calls mono_debug_method_from_token().
25092
25093 2002-03-23  Martin Baulig  <martin@gnome.org>
25094
25095         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
25096         specifies the number of bytes to be converted, not the array size.
25097         Return the number of chars, not the number of bytes.
25098         (ves_icall_iconv_get_chars): The `byteCount' argument
25099         specifies the number of bytes to be converted, not the array size.
25100
25101 2002-03-23  Martin Baulig  <martin@gnome.org>
25102
25103         * reflection.h (MonoReflectionSigHelper): New type.
25104
25105         * reflection.c (mono_reflection_sighelper_get_signature_local),
25106         (mono_reflection_sighelper_get_signature_local): New functions.
25107
25108         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
25109         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
25110         interncalls.
25111
25112 2002-03-23  Martin Baulig  <martin@gnome.org>
25113
25114         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
25115         is_writeable is set.
25116         (mono_raw_buffer_update): New function to write the modified map
25117         back to disk.
25118
25119         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
25120
25121         * debug-symfile.c (mono_debug_update_symbol_file): Call
25122         mono_raw_buffer_update() when done writing.
25123
25124 2002-03-23  Martin Baulig  <martin@gnome.org>
25125
25126         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
25127
25128         * debug-symfile.c: Added support for arguments and local variables.
25129
25130 2002-03-23  Dick Porter  <dick@ximian.com>
25131
25132         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
25133         protected by ifdefs, hence breaking the w32 build.
25134
25135 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
25136
25137         * object.c: implement is_interned() the right way.
25138
25139 2002-03-21  Martin Baulig  <martin@gnome.org>
25140
25141         * debug-symfile.[ch]: New files to handle debugging information
25142         files. There's also support to dynamically update these symbol
25143         files to include machine dependent information.
25144
25145 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
25146
25147         * threads.c (mono_thread_create): new function to create thread
25148         from C
25149
25150 2002-03-20  Martin Baulig  <martin@gnome.org>
25151
25152         * icall.c (ves_icall_InternalInvoke): Create a new object if the
25153         method is a constructor.
25154         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
25155         points to ves_icall_InternalInvoke().
25156
25157 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
25158
25159         * file-io.c: Flush shouldn't throw exceptions.
25160
25161 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
25162
25163         * file-io.c: FileStream flush support; FileSetLength now
25164         restores file pointer.
25165
25166 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
25167
25168         * class.c: set image for pointer classes.
25169
25170 2002/03/19  Nick Drochak <ndrochak@gol.com>
25171
25172         * sysmath.c: Forgot one.
25173
25174 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25175
25176         * sysmath.c: Avoid redefining existing names.
25177
25178 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
25179
25180         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
25181         handled by runtime as icall rather than dllimport from libm.so
25182         * file-io.c, file-io.h: fixed handle argument type.
25183
25184 2002-03-18  Dick Porter  <dick@ximian.com>
25185
25186         * reflection.c (mono_image_get_type_info): rename interface to
25187         iface, because of "#define interface struct" on windows.
25188
25189 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
25190
25191         * class.c, class.h: rename and export mono_ptr_class_get().
25192         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
25193         * reflection.c, reflection.h, icall.c: better/saner type name
25194         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
25195         method signatures.
25196
25197 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
25198
25199         * class.c (mono_class_init): removed hardcoded GHC_SLOT
25200
25201         * icall.c (ves_icall_InternalInvoke): impl.
25202
25203 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
25204
25205         * reflection.c: output the interface map table, too.
25206
25207 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
25208
25209         * class.c (class_compute_field_layout): separate computation of 
25210         static field layout
25211
25212 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
25213
25214         * icall.c: added System.Buffer support.
25215         * file-io.c: moved file icalls from PAL to FileStream.
25216
25217 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
25218
25219         * icall.c (ves_icall_System_Object_GetHashCode): impl.
25220
25221 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
25222
25223         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
25224
25225 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
25226
25227         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
25228
25229 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25230
25231         * debug-helpers.{c,h}: moved here from monograph some useful functions
25232         to locate a method by name/signature in a class or image. Included
25233         also a small and flexible IL disassembler.
25234
25235 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
25236
25237         * reflection.c: fixup tokens in methods with small header size, too.
25238
25239 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
25240
25241         * object.c (mono_string_to_utf8): remove assert(!error), instead
25242         print a warning. 
25243
25244 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
25245
25246         * icall.c: update to the new mono_Array_class_get interface.
25247
25248 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
25249
25250         * appdomain.c, object.c: Boehm-GC enable.
25251         * icall.c: make get_data_chunk() support split data requests.
25252         Ensure a class is initialized in more cases. Return only the first
25253         property found in GetProperties() or the compiler gets confused. 
25254         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
25255         * reflection.h, reflection.c: add fixup mechanism for field and method
25256         tokens. Initialize assembly->typeref in a single place. Output
25257         properties after events. Support custom attributes for events, too.
25258         Typo fix for paramter custom attrs.
25259
25260 2002-03-07  Martin Baulig  <martin@gnome.org>
25261
25262         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
25263
25264 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
25265
25266         * class.c (mono_array_class_get): fix. for multi. dim. arrays
25267
25268 2002-03-06  Martin Baulig  <martin@gnome.org>
25269
25270         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
25271         non-zero lower bounds. See testcases #F10-#F13.
25272
25273 2002-03-05  Martin Baulig  <martin@gnome.org>
25274
25275         * exception.c (mono_get_exception_argument_out_of_range): New exception.
25276
25277         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
25278         ves_icall_System_Array_GetValue(), only calculate the absolute array position
25279         here.
25280         (ves_icall_System_Array_SetValue): Likewise.
25281         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
25282         as argument and does the actual work. This function is used when copying a
25283         multi-dimensional array.
25284         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
25285         now do all the widening conversions of value types.
25286         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
25287
25288 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
25289
25290         * class.c: remove some magic numbers and use the smbolic names,
25291         instead. Added init_events() to load event info at class init time.
25292         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
25293         and mono_metadata_methods_from_event().
25294         * reflection.h, reflection.c: added support for writing out the evnets
25295         related information.
25296
25297 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
25298
25299         * reflection.h, icall.c: use a different method (GetInterfaces)
25300         to gather interface info and add isbyref, isprimitive and
25301         ispointer to the ves_icall_get_type_info() return value.
25302
25303 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
25304
25305         * class.h: stared adding support for events.
25306         * icall.c: split find_members implementation. Added debug icall to get
25307         the address of an object.
25308         * reflection.c: handle TypeBuilders in mono_type_get_object().
25309
25310 2002-03-01  Martin Baulig  <martin@gnome.org>
25311
25312         * icall.c (ves_icall_System_Array_GetLength): This must throw an
25313         ArgumentOutOfRangeException(), not an ArgumentException().
25314         (ves_icall_System_Array_GetLowerBound): Likewise.
25315         (ves_icall_System_Array_GetValue): Improved argument checking.
25316         (ves_icall_System_Array_SetValue): Improved argument checking.
25317
25318 2002-03-01  Martin Baulig  <martin@gnome.org>
25319
25320         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
25321         called with invalid arguments rather than just dying with g_assert().
25322         (ves_icall_System_Array_SetValue): Likewise.
25323         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
25324         raise a NotImplementedException instead.
25325         (ves_icall_System_Array_GetLength): Added argument checking.
25326         (ves_icall_System_Array_GetLowerBound): Added argument checking.
25327
25328 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
25329
25330         * object.h (mono_assert): new macros mono_assert and
25331         mono_assert_not_reached
25332
25333 2002-02-28  Martin Baulig  <martin@gnome.org>
25334
25335         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
25336         and "System::String::IsInterned" to "System::String::_IsInterned".
25337
25338 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
25339
25340         * icall.c: remove hacks for typebuilder. Added icall to create a
25341         modified type from a tybebuilder.
25342         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
25343         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
25344         to create a backing MonoClass for a TypeBuilder.
25345
25346 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
25347
25348         * class.c, class.h: more refactoring of class init.
25349         Export mono_class_setup_mono_type() and mono_class_setup_parent().
25350
25351 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
25352
25353         * marshal.c, marshal.h: start of marshaling interface.
25354
25355 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
25356
25357         * icall.c: fix order in assembly qualified name icall.
25358
25359 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
25360
25361         * class.c: do not free str, since we store it in the hash table.
25362         * reflection.h: add label field to MonoILExceptionInfo.
25363         * reflection.c: handle references to more than one assembly. Handle
25364         case when there isn't a module created in the assembly.
25365
25366 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
25367
25368         * class.c: Fix typo. Start refactoring of class init code.
25369
25370 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
25371
25372         * appdomain.c: exit with 1 on error.
25373         * class.c: we already have the name in MonoClassField.
25374         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
25375         MonoStreamHeader instead of an offset of image->raw_metadata.
25376
25377 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
25378
25379         * appdomain.c (mono_init): Be even more descriptive about the error.
25380
25381 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
25382
25383         * appdomain.c: give the user an informative message when corlib can't
25384         be loaded.
25385
25386 2002-02-26  Martin Baulig  <martin@gnome.org>
25387
25388         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
25389         New icall to get the time zone data.
25390
25391 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
25392
25393         * reflection.c: set virtual and raw size of section correctly.
25394         * threads.c: transfer domain information to newly created threads.
25395
25396 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
25397
25398         * class.c: when instancing a class in a domain, load the default
25399         vaules for static fields from the constant table. Fix System.Enum to
25400         not be an enum.
25401         * icall.c: implement Object::GetType() internalcall. Implemented
25402         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
25403         Fixed checking of binding flags in find_members().
25404         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
25405         * reflection.c: handle enumerations when writing to the constant
25406         table. Use a different object cache for types.
25407
25408
25409 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
25410
25411         * object.c (mono_object_isinst): fix for arrays
25412
25413         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
25414
25415 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
25416
25417         * object.c: don't use mprotect ()  and fix intern pool hash table
25418         lookup for big endian systems.
25419
25420 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
25421
25422         * icall.c: change type_is_subtype_of () signature.
25423
25424 2002-02-21  Mark Crichton  <crichton@gimp.org>
25425
25426         * rand.c, rand.h: Added random number generator for
25427         System.Security.Cryptography classes.
25428
25429         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
25430
25431         * icall.c: Added System.Security.Cryptography calls.
25432
25433 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
25434
25435         * class.c, icall.c, metadata.c: better support for pointer types.
25436         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
25437         * reflection.c: Add support for getting custom attrs for properties
25438         and simplify some code.
25439
25440 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
25441
25442         * icall.c: change getToken () and add custom attribute GetBlob()helper
25443         method.
25444         * reflection.h: add custom attrs array to the reflection builder structures.
25445         * reflection.c: encode and emit custom attributes for all the relevant
25446         reflection objects. Cache fieldref and methodref tokens. Change
25447         mono_image_create_token() interface to take a MonoDynamicAssembly.
25448         More complete custom attributes decoder. Load custom attributes for
25449         Assembly, Field, Method and Constructor objects, too. Make the
25450         returned array an Attribute[] one, not object[]. Added
25451         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
25452         custom attribute constructor.
25453
25454 2002-02-20  Dick Porter  <dick@ximian.com>
25455
25456         * icall.c:
25457         * rawbuffer.c:
25458         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
25459         problem code out for now).
25460
25461 2002-02-19  Radek Doulik  <rodo@ximian.com>
25462
25463         * object.c (mono_ldstr): use hash table to avoid multiple swapping
25464
25465 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
25466
25467         * icall.c: register the GetCustomAttributes method.
25468         * object.c, object.h: add mono_string_new_len ().
25469         * reflection.h, reflection.c: added mono_runtime_invoke(),
25470         mono_install_runtime_invoke(). Added
25471         mono_reflection_get_custom_attrs () to load custom attributes and
25472         create the attribute objects.
25473
25474 2002-02-19  Dick Porter  <dick@ximian.com>
25475         * threads-dummy-types.c:
25476         * threads-dummy-types.h:
25477         * threads-dummy.c:
25478         * threads-dummy.h:
25479         * threads-pthread-types.c:
25480         * threads-pthread-types.h:
25481         * threads-pthread.c:
25482         * threads-pthread.h:  Deleted obsolete files
25483
25484 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
25485
25486         * class.c (mono_class_vtable): runtime init the class when we
25487         allocate static class data.
25488
25489         * icall.c (ves_icall_System_Array_SetValue): check for null values.
25490
25491         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
25492         and String - but we will need generic marshalling support in the
25493         future. 
25494         (mono_init): set the domain name in a ms compatible way
25495
25496         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
25497         String[].
25498
25499 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
25500
25501         * object.c (mono_array_clone): use alloca() instead of g_malloc  
25502         for sizes
25503
25504         * appdomain.c (mono_domain_unload): impl.
25505
25506 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
25507
25508         * appdomain.c, object.c: fix intern pool implementation.
25509         * class.c: fix alignment code.
25510
25511 2002-02-16  Radek Doulik  <rodo@ximian.com>
25512
25513         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
25514         and s2 > s1, just copy lower bytes to be compatible with little
25515         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
25516         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
25517
25518         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
25519         force big_endian to be 1 for big endian machines 
25520         (ves_icall_iconv_new_decoder): ditto
25521
25522 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
25523
25524         * socket-io.c (convert_sockopt_level_and_name): If the system
25525         doesn't define SOL_IP or SOL_TCP, get them by hand using
25526         getprotobyname() and caching the values (because this could be a
25527         slow operation).
25528         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
25529         Use the appropriate struct when the system does support it. Ie,
25530         not all systems have struct ip_mreqn so use struct ip_mreq when
25531         appropriate.
25532
25533 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
25534
25535         * reflection.c: handle finally clauses.
25536
25537 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
25538
25539         * socket-io.c: use g_snprintf() instead of snprintf.
25540
25541 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
25542
25543         * reflection.c (mono_param_get_objects): Cast second argument to
25544         mono_method_get_param_names to a const char** to silence the
25545         compiler warning.
25546
25547         * appdomain.c (mono_domain_assembly_open): Put parens around the
25548         truth statement in the for-loop.
25549
25550         * unicode.c (iconv_convert): Got rid of a compiler warning about
25551         int i being unused when the system has a new iconv.
25552         (iconv_get_length): Same.
25553
25554         * image.c (load_class_names): Cast the second argument to
25555         g_hash_table_insert() to char* to hush compiler warnings about the
25556         arg being a const.
25557         (mono_image_open): Same here.
25558
25559         * socket-io.c: Don't conditionally include sys/filio.h or
25560         sys/sockio.h here anymore since we now get them from
25561         io-layer/io-layer.h
25562         (inet_pton): If the system doesn't support inet_aton, implement
25563         using inet_addr and also #define INADDR_NONE if it isn't defined
25564         by the system.
25565
25566 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
25567
25568         * metadata.c, metadata.h: added function to get packing and size info
25569         of a typedef.
25570         * reflection.h, reflection.c: handle field RVA data. Save info about
25571         the table layout if needed. Assign typedef indexes to all the types
25572         before dumping the info about them to avoid forward reference problems.
25573
25574 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
25575
25576         * socket-io.c (convert_sockopt_level_and_name): ifdef
25577         SO_ACCEPTCONN because it is not defined on my system (old debian)
25578
25579 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
25580
25581         * opcode.c: use stddef.h to get NULL.
25582
25583 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
25584
25585         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
25586         for FIONBIO, FIONREAD and SIOCATMARK.
25587         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
25588         define INADDR_NONE and besides, inet_addr() is deprecated and
25589         should not be used. Use inet_pton() instead - it also has the
25590         added bonus that it can easily handle IPv6 addresses as well.
25591         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
25592
25593 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
25594
25595         * decimal.c: remove _MSC_VER conditional.
25596
25597 2002-02-13  Dick Porter  <dick@ximian.com>
25598
25599         * socket-io.c: 
25600         * icall.c: Internal calls for Blocking, Select, Shutdown,
25601         GetSocketOption and SetSocketOption
25602
25603 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
25604
25605         * assembly.cs: better resolver: use it instead of some kludgy
25606         code.
25607
25608 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
25609
25610         * reflection.c: the best way to speed-up the compiler is to avoid
25611         infinite loops.
25612
25613 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
25614
25615         * class.c (mono_class_vtable): changed the object layout
25616         (obj->vtable->class). 
25617         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
25618
25619 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
25620
25621         * assembly.c: look for assemblies in the assembly dir, too.
25622
25623 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
25624
25625         * class.c: fix thinko in mono_class_from_type().
25626
25627 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
25628
25629         * exception.h, exception.c: added TypeLoadException.
25630         * object.h, object.c: added mono_array_clone ().
25631         * icall.c: handle throwOnError in AssemblyGetType().
25632         Added Array.Clone().
25633         * opcode.h, opcode.c: use a single value for the opcode val.
25634         Compile fix for non-gcc compilers.
25635
25636 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
25637
25638         * opcodes.c, opcodes.h: export interesting info about opcodes.
25639
25640 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
25641
25642         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
25643         icalls. 
25644
25645         * class.c (class_compute_field_layout): set element_class for enums
25646         (mono_class_create_from_typedef): set element_class for normal classes
25647
25648         * icall.c (ves_icall_System_Enum_get_value): impl.
25649
25650         * class.c (mono_class_create_from_typedef): do not set valuetype
25651         flag for System.ValueType and System.Enum
25652
25653 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
25654
25655         * unicode.c (iconv_convert): fix big endian problem.
25656
25657 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
25658
25659         * class.c: add asserts if we are ever going to scribble over memory.
25660         * socket-io.c: not all systems have AF_IRDA defined.
25661
25662 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
25663
25664         * class.c (class_compute_field_layout): do not consider static
25665         fields to compute alignment
25666
25667 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
25668
25669         * appdomain.c (mono_appdomain_get): impl.
25670         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
25671
25672 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25673
25674         * icall.c: ignore "file://" prefix when loading an assembly.
25675
25676 2002-01-23  Dick Porter  <dick@ximian.com>
25677
25678         * socket-io.c:
25679         * icall.c:
25680         * Makefile.am: Added socket support
25681
25682 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
25683
25684         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
25685         code back.  This should return the assemblies that are loaded by
25686         the runtime on behalf of an application domain. 
25687
25688         The current implementation is still broken, it just returns every
25689         assembly loaded, but until we get real applications domain this
25690         will do.
25691
25692 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
25693
25694         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
25695         AppDomain object.
25696
25697 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
25698
25699         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
25700         the mono_class_from_name lookup.
25701         (ves_icall_get_parameter_info): ditto.
25702         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
25703         method.
25704         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
25705
25706 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
25707
25708         * class.c: load also nested classes on class init.
25709         System.ValueType instance methods gets passed boxed
25710         values, unless methods in derived classed that get a pointer to the
25711         data.
25712         * icall.c: use better name parsing code in GetType().
25713         * image.c, image.h: add mono_image_loaded ().
25714         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
25715         * reflection.c, reflection.h: added mono_reflection_parse_type().
25716
25717 2002-01-22  Veronica De Santis <veron78@interfree.it>
25718
25719         * icall.c : Added mapping of internal calls for Manual and Auto reset events
25720         * threads.c : Added the implementation of internal calls for events
25721         * threads.h : Added prototypes of internal calls for events
25722         
25723 2002-01-21  Radek Doulik  <rodo@ximian.com>
25724
25725         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
25726
25727 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
25728
25729         * class.c (mono_class_init): set min_align to 1 (instead of 0)
25730         (mono_class_value_size): use min_align
25731
25732 2002-01-20  Dick Porter  <dick@ximian.com>
25733
25734         * threads.h:
25735         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
25736         so it compiles on w32.
25737
25738 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
25739
25740         * metadata.c (mono_type_stack_size): impl.
25741
25742         * class.c (mono_class_get_field): impl. memberref token
25743
25744 2002-01-16 Veronica De Santis <veron78@@interfree.it>
25745
25746         * icall.h : Added the internal calls mapping for CreateMutex_internal
25747                     and ReleaseMutex_internal.
25748         * threads.h : Added the prototype of mutexes internal calls.
25749         * threads.c : Added the implementations of mutexes internal calls.
25750
25751 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
25752
25753         * metaparse.h: removed unused file.
25754         * reflection.c, reflection.h: added stream_data_align () function 
25755         to align data in streams and keep stream aligned. Add support for
25756         exception support in method headers.
25757
25758 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
25759
25760         * unicode.c: make iconv_convert () return the number of bytess written
25761         in the output buffer.
25762
25763 2002-01-15  Dick Porter  <dick@ximian.com>
25764         * threads.c: Make the runtime's idea of infinite timeouts coincide
25765         with the class library's
25766
25767         Fix a particularly egregious bug in mono_thread_cleanup(). That
25768         code was so utterly bogus it must have been written on a Monday.
25769
25770 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
25771
25772         * reflection.h: add subtypes field to TypeBuilder.
25773         * reflection.c: encode constants for literal fields.
25774         Handle subtypes. Fix user string token (and add a zero byte)
25775         at the end.
25776         
25777 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
25778
25779         * class.c (mono_class_init): bug fix: assign slot numbers for
25780         abstract methods.
25781
25782 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
25783
25784         * reflection.c: don't try to output a code RVA for abstract methods.
25785         Small fixes for method header format. Output parameter info to the
25786         ParamDef table. Save method overriding info to MethodImpl table.
25787         Fix property support. Allow typedef.extends to be a type in the
25788         building assembly.
25789         * verify.c: fix off-by-one error.
25790
25791 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
25792
25793         * class.c: fix mono_class_from_mono_type () for szarray types.
25794         Remove unused cache check in mono_class_from_type_spec().
25795         * icall.c: *type_from_name () functions handle simple arrays and byref.
25796         * reflection.c: handle byref and szarray types. Handle methods without
25797         body (gets P/Invoke compilation working). Handle types and fields in
25798         get_token ().
25799         * reflection.h: add rank to MonoTypeInfo.
25800
25801 2002-01-10  Dick Porter  <dick@ximian.com>
25802
25803         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
25804         internal calls
25805
25806 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
25807
25808         * icall.c: initialize class in type_from_handle ().
25809         Loop also in parent classes for get_method ().
25810         * reflection.c: properly encode class and valuetype types.
25811         Start on encoding TypeBuilder types. Handle fieldrefs.
25812         Use correct length when registering a user string.
25813         Handle ConstructorBuilder and MonoMethod in get_token ().
25814         Make mono_type_get_object () aware of cached types.
25815         * object.c: back out change to mono_string_new ().
25816
25817 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
25818         * object.c: mono_string_new should return a NULL when the string 
25819         passed in is NULL -- not try to deference it.
25820         
25821 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
25822
25823         * icall.c: hack to make IsSubType work for TypeBuilders.
25824         * reflection.c: emit constructors before methods.
25825         Retrieve param names in mono_param_get_objects().
25826
25827 2002/01/05  Nick Drochak  <ndrochak@gol.com>
25828
25829         * Makefile.am: fix list of headers and sources so automake 1.5
25830         doesn't complain. Removed \# at end of list.
25831
25832 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
25833
25834         * reflection.c: get token for a method ref. Set return type of
25835         constructor to void.
25836         * loader.c: debug message.
25837         * class.c: typo fix.
25838
25839 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
25840
25841         * icall.c: fix array init with rank > 1. FindMembers
25842         loops in parent class as well.
25843         * image.c: do not insert nested types in name cache.
25844         * reflection.c: warning fix.
25845         * reflection.h: add override method (for interface impl).
25846
25847 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
25848
25849         * metadata.c: fix customattr decoding.
25850
25851 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25852
25853         * rawbuffer.cs: Added native Win32 implementation, avoids using
25854         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
25855
25856 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
25857
25858         * class.c: make the low-level routines handle the cache.
25859
25860 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
25861
25862         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
25863
25864 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
25865
25866         * class.c: fix mono_array_element_size() for objects.
25867         * class.h, class.c: add properties to MonoClass and load them
25868         at init time.
25869         * icall.c: check with isinst() when assigning a value to an array
25870         instead of requiring the classes to match exactly.
25871         Implemented icall for System.Type::GetType().
25872         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
25873         enums. Handle bindingflags when looking for methods and fields.
25874         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
25875         and mono_metadata_methods_from_property().
25876         * reflection.h, reflection.c: added structures for propreties,
25877         parameters and enums. Implemented mono_property_get_object() and
25878         mono_param_get_objects().
25879
25880 2001-12-18  Dick Porter  <dick@ximian.com>
25881
25882         * file-io.c: Use mono_string_to_utf16() instead of
25883         mono_string_chars()
25884
25885         * object.c: Added mono_string_to_utf16(), which copies the non
25886         NULL-terminated MonoString into a new double-null-terminated
25887         buffer.
25888
25889 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
25890
25891         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
25892
25893 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
25894
25895         * file-io.c: raise exceptions if handle is invalid.
25896
25897 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
25898
25899         * assembly.c: yet another check for mscorlib.
25900         * class.c, class.h: load nesting info for classes.
25901         * icall.c: many new functions to support the Reflection classes.
25902         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
25903         * reflection.h, reflection.c: mono_image_create_token(),
25904         mono_assembly_get_object(), mono_type_get_object(),
25905         mono_method_get_object(), mono_field_get_object(): methods to return
25906         objects that parallel the C representation of assemblies, types,
25907         methods, fields.
25908
25909 2001-12-11  Dick Porter  <dick@ximian.com>
25910
25911         * icall.c:
25912         * file-io.c: Internal calls for file IO.
25913
25914 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
25915
25916         * tabledefs.h: missing FileAttributes.
25917         * verify.h, verify.c: use is_valid_string () to simplify and check for
25918         valid strings more correctly. Fix warnings and speeling.
25919         Check more tables: Filed, File, ModuleRef, StandAloneSig.
25920         Check code: branches, maxstack, method calls.
25921
25922 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
25923
25924         * object.c (mono_object_allocate): removed static, so that the jit
25925         can allocate value types.
25926
25927         * icall.c (ves_icall_System_DateTime_GetNow): impl.
25928
25929 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
25930
25931         * class.c: init enum types right away and register the
25932         token->MonoClass map in mono_class_create_from_typedef ().
25933         * verify.h, verify.c: first cut of the verifier.
25934         * pedump.c: add --verify switch to verify metadata tables.
25935         * tabledefs.h: add some missing enums.
25936
25937 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
25938
25939         * class.c (mono_install_runtime_class_init): impl.
25940         (mono_class_init): renamed mono_class_metadata_init to
25941         mono_class_init, also removed the metadata_inited flag
25942
25943         * object.c (mono_object_isinst): use faster algorithm
25944
25945 2001-11-30  Radek Doulik  <rodo@ximian.com>
25946
25947         * mono-endian.h: reverted last change
25948         added function prototypes
25949
25950         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
25951         add mono-endian.c back
25952
25953         * mono-endian.c: returned back, as Paolo pointed out, it's needed
25954         for unaligned access, I've mistaked it with endianess. I am
25955         sorry.
25956         (mono_read16): fix reverted endianess
25957         (mono_read64): ditto
25958         (mono_read32): ditto
25959
25960 2001-11-30  Dick Porter  <dick@ximian.com>
25961
25962         * exception.c: Implement mono_exception_from_name()
25963
25964 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
25965
25966         * metadata.h, metadata.c: remove params_size and locals_size and their
25967         calculation from the metadata code: they are only usefult to the
25968         interp.
25969
25970 2001-11-29  Radek Doulik  <rodo@ximian.com>
25971
25972         * object.c (mono_ldstr): swap bytes here, it's probably not the
25973         best place, but works for me now, I'll redo it once I know mono
25974         better, also note that I add PROT_WRITE and don't reset back, also
25975         note that it's only affects big endians, so x86 should be OK
25976
25977         * mono-endian.h (read16): use just glib macros for both endians
25978
25979         * mono-endian.c: removed as glib macros are used in in
25980         mono-endian.h so we don't need to care about endianess for read
25981         macros as glib does that for us already
25982
25983 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
25984
25985         * class.h, class.h: take minimum alignment into consideration so
25986         that the fields of a class remain aligned also when in an array.
25987
25988 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
25989
25990         * loader.h, loader.c: add mono_method_get_param_names().
25991         * class.c: 0-init class fields.
25992
25993 2001-11-26  Dick Porter  <dick@ximian.com>
25994
25995         * icall.c:
25996         * threads-types.h:
25997         * threads.c: New file that handles System.Threading on all platforms
25998
25999         * object.c: 
26000         * object.h: Remove the synchronisation struct from MonoObject,
26001         replace it with a pointer that gets initialised on demand
26002
26003         * Makefile.am: Replace all the system-specific threading code with
26004         a single file that uses the new wrapper library
26005
26006 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
26007
26008         * class.c, class.h: add mono_install_trampoline() so that the runtime
26009         can register a function to create a trampoline: removes the ugly
26010         requirement that a runtime needed to export arch_create_jit_trampoline.
26011         * object.h, object.c: added mono_install_handler() so that the runtime
26012         can install an handler for exceptions generated in C code (with
26013         mono_raise_exception()). Added C struct for System.Delegate.
26014         * pedump.c: removed arch_create_jit_trampoline.
26015         * reflection.c: some cleanups to allow registering user strings and
26016         later getting a token for methodrefs and fieldrefs before the assembly
26017         is built.
26018         * row-indexes.h: updates and fixes from the new ECMA specs.
26019
26020 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
26021
26022         * class.h, class.c: add enum_basetype field to MonoClass.
26023         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
26024         to get index in the constant table reated to a field, param or
26025         property.
26026         * reflection.h, reflection.c: handle constructors. Set public-key and
26027         version number of the built assembly to 0.
26028         * row-indexes.h: update from new ECMA spec.
26029
26030 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
26031
26032         * class.h, class.c: add a max_interface_id to MonoClass.
26033         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
26034         since it's used to do that. Added mono_type_type_from_obj().
26035         Make GetType() return NULL instead of segfaulting if the type was not
26036         found. Handle simple arrays in assQualifiedName.
26037         * object.h: add a struct to represent an Exception.
26038         * reflection.c: output call convention in method signature.
26039         Add code to support P/Invoke methods and fixed offsets for fields.
26040
26041 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
26042
26043         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
26044         the value.
26045         * icall.c: use mono_array_addr instead of array->vector: fixes the
26046         reflection image writing.
26047         * reflection.c: init call convention byte to 0 in method signature.
26048         Encode the property signature. Don't output property-related methods
26049         twice. Really process the properties for a type (don't cast a field to
26050         a property, my mom always told me that).
26051         Fix 64 bit issues in pointer alignment in a different and more
26052         readable way.
26053
26054 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
26055
26056         * loader.h: Removed type class from MonoDefaults, added monotype
26057
26058         * loader.c: Loaded MonoType, removed loading of Type
26059
26060         * icall.c (my_mono_new_object): Now returns a System.MonoType,
26061         and fills in System.Type._impl with a RuntimeTypeHandle rather
26062         than the actual MonoClass *
26063
26064         (ves_icall_type_from_handle): change from type_class to
26065         monotype_class
26066
26067         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
26068         implemented
26069
26070         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
26071         implemented
26072
26073         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
26074
26075         (ves_icall_System_Reflection_Assembly_GetType): implemented
26076
26077         (ves_icall_System_MonoType_assQualifiedName): implemented
26078
26079         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
26080
26081 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26082
26083         * assembly.c (mono_assembly_open): Implement a cache for the
26084         assemblies. 
26085
26086         (mono_assembly_close): only destroy the assembly when the last
26087         reference is gone.
26088         
26089 2001-11-09  Dick Porter  <dick@ximian.com>
26090
26091         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
26092
26093 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
26094
26095         * class.c (mono_class_metadata_init): bug fix: compute the right slot
26096
26097 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
26098
26099         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
26100         from Martin Weindel.
26101         * object.h: add mono_string_chars ().
26102
26103 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
26104
26105         * reflection.c (build_compressed_metadata): Eliminates warnings
26106         and uses 64-bit clean code.
26107
26108         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
26109         (mono_type_equal): Change signature to eliminate warnings.
26110
26111 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
26112
26113         * icall.c, loader.c: remove the internalcall array constructors.
26114         Changes to match the new MonoArray structure.
26115         * object.h, object.c: an array object doesn't allocate an extra
26116         vector. Add mono_array_new_full () to create jagged arrays easily.
26117
26118 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
26119
26120         * metadata.h, metadata.c: add mono_metadata_field_info () to
26121         retreive all the info about a field from vairous tables.
26122         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
26123         * class.h, class.c: augment MonoClassField with more info.
26124         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
26125         policy and load a field's RVA if needed.
26126
26127 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
26128
26129         * class.c (mono_class_metadata_init): create a trampoline for all
26130         virtual functions instead of actually compiling them.
26131
26132 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
26133
26134         * class.h, class.c: include name in MonoClassField.
26135         * class.c: fix fundamental type of System.Object and System.String.
26136         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
26137         tokens in ldtoken.
26138         * icall.c: remove internalcalls for the Reflection stuff that is now
26139         done in C# code.
26140         * loader.c: mono_field_from_memberref () implementation.
26141         * mono-endian.c: thinko (s/struct/union/g).
26142         * object.c, object.h: make the mono_string_* prototypes actually use
26143         MonoString instead of MonoObject.
26144         * reflection.c, reflection.h: updates for changes in the reflection
26145         code in corlib: we use C structures that map to the actual C# classes.
26146         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
26147         fat method header if needed and use the info from the ILGenerator for
26148         methods. Handle fields in types. Misc fixes.
26149
26150 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
26151
26152         * class.c (mono_class_metadata_init): bug fix: always allocate
26153         space for static class data
26154
26155 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
26156
26157         * class.c (mono_compute_relative_numbering): use relative
26158         numbering to support fast runtime type checks.
26159
26160 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
26161
26162         * class.c (mono_class_create_from_typeref): added debugging output
26163         to print class name when MonoDummy is returned instead of real class
26164
26165 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
26166
26167         * class.c (mono_class_metadata_init): interface offset table now
26168         contains pointers into the vtable - this is more efficient for the jit
26169
26170 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
26171
26172         * class.c (mono_class_metadata_init): use a temporary vtable (the
26173         old algorithm only worked for the interpreter, but not for the jit)
26174
26175 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
26176
26177         * loader.c (method_from_memberref): use mono_class_get to get the
26178         class of an array instead of using System.Array directly.
26179         (mono_get_method): also add MEMBERREF methods to the method cache
26180         which usefull for arrays.
26181
26182 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
26183
26184         * pedump.c (arch_compile_method): added to compute vtable entry
26185
26186         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
26187         number of interfaces.
26188         
26189         * class.h: merged MonoArrayClass into MonoClass
26190
26191         * class.c (mono_class_create_from_typedef): compute the vtable size and
26192         allocate space to include the vtable inside MonoClass
26193         (mono_class_metadata_init): initialize the vtable
26194
26195 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
26196
26197         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
26198         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
26199         * image.c: endian fixes by Laurent Rioux.
26200         * object.h, object.c: rename MonoStringObject to MonoString and
26201         MonoArrayObject to MonoArray. Change some function names to conform to
26202         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
26203         guint16* as first argument, so don't use char*.
26204         Provide macros to do the interesting things on arrays in a portable way.
26205         * threads-pthread.c: updates for the API changes and #include <sched.h>
26206         (required for sched_yield()).
26207         * icall.c: updates for the API changes above.
26208         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
26209         platforms that need them.
26210
26211 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
26212
26213         * class.c: set the correct type for all the fundamental
26214         type when loading the class.
26215
26216 2001-10-05  Dick Porter  <dick@ximian.com>
26217
26218         * threads-pthread.c (pthread_mutex_timedlock): Simple
26219         compatibility version for C libraries that lack this call.
26220
26221 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
26222
26223         * class.c: MonoTypes stored in MonoClass are stored as
26224         fundamental MonoTypes when the class represents a
26225         fundamental type (System.Int32, ...).
26226         The TypeHandle return by ldtoken is a MonoType*.
26227         * icall.c: ves_icall_get_data_chunk () write out all the
26228         PE/COFF stuff. Implement ves_icall_define_method (),
26229         ves_icall_set_method_body (), ves_icall_type_from_handle ().
26230         * image.c: properly skip unknown streams.
26231         * loader.h, loader.c: add type_class to mono_defaults.
26232         * metadata.c, metadata.h: export compute_size () as
26233         mono_metadata_compute_size () with a better interface.
26234         Typo and C&P fixes.
26235         * pedump.c: don't try to print the entry point RVA if there is no entry point.
26236         * reflection.c, reflection.h: many cleanups, fixes, output method
26237         signatures and headers, typedef and typeref info, compress the metadata
26238         tables, output all the heap streams, cli header etc.
26239         * row-indexes.h: typo fixes.
26240
26241 2001-10-04  Dick Porter  <dick@ximian.com>
26242
26243         * object.h: Add a synchronisation mutex struct to MonoObject
26244
26245         * object.c (mono_new_object): Initialise the object
26246         synchronisation mutexes
26247
26248         * icall.c: System.Threading.Monitor internal calls
26249         
26250         * threads-pthread.h:
26251         * threads-pthread.c: System.Threading.Monitor internal calls
26252
26253         * threads-types.h: New file, includes the system-specific thread
26254         structures
26255         
26256         * threads-pthread-types.h:
26257         * threads-pthread-types.c: New files, handle pthread-specific
26258         synchronisation types
26259
26260         * threads-dummy-types.h: 
26261         * threads-dummy-types.c: New files of dummy support for
26262         thread-specific types
26263
26264         * metadata.c:
26265         * image.c:
26266         * pedump.c: include mono-endian.h not endian.h
26267         
26268         * Makefile.am: More threads files.
26269         Name mono-endian.h not endian.h
26270
26271 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
26272
26273         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
26274         stuff and implement a few more bits.
26275         * icall.c: a field needs to be dereferenced twice. Do not use the same
26276         name for two variables in the same scope.
26277         * image.c, image.h: cleanups.
26278
26279 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
26280
26281         * class.c (mono_class_metadata_init): bug fix: compute the right size
26282
26283 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
26284
26285         * icall.c: implemented some of the Reflection internalcalls.
26286         * image.c, image.h: start writing out the PE/COFF image.
26287         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
26288         that does the reverse than decode_blob_size ().
26289         * object.c: use mono_metadata_encode_value (). Move here
26290         temporary implementation of mono_string_to_utf8 ().
26291         * rawbuffer.c: make malloc_map static.
26292
26293 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
26294
26295         * metadata.c: fix type comparison for arrays.
26296         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
26297         Added a couple of new classes to monodefaults.
26298         * icall.c: added a couple of Reflection-related internalcalls.
26299         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
26300         Added a byval_arg MonoType to MonoClass.
26301
26302 2001-09-28  Dick Porter  <dick@ximian.com>
26303
26304         * icall.c:
26305         * threads-pthread.h: 
26306         * threads-pthread.c: Implemented internal calls for
26307         LocalDataStoreSlot operations.  Applied mutexes around all shared
26308         data.  Reworked the thread creation and Start() operations to
26309         avoid a race condition.
26310         
26311         * threads-dummy.h:
26312         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
26313
26314 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
26315
26316         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
26317
26318 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
26319
26320         * class.c, loader.c: warn and return NULL instead of erroring out.
26321         * icall.c: added System.AppDomain::getCurDomain().
26322         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
26323
26324 2001-09-25  Dick Porter  <dick@ximian.com>
26325
26326         * threads-pthread.h:
26327         * threads-pthread.c: Implemented timed thread joining and added
26328         System.Threading.Thread::Join_internal internal call
26329
26330         * icall.c: Added System.Threading.Thread::Join_internal internal call
26331
26332         * threads-dummy.h:
26333         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
26334
26335 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
26336
26337         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
26338         mono_string_intern () to implement the semantics of the ldstr opcode
26339         and the interning of System.Strings.
26340         * icall.c: provide hooks to make String::IsIntern and String::Intern
26341         internalcalls.
26342
26343 2001-09-23  Dick Porter  <dick@ximian.com>
26344
26345         * threads-dummy.c: 
26346         * threads-dummy.h: New files of dummy threading routines
26347
26348         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
26349         support code based on system specifics
26350
26351         Rename PTHREAD_LIBS to THREAD_LIBS
26352         
26353 2001-09-23  Dick Porter  <dick@ximian.com>
26354
26355         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
26356         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
26357         internal calls.
26358         (mono_thread_init): Set up a Thread object instance to return when
26359         the main thread calls Thread.CurrentThread
26360         (mono_thread_cleanup): Wait for all subthreads to exit
26361
26362         * icall.c: New internal calls for System.Threading.Thread::Sleep
26363         (including Schedule) and CurrentThread
26364
26365         * threads.h: New file, to insulate thread-specific stuff from the
26366         rest of the code
26367
26368 2001-09-21  Dick Porter  <dick@ximian.com>
26369
26370         * threads-pthread.h: 
26371         * threads-pthread.c: New file, for handling pthreads-style
26372         threading support.  Start() now starts a new thread and executes
26373         the ThreadStart delegate instance.
26374
26375         * icall.c: Added the internalcall for
26376         System.Threading.Thread::Start_internal
26377
26378         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
26379
26380 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
26381
26382         * loader.c: work around the different signatures for delegates
26383         constructors csc generates in compiled code vs the ones compiled in mscorlib.
26384
26385 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
26386
26387         * class.h, class.c: add mono_class_get_field_from_name ().
26388         * *: Fix C comments and other ANSI C issues.
26389
26390 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
26391
26392         * endian.h, assembly.c: fix some endianness issues.
26393
26394 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
26395
26396         * loader.h, load.c: add delegate_class to mono_defaults.
26397         Handle runtime provided methods in mono_get_method ().
26398
26399 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
26400
26401         * loader.c (mono_get_method): use pinvoke for internal call
26402
26403         * icall.c: use pinvoke for internal call
26404
26405         * loader.c (method_from_memberref): set the method name
26406
26407 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
26408
26409         * metadata.c: help the compiler generate better code for
26410         mono_class_from_mono_type ().
26411
26412 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
26413
26414         * class.c (mono_class_metadata_init): delayed computing of the
26415         class size to mono_class_metadata_init ()
26416
26417 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
26418
26419         * class.c, class.h: add an interfaces member to MonoClass.
26420         * image.c, image.h: add assembly_name field to MonoImage
26421         from the assembly table.
26422         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
26423
26424 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
26425
26426         * class.c: Handle Array in mono_class_from_mono_type ().
26427         * metadata.c, pedump.c: some endian fixes.
26428
26429 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
26430
26431         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
26432         * metadata.c: fix small problem introduced with the latest commit.
26433
26434 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
26435
26436         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
26437         We don't need a MonoMetadata pointer anymore to compare signatures in
26438         mono_metadata_signature_equal (), update callers.
26439         Reduced memory usage an number of allocations for MonoMethodHeader and
26440         MonoMethodSignature.
26441
26442 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
26443
26444         * metadata.c: added compare for szarray.
26445
26446 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
26447
26448         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
26449         and add a couple more types to it and mono_defaults. Give an hint on
26450         classes that need implementing in our corlib and are referenced
26451         in mscorlib.
26452
26453 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
26454
26455         * class.h, class.c: keep track if a class is also an Enum.
26456         * loader.c: Implement a couple more types for use in libffi
26457         marshalling. Gives better diagnostics when failing to dlopen
26458         a library. Set method->klass for P/Invoke methods, too.
26459
26460 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
26461
26462         * class.c, class.h: add a MonoType this_arg to MonoClass that
26463         represents a pointer to an object of the class' type that
26464         can be used by the interpreter and later the type cache.
26465         Add best guess alignment info for valuetype objects.
26466
26467 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
26468
26469         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
26470         into MonoType: one less level of indirection and allocation and
26471         simplifies quite a bit of code. Added cache for MonoTypes that are
26472         used frequently, so that we don't need to allocate them all the time.
26473
26474 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
26475
26476         * class.c (mono_class_create_from_typedef): System.Enum is also a
26477         value type, although it does not derive from System.ValueType
26478         (maybe a bug in the ms compiler?)
26479
26480         * metadata.c (mono_type_size): return the right size for value types
26481
26482         * loader.c (mono_get_method): only initialize method header if not abstract
26483
26484         * class.c (mono_class_from_mono_type): use mono_default values. 
26485
26486 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
26487
26488         * *: use MonoClass pointers instead of <type_tokens>
26489         
26490         * class.h: new flag: metadata_inited.
26491
26492         * class.c (mono_class_metadata_init): impl.
26493         (mono_class_instance_size): impl.
26494         (mono_class_data_size): impl.
26495
26496 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
26497
26498         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
26499         MonoClass now has the name and name_space fields. 
26500         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
26501         mono_get_method () takes and optional MonoClass as argument.
26502         Removed mono_typedef_from_name() and added mono_class_token_from_name()
26503         instead that takes advantage of a map from class names to typedef
26504         tokens in MonoImage.
26505
26506 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
26507
26508         * metadata.c: zero is not a valid alignment boundary.
26509         Merge MONO_TYPE_VOID in default decoding code.
26510
26511 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
26512
26513         * image.h: merged MonoMetadata into MonoImage
26514
26515         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
26516         identify the type of elements.
26517
26518 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
26519
26520         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
26521         * cil-coff.h: split MonoMSDOSHeader and add size info.
26522         * image.c: add some consistency checks.
26523         * metadata.c: fix row size computation: one programmer
26524         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
26525         add explanation for the locator routine.
26526         Fix decoding of size in method header.
26527         
26528 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
26529
26530         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
26531         (g_concat_dir_and_file): Bring g_concat_dir_and_file
26532         function from gnome-libs.  This uses the right path separator
26533         based on the OS, and also works around a bug in some systems where
26534         a double slash is not allowed. 
26535         (default_assembly_name_resolver): Use g_concat_dir_and_file
26536         (mono_assembly_open): ditto.
26537
26538 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
26539
26540         * metadata.c (mono_metadata_signature_equal): impl.
26541
26542         * *: void is now a realy MonoType (instead of using NULL)
26543         
26544         * metadata.c (do_mono_metadata_parse_type): use
26545         mono_metadata_parse_type to parse void value.
26546
26547 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
26548
26549         * metadata.c, metadata.h: in the signature and method header store
26550         only the space required for holding the loca vars and incoming arguments.
26551
26552 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
26553
26554         * metadata.c (do_mono_metadata_parse_type): treat void like any
26555         other type (instead of assigning NULL);
26556
26557 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
26558
26559         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
26560
26561 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
26562
26563         * image.c (do_mono_image_open): added a cache for arrays.
26564
26565 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
26566
26567         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
26568         decode a single column from a row in a metadata table and changes
26569         to take advantage of it in the typedef locator (gives a nice speed up).
26570         Store offset info for function params.
26571
26572 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
26573
26574         * image.h (MONO_IMAGE_IS_CORLIB): removed 
26575
26576 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
26577
26578         * assembly.c: how could mono_assembly_close () had ever worked?
26579         * metadata.c, metadata.h: provide offset info for local vars.
26580         Implement mono_type_size () to take care of alignment as well
26581         as size (it was mono_field_type_size in cli/class.c before).
26582
26583 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
26584
26585         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
26586
26587         * assembly.h (CORLIB_NAME): set to corlib.dll
26588
26589         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
26590
26591 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
26592
26593         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
26594         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
26595         tokentype.h: massive namespace cleanup.
26596
26597 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
26598
26599         * metadata.h, metadata.c: decode exception clauses when parsing method header.
26600
26601 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
26602
26603         * metadata.c (mono_metadata_free_type): added check for type !=
26604         NULL (void) before calling mono_metadata_free_type()
26605
26606 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
26607
26608         * metadata.h, row_indexes.h: added header with enumerations to use
26609         to index in the columns from tables in metadata and to decode coded
26610         tokens: we should start using this instead of embedding magic numbers
26611         all over the code.
26612
26613 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
26614
26615         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
26616         Move metadata_t info from cli_image_info_t to MonoImage, where
26617         it's easily accessible. Changed all the uses accordingly.
26618         Added the method and class caches to MonoImage.
26619         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
26620         and mono_metadata_decode_value () signature to be more consistent
26621         with the other parse functions (and simplify code). Taken advantage
26622         of zero-length array allocation with GCC. Removed reduntant (and
26623         wrong) MonoFieldType struct and use MonoParam instead. Changed
26624         mono_metadata_parse_field_type () to use common code for parsing.
26625         Added mono_metadata_typedef_from_field () and
26626         mono_metadata_typedef_from_method () to lookup a typedef index from a
26627         field or method token.
26628         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
26629
26630 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
26631
26632         * metadata.c (mono_metadata_parse_field_type): Implement. 
26633         (do_mono_metadata_parse_type): Split engine from
26634         mono_metadata_parse_type, so that we can create smaller structures
26635         for things that just have one pointer to the MonoType (look at
26636         the MonoFieldType)
26637
26638 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
26639
26640         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
26641         as Jan Gray found out, it is incorrect. 
26642
26643 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
26644
26645         * assembly.c: Implement asssembly loading.  This loads an image
26646         and loads all the referenced assemblies.  Come to think of it, we
26647         could always do lazy loading of the assemblies. 
26648
26649         * image.c (mono_image_open): Keep loaded images in a hashtable.
26650
26651         * image.h (MonoImage): Add reference count.
26652
26653 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26654
26655         * assembly.c (mono_assembly_open): Keep track of the file name in
26656         case the assembly has no ASSEMBLY table.
26657
26658         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
26659         from get.c here.
26660
26661 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
26662
26663         * metadata.c, metadata.h: decode local vars in method header
26664         parse function. Change callers accordingly.
26665
26666 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
26667
26668         * metadata.h, cil-coff.h: protect against multiple inclusion.
26669         Added some new structures to hold information decoded from metadata:
26670         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
26671         and relevant decoding/free functions.
26672         * metadata.c: implement decoding functions. Add warning for out of bounds
26673         index in mono_metadata_locate(). Implement mono_get_method () to retreive
26674         all the info about a method signature and invocation. Remove check on
26675         uninitialized local var in parse_mh() and fix memory leak.
26676
26677 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
26678
26679         * metadata.h: More macros.
26680
26681         * tokentype.h: New file.
26682
26683 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
26684
26685         * assembly.c: added a consistency check and initialize
26686         some structures with g_new0().
26687         * metadata.c: fixed a couple more bugs in table size computation
26688         and add other checks for out-of bound access to metadata.
26689
26690 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
26691
26692         * metatada.c: fix bugs computing table sizes. Spew a
26693         warning when index in string heap is out of bounds.
26694
26695 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
26696
26697         * metadata.h: Add a couple of macros to manipulate tokens. 
26698
26699 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
26700
26701         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
26702         cli_section_tables).
26703
26704 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
26705
26706         * metadata.c (mono_metadata_user_string): New function, provides
26707         access to the UserString heap. 
26708
26709 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
26710
26711         * metadata.c: Add inline documentation.
26712
26713 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
26714
26715         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
26716         files. 
26717
26718 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
26719
26720         * typeattr.h: New file, TypeAttribute flags. 
26721
26722 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
26723
26724         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
26725         mono_assembly_ensure_section): Section loading code.
26726         (load_section_tables): Load the sections.
26727
26728         * mono/metadata/metadata.c (mono_metadata_locate_token,
26729         mono_metadata_locate): Functions to locate the information
26730         definition given a token or a table and an index.
26731         (mono_metadata_compute_table_bases): New.
26732         (compute_size): New function to compute the sizes of the various
26733         tables.
26734
26735         * mono/metadata/metadata.h: Finish listing the different index
26736         types. 
26737
26738         * mono/metadata/pedump.c: Improve to dump new information.
26739
26740 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26741
26742         * mono/metadata/metadata.c: Entered all the tables matching
26743         Beta2. 
26744
26745         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
26746
26747
26748