2009-12-26 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / ChangeLog
blob57a68857cf638098f0edaf77e55257e89091f12a
1 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
3         * generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
4         they cannot be patched. Partly fixes #564408.
6 2009-12-24  Mark Probst  <mark.probst@gmail.com>
8         * metadata-internals.h, reflection.c: Use the
9         MonoDynamicImage.handleref hash table only with unmanaged keys,
10         and add a managed hash table handleref_managed for managed keys.
12 2009-12-24  Mark Probst  <mark.probst@gmail.com>
14         * sgen-gc.c: Unset to-space bumper between collections.  It might
15         become invalid due to degraded allocations.
17 2009-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
19         * loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
20         with the one from the original method.
22         * metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
23         compatibility.
25         * verify-internals.h: Add new function to the internal API.
27 2009-12-18  Dimitar Dobrev  <dpldobrev@yahoo.com>
29         * culture-info-tables.h: regenerated it to include the Georgian culture.
31 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
33         * sgen-gc.c: Include mono/utils/memcheck.h.
35         * reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
36         instead of the current domain, since the two might not match if this is called
37         from the debugger.
39         * metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
40         domain which created this assembly.
42 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
44         * debug-helpers.c (dis_one): Avoid a glib assert on empty strings.
46 2009-12-17  Mark Probst  <mark.probst@gmail.com>
48         * sgen-gc.c: Managed implementation of the specialized generic
49         store write barrier.
51 2009-12-17  Rodrigo Kumpera  <rkumpera@novell.com>
53         * icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
54         A private virtual newslot method is used to implement an interface method without exposing
55         it to users. When querying for public instance methods, such method would hide a public one
56         on a parent type.
58         Fixes #564379.
60 2009-12-17  Zoltan Varga  <vargaz@gmail.com>
62         * reflection.c (resolve_object): Fix the encoding of unmanaged calling
63         conventions.
65 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
67         * reflection.c (mono_type_get_object): Guard against NULL generic param owner.
69 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
71         * class-internals.h (MonoDynamicGenericClass): Kill property and event related fields
72         as they are no longer used.
73         
74          * metadata.c (free_generic_class_dependents): Remove reference to previous fields
76         * reflection.c (mono_reflection_generic_class_initialize): Ditto.
78 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
80         * reflection.c (mono_type_get_object): If the type is VAR or MVAR check
81         if the owner class has not been finished before returning reflection_info.      
83         Fixes #565127.
85 2009-12-16  Zoltan Varga  <vargaz@gmail.com>
87         * reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
88         param doesn't have custom attributes. Fixes #565117.
90         * class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
91         #565120.
93 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
95         * class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.
97 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
99         * pedump.c: Add partial-md mode that doesn't perform full metadata verification. It does the
100         same amount done by a core-clr enabled runtime.
102 2009-12-15  Marek Habersack  <mhabersack@novell.com>
104         * appdomain.c (mono_make_shadow_copy): make sure access mode of
105         the target files is reset to writable by owner and readable by
106         everyone else to prevent problems when updating shadow copies of
107         files whose source is read-only. Fixes bug #556884
109 2009-12-15  Mark Probst  <mark.probst@gmail.com>
111         * class.c (mono_generic_class_get_class): Allocate the generic
112         class via malloc again, so that it can be freed when any one of
113         the images of its constituent types is closed.
115         * metadata.c: When closing an image, don't free generic insts and
116         generic classes right away, but put them into a list for later
117         freeing.
119         * image.c, metadata-internals.h: Store the free list and in the
120         second pass of closing an image, free it.
122 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
124         * reflection.c (mono_generic_class_get_object): Assert if this is ever called.
126         * reflection.c (mono_reflection_register_with_runtime): Only register dynamic
127         types in type_hash.
129         * reflection.c (resolve_object): Call ensure_complete_type on the inflated field.
131 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
133         * reflection.c (mono_reflection_type_get_handle): Properly fail in case of a broken
134         user type.
136         * reflection.c (mono_reflection_register_with_runtime): Throws in case a bad user type
137         is used.
139 2009-12-14  Miguel de Icaza  <miguel@novell.com>
141         * verify.c (mono_method_verify): The Unused opcodes produce an
142         InvalidProgramException on .NET
144 2009-12-14  Sebastien Pouliot  <sebastien@ximian.com>
146         * loader.c (mono_method_get_header): Move assert after the verifier
147         has been called on the method header.
149 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
151         * object-internals.h: Remove useless field from MonoReflectionGenericClass.
153         * appdomain.c: Bump corlib version.
155 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
157         To properly support user types, MonoGenericClass has to be used for regular, non SRE,
158         types as well since otherwise generic instances would not return UT as arguments but
159         their undelying system type.
161         * object-internals.h: Change field types of MonoGenericClass and *OnTypeBuilderInst
162         to reflect the fact that they can have now multiple different types.
164         * reflection.c (mono_image_get_field_on_inst_token): Handle MonoField.
166         * reflection.c (mono_image_get_ctor_on_inst_token): Handle MonoCMethod.
168         * reflection.c (mono_image_get_method_on_inst_token): Handle MonoMethod.
170         * reflection.c (mono_reflection_register_with_runtime): Init super types
171         if the image is not dynamic.
173         * reflection.c (mono_reflection_bind_generic_parameters): In case of a MonoGenericClass,
174         check if the generic type definition is a TypeBuilder.
176         * reflection.c (mono_reflection_generic_class_initialize): If the generic type definition
177         doesn't belong to a dynamic image, skip initialization.
179         * reflection.c (resolve_object): Properly handle *OnTypeBuilderInst types where their
180         base definition is not a dynamic type.
182 2009-12-11  Marek Habersack  <mhabersack@novell.com>
184         * object.c (mono_ldstr, mono_ldstr_metadata_sig): added calls to
185         mono_profiler_string_allocation
187         * string-icalls.c (ves_icall_System_String_InternalAllocateStr):
188         if string profiling is enabled, call
189         mono_profiler_string_allocation
191         * profiler.h: added two MonoProfileFlags -
192         MONO_PROFILE_IOMAP_EVENTS and MONO_PROFILE_STRING_ALLOC as well as
193         installation functions for the hooks below.
195         * profiler-private.h, profiler.c: added two hooks:
196         mono_profiler_string_allocation called whenever a string is
197         allocated by InternalAllocateStr and mono_profiler_iomap called
198         whenever IOMAP code performs an adjustement on a file path.
200 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
202         * boehm-gc.c: fixed race condition while getting the target of a
203         disappearing link (bug #522233).
205 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
207         * class.c (mono_type_get_full): Produce warning instead of simply swallowing
208         the error.
210 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
212         * reflection.c: Add mono_reflection_register_with_runtime icall to
213         allow a MonoGenericClass to register itself as the managed mirror of
214         a given generic instance.
215         This is a temporary workaround until all MGC instantiation happens in
216         managed code.
218         * object-internals.h: Ditto.
220         * icall-def.h: Ditto.
222 2009-12-10  Mark Probst  <mark.probst@gmail.com>
224         * sgen-gc.c (find_in_remsets): Also search the generic store
225         remsets.
227 2009-12-10  Mark Probst  <mark.probst@gmail.com>
229         * sgen-gc.c: Don't access class names in debugging code when
230         unloading a domain, because they might not be valid anymore.
232 2009-12-10  Mark Probst  <mark.probst@gmail.com>
234         * domain.c, domain-internals.h: New function mono_domain_unset().
236         * appdomain.c (unload_thread_main): Detach the thread again at the
237         end.
239         * threads.c: When a thread exists or is detached, unset its domain
240         so that it's NULL when, for example, a pthread destructor runs.
242         * sgen-gc.c: Assert that there is no domain set after a thread is
243         done.
245 2009-12-10  Mark Probst  <mark.probst@gmail.com>
247         * class.c (mono_generic_class_get_class),
248         metadata.c (free_generic_class): Allocate generic MonoClass's from
249         the image mempool, not via malloc.  The problem with malloc is
250         that when unloading a domain those classes are freed before
251         clearing the heap and SGen needs the classes.  Rewriting the
252         unloading code to do the free later would be more work and there's
253         no point in using malloc anyway.
255 2009-12-09  Sebastien Pouliot  <sebastien@ximian.com>
257         * loader.c (mono_method_signature): Always call mono_loader_unlock 
258         before returning.
260 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
262         * metadata-verify.c: Add mono_verifier_verify_string_signature to check
263         user string blobs.
265         * verify-internals.h: Add new function to the internal API.
267         * verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
268         check if it's a valid string.
270         * object.c (mono_ldstr): Ditto.
272         Fixes #561943.
274 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
276         * icall.c (ves_icall_GetCurrentMethod): Drop all generic arguments
277         from a method before returning it. This is the expected behavior.
279 2009-12-08  Rodrigo Kumpera  <rkumpera@novell.com>
281         * reflection.c (inflate_method): Handle the case of a regular system type.
283 2009-12-08  Mark Probst  <mark.probst@gmail.com>
285         * sgen-gc.c, sgen-pinning-stats.c, sgen-gray.c: More statistics
286         gathering code.
288         * mempool.c, mempool-internals.h: New function
289         mono_mempool_get_bytes_allocated().
291         * Makefile.am: sgen-pinning-stats.c added.
293 2009-12-08  Mark Probst  <mark.probst@gmail.com>
295         * sgen-gc.c (create_allocator): Only use the fast path if the
296         object size is within the small object size limit.
298 2009-12-07  Mark Probst  <mark.probst@gmail.com>
300         * sgen-gc.c: Make sure section->data is aligned to 8 bytes by
301         possibly adding padding to sizeof (GCMemSection).
303 2009-12-07  Mark Probst  <mark.probst@gmail.com>
305         * sgen-gc.c (mono_gc_wbarrier_nostore): Skip the remset if the
306         reference is not in the nursery.
308 2009-12-07  Rodrigo Kumpera  <rkumpera@novell.com>
310         * class.c (mono_class_from_typeref): Bounds check idx against the 
311         assemblyref table.
313 2009-12-07  Mark Probst  <mark.probst@gmail.com>
315         * sgen-gc.c, sgen-pinning.c: When pinning, make only one pass
316         through the potential roots, then sort the results and find the
317         pinned objects from there.
319         * Makefile.am: sgen-pinning.c added.
321 2009-12-07  Mark Probst  <mark.probst@gmail.com>
323         * sgen-gc.c: Record generic stores in specialized remset buffers.
325 2009-12-06  Mark Probst  <mark.probst@gmail.com>
327         * sgen-gc.c: Make pinned chunks the same size as major heap
328         sections, and align them as well, so that we can check whether an
329         object is in a pinned chunk or a major section in constant time.
331 2009-12-06  Mark Probst  <mark.probst@gmail.com>
333         * sgen-gc.c (build_nursery_fragments): Don't leak fragments.
335 2009-12-06  Mark Probst  <mark.probst@gmail.com>
337         * sgen-gc.c: Make all major heap sections the same size (currently
338         128k) and allocate them on aligned addresses.  Small heap sections
339         give us better granularity with pinned objects - we can free up
340         much more memory.
342 2009-12-06  Mark Probst  <mark.probst@gmail.com>
344         * string-icalls.c (ves_icall_System_String_GetLOSLimit): Debug
345         output removed.
347 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
349         Applied patch from Laurent Etiemble (laurent.etiemble@gmail.com).
351         * mono/metadata/assembly.c: When opening an assembly image, pass the real
352         names in addition to the runtime generated one.
354         * mono/metadata/image.h: Add a function to take the real name of the assembly
355         image.
357         * mono/metadata/image.c: If a real name has been passed to load an assembly,
358         use it instead of the runtime generated one.
360         Code is contributed under MIT/X11 license.
362 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
364         * marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
365         before the other checks to prevent problems if the DateTime class is blittable.
366         Hopefully fixes #559600.
368 2009-12-05  Mark Probst  <mark.probst@gmail.com>
370         * string-icalls.c, string-icalls.h, icall-def.h: New icall that
371         returns the largest string length that will not be put into the
372         LOS.
374         * sgen-gc.c, gc-internal.h: New function that returns the largest
375         object size that will not be put into the LOS.
377         * appdomain.c: Bump corlib version.
379 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
381         * class-internals.h: Add MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
383         * generic-sharing.c: Handle MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
385 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
387         * reflection.c (inflate_method): Fix signature.
389         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Reflect change
390         in managed code.
392 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
394         * reflection.c (inflate_method): Make this method work with TypeBuilder as well.
396 2009-12-03  Mark Probst  <mark.probst@gmail.com>
398         * sgen-gc.c: Abstract to-space handling.
400 2009-12-03  Rodrigo Kumpera  <rkumpera@novell.com>
402         * loader.c (find_method_in_class): Ignore methods with broken signatures.
404         Fixes #559906.
406 2009-12-03  Mark Probst  <mark.probst@gmail.com>
408         * sgen-gc.c: Only add references from outside the nursery to
409         within the nursery to the global remset list.
411 2009-12-03  Mark Probst  <mark.probst@gmail.com>
413         * appdomain.c (create_exceptions): Set the domain temporarily if
414         necessary to avoid cross-domain references.
416 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
418         * verify.c (get_stack_type): Return that the type is invalid instead of
419         asserting.
421         * verify.c (mono_method_verify): Verify that all locals and arguments
422         have valid stack types.
424         Fixes #559913.
426 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
428         * verify.c (mono_method_verify): Bounds check the filter offset. Make all
429         bounds checking overflow aware.
431         Fixes #559910.
433 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
435         * verify.c (do_invoke_method): Check for invalid method signatures.
437         Fixes #553450.
439 2009-12-02  Jb Evain  <jbevain@novell.com>
441         * appdomain.c (MONO_CORLIB_VERSION): bump.
442         * icall-def.h (get_base_definition): renamed to get_base_method
443         and add a boolean argument indicating we want the original
444         method definition, or the immediate base method.
445         * icall.c: apply the get_base_definition to get_base_method change.
447 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
449         * class.c (mono_class_setup_fields): Fail an enum without an instance field.
451         Fixes #558042.
453 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <lupus@ximian.com>
455         * class.c: remove asserts for invalid type token in
456         mono_class_name_from_token(), mono_assembly_name_from_token() and
457         mono_class_create_from_typedef () (fixes bug #553318).
459 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <lupus@ximian.com>
461         * metadata.c, class.c, loader.c: remove assert after bsearch() for
462         incorrect assemblies (bug #553322).
464 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
466         * metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.
468         * metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 
470         * class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.
472         * class.c (inflate_generic_context): Ditto.
474         * loader.c (method_from_methodspec): Ditto.
476         Fixes #558230.
478 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
480         * class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.
482         * class.c (mono_class_create_from_typespec): Ditto.
484         * class.c (mono_class_get_full): Fix for change on the above 2 functions.
486         * class.c (mono_type_get_full): Fix for change on the above 2 functions.
488         Fixes #558184.
490 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
492         * verify.c (mono_class_has_default_constructor): Check fror broken signatures.
494         * verify.c (verify_delegate_compatibility): Ditto.
496         * verify.c (do_newobj): Ditto.
498         Fixes #558046.
500 2009-12-02  Mark Probst  <mark.probst@gmail.com>
502         * sgen-gc.c: Use a gray queue instead of requiring that gray
503         objects are in a contiguous region.
505         * sgen-gray.c: The gray queue implementation.
507         * Makefile.am: sgen-gray.c added.
509 2009-12-02  Mark Probst  <mark.probst@gmail.com>
511         * appdomain.c: When unloading a domain, zero its static data and
512         perform a minor collection when using SGen.  That will get rid of
513         all the remsets pointing into that domain's static data.
515         * sgen-gc.c: Allow remsets into static data.  By doing this we
516         need less checks so we're more efficient.
518 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
520         * verify.c (mono_method_verify): Check for catch clauses with broken
521         types.
523         Fixes #558465.
525 2009-12-01  Jb Evain  <jbevain@novell.com>
527         * class.c (make_generic_param_class): set the namespace of
528         the generic parameter class from its owner, if available.
530 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
532         * verify.c (code_bounds_check): Do proper overflow checking.
534         * verify.c (mono_method_verify): The number of switch entries is
535         an unsigned int. Properly bounds check it.
537         Fixes #558594.
539 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
541         * metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
542         mono_metadata_method_has_param_attrs which only checks if a given param
543         list has a non zero flags entry.
545         * metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
546         to inform how many params should we expect to decode.
548         * loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
549         as it's faster than mono_metadata_get_param_attrs.
551         * metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
552         add mono_metadata_method_has_param_attrs.
554 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
556         * class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
557         failures.
559         * class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
560         is -1 but its class is broken.
562         Fixes #558522.
564 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
566         * metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
567         for parameter overflow.
569         * metadata.c (mono_metadata_parse_method_signature_full): Use checked version
570         of mono_metadata_get_param_attrs.
572         * metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
573         API.
575         * loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.
577 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
579         * class.c (mono_class_setup_fields): Check for fields with broken types.
581         Fixes #558741.
583 2009-11-28  Rodrigo Kumpera  <rkumpera@novell.com>
585         * reflection.c (ensure_generic_class_runtime_vtable): Split this function in 2
586         so we can avoid calling ensure_runtime_vtable multiple times for the GTD during
587         its TypeBuilder::CreateType ().
589         * reflection.c (ensure_generic_class_runtime_vtable): Avoid initializing interfaces
590         if not needed.
592         * reflection.c: Every time we change the interface array, set interfaces_packed to NULL
593         to make setup_interface_offsets happy.
595         * reflection.c (remove_instantiations_of_and_ensure_contents): Fix instances again as corlib
596         compilation now works.
598 2009-11-28  Zoltan Varga  <vargaz@gmail.com>
600         * appdomain.c (create_exceptions): New helper function extracted from
601         mono_runtime_init () to precreate objects used during exception handling.
602         (mono_runtime_init): Call it.
603         (mono_domain_create_appdomain_internal): Ditto. Fixes #555264.
605 2009-11-27  Rodrigo Kumpera  <rkumpera@novell.com>
607         * reflection.c (remove_instantiations_of_and_ensure_contents): Temp hack to fix corlib
608         compilation until the proper one is found.
610 2009-11-27  Zoltan Varga  <vargaz@gmail.com>
612         * class.c (mono_class_setup_vtable_general): Cache the result of
613         get_virtual_methods () since it can be slow because of the metadata
614         optimization.
616         * metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
617         from a MonoValueHashTable for now, since the later is based on an earlier
618         version of hpj's internal probing code and seems to have serious collision
619         issues.
621         * loader.c (mono_get_method_full): Update after the change above.
623 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
625         * class-internals.h (MonoCachedClassInfo): Add 'is_generic_container' field.
627 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
629         * reflection.c (get_field_on_inst_generic_type): Try to fallback using the field from
630         the GTD instead of the DGC instead of crashing.
632         * reflection.c (ensure_generic_class_runtime_vtable): Only reinflate stuff that is
633         required. Inflate fields if needed.
635         * reflection.c (remove_instantiations_of): Ensure generic instances are properly
636         finished. Renamed.
638 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
640         * class.c (check_interface_method_override): Check for NULL signatures and fail
641         the type.
643         * debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.
645         Fixes #553428.
647 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
649         * class.c (mono_class_get_virtual_methods): Call decode_row_col to obtain
650         the MONO_METHOD_FLAGS column instead of decoding the whole row.
652 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
654         * loader.c (field_from_memberref): Resolve the class first then the field
655         signature. Remove a lot of duplicated code and make sure we don't pass valid
656         values to mono_loader_set_error_field_load.
658         Fixes #553306.
660 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
662         * class.c (inflate_generic_type): Change code to use new signature of
663         mono_error_set_bad_image.
665         Fixes #558124.
667 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com> 
669         * verify.c (mono_method_verify): Don't free ctx.params items if 
670         we aborted while inflating the ctx.locals. Complete previous fix
672 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com>
674         * verify.c (mono_method_verify): Use the uninflated type name, 
675         when the inflated is null, to report errors. Also take care when
676         freeing, not to free everything since, in case of an error, some
677         stuff would be copies (i.e. not allocated by the function itself)
678         Fix bug #558145
680 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
682         * verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
683         or overflow. The caller must have done this check explicitly. This guard us
684         from accessing invalid memory.
686         * verify.c (do_push_static_field): Check for stack overflow.
688         Fixes #553333.
690 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
692         * loader.c (find_method_in_class): Don't crash if the signature cannot
693         be resolved.
695         * metadata.c (mono_metadata_parse_generic_param): Return NULL instead
696         of asserting for the case of invalid params.
698         Fixes #553304.
700 2009-11-24  Sebastien Pouliot  <sebastien@ximian.com>
702         * image.c (mono_image_load_module): Fix crash when a bad assembly
703         has no module at all (fix bug #553412) and also replace the 
704         g_assert with a return NULL (documented return value for failure)
706 2009-11-23  Zoltan Varga  <vargaz@gmail.com>
708         * debug-helpers.c (mono_type_get_desc): Handle typedbyref.
710 2009-11-23  Miguel de Icaza  <miguel@novell.com>
712         * file-io.c: Change FindFirst/FindNext/FindClose API to return the
713         file attribute to managed code and avoid doing the mask/attribute
714         checks here. 
716 2009-11-22  Miguel de Icaza  <miguel@novell.com>
718         * file-io.c: Surface a smart FindFirst/FindNext/FindClose API to
719         the managed world.
721         * icall-def.h: New entry points.
722         
723 2009-11-19  Mark Probst  <mark.probst@gmail.com>
725         * process.c: Don't put references to managed objects into a
726         g_ptr_array.
728 2009-11-18  Sebastien Pouliot  <sebastien@ximian.com>
730         * class.c (can_access_internals): Allow CoreCLR to participate in
731         allowing (or not) [InternalsVisibleTo] between assemblies.
732         * security-core-clr.c|h: Make sure that only trusted code (a 
733         superset of platform code) can access the internals of platform
734         code.
736 Mon Nov 16 16:28:11 CET 2009 Paolo Molaro <lupus@ximian.com>
738         * reflection.c: use the correct base class to get the virtual method
739         "get_UnderlyingSystemType" and speed up the icall. Fixes bug #555013.
741 2009-11-16  Sebastien Pouliot  <sebastien@ximian.com>
743         * security-core-clr.c (get_caller_no_reflection_related): 
744         [Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
745         it's still reflection and must be filtered correctly.
747 2009-11-16  Mark Probst  <mark.probst@gmail.com>
749         * object.c (compute_class_bitmap): Fix for large bitmaps.
751 2009-11-15  Zoltan Varga  <vargaz@gmail.com>
753         (mono_gc_get_suspend_signal): Fix the build with a system libgc.
755         * boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
756         koush@koushikdutta.com). Disable GC_no_dls on android.
758 2009-11-12  Mark Probst  <mark.probst@gmail.com>
760         * sgen-gc.c (find_tlab_next_from_address): Handle the case where
761         tlab_next points outside the TLAB because the allocator was
762         interrupted.
764 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
766         * reflection.c (mono_image_module_basic_init): Handle exceptions correctly.
768 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
770         * object-internals.h: Change signature for mono_string_to_utf8_image.
772         * object.c (mono_string_to_utf8_image): Change signature to take a MonoError
773         argument.
775         * reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
776         exceptions due to mono_string_to_utf8.
778 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
780         * object-internals.h: Change signature for mono_string_to_utf8_mp.
782         * object.c (mono_remote_class): Make sure all resources are released before
783         raising an exception.
785         * object.c (mono_print_unhandled_exception): Avoid raising an exception.
787 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
789         * mono-perfcounters.c (network_get_impl): Change variable initialization
790         ordering to fix potential memory leak in case of exceptions.
792         * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
793         encoded strings.
794         
795 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
797         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
798         variable initialization ordering to fix potential memory leak in case
799         of exceptions.
801 2009-11-09  Zoltan Varga  <vargaz@gmail.com>
803         * icall.c (mono_ArgIterator_Setup): Remove the MONO_ARCH_REGPARMS stuff, its not
804         needed.
806 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
808         * appdomain.c: Fix shadow path code to better deal with exceptions.
810 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
812         * appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
813         exception in the middle of the runtime code.
815 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
817         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
818         leak memory with broken envvar value.
820 2009-11-06  Mark Probst  <mark.probst@gmail.com>
822         * reflection.c (mono_reflection_setup_internal_class): Because
823         nested classes are not added to the name cache, we must put them
824         in the reflection_info_unregister_classes list.
826 2009-11-05  Sebastien Pouliot  <sebastien@ximian.com>
828         * class.c: When CoreCLR is enabled don't call mono_init_com_types
829         if MONO_CLASS_IS_IMPORT return true unless the type reside in 
830         platform (trusted) code. Instead we return a TypeLoadException to
831         be thrown later. This is the exception thrown by Silverlight 2 if
832         a type, inside application (user) code is marked with [ComImport]
834 2009-11-05  Zoltan Varga  <vargaz@gmail.com>
836         * icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
837         mono_is_debugger_attached () too.
839         * mono-debug.c (mono_is_debugger_attached): New helper function.
840         (mono_set_is_debugger_attached): Ditto.
842 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
844         * object-internals.h: Add mono_string_to_utf8_checked.
846         * object.c: Implement mono_string_to_utf8_checked.
848 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
850         * class.c: Add missing check for load errors after every
851         call to mono_class_setup_fields
853         Fixes #552282.
855 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
857         metadata-verify.c (verify_tables_schema): Fix the error message.
859 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
861         * metadata.c: Change event table schema to use TDOR for event type
862         as this is what it's meant to be.
864         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
865         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
866         entry.
868         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
869         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
870         rows in MONO_TABLE_GENERICPARAM.
872         Fixes #552289.
874 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
876         * class.c (mono_image_add_to_name_cache): Assert on duplicate
877         insertion.
879         * reflection.c (mono_reflection_setup_internal_class): Avoid
880         registering a gc root the same MonoClass multiple times.
881         Don't register nested types on the global scope as they should
882         not be available there.
884 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
886         * culture-info-tables.h: regenerated.
888 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
890         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
892 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
894         * string-icalls.c|h: Remove string internal calls that are not 
895         used anymore by the class libraries.
896         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
897         which is not used in the class librairies.
898         * icall-def.h: Update tables.
900 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
902         * class.h: Move mono_class_inflate_generic_type_checked...
904         * class-internals.h: to here and make it internal. We don't want to
905         further expose MonoGenericContext. 
907 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
909         * verify.c (mono_method_verify): Improve error message.
911 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
913         * reflection.c (fieldref_encode_signature): If field_image is NULL then
914         the token is already properly encoded. Fixs 4.0 build.
916 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
918         * locales.c (construct_number_format): Check if the number index is
919         valid before trying to use it, if not, just return.
920         
921 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
923         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
924         since that loses the abort state. Fixes #539394.
926 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
928         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
929         explicit this argument to the call signature.
930         (mono_marshal_get_icall_wrapper): Ditto.
932 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
934         * reflection.c (fieldref_encode_signature): Add new field_image parameter
935         to indicate which assembly to use when resolving a custom-mod.
937         Fixes handling of volatile fields used across assemblies as reported in #551513.
939 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
941         * loader.c: Improve error messages.
943 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
945         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
946         of interfaces. Fixes IKVM.
948         * class.c (mono_class_setup_vtable_general): Improve debug spew.
950 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
952         * verify.c (verifier_inflate_type): Return the inflated type on success.
954 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
956         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
958         * threads.c (mono_thread_attach): Call the profiler thread start callback.
960         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
962         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
963         flag set.
965         * profiler.c: Add new profiler callbacks for runtime invoke.
967         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
969 2009-11-01  Mark Probst  <mark.probst@gmail.com>
971         * sgen-gc.c: Keep track of the reason for a major collection and
972         write it to the heap-dump file.
974 2009-10-31  Miguel de Icaza  <miguel@novell.com>
976         * threads.c: refactor the code that initializes the
977         thread_start_args into a reusable function and use this in the two
978         methods that start up threads.
980 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
982         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
983         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
985 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
987         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
988         Until now, we only had the per-cpu(core) counters.
990 2009-10-28  Mark Probst  <mark.probst@gmail.com>
992         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
993         mono_gc_get_suspend_signal(), which returns the suspend signal
994         number used by the GC.
996 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
998         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
1000         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
1001         signalling start_notify.
1003 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
1005         * appdomain.c: do not test the st_mode field for shadow-copies.
1006         Fixes bug #545276.
1008 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
1010         * threadpool.[ch]: added hooks for thread start/finish and item
1011         processing begin/end. For monotouch use only.
1013 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
1015         * threads.c (mono_thread_get_name): New helper function.
1017         * reflection.c (resolve_object): Set handle_class for strings too.
1018         (mono_reflection_create_custom_attr_data_args): New helper function to decode
1019         a cattr blob into a set of arrays and structures without creating the custom
1020         attributes themselves.
1021         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
1023         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
1025         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
1026         function.
1028 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1030         * verify.c: Replace calls to mono_class_inflate_generic_type with
1031         mono_class_inflate_generic_type_checked. Fixes #480005.
1033 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1035         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
1036         object since not all paths lead to callees initing it.
1038 2009-10-23  Alp Toker  <alp@nuanti.com>
1040         Fix embedding API breakage from r144688. mono-compiler.h is an internal
1041         header and should not be shipped:
1043         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
1044         which is specific to the mono build. Not going to work.
1046 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
1048         * security-manager.c: Report if core-clr is active from
1049         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
1050         to allow Moonlight BCL to behave appropriately (both in browser
1051         and outside, e.g. smcs)
1053 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1055         * mono-config.c: ignore UTF-8 BOM and report parser errors.
1056         Fixes bug #549108.
1058 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1060         * class.c: fix typo.
1062 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
1064         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
1065         a MonoError parameter.
1067         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
1068         version that can does proper error handling.
1070         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
1072         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
1074         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
1076 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
1078         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
1079         NO_UNALIGNED_ACCESS is defined.
1081 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
1083         * marshal.c (mono_string_builder_to_utf16): Applied patch from
1084         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
1085         Fixes #549173.
1087 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1089         * sgen-gc.c: Shorten sections whenever possible.
1091 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1093         * sgen-gc.c: Use our portable semaphore #defines.
1095 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1097         * sgen-gc.c: A debug option for dumping the heap layout to a file
1098         after each collection.
1100 2009-10-21  Mark Probst  <mark.probst@gmail.com>
1102         * sgen-gc.c: Make managed write barriers atomic via
1103         thread-restarts.
1105 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
1107         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
1108         methods. Fixes #543021.
1110 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
1112         * socket-io.[ch]: fix VS build.
1114 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
1116         * icall-def.h:
1117         * socket-io.[ch]: implemented SendFile.
1119 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
1121         * class.c (mono_class_create_from_typedef): Initialize class->element_class
1122         before the interfaces to avoid crashes later if class initialization fails.
1123         Fixes #548417.
1125         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
1126         Fixes #548276.
1128 2009-10-20  Marek Safar  <marek.safar@gmail.com>
1130         * domain.c: Bump 4.0 version.
1132 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
1134         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
1135         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
1136         check since 'pubkey' can't be NULL at this stage
1137         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
1138         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
1139         initialization of 'iter'
1141 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
1143         * cominterop.c : Search the interface parts of vtable to find 
1144           method matches.  Fixes 547030.
1146         Code is contributed under MIT/X11 license.
1148 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
1150         * marshal.c: BeginInvoke cannot be called on multicast delegates with
1151         multiple targets. Fixes bug #574426.
1153 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
1155         * profiler.h: Put here the definition of
1156         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
1157         (and fix the build...).
1159 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
1161         * profiler.c, profiler.h, profiler-private.h:
1162         Added support for different ways of getting call chains in stat mode.
1164 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1166         * object.c, object-internals.h: New function for computing the
1167         size of an array, factored out of mono_array_new_full().  Use
1168         SGen's functions for allocating arrays and vectors.
1170         * sgen-gc.c, gc-internal.h: Special functions for allocating
1171         arrays and vectors without race conditions.  A managed array
1172         allocator method.
1174         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
1176 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1178         * object.c, object.h, icall.c: Write barriers do the copying now,
1179         as well, so no need for an additional memcpy.
1181         * sgen-gc.c: Lock when storing remsets.  Do the memory
1182         copying/moving in the write barriers.
1184         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
1186         * reflection.c: Added an assert.
1188 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1190         * threads.c, process.c: A few missing write barriers.
1192 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
1194         * mono-perfcounters.c, mono-perfcounters-def.h: Add
1195         network performance counters for bytes sent per second, bytes
1196         received per second, and bytes total per second.
1198         Code is contributed under MIT/X11 license.
1200 2009-10-09  Mark Probst  <mark.probst@gmail.com>
1202         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
1203         Fix warning.
1205 2009-10-09  Mark Probst  <mark.probst@gmail.com>
1207         * threads.c, object-internals.h, object.c: Move code for
1208         transferring an object to a different domain (via
1209         serialization/remoting) to object.c.
1211         * object.c (call_unhandled_exception_delegate): If the exception
1212         is in a different domain than the delegate, transfer the exception
1213         to that domain.
1215 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
1217         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
1218         Fixes #322934.
1220 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
1222         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
1224 2009-10-06  Mark Probst  <mark.probst@gmail.com>
1226         * object.c (mono_method_return_message_restore): Handle the case
1227         where the argument is an instance of a generic type.  Fixes
1228         #544446.
1230 2009-10-06  Mark Probst  <mark.probst@gmail.com>
1232         * object.c (set_value): Write barrier fix - we must pass the
1233         count, not the size.
1235 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
1237         * domain.c (mono_init_internal): Print a useful error message when encountering
1238         an old mscorlib, instead of crashing. Fixes #544307.
1240 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
1242         * appdomain.c (copy_app_domain_setup): Fix a warning.
1244         * debug-helpers.c (dis_one): Ditto.
1246 2009-10-04  Mark Probst  <mark.probst@gmail.com>
1248         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
1249         into the new domain, instead of referencing the original one.
1251         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
1252         non-static.
1254         * appdomain.c: Corlib version bump.
1256 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1258         * threadpool.c: one more...
1260 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1262         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
1263         threads to die because we're shutting down. delgate5.exe works again.
1265 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
1267         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
1268           ccw_interface_hash table when a ccw is finalized.
1270         Code is contributed under MIT/X11 license.
1272 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1274         * assembly.c, domain.c, image.c, metadata-internals.h: Split
1275         domain and image unloading into two steps.  We must do this
1276         because clearing the domain in SGen requires the class metadata to
1277         be intact, but we need to free the mono_g_hash_tables in case a
1278         collection occurs during domain unloading and the roots would trip
1279         up the GC.
1281 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1283         * object-internals.h: Remove serialized culture fields from
1284         MonoInternalThread.
1286         * icall-def.h, thread-types.h, threads.c: Remove serialized
1287         culture icalls.
1289         * appdomain.c: Corlib version bump.
1291 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
1293         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
1294         Fixes #543133.
1296 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1298         * sgen-gc.c: Try to shorten the new section after a major
1299         allocation to avoid ever-growing sections.
1301 2009-10-13  Martin Baulig  <martin@ximian.com>
1303         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
1304         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
1305         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
1306         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
1308         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
1310 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
1312         * threadpool.c: fixed the order in which 'completed' and the wait
1313         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
1314         No need to use the wait_handle field of ASyncCall. Make sure the
1315         threadpool is active when adding a job or queueing an idle thread.
1317 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
1319         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
1321         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
1322         when using --compile-all.
1324 2009-09-27  Mark Probst  <mark.probst@gmail.com>
1326         * metadata.c (free_generic_class): Unregister the field_objects
1327         roots if we're using SGen.
1329 2009-09-27  Mark Probst  <mark.probst@gmail.com>
1331         * reflection.c (mono_dynamic_image_free): Deregister the GC root
1332         for GenericParamTableEntry.gparam.
1334 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1336         * marshal.c: don't create the handle when calling. It is created later
1337         if needed.
1339 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1341         * sgen-gc.c: Warning fixes.
1343 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1345         * sgen-gc.c: New debug option "xdomain-checks", which scans the
1346         whole heap for cross-domain references before each collection.
1348         * sgen-scan-object.h: The scan action can now use SCAN to scan the
1349         object.
1351         * threadpool-internals.h, threadpool.c: New function
1352         mono_thread_pool_is_queue_array() for checking whether a given
1353         array is used as a (cross-domain) queue by the thread pool code.
1355 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1357         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
1358         searches the whole heap for objects containing a specific
1359         reference.  Only for debugging.
1361 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1363         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
1365         * icall-def.h, threads.c, threads-types.h: New icalls for copying
1366         byte arrays between domains.
1368 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1370         * threadpool.c:
1371         * class-internals.h:
1372         * mono-perfcounters-def.h:
1373         * mono-perfcounters.c:
1374         -There is a list of idle threads
1375         -Each of those idle threads wait on their own WaitHandle instead
1376         of all of them using the same semaphore. When a new work item is
1377         added, the job is assigned directly to an idle thread or a newly
1378         created one if possible and then the handle for that thread is
1379         signaled. Compare that to the current approach where all the
1380         threads in the pool compete to dequeue a job from the same
1381         queue.
1382         -New struct ThreadPool that brings together the bunch of static
1383         variable for each threadpool (IO and regular).
1384         -New performance counters: # of items added and its rate per
1385         threadpool. The rate will be used later, perhaps together with
1386         other perf. counters, to decide when idle threads should exit.
1388 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
1390         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
1391         Fix typo on Windows build.      
1392         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
1393         
1394         Code is contributed under MIT/X11 license.
1396 2009-09-25  Mark Probst  <mark.probst@gmail.com>
1398         * object-internals.h: The Thread class is split up into Thread and
1399         InternalThread now.  We have exactly one InternalThread per
1400         thread, and at most one Thread per appdomain per thread.  Most
1401         data is stored in InternalThread.  All InternalThread objects live
1402         in the root domain.
1404         * class-internals.h: Add internal_thread_class to MonoDefaults.
1406         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
1407         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
1408         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
1409         resulting from the split of the Thread class.
1411         * gc-internal.h: Prototype for new function for checking whether a
1412         thread is the finalizer thread.
1414         * appdomain.c: Corlib version bump.
1416 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
1418         * appdomain.c|h: Add a mono_domain_try_unload method which is
1419         equivalent to mono_domain_unload, except that it returns an exception
1420         instead of throwing it. Make mono_domain_unload use the
1421         mono_domain_try_unload method to avoid code-duplication.
1423 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
1425         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
1426         a problem.
1428 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
1430         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
1431         aborting when a conversion is not implemented.
1433 2009-09-23  Miguel de Icaza  <miguel@novell.com>
1435         * verify.c: when comparing culture strings, use g_ascii_strcmp
1437         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
1438         when comparing public key tokens to use memcmp on 16 bytes.   I do
1439         not believe this ever worked as advertised in the past.
1441         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
1442         which would have always failed earlier.
1444 2009-06-25  Miguel de Icaza  <miguel@novell.com>
1446         * gc.c: Raise a NullArgumentException if the object passed is
1447         null.
1449 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
1451         * image.c (mono_image_close): Atomically decrement the reference count and
1452         remove the image from the hash tables, to prevent another thread from seeing a
1453         dying MonoImage. Fixes #541194.
1455 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1457         * threadpool.c: actually use the minimum number of 'completion ports'
1458         (for us is just a potential worker thread).
1460 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1462         * threadpool.c: remove ares_htable. It does not make sense any more
1463         since the same objects are now stored in GC-tracked arrays while they are
1464         in the queue.
1466 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1468         * threadpool.c: increase the minimum length of the queues to 128.
1469         Remove warning.
1471 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
1473         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
1474         return the modified signature used by string ctors.
1476 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
1478         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
1479         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
1480         method, to be used by full-aot.
1482 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
1484         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
1485         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
1486         be known to be good.
1488         * class.c (mono_class_init): Fail array types if their element type fails initialization
1489         as well.
1491         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
1492         initialization, additionally we request the element_type vtable to be initialized as well.
1494         This is fine and should not increase the working set in any meaningful way since it's reasonable
1495         to assume       that most code will create an array and eventually populate it, which will require the
1496         type's vtable to be initialized.
1498         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
1500 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
1502         * normalization-tables.h : regenerated.
1504 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
1506         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
1507         a leb128 encoding can take up to 5 bytes.
1509 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
1511         * class.c (verify_class_overrides): Remove useless argument.
1513         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
1514         before interface enumeration as this is no longer required.
1516 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
1518         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
1519         used under mono_class_init context. This functions avoid any code path that
1520         calls mono_class_init, which leads it to be slow as some things like the interface
1521         bitmap are not available.
1523         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
1524         of it's own broken version. Fixes the verifier part of #538588.
1526         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
1527         API.
1529 2009-09-15  Mark Probst  <mark.probst@gmail.com>
1531         * class.c (mono_class_init): Always set an exception in a class if
1532         vtable setup fails.  Fixes #538577.
1534         * generic-sharing.c: Raise an exception if mono_class_vtable()
1535         returns NULL.
1537 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
1539         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
1540         methods of vtypes, as they could be incorrectly shared with static methods
1541         taking an IntPtr argument.
1543 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
1545         * domain.c:
1546         * object.c:
1547         * class-internals.h: renamed waithandle_class to
1548         manualresetevent_class.
1549         * marshal.c: propagate the exception if a remoting BeginInvoke call
1550         fails.
1552 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1554         * object.c: Properly handle vtable failures.
1556 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1558         * socket-io.c: Assert on vtable failure.
1560         * mono-mlist.c: Assert on vtable failure.
1562 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1564         * marshal.c: Assert on vtable failure.
1566 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1568         * icall.c: Properly handle vtable failures.
1570 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1572         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
1574 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1576         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
1578         * console-unix.c (do_console_cancel_event): Same.
1580 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1582         * class-internals.h: Add mono_class_vtable_full function that allows control
1583         if an exception should be raised or not.
1585         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
1586         to do what its documentation say, that is to return NULL and set exception_type on
1587         failure.
1589         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
1590         and change the code to honor it.
1592 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1594         * verify.c: Fix typo in error message.
1596 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
1598         * security-core-clr.c: Fix default_platform_check so it can run
1599         the runtime coreclr tests (without an infinite recursion when
1600         throwing an exception).
1602 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1604         object.c (mono_delegate_ctor_with_method): Guard against null method.
1606 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1608         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
1609         that should be replaced with error handling later.
1611 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1613         * marshal.c (mono_delegate_end_invoke): Fix warning.
1615 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1617         * loader.c (mono_field_from_token): Properly handle invalid
1618         dynamic tokens.
1620 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1622         * pedump.c (verify_image_file): Skip types that can't be
1623         decoded.
1625 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1627         * verify.c: Look for recursive valuetypes only against the
1628         type been initialized as this is a lot simpler and works.
1630 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1632         * verify.c: Ensure that fields are properly loaded before
1633         checking them.
1635 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
1637         * object.c (mono_object_get_virtual_method) : Call 
1638           mono_cominterop_get_invoke if the object is a COM object.
1640         Code is contributed under MIT/X11 license.
1642 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
1644         * verify.c: Check for recursive valuetype definitions.
1646 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
1648         Use inheritance-aware interface offsets. Inherited types use the same offsets
1649         of their parents. This reduce offset duplication in case more than one type in
1650         the inheritance tree explicitly implements the same interface.
1652         This also removes a source of vtable bubbles found in #532409. An abstract type
1653         isn't required to provide abstract methods to all interfaces it implements, which
1654         resulted in a bubble with the previous scheme as the child would get a non-full
1655         vtable from its parent. We fail all concrete types with vtable bubbles, so this
1656         should be fixed.
1658         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
1659         it's expected to not cause any significant increase beyond that.
1661         * class.c (setup_interface_offsets): Compute super class iface offsets
1662         first to force sharing.
1664         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
1665         dumping only the relevant ones.
1667         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
1668         methods a new slot regardless if they belong to an interface or not. This allows
1669         an inherited type to override the iface method separately from the class one.
1671 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
1673         * threadpool.c: make the Sleep() alertable to prevent delays exiting
1674         applications that take less than 2s to execute.
1675         Bug #524984 fixed.
1677 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
1679         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
1681         * object.c (mono_get_runtime_callbacks): New helper function to return
1682         the runtime callbacks.
1684         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
1685         mono_get_runtime_build_info () as the display name.
1686         
1687 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
1689         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
1690         argument, since NEWARR expects a native int. Fixes #481559.
1692 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
1694         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
1695         against broken SRE methods.
1697 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
1699         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
1700         a NULL variable. Abort early on failure.
1702 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
1704         * class.c (can_access_type): Fail visibility test for non nested
1705         types with nested visibility.
1707 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
1709         * assembly.c (parse_public_key): Avoid allocating (and not 
1710         freeing) the public key array when it's not requested by the 
1711         caller.
1712         * threads.c (mono_thread_manage, mono_thread_create_internal, 
1713         ves_icall_System_Threading_Thread_Thread_internal): Free 
1714         allocated memory on error.
1716 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
1718         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
1720 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
1722         * class.c (mono_class_setup_fields): Remove duplicated local variable
1723         named gklass.
1724         Rename gklass to gtd to reflect the fact that it points to the generic
1725         type definition.
1726         Remove the duplicated call to mono_class_setup_fields on gtd and move
1727         the error check to the beginning.
1729 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
1731         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
1732         Remove cruft of the previous patch.
1734 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1736         * metadata-verify.c (verify_method_table): Check for abstract + final.
1737         Fixes #534175.
1739 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1741         * verify.c (verify_class_fields): Check for duplicate fields.
1743 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1745         * metadata-verify.c: Verify the typeref table for duplicates.
1747 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1749         This reverts r140936 and properly handles interfaces with static methods. The
1750         right fix is to ensure vtables without bubles which is an easier to verify
1751         constraint. We should avoid such special cases as of the reverted patch as those
1752         only make the runtime more brittle.
1754         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
1755         static methods on interfaces.
1757         * class.c (setup_interface_offsets): Use the number of virtual methods when
1758         calculating interface offsets instead of the number of methods. This way we
1759         avoid bubles on the layout.
1761 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
1763         * metadata-verify.c (verify_metadata_header): Some very smart
1764         obfuscators like to add extra stream headers. Ignore them.
1766 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
1768         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
1769         methods correctly.
1771 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
1773         * metadata-verify.c: Verify for duplicated types.
1775 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
1777         * metadata-verify.c (verify_typedef_table): Verify for nested types
1778         without an entry on the nested class table.
1780 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
1782         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
1783         <tom_hindle@sil.org>. Add locking around hash table accesses.
1785 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1787         * verify.c (mono_verifier_verify_class): Verify all interface if
1788         really are interfaces. Fixes #534184.
1790 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
1792         * pedump.c: Initialize all types during metadata validation so we report
1793         errors only detected as part of class initialization.
1795 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
1797         * metadata-verify.c (verify_method_table): PInvoke requires method to
1798         be static. Fixes #534189
1800 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
1802         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
1803         being NULL.
1805 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1807         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
1808         for holes or bad methods. Fixes #525314.
1810 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1812         * class.c (setup_interface_offsets): Don't allocate slot
1813         for the same interface multiple times. This creates bubbles
1814         that waster space and make vtable verification harder.
1816         The same interface get a slot multiple times since we need
1817         to get the closure of all implemented interfaces, which means
1818         the same interface is reported multiple times.
1820 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1822         * verify.c (mono_verifier_verify_class): Don't check the fields
1823         of generic instances since the context on which they got expanded
1824         might lead to false positives.
1826         Such thing happens when a generic type is inflated in the context
1827         of a generic method and the inflated type of a field turns into a
1828         generic method argument, which causes the checking code to think
1829         it's an invalid class when it's not.
1831 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1833         * verify.c (mono_type_is_valid_in_context): Verify if type
1834         is NULL and remove duplicate test.
1836 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1838         * verify.c (mono_verifier_verify_class): Check fields for
1839         invalid generic arguments.
1841 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1843         * class.c (verify_class_overrides): Verify if for static
1844         and non virtual methods.
1846 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1848         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
1849         Check for errors after retrieving the vtable.
1851 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1853         * class.c (mono_class_setup_vtable_general): Verify
1854         if method overrides are valid before processing them.
1856 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1858         * marshal.c (mono_array_to_lparray): Fix minimal build with
1859         cominterop disabled.
1861         * marshal.c (mono_free_lparray): Same.
1863 2009-08-21  Mark Probst  <mark.probst@gmail.com>
1865         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
1866         the hash function for the ares_htable.
1868 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
1870         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
1871         bit for assembly flags. MS is ok with it but there is no spec anywhere
1872         on its mean
1874 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1876         * class.c (mono_class_create_from_typedef): Emit profiler events
1877         in all cases.
1879 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1881         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
1882         Release memory on failure.
1884 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1886         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
1887         to the internal API.
1889         * metadata.c (get_constraints): Use a single-linked table as we don't
1890         traverse it backward. Fail and return FALSE if only of the contraint types
1891         is not found.
1893         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
1894         to mono_metadata_load_generic_param_constraints except for having a return value.
1895         This has to be done since the later is part of the public API.
1897         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
1898         and fail the type.
1900         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
1901         and fail the method.
1903 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1905         * metadata-verify.c (is_valid_method_header): Add work-around to deal
1906         with MS broken behavior of emmitting EH section sizes without the
1907         header size added.
1909 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1911         * metadata.c (mono_type_create_from_typespec): Don't allocate image
1912         memory until we're sure that we'll need it. This avoids leaking for
1913         broken types or duplicated instantiation.
1915 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1917         * metadata-verify.c (is_valid_method_header): Fix stupid formating
1918         mistake.
1920 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1922         * metadata-verify.c (is_valid_method_header): Fix number of clauses
1923         and expected size calculation.
1925 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1927         * class.c (mono_class_get_field_idx): Add fixme for broken
1928         behavior for types with multiple fields with the same name.
1929         I would rather fix it, but have no idea on how to generate
1930         such artifact for testing.
1932 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1934         * verify.c (verifier_load_field): We should allow references to
1935         fields to be made using the generic type definition. It's up to
1936         the loader system to fail invalid ops.
1938         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
1939         are invalid.
1941 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1943         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
1945         * metadata-internals.h: Fix declaration of 
1946         mono_metadata_interfaces_from_typedef_full.
1948         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
1949         heap_alloc_result parameter that controls if the result should be
1950         g_malloc'd.
1952         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
1953         array be g_malloc'd and properly document this public API function.
1955 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1957         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
1958         remove METHOD_HEADER_TINY_FORMAT1.
1960         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
1962         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
1964         Both spec and MS uses only 2 bits to enumerate the kind of header.
1965         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
1966         is superfluous, only used for tiny headers with odd code lengths.
1968         This change also make sure that mono doesn't wronly interpret bit 2
1969         of fat header flags, which is currently reserved.
1971 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1973         * metadata.c (do_mono_metadata_parse_type): Do error
1974         checking for element types. Don't abort if presented
1975         with a broken type kind.
1977 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1979         * metadata.c (mono_metadata_parse_method_signature_full):
1980         Gracefully fail bad vararg signatures.
1982 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1984         * profiler.c:
1985         * class.c: Fix warnings for uninitialized variables.
1987 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1989         * icall.c: Fix _NSGetEnviron method declaration warning.
1991 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1993         * icall.c:
1994         * reflection.c: Make bitwise checks explicit.
1996 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1998         * debug-helpers.c:
1999         * marshal.c: Fix printf warnings.
2001 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
2003         * reflection.c (encode_cattr_value): Fix a warning.
2005 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2007         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
2008         of array bounds.
2010 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2012         * loader.c (mono_method_signature): Don't assert on broken
2013         signature. Print a more useful error message.
2015 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2017         * loader.c (mono_method_get_marshal_info): Assert if
2018         signature is invalid. Bounds check stores to the
2019         mspecs array;
2021 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2023         * loader.c (field_from_memberref): Fix warning.
2025 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2027         * loader.c (mono_method_get_param_names): Check if signature
2028         is null. Don't store beyond the size of the name array.
2030 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2032         * loader.c (mono_get_method_constrained): Check if signature
2033         is null.
2035 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2037         * loader.c (mono_loader_set_error_bad_image): Improve
2038         error messages.
2040 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2042         * loader.c (mono_get_method_full): Convert an assertion
2043         into a loader error.
2045 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2047         * class-internals.h, class.c: Better naming and documentation.
2049 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
2051         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
2052         obj is NULL.
2054 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2056         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
2057         parsing fails.
2059 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2061         * loader.c (mono_loader_error_prepare_exception): Handle missing field
2062         errors with no class set.
2064         * loader.c (field_from_memberref): If the field signature is of the wrong
2065         type fail with a MissingFieldException instead of a BadImageException as
2066         this is the behavior observed on MS. 
2068 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2070         * loader.c (field_from_memberref): Don't crash if either the field
2071         signature or the typespec class are invalid.
2073 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2075         * verify.c (verifier_load_field): Don't allow field related
2076         ops to reference fields on generic type definition.
2078 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2080         * metadata-verify.c: Add new warning level for errors specified
2081         by ECMA 335 but that MS ignores.
2083         * metadata-verify.c (verify_method_table): Make compiler controled
2084         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
2085         this check is safe because the end result will only be some visibility
2086         exceptions been thrown.
2088 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2090         * verify.c (get_boxable_mono_type): Don't allow the
2091         use of the generic type definition on boxed type positions.
2093         Fixes #531237.
2095 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2097         * threadpool.c: Make sure no cross-domain references remain in
2098         ares_htable or the arrays that are thrown away when resizing.
2100 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2102         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
2103         list of classes for which we have to unregister reflection_info
2104         with the GC and which are not in the namespace cache.
2106         * reflection.c (mono_reflection_initialize_generic_parameter): Add
2107         the class to the list.
2109 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2111         * domain.c (mono_domain_free): Unregister the GC roots in
2112         MonoDomain.
2114 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
2116         * reflection.c (mono_reflection_type_get_handle): Fix typo.
2118 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
2120         * class.c: Add mono_class_get_field_from_name_full which does
2121         the same as mono_class_get_field_from_name but does check field
2122         signature as well.
2124         * class-internals.h: Export mono_class_get_field_from_name_full as
2125         part of the internal API.
2127         * loader.c (field_from_memberref): Search fields by name and signature
2128         as it's valid to have two fields with same name but different types.
2130         Fixes #528055.
2132 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
2134         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
2136         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
2138         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
2139         System.Type.
2141 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
2143         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
2145         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
2147 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2149         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
2150         to sgen-scan-object.h, which can be included and parameterized via
2151         macros.
2153         * Makefile.am: sgen-scan-object.h added.
2155 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2157         * gc.c: #define GC_dont_gc if we're compiling with SGen.
2159 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2161         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
2162         before clearing a domain in the GC.
2164 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2166         * exception.c (mono_exception_from_name_domain): Actually create
2167         the exception in the specified domain.
2169         * appdomain.c (mono_domain_create_appdomain_internal): Create the
2170         OutOfMemoryException a bit later so that the domain is inialized
2171         "enough" that it works.
2173 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2175         * threads.c (thread_cleanup): Clean up the cached_culture_info
2176         array to prevent cross-domain references.
2178 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
2180         * metadata.c: more documentation for MonoType accessors.
2182 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
2184         Fix incorrect size definitions where the tail array isn't a list
2185         of pointers
2186         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
2187         define size.
2188         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
2189         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
2190         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
2192 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2194         * reflection.h:
2195         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
2197 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2199         * metadata.c:
2200         * loader.c:
2201         * metadata-internals.h:
2202         * method-builder.c:
2203         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
2205 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2207         * cominterop.c:
2208         * metadata.c:
2209         * metadata.h:
2210         * loader.c:
2211         * marshal.c:
2212         * reflection.c: #define for sizeof in MonoType and
2213         MonoMethodSignature.
2215 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2217         * domain.c:
2218         * domain-internals.h: add and use #define's instead of sizeof()
2219         for MonoJitInfo and MonoJitInfoTable.
2221 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2223         * object.c:
2224         * class.h: use #define instead of sizeof() for MonoRemoteClass.
2226 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
2228         * metadata.c:
2229         * metadata.h:
2230         * object.c:
2231         * class-internals.h:
2232         * generic-sharing.c:
2233         * marshal.c: use a #define instead of sizeof() for a few
2234         structures that use a zero-length array.
2236 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
2238         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
2239         to handle inflated generic methods.
2241         * appdomain.c: Bump corlib version.
2243         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
2244         instances.
2246         * reflection.c (fixup_method): Same
2248         * reflection.c (resolve_object): Same.
2250         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
2251         g_error and a decent message.
2253 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
2255         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
2256         from the object because it could not yet be available globally
2257         (it happens if the profiler tries to create a gchandle on the
2258         MonoThread object of a thread that is still registering itself
2259         with the runtime).
2261 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
2263         * reflection.c (mono_generic_class_get_object): Initialized the
2264         managed type arguments array.
2266         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
2268         * appdomain.c: Bump corlib version.
2270 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
2272         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
2273         #527902.
2275 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
2277         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
2278         Avoid a crash if synch_cs is not set.
2279         
2280         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
2281         Handle the case when the handle is 0.
2283         * appdomain.c: Bump corlib version.
2285 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
2287         * reflection.c (mono_type_get_object): Fix a warning.
2289 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2291         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
2292         descriptor here.  We assume it's already been computed.
2294         * generic-sharing.c (instantiate_other_info): Compute the GC
2295         descriptor for info type MONO_RGCTX_INFO_KLASS.
2297 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2299         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
2300         type, so don't use MONO_OBJECT_SETREF to set a field.
2302 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2304         * gc.c: We were missing one case where invoking a finalizer would
2305         not reset the domain.  Also, in the finalizer thread loop, assert
2306         that we're in the root domain.
2308 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2310         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
2311         if the type is not an array.
2313 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2315         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
2316         method bound to the declaring type of the method. Raise an exception
2317         if the type is not a generic param.
2319 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2321         * class.c (print_unimplemented_interface_method_info): Print the
2322         full type name.
2324         * class.c (mono_class_setup_vtable_general): When dealing with a
2325         generic instance first check if the generic type definition is
2326         not broken.
2328 2009-02-11 Tom Hindke <tom_hindle@sil.org>
2330         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
2332         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
2334         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
2336         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
2338         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
2340         Code is contributed under MIT/X11 license
2342 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
2344         * verify.c: Fix naming of stelem and ldelem.
2346 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2348         * generic-sharing.c: Replace the templates lock with the loader
2349         lock because of very hard to resolve deadlock issues.
2351 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
2353         * icall.c (ves_icall_Type_GetMethodsByName): Use 
2354         mono_class_get_vtable_size () instead of accessing klass->vtable_size
2355         directly. Fixes #525338.
2357         * class.c (mono_class_get_vtable_size): New helper function.
2359         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
2360         the field belongs to the type. Fixes #525733.
2362 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2364         * sgen-gc.c: When we stop a thread and its stack top is not within
2365         its allocated stack (because it's in an altstack signal handler),
2366         restart it and stop it again, until it is.
2368 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2370         * sgen-gc.c: Take a thread's stack top and registers from the
2371         sigcontext in the suspend signal handler.
2373         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
2374         stuff to sgen-archdep.h.
2376         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
2377         caller, because have code in sgen-archdep.h to acquire that data.
2379 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
2381         * profiler.c, profiler.h, profiler-private.h:
2382         Added support for keeping track of code chunks and buffers.
2384 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
2386         * metadata-verify.c: Fix endianness problems on decoding functions.
2387         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
2389 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2391         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
2392         schema for vectors and one dimension SZARRAY.
2394 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2396         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
2397         schema for vectors and one dimension SZARRAY.
2399 2009-07-27  Mark Probst  <mark.probst@gmail.com>
2401         * icall-def.h, thread-types.h, threads.c: New separate icalls for
2402         Interlocked.(Compare)Exchange with object arguments, which invoke
2403         write barriers.
2405 2009-07-26  Miguel de Icaza  <miguel@novell.com>
2407         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
2408         passed invalid arguments.   Fixes another crasher in the
2409         Silverlight test suite.
2411         * class.c (mono_class_array_element_size): Return 0 for the size
2412         of the class;  This fixes the crasher exposed by :
2414         typeof (void).MakeArrayType ();
2416         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
2417         if there is no method to dereference.    Put all the code that
2418         depends on this inside the if (method) block.
2420         This fixes the crasher exposed by Microsoft's Silvelright CLR test
2421         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
2423         With this change, we pass the test.
2424         
2425         * reflection.c (mono_reflection_sighelper_get_signature_local):
2426         Only dereference the assembly if it has been set.    Fixes a
2427         crasher exposed by #525328
2429 2009-07-25  Mark Probst  <mark.probst@gmail.com>
2431         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
2432         don't perform the store in mono_gc_wbarrier_generic_nostore().
2433         Remove the second argument (value), which is not needed.
2435 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
2437         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
2438         the build.
2440         * boehm-gc.c: Ditto.
2441         
2442 2009-07-24  Mark Probst  <mark.probst@gmail.com>
2444         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
2445         not perform the store itself.  Introduce
2446         mono_gc_wbarrier_generic_nostore(), which is the same as
2447         mono_gc_wbarrier_generic_store(), except it doesn't perform the
2448         store.
2450 2009-07-24  Mark Probst  <mark.probst@gmail.com>
2452         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
2453         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
2454         we still need the memcpy().
2456 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2458         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
2459         so that big arrays are handled correctly.  Always use
2460         safe_object_get_size() to calculate array object sizes, which
2461         takes bounds into account.
2463 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2465         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
2466         GC descriptor is computed before we use it.
2468 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2470         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
2471         write barrier if necessary.
2473 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2475         * icall-def.h, icall.c, thread-types.h: New separate icall for
2476         VolatileWrite(object&,object) that uses a write barrier.
2478         * console-unix.c, file-io.c, icall.c, threads.c: Use write
2479         barriers in icalls which write to "ref" or "out" arguments.
2481 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
2483         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
2484         handler in a separate icall, to reduce the size of the wrappers.
2486 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2488         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
2490 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2492         * metadata-verify.c (parse_field): Allow byref field.
2494         * metadata-verify.c (parse_locals_signature): Allow byref locals.
2496         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
2498 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2500         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
2501         Fixes #522784.
2503 2009-07-20  Robert Jordan  <robertj@gmx.net>
2505         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
2506         Fix invalid IL in valuetype handling (STOBJ must push the
2507         corresponding class). Fixes bug #523149.
2509         Code is contributed under MIT/X11 license.
2511 2009-07-20  Geoff Norton  <gnorton@novell.com>
2513         * gc.c: Use proper semaphores where available on posix and darwin.
2515 2009-07-19  Geoff Norton  <gnorton@novell.com>
2517         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
2519 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
2521         * refletion.c (is_sre_usertype): Change name to is_usertype and
2522         invert it's result so it returns true if the type is an user type
2523         and not the opposite.
2525         * reflection.c (is_*_type): Change all of those to use new macro
2526         check_corlib_type_cached that cached the type lookup so we don't
2527         need to do string comparisons all the type. Changed the signature
2528         to take a MonoClass instead.
2530         * reflection.c: Change mono_image_create_token and resolve_object
2531         to use is_sre_* functions.
2533 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2535         * sgen-gc.c: Check for writes to the stack in the managed
2536         wbarrier as well.
2538 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2540         * sgen-gc.c: When a thread is unregistered, don't free its remsets
2541         but put them on a list which is processed with the other thread's
2542         remsets.
2544 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2546         * sgen-gc.c: Fix and enable the internal allocator instead of
2547         using malloc/free (which causes deadlocks).
2549 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2551         * refletion.c: Fix builds with SRE disabled by adding a minimal
2552         implementation of mono_reflection_type_get_handle.
2554 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2556         * refletion.c: Make mono_reflection_type_get_handle non static.
2558         * object-internals.h: Export mono_reflection_type_get_handle.
2560         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
2561         unmanaged handle using mono_reflection_type_get_handle.
2563 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2565         * refletion.c: Replace all reads of MonoReflectionType::type with
2566         calls to mono_reflection_type_get_handle. Only the functions that
2567         deal with constructing TypeBuilder::type have not been changed
2568         because they have to deal with NULL values.
2570         This is a first step into supporting reflection types that don't
2571         map directly into their unmanaged counterpart.
2573 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
2575         * metadata-verify.c (parse_locals_signature): Don't complain
2576         on signature with zero locals since MS generates it and doesn't
2577         bother with.
2579 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
2581         * reflection.c (mono_image_get_array_token): Resolve return
2582         type using mono_reflection_type_get_handle.
2584         * reflection.c (mono_image_get_array_token): Resolve array method
2585         parent type using mono_reflection_type_get_handle.
2587 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
2589         * reflection.c (mono_image_basic_init): Applied patch from
2590         <Dax@daxxfiles.net>. Set the public key token from the assembly
2591         builder. Fixes #518909.
2593         * appdomain.c: Bump corlib version.
2595 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
2597         * class.c (mono_class_needs_cctor_run): Make this return false if
2598         the class has no cctor.
2600 2009-07-13  Mark Probst  <mark.probst@gmail.com>
2602         * sgen-gc.c: When the minor GC needs to allocate a new section,
2603         invoke the major GC afterwards.
2605 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
2607         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
2608           Applying the window_style field to the SHELLEXECUTEINFO struct.
2610         Code is contributed under MIT/X11 license.
2612 2009-07-13  Mark Probst  <mark.probst@gmail.com>
2614         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
2615         locking earlier.  Fix it in the managed allocator by making sure
2616         that no thread is stopped there before the GC runs.  If we do stop
2617         a thread there, we restart it and let it run a but, until it stops
2618         somewhere else.
2620         * gc-internal.h, gc.c: Function for getting the IP from a signal
2621         context via a function registered by mini.
2623 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
2625         * object-internals.h (MonoIntPtr): New structure describing a boxed
2626         IntPtr.
2628         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
2629         returns. Fixes #519953.
2631         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
2633 2009-07-09  Mark Probst  <mark.probst@gmail.com>
2635         * class-internals.h, generic-sharing.c: New RGCTX info type for
2636         getting a remoting invoke with check wrapper.
2638 2009-07-07  Geoff Norton  <gnorton@novell.com>
2640         * icall-def.h: Fix the enable-minimal build.
2642 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2644         * object-internals.h: Add MonoReflectionDerivedType.
2646         * reflection.c: Implement support for PointerType.
2647         Fixed tons of warnings.
2649 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2651         * object-internals.h: Add MonoReflectionByRefType.
2653         * reflection.c: Implement support for ByRefType.
2655 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2657         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
2659         * object-internals.h: Add MonoReflectionArrayType and
2660         mono_reflection_create_unmanaged_type.
2662         * reflection.c: Implement support for ArrayType.
2664 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2666         * metadata-verify.c (is_valid_method_header): Parse EH block
2667         flags correctly.
2669 2009-07-03  Mark Probst  <mark.probst@gmail.com>
2671         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
2672         processing the disappearing links, and process disappearing links
2673         in a loop until no new objects are copied.
2675 2009-07-03  Mark Probst  <mark.probst@gmail.com>
2677         * object.c (handle_enum): Invoke the write barrier when copying
2678         value type instances.
2680         * sgen-gc.c: Register remsets for unmanaged write barriers only
2681         when the address written to is actually on the heap.  This makes
2682         set_value() in object.c work without requiring that the result be
2683         on the heap.
2685 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
2687         The runtime wrappers are all bound to a given type that must
2688         exist in the same image. For regular images we use the <Module>
2689         type, which is required to exist for all images.
2691         The <Module> type can't be used for dynamic images because it
2692         might not exist at the time the wrapper is required, so we create
2693         a synthetic type to use instead.
2695         The current code works because of the 2 stage setup of MonoClass,
2696         but once this is gone it will no longer work.
2698         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
2700         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
2702         * object-internals.h: Export mono_image_set_wrappers_type icall
2703         as part of the internal API.
2705         * marshal.c (get_wrapper_target_class): If the image is dynamic,
2706         use MonoDynamicImage::wrappers_type instead of the <Module> type.
2708         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
2709         image wrappers_type to the provided value.
2711 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
2713         * appdomain.c (deregister_reflection_info_roots): No need
2714         to use the image lock here.
2716 2009-07-02  Mark Probst  <mark.probst@gmail.com>
2718         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
2720 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
2722         * threads.c: Store the thread start argument in a hash table instead of
2723         registering it as a root, as libgc doesn't support unregistering roots
2724         under windows, leading to 'too many root sets' errors when many threads
2725         are created.
2727         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
2728         shutdown, they can still be referenced by the other dying objects.
2729         Fixes #514506.
2731 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2733         * socket-io.c: DontLinger does not allow LingerOptions.
2735 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2737         * metadata-verify.c: The spec doesn't mention that it's possible to add
2738         custom attribute to a generic parameter. Fixed.
2740 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2742         * class.c (inflate_generic_type): Don't crash while trying to output a message
2743         on why we're aborting.
2745 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
2747         * socket-io.c: DontLinger can take an int or a boolean too.
2749 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
2751         * gc.c: check for a null argument to SuppressFinalize () and
2752         ReRegisterForFinalize ().
2754 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2756         * loader.c (method_from_methodspec): Call into the verifier to check
2757         the signature.
2759         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
2761         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
2762         part of the internal API.
2764 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2766         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
2767         the signature.
2769         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
2771         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
2772         part of the internal API.
2774 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2776         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
2777         the signature.
2779         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
2780         blob verification.
2782         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
2783         part of the internal API.
2785 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2787         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
2788         when doing basic verification. 
2790         This check must be done since the runtime peeks into signatures in much
2791         more places than it does decoding so it makes sense to ensure that all
2792         pointers to blob objects are well formed.
2794 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2796         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
2797         Use proper overflow dectection. Fix usage of it.
2799 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2801         * loader.c (field_from_memberref): Call into the verifier to check
2802         the signature.
2804         * loader.c (mono_method_get_signature_full): Same.
2806         * loader.c (method_from_memberref): Same.
2808         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
2810         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
2811         part of the internal API.
2813 2009-06-25  Mark Probst  <mark.probst@gmail.com>
2815         * threadpool.c (mono_thread_pool_add): If the domain is unloading
2816         or unloaded, still return an AsyncResult, but don't add it to the
2817         threadpool.
2819 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2821         * threads.c: fix missing colon when DEBUG is defined.
2823 2009-06-25  Mark Probst  <mark.probst@gmail.com>
2825         * threadpool.c: Don't add new calls to a threadpool if the domain
2826         of the call is unloading or unloaded.  When dequeuing a job, null
2827         the reference in the queue.
2829 2009-06-25  Mark Probst  <mark.probst@gmail.com>
2831         * sgen-gc.c (null_link_in_range): Add the dislink for the old
2832         generation if an object was moved.
2834 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
2836         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
2837           parameters of type SAFEARRAY[VARIANT].
2839         * reflection.c (encode_marshal_blob): Properly generate element type
2840           (SafeArraySubType marshal attribute option).
2842         Code is contributed under MIT/X11 license.
2844 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
2846         * reflection.c: in mono_method_clear_object () really ensure all the
2847         objects are removed.
2849 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2851         * loader.c (mono_method_signature): Call into the verifier to check
2852         the method signature.
2854         * metadata-verify.c (verify_method_table): Move signature verification
2855         to verify_method_table_full.
2857         * metadata-verify.c: Add mono_verifier_verify_method_signature.
2859         * verify-internals.h: Export mono_verifier_verify_method_signature as
2860         part of the internal API.
2862 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2864         * loader.c (mono_method_get_header): Call into the verifier to
2865         check the method header.
2867         * metadata-verify.c: Add mono_verifier_verify_method_header.
2869         * verify-internals.h: Export mono_verifier_verify_method_header as
2870         part of the internal API.
2872 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2874         * class.c (mono_class_find_enum_basetype): Call into the verifier to
2875         check the field signature. Replace an assert with an explicit check.
2877         * class.c (mono_class_setup_fields): Call into the verifier to check
2878         the field signature.
2880         * metadata-verify.c: Add mono_verifier_verify_field_signature.
2882         * verify-internals.h: Export mono_verifier_verify_field_signature as
2883         part of the internal API.
2885 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2887         * class.c (mono_class_find_enum_basetype): Simplify this function
2888         by moving code outside of the loop and not decoding static fields.
2890 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2892         * metadata-verify.c (verify_typedef_table): Check the extends
2893         token here. Move to here a flags check from verify_typedef_table_full.
2895 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
2897         * metadata-verify.c (is_valid_method_header): Fix a warning.
2899         * metadata-internals.h (MonoImage): Remove the unused 
2900         static_rgctx_invoke_wrapper_cache.
2902         * image.c marshal.c: Ditto.
2904 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2906         * image.c (do_mono_image_load): Enable table data verification.
2908 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2910         * metadata-verify.c (is_valid_constant): Fix nullref check.
2912 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2914         * metadata-verify.c (is_valid_constant): Fix string bounds check.
2916 2009-06-22  Mark Probst  <mark.probst@gmail.com>
2918         * sgen-gc.c: Managed allocation with pthreads TLS.
2920         * threads.c, threads-types.h: Functions for the JIT to tell the
2921         runtime whether it supports the MONO_TLS opcode.
2923 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2925         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
2926         without methods.
2928 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2930         * metadata-verify.c (is_valid_constant): Fix the string length check.
2931         Use safe overflow checking. Add decent error messages.
2933 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2935         * metadata-verify.c: Move remaininh blob checks to the offline
2936         verification path.
2938 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2940         * metadata-verify.c: Move more blob checks to the offline verification
2941         path.
2943 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
2945         * object-internals.h : Adding interrupt_on_stop field.
2947         * threads.c (mono_thread_request_interruption) : On Windows exit the
2948           thread if interrupt_on_stop is set.
2950         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
2951          Removing old interrupt logic and setting the interrupt_on_stop for the
2952          thread when calling accept.
2954         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
2955          setting the interrupt_on_stop for the thread when calling accept.
2957         Contributed under MIT/X11 license.
2959 2009-06-20  Martin Baulig  <martin@ximian.com>
2961         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
2963 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
2965         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
2966         running in no-exec mode.
2968 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2970         * metadata-verify.c (verify_method_table): Move header
2971         checking to verify_method_table_full.
2973         * metata-verify.c (mono_verifier_verify_full_table_data):
2974         Call verify_method_table_full.
2976 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2978         * metadata-verify.c (verify_field_table): Move signature
2979         checking to verify_field_table_full.
2981         * metata-verify.c (mono_verifier_verify_full_table_data):
2982         Call verify_field_table_full.
2984 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2986         * metadata-verify.c (verify_typedef_table): Move remaining
2987         stuff to verify_typedef_table_full.
2989 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2991         * metadata-verify.c: Kill is_corlib from VerifyContext.
2992         It is only used by the offline mode.
2993         So we better remove it from the runtime path.
2995 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2997         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
2998         function that perform the offline metadata verification steps.
3000         * metadata-verify.c (verify_typedef_table): Move some checks to
3001         verify_typedef_table_full and make it been called by new function
3002         mono_verifier_verify_full_table_data.
3004         * pedump.c: Call mono_verifier_verify_full_table_data.
3006         * verify-internals.h: Export mono_verifier_verify_full_table_data as
3007         part of the internal API.
3009 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3011         * metadata-verify.c (typedef_is_system_object): Fix System.Object
3012         check.
3014         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
3015         flags bits. SupportLastError was confused as bit 7 instead of 6.
3017         * metadata-verify.c (verify_implmap_table): Fix import scope verification
3018         to check against the module ref table instead of module.
3020         * metadata-verify.c (verify_implmap_table): Fix corlib check.
3022         * pedump.c: Call mono_image_load_names.
3024 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3026         * image.c: Extract mono_image_load_names from do_mono_image_load.
3028         * metadata-internals.h: Export mono_image_load_names as part of
3029         the internal API.
3030         
3031 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
3033         * metadata.c (mono_metadata_cleanup): Free the generic method cache
3034         first, as it could reference data in the other caches.
3036 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
3038         * metadata-verify.c: Finished with method header verification.
3040 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
3042         * metadata-verify.c: Added more header verification code.
3043         Now only EH clauses are missing.
3045 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
3047         * marshal.c (get_runtime_invoke_type): Don't share primitive types
3048         for return values.
3050 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
3052         * metadata-verify.c: Initial method header verification.
3054 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
3056         * metadata-verify.c (verify_import_table): The IAT contents
3057         might end been patched by the windows DL when running with
3058         coree enabled.
3060 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
3062         * class.c (mono_class_from_typeref): If the enclosing type is not
3063         found return null instead of crashing. Fixes #508487.
3065 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
3067         * normalization-tables.h : updated to the latest unicode charcter
3068           data.
3069         * appdomain.c : bump corlib version.
3071 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
3073         * class.c (mono_class_from_name): Fix support for assembly references
3074         in the EXPORTEDTYPE table. Fixes #511704.
3076 2009-06-13  Geoff Norton  <gnorton@novell.com>
3078         * domain.c: Ensure that mono_domain_assembly_open actually opens the
3079         assembly in the target domain.
3081 2009-06-12  Robert Jordan  <robertj@gmx.net>
3083         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
3084         because "this" of the managed signature has become an
3085         ordinary parameter in the unmanaged signature.
3087 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
3089         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
3090         field for owner-less generic containers.
3092         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
3093         image field of the owner-less generic containers created here.
3095         * metadata.c (mono_metadata_load_generic_params): Ditto, the
3096         contain is ownerless until the caller sets its owner.
3098         * metadata.c (type_in_image): Handle owner-less generic containers
3099         correctly.
3100         
3101 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
3103         * image.c (mono_image_close): Support debug_assembly_unload for
3104         dynamic images too.
3106 2009-06-11 Andrés G. Aragoneses  <aaragoneses@novell.com>
3108         * class.c: Fix some typos in comments.
3110 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
3112         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
3114         * threads.c (mono_thread_execute_interruption): Avoid creating the
3115         abort exception object while holding the synch_cs lock.
3117 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3119         * metadata-verify.c: Verify basic cattr content.
3121 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
3123         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
3124         nested types.
3125         
3126         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
3127         support for nested types. Fixes #511704.
3129 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3131         * metadata-verify.c: Verify methodspec signatures.
3133 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3135         * metadata-verify.c: Verify typespec signatures.
3137 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
3139         * metadata.c (free_inflated_method): Call 
3140         mono_marshal_free_inflated_wrappers (), which was missed earlier.
3142 2009-06-08  Miguel de Icaza  <miguel@novell.com>
3144         * mono-config.c: Small change to report the PPC64/ILP32 model.
3146 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3148         * metadata-verify.c (parse_type): Check szarray.
3150 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3152         * metadata-verify.c (parse_type): Check fnptr.
3154 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3156         * metadata-verify.c (parse_type): Check generic instances.
3158 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3160         * metadata-verify.c (parse_type): Check array shape.
3162 2009-06-05  Robert Jordan  <robertj@gmx.net>
3164         * class.c (mono_class_create_from_typedef): Check only for
3165         mscorlib's System.Array.
3167 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3169         * metadata-verify.c (parse_type): Check pointer, class/valuetype
3170         and generic params. 
3172         * metadata-verify.c (parse_field): Check the signature.
3174 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3176         * metadata-verify.c: Implement locals signature check.
3178 2009-06-04  Marek Safar  <marek.safar@gmail.com>
3180         * domain.c: Add .NET 4.0 Beta 1 version.
3182 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
3184         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
3185           For QueryInterface on CCWs consider the base class
3186           interfaces as well.
3188         Code is contributed under MIT/X11 license.
3190 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
3192         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
3194         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
3195         used.
3197         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
3198         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
3200         * generic-sharing.c (inflate_other_data): Ditto.
3201         
3202 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3204         * metadata-verify.c: Implement property signature check.
3206 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3208         * sgen-gc.h: Register saving support for PPC.
3210 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3212         * sgen-gc.c: Fixed a pthread TLS screwup.
3214 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3216         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
3217         supported.
3219 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3221         * sgen-gc.c: Disable TLA and managed allocation if the __thread
3222         keyword is not supported.
3224 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
3226         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
3227         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
3228         the inflated method is freed. Fixes #508389.
3230         The code is contributed under the MIT/X11 license.
3231         
3232 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
3234         * marshal.c (get_wrapper_target_class): New helper function.
3235         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
3236         the <Module> class of the image. Fixes #509049.
3238 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3240         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
3241         Check if the thread was interrupted and proccess it straight away.
3242         Makes abortion much more responsive.
3244 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3246         * threads.c (mono_thread_execute_interruption): Use atomic cas with
3247         MonoThread::interruption_requested to match it's counterpart.
3249         Fixes a hang in abort-stress-1 on a 2 core x86.
3251         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
3252         Fix warning.
3254 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3256         Change MonoImage::name_cache to be protected by the image lock
3257         instead of the loader lock.
3259         * appdomain.c (deregister_reflection_info_roots): Protect access
3260         to name_cache.
3262         * class.c (mono_image_init_name_cache): Change from the loader lock
3263         to the image lock. Check if the cache wasn't already created.
3265         * class.c: Change from the loader to the image lock.
3267         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
3268         the code to hold the image lock while iterating over name_cache and
3269         not go into mono_array_new holding it.
3271         * metadata-internals.h: Add a comment about this change.
3273 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3275         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
3276         Under the 2.0 profile raise the loader error.
3278         Fixes #508532.
3280 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3282         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
3283         of ldind opcode for generic instances so we don't fail for direct wrappers.
3284         This only affect direct calls.
3286 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
3288         * reflection.c (create_dynamic_mono_image): Fix warnings.
3290         * generic-sharing.c (other_info_equal): Ditto.
3291         
3292 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3294         * metadata-verify.c: Implement field signature check.
3296 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3298         * metadata-verify.c: Implement standalone signature check.
3300 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3302         * metadata-verify.c: Implement methodref signature check.
3304 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
3306         * object-internals.h (MonoRuntimeCallbacks): New structure containing
3307         callbacks supplied by the runtime.
3309         * object.c (mono_install_callbacks): New internal function to install
3310         the callbacks.
3312         * object.c (mono_create_ftnptr): Move the implementation of this to
3313         mini/.
3315         * object.c (mono_get_addr_from_ftnptr): Ditto.  
3317 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3319         * metadata-verify.c (parse_return_type): Proper byref check.
3320         * metadata-verify.c (is_valid_method_signature): Check for zero arity
3321         generic signatures and method params.
3323 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3325         * metadata-verify.c (decode_signature_header): Fix bounds check.
3327         * metadata-verify.c (parse_custom_mods): Check custom mods.
3329         * metadata-verify.c (parse_type): Do initial basic verification
3330         of valid values.
3331         
3332         * metadata-verify.c (is_valid_method_signature): Parse the generic
3333         param count.
3335 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
3337         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
3338         discarded based on their most specific definition so we set the method_slots
3339         array before checking if the method is acceptable or not.
3341         Fixes #506757.
3343 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3345         * icall.c: Free the old array when resizing a mono_ptr_array.
3347 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3349         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
3350         for the hashes whose keys are managed objects.
3352 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3354         * object-internals.h, threads.c: Set the execution context on
3355         thread start here, not in corlib.
3357         * appdomain.c: Bump corlib version.
3359 2009-05-27  Martin Baulig  <martin@ximian.com>
3361         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
3362         if `_mono_debug_using_mono_debugger' is set to make things work
3363         properly when embedding Mono.
3365 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
3367         * class.c (mono_class_setup_fields): Don't mark simd types as having
3368         16 bytes alignment as the whole runtime doesn't support.
3370 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
3372         * metadata-verify.c (safe_read): Use endian safe read macros.
3374 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
3376         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
3377         it is read-only when using full aot.
3379 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3381         * metadata-verify.c (is_valid_method_signature): Verify parts
3382         of the return type. Provide an error message in case of failure.
3384 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3386         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
3388 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3390         * metadata-verify.c: Include the size prefix in the bounds check.
3392 2009-05-22  Miguel de Icaza  <miguel@novell.com>
3394         * icall.c: Remove warnings.
3396         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
3397         prevent auto-detection based on GCC defines.
3399         Add PS3
3401         * metadata-verify.c: Do not include signal.h
3403         * generic-sharing.c, marshal.c: Add returns to avoid some warning
3404         messages.  Not sure why the g_assert_not_reached is not enough to
3405         quiet the compiler.
3406         
3408         * appdomain.c: Remove code that is not used when
3409         DISABLE_SHADOW_COPY is set.
3411         * image.c: use g_getenv
3413 2009-05-21  Miguel de Icaza  <miguel@novell.com>
3415         * reflection.c: Remove code that it not used with
3416         DISABLE_REFLECTION_EMIT is defined.
3418 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
3420         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
3421         invoke wrappers.
3423 2009-05-20  Miguel de Icaza  <miguel@novell.com>
3425         * socket-io.c
3426         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
3427         the ifdef here and instead put that on io-layer
3429 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3431         * metadata-verify.c: Verify the generic param constraint table.
3433 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3435         * metadata-verify.c (verify_generic_param_table): Fix
3436         thinko on the valid flags bits for generic params.
3438 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3440         * metadata-verify.c: Verify the methodspec table.
3442 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3444         * metadata-verify.c: Verify the generic param table.
3446 2009-05-19  Mark Probst  <mark.probst@gmail.com>
3448         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
3450 2009-05-19  Mark Probst  <mark.probst@gmail.com>
3452         * sgen-gc.c: Use generation enum more consistently and use the
3453         correct generation in mono_gc_register_for_finalization().
3455 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3457         * metadata-verify.c: Verify the nested class table.
3459 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3461         * metadata-verify.c: Verify the manifest resource table.
3463 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
3465         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
3467 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
3469         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
3470         wrappers, this is now done in the JIT.
3471         
3472         * class.c (mono_set_generic_sharing_supported): New internal function.
3473         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
3475 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3477         * metadata-verify.c: Verify the exported type table.
3479 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3481         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
3483 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3485         * metadata-verify.c: Verify the file table.
3487 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3489         * metadata-verify.c (verify_assembly_table): Fix an error message.
3491         * metadata-verify.c: Verify the assemblyref table.
3493 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3495         * metadata-verify.c (verify_assembly_table): Fix the valid
3496         bits mask for flags.
3498 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
3500         * debug-helpers.c (mono_method_full_name): Print generic parameters of
3501         generic methods as well.
3503 2009-05-15  Geoff Norton  <gnorton@novell.com>
3505         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
3506         use-case and is significantly more performant than the wapi layer.
3508 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3510         * metadata-verify.c: Verify the assembly table.
3512 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3514         * metadata-verify.c: Fix rows limit check.
3516 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3518         * metadata-verify.c: Verify the fieldrva table.
3520 2009-05-13  Mark Probst  <mark.probst@gmail.com>
3522         * sgen.c: Speed up weak links and finalizers by grouping them by
3523         generation.
3525 2009-05-13  Mark Probst  <mark.probst@gmail.com>
3527         * marshal.c (delegate_hash_table_add): When overwriting an entry,
3528         free the old GCHandle (only applies to SGen).
3530 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
3532         * loader.c (mono_get_method_from_token): Avoid the expensive call to
3533         mono_metadata_load_generic_params () for non-generic methods.
3535 2009-05-12  Mark Probst  <mark.probst@gmail.com>
3537         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
3538         New function for returning a monitor's weak link if it has one.
3540         * sgen-gc.c: Remove an object's monitor's weak link (if it has
3541         one) when clearing a domain.  These can still be around because
3542         the object might not have been collected.
3544 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
3546         * gc.c: Fix a warning.
3548 2009-05-12  Kornél Pál  <kornelpal@gmail.com>
3550         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
3551         prevous wait that resulted in a deadlock on Windows when initializing
3552         the runtime form DllMain. Also results in improved startup time.
3553         (finalizer_thread): Get rid of thread_started_event.
3554         * threads.c, threads-types.h (mono_thread_create_internal): Return the
3555         resulting MonoThread.
3557         Contributed under MIT/X11 license.
3559 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
3561         * metadata-verify.c: Verify the implmap table.
3562         Don't require that #US and #Strings be present.
3564 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
3566         * security-core-clr.c: Delegate checks are done at creation time,
3567         not a invocation time. Fix exception for Telerik Silverlight demo
3569 2009-05-11  Mark Probst  <mark.probst@gmail.com>
3571         * sgen-gc.c (need_remove_object_for_domain): Remove the special
3572         case for the Thread class.
3574         * threads.c: Do clean-up of abort exception/state in
3575         thread_cleanup() instead of Thread.free_internal().  Also clean up
3576         current_appcontext.  The reason we have to do that is because
3577         those references might point into another domain and if that
3578         domain is unloaded before the thread is finalized, they point to
3579         invalid data.
3581 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
3583         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
3584         stub signatures.
3585         
3586         Contributed unter MIT/X11 license.
3588 2009-05-09  Miguel de Icaza  <miguel@novell.com>
3590         * verify.c, metadata-verifier.c: Add support for disabling the
3591         verifier in some builds.
3593         [ Sorry, my previous commit accidentally commited some work in
3594         progress ]
3596 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
3598         * class.c (mono_class_setup_fields): Set class->field.first for
3599         generic instances.
3601 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
3603         * metadata-verify.c: Verify the typespec table.
3605 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
3607         * metadata-verify.c: Verify the module table.
3609 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3611         * metadata-verify.c: Verify the methodimpl table.
3613 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3615         * metadata-verify.c: Verify the property table.
3617 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
3619         * debug-helpers.c (mono_method_desc_match): Add support for generic
3620         glob patterns.
3622 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
3624         * metadata-verify.c: Verify the propertymap table.
3626 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
3628         * metadata-verify.c: Verify the event table.
3630         * metadata-verify.c (search_sorted_table): Fix offset
3631         calculation.
3633 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
3635         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
3637 2009-05-01  Mark Probst  <mark.probst@gmail.com>
3639         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
3640         because mono_delegate_free_ftnptr() needs it.
3642 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3644         * metadata-verify.c: Verify the eventmap table.
3646 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3648         * metadata-verify.c: Verify the standalonesig table.
3650 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3652         * metadata-verify.c: Verify the field layout table.
3654 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3656         * class.c (mono_type_get_name_recurse): Don't crash
3657         for ownerless generic params.
3659         * debug-helpers.c (mono_type_get_desc): Correct the format
3660         for ownerless generic params.
3662 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3664         * metadata-verify.c: Verify the class layout table.
3666 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3668         * metadata-verify.c: Verify the decl security table.
3670 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3672         * domain.c (mono_domain_set_internal_with_options): Don't do
3673         anything if the old domain is the same as the old one.  Fixes
3674         #499326.
3676 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3678         * appdomain.c: Deregister the reflection_info roots when unloading
3679         a domain.
3681         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
3682         memory allocated by a domain and frees its disappearing links.
3684         * boehm-gc.c, null-gc.c: Empty implementation of
3685         mono_gc_clear_domain().
3687 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3689         * appdomain.c (clear_cached_vtable): Free the static fields memory
3690         block.
3692 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3694         * gc.c: Set the correct domain when invoking finalizers.
3696         * appdomain.c: Set the correct domain when creating threads.
3698 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3700         * sgen-gc.c: Fix skip size for vectors.
3702 2009-05-03  Martin Baulig  <martin@ximian.com>
3704         * mono-debug-debugger.c
3705         (mono_debugger_check_breakpoints): Check class init handlers even
3706         if we don't have any method load handers.
3708 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
3710         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
3711         returning refonly assemblies if refonly is FALSE. Fixes #499013.
3713 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
3715         * metadata-verify.c: Verify the field marshal table.
3717 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
3719         * metadata-verify.c: Verify the custom attribute table.
3721 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3723         * metadata-verify.c: Verify the constant table.
3725 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3727         * metadata-verify.c: Verify the memberef table.
3729 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3731         * metadata-verify.c (get_coded_index_token): Remove
3732         dead argument.
3734 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3736         * metadata-verify.c: Verify the interfaceimpl table.
3738 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3740         * verify.c: Improve error message.
3742         * debug-helpers.c (mono_type_get_desc): Harden the code that
3743         deals with VAR and MVAR.
3745 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
3747         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
3748         part of #498692.
3750 2009-04-23 Tom Hindle <tom_hindle@sil.org>
3752         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
3753         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
3755 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
3757         * security-core-clr.c: Avoid redundant checks for platform code, 
3758         e.g. check for method and for class (very common) and check
3759         for class and outer class (less common)...
3761 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
3763         * reflection.c: Avoid returning random cattrs for synthetic methods.
3764         Fixes #498545.
3766 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3768         * assembly.c: assemblies in the GAC should never be shadow-copied.
3770 2009-04-26  Mark Probst  <mark.probst@gmail.com>
3772         * domain.c, domain-internals.h: Disable
3773         track_resurrection_{objects,handles}_hash in MonoDomain if using
3774         SGen.
3776 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3778         * metadata-verify.c: Verify the param table.
3780 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3782         * metadata-verify.c (verify_typedef_table): Range check FieldList and
3783         MethodList.
3785         * metadata-verify.c (verify_method_table): Proper check the ParamList
3786         field.
3788 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3790         * metadata-verify.c (verify_method_table): Check for runtime
3791         implemented functions such as delegate .ctors. Remove spurious
3792         printf.
3793         
3794 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3796         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
3798 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3800         Don't allocate MonoGenericInfo for ownerless generic params.
3801         * class-internals.h (MonoGenericParam::info): Move field to ...
3802         (MonoGenericParamFull): ... this.  New struct.
3803         (MonoGenericContainer::type_params): Change type to
3804         MonoGenericParamFull.
3805         (MonoGenericParam, MonoGenericContainer): Update accessors.
3806         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
3807         'info' field for ownerless generic param.
3808         (mono_metadata_load_generic_params): Update to changes.
3809         * reflection.c (mono_reflection_create_generic_class): Likewise.
3810         (reflection_methodbuilder_to_mono_method): Likewise.
3811         (mono_reflection_initialize_generic_parameter): Likewise.
3813 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3815         Don't use MonoGenericParamInfo for ownerless generic params.
3816         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
3817         use ParamInfo class at all.
3818         (mono_class_from_generic_parameter): Use them.
3819         (make_generic_param_class): Fix a couple of instances where 'pinfo
3820         == NULL' wasn't handle.
3822 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3824         * class.c (make_generic_param_class): Carve out of ...
3825         (mono_class_from_generic_parameter): ... here.
3827 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3829         Simplify mono_class_from_generic_parameter
3830         * class-internals.h (MonoGenericParamInfo::token): New field.
3831         * metadata.c (mono_metadata_load_generic_params): Initialize it
3832         from metadata.
3833         * class.c (mono_class_from_generic_parameter): Use it instead of
3834         searching through metadata.
3836 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3838         * metadata-verify.c: Add verification of the method table.
3840 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3842         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
3843         Delegate::Invoke optimization.
3845 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3847         * appdomain.c (mono_domain_create_appdomain_internal): Free the
3848         string returned by get_shadow_assembly_location_base.
3850         * appdomain.c (get_shadow_assembly_location_base): Add a comment
3851         about caller's ownership.
3853 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3855         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
3856         reflection memory on domain unload.
3858         * domain.c (mono_domain_free): Don't free refobject_hash, let the
3859         reflection cleanup code do it.
3861         * domain-internals.h: Add mono_reflection_cleanup_domain.
3863         This fixes a memory leak for managed mirrors of reflection objects
3864         on domain unload. 
3866 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
3868         * metadata-verify.c: Implement more verification of the field table.
3870 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
3872         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
3873         doesn't try to parse the input assembly, which can be broken.
3875 2009-04-23  Mark Probst  <mark.probst@gmail.com>
3877         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
3878         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
3879         by using the lowest bit in the link to store whether the link is
3880         tracked.  Move the track_resurrection hashes into boehm-gc.c.
3882 2009-04-22  Miguel de Icaza  <miguel@novell.com>
3884         * Makefile.am: Split the console support in platform specific code
3885         and put together a framework for making this easy in the future so
3886         that we can start splitting code instead of having a mess of PLATFORM_WIN32
3888 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3890         * pedump.c: Fix a warning.
3892 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3894         * verify.c (mono_delegate_type_equal): Compare valuetypes using
3895         mono_class_from_mono_type to avoid bad interactions with the dual representation
3896         of the generic type definition.
3898 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3900         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
3901         get the MonoClass for the call context type as it might be a generic
3902         instance.
3904         Fixes #491483.
3906 2009-04-21  Mark Probst  <mark.probst@gmail.com>
3908         * object-internals.h: The Thread object has no execution_context
3909         member anymore.
3911         * threads.c, threadpool.c, threads-types.h: Accessor functions for
3912         the execution context.
3914         * appdomain.c: Bump corlib version.
3916 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3918         * verify.c (do_newobj): Improve error message.
3920 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3922         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
3923         is nested in the filter block.
3925         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
3926         block is not fully nested.
3928         Fixes #495656.
3930 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3932         * verify.c (verify_type_compatibility_full): Compare MonoClass and
3933         not MonoType to check for equality of valuetypes as the generic type
3934         definition allows for two different encodings: the generic type definition
3935         class or a generic instance over the GTD arguments.
3937         Fixes #496175.
3939 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3941         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
3943         * verify.c (do_initobj): Improve error message.
3945 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3947         * metadata-verify.c: Enable pe verification as the issue with #496453
3948         is that the authenticode data directory have a different unspecified
3949         format. Ignore it for now.
3951         * pedump.c: Run the metadata verifier together with the IL verifier.
3953         Fixes ##496453.
3955 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
3957         * metadata-verify.c: Temporarily disable pe verification due to #496453.
3959 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3961         * class.c (can_access_type): Check visibility against
3962         the element type for pointers and arrays.
3964         Fixes #496150.
3966 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3968         * metadata-verify.c: Fix cli and table verification to use information
3969         from the MonoImage. A lot of duplicated code got killed.
3971 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3974         This patch starts to integrate the metadata verifier with the runtime code.
3976         This patch causes major regression in functionality for the metadata verifier
3977         as cli and table verification are disabled since they require to be ported to
3978         use MonoImage information.
3980         * image.c (do_mono_image_load): Split the code in this function
3981         into mono_image_load_pe_data and mono_image_load_cli_data.
3982         Add     care_about_pecoff parameter to not load pecoff data.
3983         Call into the metadata verifier for pecoff and cli verification.
3985         * image.c (mono_image_open_raw): New function that doesn't perform
3986         any parsing of the image contents.
3987         
3988         The reason for the 3 new functions is to give pedump better control
3989         into the interaction with the verifier.
3991         * metadata-internals.h: Add new functions from image.c as part of the
3992         internal mono API.
3994         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
3995         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
3996         to make those functions work together with the runtime.
3998         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
3999         true if the image needs to be verified.
4001         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
4003         * pedump.c: Use new metadata verifier API.
4005 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
4007         * object.c (mono_install_vtable_trampoline): Make this receive a
4008         trampoline creation function instead of trampoline, allowing the JIT
4009         to use a different trampoline for each vtable.
4011 2009-04-18  Mark Probst  <mark.probst@gmail.com>
4013         * object.c (mono_raise_exception): Don't reset the thread abort
4014         exception state here.
4016 2009-04-18  Mark Probst  <mark.probst@gmail.com>
4018         * icall-def.h: New icall for getting the thread abort exception
4019         state for a thread.
4021         * object.c, thread.c, object-internals.h: A thread's abort
4022         exception state is now a GC handle.  To get the object it stands
4023         for, we must move it into the current app domain, if it's
4024         different than the one where it originated from.
4026         * appdomain.c: Bump corlib version.
4028         * domain.c, domain-internals.h: New function for setting the
4029         domain and migrate the thread abort exception or not.
4031 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4033         * metadata-verify.c: Add initial verification of the
4034         field table.
4036 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4038         * metadata-verify.c: Add a macro to conditionally enable
4039         dumping of verification information. Add  make_coded_token
4040         and search_sorted_table to enable search sorted tables
4041         by a given coded token.
4043 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4045         * metadata-verify.c: Add array mapping from table index
4046         to description offset. Add get_col_offset and get_col_size
4047         functions.
4049 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4051         * metadata-verify.c: Add remaining table descriptions offsets.
4052         Add remaining coded index descriptions.
4054 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4056         * metadata-verify.c: Fixed constant table description.
4057         Fixed calculation of HasCustomAttribute coded index size.
4058         Fixed calculation of size for many table indexes. 
4060 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4062         * pedump.c (dump_metadata): Dump table offset instead
4063         of useless pointer in memory.
4065 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4067         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
4069 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4071         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
4072         a missing of for interface types.
4074 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4076         * metadata-verify.c (verify_pe_optional_header): Add comment of why
4077         the code is commented.
4079         * metadata-verify.c (verify_resources_table): Remove spurious printf
4080         and don't fail if there are unmanaged resources. Gmcs generates a useless
4081         one     for all assemblies - I bet it's some MS compatibility junk.
4083 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4085         * metadata-verify.c (verify_typedef_table): Verify the extends field.
4087         * metadata-verify.c (mono_image_verify): Add a is_corlib.
4089         * verify-internals.h: Same.
4091         * pedump.c: Fix for mono_image_verify new signature.
4093 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4095         * metadata-verify.c (verify_typedef_table): Verify for some invalid
4096         flags combinations.
4098 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4100         * metadata-verify.c (verify_module_table): Ignore the generation field.
4102 2009-04-15  Martin Baulig  <martin@ximian.com>
4104         * debug-mono-symfile.c
4105         (mono_debug_symfile_lookup_location): Don't print a warning for
4106         unknown extended opcodes if they're within 0x40 and 0x7f.
4108 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
4110         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
4111         invoke signatures returning an enum. Fixes #494847.
4113 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4115         * metadata-verify.c: Initial code to verify the typedef table.
4117 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4119         * verify.c (mono_method_verify): Don't fail if an unconditional branch
4120         with non empty stack happens before the beginning of a try block.
4122         Fixes #494812.
4124 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4126         * metadata-verify.c: Verify typename and typenamespace fields of
4127         the typeref table.
4129 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
4131         * metadata-verify.c: Initial code to verify the typeref table.
4133 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
4135         * verify.c (verify_delegate_compatibility): Fix error message.
4137 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
4139         * security-core-clr.c: Fix typo
4141 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
4143         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
4144         a MonoGHashTable to keep its values alive.
4145         (emit_marshal_boolean): Fix a warning.
4147 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4149         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
4150         not have any interface configured for IPv4/IPv6.
4152 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4154         * assembly.c: fix typo in error message.
4156 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
4158         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
4159         allocating the location holding the this argument to prevent
4160         'too many root sets' errors.
4162         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
4163         to mark fields as special static.
4164         (mono_field_static_get_value): Handle special static fields.
4165         (mono_field_static_set_value): Ditto.
4167         * class-internals.h (struct _MonoClassField): Document this.
4169 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4171         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
4172           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
4173           case.  This will handle when managed code returns null to native code.
4175         Code is contributed under MIT/X11 license.
4177 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4179         * object.c (build_imt_slots): Changing a free to a g_free to match
4180           the g_malloc0 in add_imt_builder_entry that allocated this memory.
4182         Code is contributed under MIT/X11 license.
4184 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4186         * marshal.c (emit_marshal_boolean): Adding code to ensure that
4187           the correct TRUE value is passed through the marshaling layer.
4189         Code is contributed under MIT/X11 license.
4191 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
4193         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
4194         correctly. Fixes #492330.
4195         
4196         * marshal.c: Fix the embedding of object pointers into JITted code in
4197         the native-to-managed wrappers by allocating some GC tracked memory, and
4198         embedding the address of that.
4200 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
4202         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
4203         pointers into the vtable.
4205 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4207         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
4209         * verify.c (verify_ldftn_delegate): Improve error message.
4211 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
4213         * reflection.c (my_mono_class_from_mono_type): Remove.
4215 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
4217         Prepare to reduce memory usage of owner-less generic parameters (1/n)
4218         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
4219         and constraints fields into ...
4220         (MonoGenericParamInfo): ... this.
4221         (mono_generic_param_info, mono_generic_container_get_param_info):
4222         New accessors.
4223         * class.c, debug-helpers.c, icall.c: Update to changes.
4224         * metadata.c, reflection.c, verify.c: Likewise.
4226 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
4228         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
4230         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
4231         
4232         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
4233         booleans with sbytes.
4235 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4237         * class.c (can_access_instantiation): Verify accesibility of element types
4238         for arrays and pointers.
4240         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
4242         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
4244         Fixes #493068.
4246 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4248         * verify.c (do_invoke_method): Improve error messages.
4250 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
4252         * verify.c:  Fixing the MSVC build.
4254         Code is contributed under MIT/X11 license.
4256 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4258         * security-core-clr.c: Simplify get_reflection_caller not to call
4259         mono_method_get_last_managed (another stack walk) and adjust the
4260         callers to handle a (should not happen) NULL return value.
4262 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4264         Add accessors to some MonoGenericParam fields
4265         * class-internals.h (mono_generic_param_owner): New accessor.
4266         (mono_generic_param_num): Likewise.
4267         (mono_type_get_generic_param_owner): New helper.
4268         (mono_type_get_generic_param_num): New helper.
4269         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
4271 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4273         * class-internals.h (mono_generic_container_get_param): New wrapper.
4274         * class.c, icall.c, metadata.c, verify.c: Use it.
4276 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4278         Fix gtest-252.cs
4279         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
4280         the standard case/loop.  In particular, don't complain about
4281         references to generic type definitions.
4283 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
4285         * debug-helpers.c (dis_one): Decode string arguments.
4287 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4289         * pedump.c (dump_verify_info): Dump type name correctly.
4291 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4293         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
4294         are larger than code size.
4296         This can happen in valid code if the try/catch block is not followed by any instruction
4297         and do a backward branch on the leave instruction.
4299         Fixes #492494.
4301 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
4303         * security-core-clr.c: Fix typo while comparing second method names
4304         in can_avoid_corlib_reflection_delegate_optimization
4306 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
4308         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
4310         Fixes #487738.
4312 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
4314         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
4315         a MVAR using a class context.
4317         Fixes #490335.
4319 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
4321         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
4323         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
4325         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
4326         functions supplied by the JIT for the SGEN GC.
4328         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
4329         
4330 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
4332         monitor.c (mono_monitor_try_enter_internal):
4333         Added calls to profile monitor contentions.
4334         Also duplicated a small piece of code (the "get the monitor" logic)
4335         from the fast path to the slow path, and changed the relevant goto
4336         statements, so that monitor acquisition events can be emitted from the
4337         slow path (this is by Paolo Molaro).
4339 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
4341         * profiler.c, profiler.h, profiler-private.h:
4342         Added support for profiling monitor contentions.
4344 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
4346         * metadata-verify.c: Verify the modules table.
4348 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
4350         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
4351         using the context of the method been verifier and not of the method been called.
4353         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
4354         safely inflate generic types. 
4356 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
4358         * security-core-clr.c: Change the strategy for checking the 
4359         "reflection using delegates optimization" to avoid unneeded 
4360         attributes in multiple class libraries.
4362 2009-04-02  Mark Probst  <mark.probst@gmail.com>
4364         * sgen-gc.c: Remove object element in the disappearing link struct
4365         by storing the object pointer in the link.
4367 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4369         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
4371 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4373         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
4375         * verify.c (mono_method_verify): Do proper bounds checking of exception
4376         clause ranges.
4378 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4380         * loader.c (mono_field_from_token): Don't crash if the field parent could
4381         not be decoded.
4383 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4385         * sgen-gc.c: Execute critical finalizers after ordinary
4386         finalizers.
4388         * class-internals.h, domain.c: Add CriticalFinalizerObject to
4389         mono_defaults.
4391 2009-03-31 Jb Evain <jbevain@novell.com>
4393         * verify.c (do_ldstr): don't check if a string is in the user strings
4394         heap if the current image is dynamic.
4396 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4398         * sgen-gc.c: Wait until the last finalizer has executed when
4399         returning from WaitForPendingFinalizers.
4401 2009-03-31  Martin Baulig  <martin@ximian.com>
4403         * mono-debug-debugger.h (MonoDebuggerEvent): Add
4404         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
4405         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
4406         (mono_debugger_event_create_appdomain): New function.
4407         (mono_debugger_event_unload_appdomain): New function.
4409         * appdomain.c (mono_domain_create_appdomain_internal): Call
4410         mono_debugger_event_create_appdomain().
4412 2009-03-31  Martin Baulig  <martin@ximian.com>
4414         * mono-debug-debugger.c
4415         (mono_debugger_register_class_init_callback): Also register the
4416         class init callback if the class is already initialized to make
4417         things work with shadow copied assemblies.
4419 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
4421         * security-core-clr.c
4422         (mono_security_core_clr_ensure_reflection_access_field): Let 
4423         critical code access the field (just like we do for methods). Use
4424         check_field_access helper.
4425         (mono_security_core_clr_ensure_reflection_access_method): Use 
4426         check_field_access helper.
4428 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4430         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
4431         call the run-finalize function directly.
4433         * gc.c, gc-internal.h: Make run_finalize() non-static.
4435 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4437         * sgen-gc.c: Use a separate struct for disappearing links.
4439 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
4441         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
4442         * MaxIOVectorLength enabled, just ignore them.
4443         Fixes bug #349688.
4445 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
4447         * metadata-verify.c: Fix eglib build.
4449 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
4451         * threads-types.h: Fix the win32 build.
4453 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
4455         * class.c: move coreclr inheritance/override checks to 
4456         security-core.clr.c
4457         * security-core.clr.c|h: add code from class.c with additional
4458         documentation. Fix override check when the method is not critical.
4460 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
4462         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
4463         (match_class): Ditto.
4465 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
4467         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
4469         * metadata-verify.c: Implement table layout row size calculation. Verify
4470         the total size of the tables.
4472 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
4474         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
4476 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4478         * appdomain.c:
4479         * console-io.[ch]: added new mono_console_init() to make sure that
4480         file descriptors 0, 1 and 2 are opened.
4481         Bug #489019 fixed.
4483 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
4485         * appdomain.h: Export a new callback type and a new function to
4486         set this callback. This allow a mono host to provide it's own
4487         definition for "platform code".
4488         * metadata-internals.h: Add a core_clr_platform_code flag on 
4489         _MonoImage to (cache and) know if it is representing platform 
4490         code.
4491         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
4492         on platform code images.
4493         * security-core-clr.c|h 
4494         (mono_security_set_core_clr_platform_callback): Allow the host
4495         to provide it's own platform check definition.
4496         (mono_security_core_clr_determine_platform_image): Detect if an 
4497         image is platform code (using the specified callback).
4498         (mono_security_core_clr_is_platform_image): Return cached value 
4499         for platform code.
4501 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
4503         * threads.c (mono_create_thread): New helper function to wrap CreateThread
4504         which has different parameter types for the 'tid' argument in windows and
4505         the io-layer.
4507         * appdomain.c attach.c threads.c: Use the new helper.
4509 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
4511         * metadata-verify.c: Verify valid table bits.
4513 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
4515         * metadata-verify.c (verify_metadata_header): Store size in the size field.
4517         * metadata-verify.c: Add initial table schema verification.
4519 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
4521         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
4522         obtain the refclass argument needed by mono_param_get_objects (). Fixes
4523         #488383.
4525         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
4527         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
4529 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
4531         * security-core-clr.c: Add/update documentation
4533 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
4535         * marshal.c (emit_marshal_object): Generate code to throw an exception
4536         instead of throwing it. Fixes #488670.
4538 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
4540         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
4541         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
4542         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
4543         and add a call to mono_security_core_clr_ensure_delegate_creation
4544         to do the extra checks required by CoreCLR.
4545         * security-core-clr.c|h: Add function to check delegate creation,
4546         both in the binding and accessibility, under CoreCLR.
4548 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
4550         * reflection.c (mono_reflection_create_dynamic_method): when 
4551         coreclr is enabled make sure that every resolved object are
4552         checked (e.g. field and method access).
4553         * security-core-clr.c|h: Add function to check objects resolved
4554         when a dynamic method is created.
4556 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4558         * metadata-verify.c: Cache directory rva translations.
4560         * metadata-verify.c: Add cli-header and streams verification.
4562 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4564         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
4565         the wrong offset (8 instead of 6).
4567 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
4569         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
4570         methods, return the native function address itself. Fixes
4571         #487758.
4573 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
4575         * console-io.c: some of the values for control characters might not be
4576         present.
4578 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
4580         * exception.c|h: Add helpers to create [Field|Method]AccessException
4581         * icall.c: Add required coreclr check calls for field reflection.
4582         Move the existing (method) check logic into security-core-clr.c
4583         * security-core-clr.c: Add functions to check if the access of a
4584         field or method is allowed when reflecting under coreclr. This is
4585         mostly done using a stack walk to find the "real" caller: i.e. the
4586         code that is calling the reflection
4588 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
4590         * gc-internal.h: Change location of gc_wrapper.h
4592 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
4594         * class.c: Simplification to coreclr checks for overrides that
4595         makes it easier to set breakpoints.
4597 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
4599         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
4600         mono_security_core_clr_method_level): Avoid potential 
4601         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
4602         user/application code) and make it easier to set breakpoints
4604 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4606         * metadata-verify.c: Reject cli header tables that mono don't handle.
4608 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4610         * pedump.c: Fix CLI header dumping.
4612 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4614         * metadata-verify.c: More CLI header verification.
4616 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
4618         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
4620 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
4622         * metadata-verify.c: Initial verification of the CLI header.
4624 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
4626         * metadata-verify.c (verify_resources_table): Fix verification of zero
4627         sized resource section and id entries count.
4629 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
4631         * icall.c: Handle user types in many Type icalls. Fixes #486303.
4633 2009-03-17  Jb Evain  <jbevain@novell.com>
4635         * profiler.c: call mono_gc_base_init from mono_profiler_load.
4637 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
4639         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
4640         (mono_gc_make_descr_for_array): Ditto.
4642 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
4644         * verify.c (mono_verifier_is_class_full_trust): Add support for
4645         CoreCLR security mode where trusted assemblies are defined as
4646         "platform code".
4648 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
4650         * metadata-verify.c: Add minimal PECOFF resource verification.
4652 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
4654         * metadata-verify.c: Be less restrictive with some coff fields.
4656 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
4658         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
4659         params as boxed values on stack. Fixes #485706.
4661 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
4663         * console-io.c: the termios values may vary in different flavors of unix.
4665 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
4667         * console-io.[ch]: return the entire set of control characters when
4668         initializing the terminal.
4669         * appdomain.c: bump corlib version.
4671 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
4673         * mono-perfcounters.c: added support for in-process custom
4674         performance counters.
4676 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
4678         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
4680 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
4682         * metadata-verify.c: Verify the data pointed by the import table. 
4684 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
4686         * metadata-verify.c (load_data_directories): Store data
4687         directory contents.
4689         * metadata-verify.c: Verify the import table. 
4691 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4693         * metadata-verify.c: Verify data directories.
4695 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4697         * metadata-verify.c: Check section header flags.
4699 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
4701         * appdomain.c: if the assembly name is a shadow-copied file, return
4702         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
4703         in mono_make_shadow_copy.
4704         * icall.c: if the assembly name is a shadow-copied file, replace it
4705         with the original assembly path.
4707         Bug #484244 fixed. NUnit tests for corlib can be run without
4708         --noshadow now.
4710 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
4712         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
4713         entries when the table is reallocated.
4715         * icall.c: Allocate the memory used by the mono_ptr_array macros using
4716         mono_gc_alloc_fixed () since it contains GC refs.
4718 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
4720         * reflection.c (ensure_complete_type): New helper function to call
4721         type resolve handlers for unfinished dynamic types.
4722         (resolve_object): Call it for MonoClassFields. Fixes #483852.
4724 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
4726         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
4727         #483247.
4729 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
4731         * appdomain.c (get_shadow_assembly_location): Fix memleak.
4733 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
4735         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
4736         between GCHandles of type WeakTrackResurrection and the objects they
4737         point to.
4739         * gc.c: Partly implement the sematics of GCHandles of type 
4740         WeakTrackResurrection: these handles should only be cleared after the
4741         finalizer of the object they are pointing to has ran.
4743 2009-03-06  Mark Probst  <mark.probst@gmail.com>
4745         * icall.c: Partially revert r126631 because using the jump
4746         trampolines for generic shared methods makes it superfluous.
4748 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
4750         * threads.c (handle_store): Create the 'threads' hash table with the proper
4751         MONO_HASH_VALUE_GC type.
4753 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
4755         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
4756         FIRST_GC_TRACKED.
4758         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
4759         and LAST_GC_TRACKED as a GC root.
4761         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
4763         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
4764         the static data even if it consists of 1 reference.
4766         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
4767         if there is a GC descriptor.
4769         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
4770         instead of through the GC since they contain no object references.
4772 2009-03-05  Mark Probst  <mark.probst@gmail.com>
4774         * generic-sharing.c (instantiate_other_info): Always return a jump
4775         trampoline for method code.
4777 2009-03-05  Marek Habersack  <mhabersack@novell.com>
4779         * culture-info-tables.h: generated to include the en-tt culture.
4781 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
4783         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
4784         capture the thread context.
4786         * object.c (mono_async_result_new): Cache the invoke wrappers to
4787         ExecutionContext::Capture.
4789 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
4791         * marshal.h: Add a prototype for what mono_compile_method returns
4792         for invoke wrappers.
4794         * gc.c: Use the new prototype declaration.
4796 2009-03-04  Geoff Norton  <gnorton@novell.com>
4798         * boehm-gc.c: Add some MONO_LOG tracing for the GC
4799         * gc-internal.h:
4800         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
4802 2009-03-04  Martin Baulig  <martin@ximian.com>
4804         * mono-debug.h
4805         (mono_debugger_runtime_invoke): Removed.
4807         * mono-debug-debugger.c
4808         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
4810 2009-03-02  Martin Baulig  <martin@ximian.com>
4812         * mono-debug.h
4813         (mono_debugger_unhandled_exception): Removed.
4814         (mono_debugger_handle_exception): Removed.
4815         (mono_debugger_throw_exception): Removed.
4817         * mono-debug.c
4818         (mono_debug_debugger_version): Bump to 5.
4820         * mono-debug-debugger.c: Moved the exception handling code to
4821         ../mini/debug-mini.c
4823 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
4825         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
4826         finalize_objects_hash.
4828         * gc.c: Use the separate lock to access the finalize_objects_hash field.
4829         
4830         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
4831         field.
4833         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
4834         cache.
4836         * image.c (mono_image_close): Free it.
4837         
4838         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
4839         allowing a creation of a wrapper which invokes its method using a CALLVIRT
4840         on the this argument.
4842         * gc.c (run_finalize): Optimize the calling of the finalizers.
4844 2009-03-03  Martin Baulig  <martin@ximian.com>
4846         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
4847         of the `MonoGenericInst' changes.
4849 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4851         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
4852         mono_array_class_get_cached to reduce locking contention. Extract
4853         a domain var.
4855         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
4856         intermediary managed arrays. Use caching version of mono_array_new
4857         to allocate the result array.
4859         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
4861         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
4863         * locales.c (create_names_array_idx):  Use mono_array_new_cached
4864         to reduce locking contention.
4866 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
4867                 
4868         * object.c (mono_method_add_generic_virtual_invocation): Put back the
4869         thunk builder code for the non-interface case.
4871 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
4873         * object.c (get_generic_virtual_entries): New helper function to collect
4874         the virtual generic method instances which need to be added to an IMT
4875         thunk.
4876         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
4877         Instead of creating a new IMT thunk, reset the vtable slot to the
4878         trampoline, the thunk will be created the next time the trampoline is called.
4879         (build_imt_slots): Add support for virtual generic methods in interfaces by
4880         adding to the IMT thunk all the methods registered using 
4881         mono_method_add_generic_virtual_invocation ().
4883         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
4884         (struct _MonoIMTCheckItem): Ditto.
4886         * object.c (mono_method_add_generic_virtual_invocation): Take a
4887         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
4888         the IMT thunk to include all items.
4889         
4890         * object.c (mono_class_create_runtime_vtable): Add a missing
4891         mono_loader_unlock ().
4893 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4895         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4897         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
4899 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4901         * object-internals.h: Rename _MonoReflectionEvent to
4902         MonoReflectionMonoEvent so it reflects the right managed type.
4903         Add a MonoReflectionEvent that correctly represents System.EventInfo.
4905         * icall.c:
4906         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
4907         type.
4909 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4911         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
4912         intermediary managed arrays. Use caching version of mono_array_new
4913         to allocate the result array.
4915 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4917         * reflection.c: Use cached version of mono_array_new alongside
4918         the mono_reflection_get_custom_attrs_by_type call path.
4920 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4922         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
4923         intermediary managed arrays. Use caching version of mono_array_new
4924         to allocate the result array.
4926         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
4928 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4930         * icall.c: Add small implementation of a growable stack bound array.
4932         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
4934         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
4935         intermediary managed arrays. Use caching version of mono_array_new
4936         to allocate the result array.
4938 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
4940         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
4941         helps Enum::CompareTo to be implemented without reboxing all enums
4942         to their underlying type.
4943 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
4945         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
4946         since it acquires a global lock leading to scalability problems.
4948         * profiler.c: Make the stat profiler work with multiple appdomains, this
4949         currently only works when no appdomains are unloaded.
4951 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
4953         * appdomain.c: make the check to avoid copying when the assembly is
4954         already shadow copied actually work.
4956 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
4958         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4960         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
4961         changes to the managed side.
4963 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
4965         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
4966         classes + a separate lock for it, as it is used frequently at runtime, not
4967         just during metadata loading/JIT compilation.
4969         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
4970         for szarrays.
4971         
4972         * object-internals.h (mono_class_from_name_cached): New macro to cache
4973         the results of the lookup locally without having to declare a static
4974         variable to hold it.
4975         (mono_class_get_field_from_name_cached): Ditto.
4976         (mono_array_class_get_cached): Ditto.
4978         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
4979         the new macros.
4980         
4981         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
4982         slower search in metadata.
4984         * pedump.c: Fix a warning.
4986 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
4988         * reflection.c (encode_locals): Add checks for user types.
4989         (method_encode_clauses): Ditto.
4990         (method_encode_code): Ditto.
4991         (mono_image_create_token): Ditto.
4993         * object-internals.h: Change the type of more fields from MonoReflectionType*
4994         to MonoObject*.
4996 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
4998         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
4999         the a thread does not suspend within 100ms.
5001         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
5002         in addition to StopRequested as well.
5004         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
5006         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
5007         search the method_hash before inserting a new entry, to avoid crashes when
5008         the same method is inserted multiple times, causing the old 
5009         MonoDebugMethodInfo structure to be freed by the value dtor function.
5011 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
5013         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
5014         SO_EXLUSIVEADDRUSE where available.
5016 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
5018         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
5019         runtime invoke wrappers, this time it is string ctor wrappers, which
5020         pass a dummy string as 'this' instead of their obj argument. Fixes
5021         #478473.
5023 2009-02-21  Jb Evain  <jbevain@novell.com>
5025         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
5026         only get create_culture once.
5028 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
5030         * reflection.c (mono_reflection_setup_internal_class): Move the user type
5031         check before the locking.
5032         
5033         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
5034         (mono_reflection_create_runtime_class): Ditto.
5035         (mono_reflection_sighelper_get_signature_local): Ditto.
5036         (mono_reflection_sighelper_get_signature_field): Ditto.
5038         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
5039         is a System.MonoType object or similar.
5040         (monotype_cast): New helper function to cast a MonoObject to a 
5041         MonoReflectionType object.
5043         * object-internals.h: Change MonoReflectionType* members in structures to
5044         MonoObject* members to force the usage of the monotype_cast () function.
5046         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
5047         structures/arrays. This causes us to assert instead of crashing when 
5048         instances of user defined subclasses of System.Type are encountered.
5050 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5052         * cil-coff.h:
5053         * icall-def.h:
5054         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
5055         win32 resource loaded from a PE file.
5057         * image.c: fix mono_image_lookup_resource.
5059 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5061         * icall-def.h:
5062         * threads-types.h:
5063         * threads.c: added internal call for WaitHandle.SignalAndWait.
5065 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
5067         * cominterop.c : Adding cominterop_type_from_handle and 
5068           registering it as an icall.  Replacing all references
5069           to type_from_handle.
5071         Code is contributed under MIT/X11 license.
5073 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5075         * Makefile.am: Add lock-tracer.h and lock-trace.c.
5077         * appdomain.c: Call the tracer init function.
5079         * domain-internals.h: Enable the tracer for the domain locks.
5081         * image.c: Enable the tracer for image locks.
5083         * loader.c: Enable the trace for the loader lock.
5085         * lock-tracer.h:
5086         * lock-tracer.c: Initial implementation of the lock trace utility.
5087         The tracer requires a compile time define to be enabled and a env var
5088         to be enabled at runtime.
5090 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5092         * domain.c (mono_domain_code_foreach): Improve documentation.
5094 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5096         * appdomain.c:
5097         * generic-sharing.c:
5098         * object.c:
5099         * reflection.c:  Adjust locking order to the new semantics where the loader lock
5100         comes first.
5102 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5104         * domain.c: Add mono_domain_code_* functions that perform locking
5105         around the domain codeman.
5107         * domain-internals.h: Export those functions.
5109         * object.c: Use new functions instead of acquiring the domain lock.
5111 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
5113         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
5114         delegate. Fixes #477396.
5116 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
5118         * reflection.c (create_custom_attr): Get rid of alloca.
5120 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
5122         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
5123           Adding exception handling for all CCW calls.
5125         Code is contributed under MIT/X11 license.
5127 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
5129         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
5131         * marshal.c (emit_marshal_boolean): Add null checks to the new 
5132         native->managed marshalling code. Fixes #476247.
5134 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
5136         * class.c (mono_class_get_vtable_entry): Move the addition of
5137         static rgctx invoke wrappers for vtable methods here, this simplifies
5138         a lot of code and causes fewer rgctx wrappers to be created.
5140         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
5141         name of the statistics to begin with an uppercase.
5143 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5145         * reflection.c: Revert previous change as it breaks the build.
5146         
5147 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5149         * verify.c: Properly handle SZARRAY element type.
5151         Fixes #474271.
5153 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5155         * reflection.c (mono_image_create_method_token): Correctly encode
5156         MethodDef MemberRefParent token.
5158         Fixes #472845.
5160 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
5162         * image.c (mono_image_close): Delete the critical section before
5163         freeing the memory holding it.
5165 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5167         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
5168         Fixes #476257.
5170 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5172         * pedump.c (main): Call mono_marshal_init so pedump
5173         doesn't crash.
5175 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5177         * loader.c (method_from_memberref): Properly fix #474271 and
5178         don't break the runtime bad.
5180 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
5182         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
5183         (mono_domain_alloc0): Ditto.
5185 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5187         * loader.c (method_from_memberref): Don't abort if the array
5188         method is not found. A regular loader failure is more informative
5189         and correct.
5191         Fixes #474271.
5193 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5195         *loader.c: Guard MonoImage::method_cache/methodref_cache
5196         using the image lock instead of the loader lock.
5198         * metadata.h: Add comments about which fields are protected by
5199         the image lock.
5201 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
5203         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
5205         * generic-sharing.c (mono_method_construct_object_context): Remove the
5206         wrapper_type == NONE assert, it is not needed.
5208 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
5210         * reflection.c (clear_cached_object): New helper function.
5211         (mono_method_clear_object): New function to clear the cached reflection
5212         objects for a dynamic method.
5214         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
5215         Partly fixes # 463323.
5216         
5217 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
5219         * class.c:
5220         * loader.c:
5221         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
5223 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
5225         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
5226         take the image lock instead of the loader lock.
5228         * metadata-internals.h: Export new functions.
5230 2009-02-12  Miguel de Icaza  <miguel@novell.com>
5232         * domain.c (app_config_parse): Remove another use of stat that is
5233         not necessary as g_file_get_contents already does the presence
5234         check. 
5236 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
5238         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
5240         * marshal.c: Move the bstr handling code to cominterop.c.
5242         * marshal.c: Remove some COM interop code missed previously.
5244 2009-02-12  Miguel de Icaza  <miguel@novell.com>
5246         More Paolo patches from the Wii port:
5247         
5248         * security.c: Remove ves_icall_System_Environment_get_UserName
5249         from here.
5251         * icall.c: And put ves_icall_System_Environment_get_UserName
5252         here. 
5254         * appdomain.c (mono_set_private_bin_path_from_config): Remove
5255         redundant call to stat that was only used to test for the file
5256         existence.   Patch from Paolo.
5258         * gc.c (run_finalize): If COM is disabled, do not link in
5259         mono_marshal_free_ccw.
5261         * generic-sharing.c: Use alloca.h here as well.
5263 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
5265         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
5267 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
5269         * cominterop.c cominterop.h: New files.
5271         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
5272         function/typedefs which are needed by cominterop.c global.
5274 2009-02-12  Mark Probst  <mark.probst@gmail.com>
5276         * generic-sharing.c: Don't take the loader lock to guard image
5277         mempool allocs.
5279 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5281         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
5282         called without the loader lock which is required to guard MonoImage:tokens.
5284 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5286         * class.c:
5287         * metadata.c:
5288         * method-builder.c:
5289         * marshal.c:
5290         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
5292 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5294         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
5295         Rework the code to use regular mono_image_alloc/0.
5297         * loader.c: Rework the code to use regular mono_image_alloc/0.
5299         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
5301 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
5303         * object-internals.h : Fixing a typo in the 
5304           MonoReflectionComVisibleAttribute struct.
5306         * marshal.c (cominterop_com_visible): Check the implemented 
5307           interfaces for ComImport.
5309         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
5310           assume that bools should be treated as VARIANTBOOLs.
5312         * marshal.c (emit_marshal_boolean): Adding cases for 
5313           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
5315         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
5316           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
5318         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
5319           should be treated as VARIANTBOOLs.    
5321         Code is contributed under MIT/X11 license.
5323 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5325         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
5326         allocation with the image lock.
5328 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5330         This patch is the last of a series to remove explicit reference of MonoImage::mempool
5331         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
5333         * object.c: Add mono_string_to_utf8_image.
5335         * object-internals.h: Export mono_string_to_utf8_image.
5337         * reflection.c: Rework all explicit references to the the image mempool to go thought
5338         the mono_image_alloc set of functions.
5340 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5342         This patch is the third of a series to remove explicit reference of MonoImage::mempool
5343         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
5344         and generics-sharing.c.
5346         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
5347         as first argument. Note that this function remains broken as it doesn't perform locking around the
5348         mempool allocation.
5350         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
5352         * image.c: Add g_slist_append_image.
5354         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
5355         the supplied image for allocation. Move code into mono_metadata_field_info_full.
5357         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
5358         Fix all related code to do the same.
5360         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
5362         * metadata-internals.h: Fix the signatures.
5364 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5366         This patch is the second of a series to remove explicit reference of MonoImage::mempool
5367         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
5368         and similar to work using MonoImage.
5370         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
5371         MonoMemPool.
5373         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
5375         * class.c (mono_metadata_signature_deep_dup): Same.
5377         * class.c (inflate_generic_type): Same.
5379         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
5381         * metadata.c (mono_metadata_signature_dup_full): Same.
5383         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
5384         mono_metadata_signature_dup_full.
5386         * metadata.c (mono_metadata_type_dup): Same.
5388         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
5390         * reflection.c: Same.
5392         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
5394         * metadata-internals.h: Fix the signatures.
5396         * class-internals.h: Same.
5398 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5400         This patch is the first of a series to remove explicit reference of MonoImage::mempool
5401         and use mono_image_alloc set of functions instead. 
5403         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
5404         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
5405         of a MonoMemPool.
5407         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
5409         * class.c (g_list_prepend_mempool): Removed.
5411         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
5413         * image.c: Add g_list_prepend_image.
5415         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
5417         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
5420 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5422         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
5423         mono_image_unlock.
5425         * image.c (mono_image_init): Init the lock field.
5427         * image.c (mono_image_init): Cleanup the lock field.
5429         * image.c: Add mono_image_(un)lock functions.
5431 2009-02-11  Mark Probst  <mark.probst@gmail.com>
5433         * class.c, class-internals.h: mono_method_get_context_general()
5434         combines the functionality of mono_method_get_context() and
5435         mini_method_get_context().
5437         * generic-sharing.c, domain-internals.h:
5438         mono_method_construct_object_context() and
5439         mono_domain_lookup_shared_generic() moved from mini.
5441         * icall.c (ves_icall_InternalInvoke): Handle the case where the
5442         method doesn't have the correct instantiation because it's shared
5443         generic code.  Fixes #473999.
5445 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
5447         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
5449         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
5450         
5451 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5453         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
5455         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
5457         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
5458         and recheck the cache for dups after it.
5460         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
5462         Fixes one of the deadlocks found in #473150.
5464 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
5466         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
5467           For Win32, add additional break conditions for accept.
5469         Code is contributed under MIT/X11 license.
5471 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
5473         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
5474         lazily initialize the native wrapper cache.
5475         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
5476         cache, since they are different from the normal wrappers.
5478         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
5480         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
5481         AOT compiled native wrappers.
5483 2009-02-09  Geoff Norton  <gnorton@novell.com>
5485         * appdomain.h:
5486         * security-core-clr.c: Allow enabling core-clr from the embedding
5487         API.
5489 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5491         * socket-io.c: when requesting all the local ips, if there are no
5492         interfaces up and running, MS returns 127.0.0.1.
5494 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5496         * mono-perfcounters-def.h: processor time is an inverse time.
5497         Fixes bug #468625.
5499 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5501         * socket-io.c: an empty host name returns the list of local IPs.
5502         Fixes bug #386637 part 1/2.
5504 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
5506         * verify.c (mono_class_interface_implements_interface): Call
5507         mono_class_setup_interfaces ().
5508         (merge_stacks): Ditto.
5510 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
5512         * class.c (mono_class_setup_interfaces): New function to lazily initalize
5513         klass->interfaces.
5514         (mono_generic_class_get_class): Don't initalize klass->interfaces.
5515         (mono_generic_class_get_class): Ditto.
5517 2009-02-06  U-QUACK\miguel  <miguel@quack>
5519         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
5520         they live in security.c
5522         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
5523         another bit from Paolo's code.
5525 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
5527         * object.c (build_imt_slots): Add a small optimization to avoid inflating
5528         methods which will be discarded by add_imt_builder_entry ().
5530         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
5531         need to be boxed.
5533         * loader.c: Add a statistics for the size of the memberref signature cache.
5534         
5535         * loader.c (find_cached_memberref_sig): New helper function.
5536         (cache_memberref_sig): Ditto.
5538         * loader.c: Cache the result of parsing memberref signatures, since otherwise
5539         they will be parsed again for every generic instantiation, leading to unbounded
5540         memory growth.
5542 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5544         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
5545         parameters of generic methods.
5547         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
5548         after the original method is copied to the inflated method.
5549         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
5551         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
5552         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
5554         * class.c metadata.c: Update after the changes above.
5556 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
5558         * metadata-verify.c: Simplified error handling and added
5559         section table validation.
5561 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5563         * class-internals.h (MonoClassExt): New structure containing rarely used
5564         fields of MonoClass.
5565         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
5566         through a new 'ext' field.
5568         * class.c (mono_class_alloc_ext): New helper function to allocate 
5569         class->ext.
5571         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
5573 2009-02-05  Mark Probst  <mark.probst@gmail.com>
5575         * object.c (mono_object_get_virtual_method): Properly inflate
5576         generic methods.  Fixes #472692.
5578 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
5580         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
5581         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
5582         for the parent type, the created type must be ready to be used on a generic
5583         instantiation.
5584         We fill this_arg/byval_arg if the parent is a generic instance to make sure
5585         we won't have duplicated entries in generic_inst_cache.
5587         Fixes #469553.
5589 2009-02-05  Miguel De Icaza  <miguel@novell.com>
5591         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
5592         replace with plain BSD per the comments on the bug MONO77637.
5594 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5596         * class.c (mono_class_get_generic_class): New accessor function.
5597         (mono_class_get_generic_container): Ditto.
5599         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
5600         fields, similar to the ones in MonoMethod.
5602         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
5603         (mono_class_create_from_typedef): Set klass->is_generic if needed.
5605         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
5606         
5607         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
5608         the same information as element_class->byval_arg.
5610         * class.c reflection.c: Remove references to class->byval_arg.
5612         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
5613         klass->enum_basetype directly.
5615         * verify.c metadata.c object.c icall.c reflection.c: Use 
5616         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
5617         directly.
5619 2009-02-04  Miguel de Icaza  <miguel@novell.com>
5621         * icall-def.h: Remove internal calls for sockets when
5622         DISABLE_SOCKET is defined, file system writing features when the
5623         OS only support reading and not writing data and Policy support if
5624         the Policy is disabled.
5625         
5626         * image.c (do_mono_image_open): Apply Paolo's patches for using
5627         mono_file_map_ APIs here.
5629         * assembly.c: Add support for platforms to avoid prefix
5630         auto-detection. 
5632 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
5634         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
5635         warning.
5637         * class.c (mono_class_inflate_generic_class): New helper function.
5639         * class.c: Use mono_class_inflate_generic_class in a few places. Add
5640         statistics for inflated methods/classes.
5642         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
5644         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
5645         the call is made from Delegate.CreateDelegate () for the invoke method of
5646         a delegate.
5648         * loader.c: Add a statistics for the memory occupied by inflated signatures.
5650         * metadata.c (mono_metadata_signature_size): New helper function.
5652         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
5653         generic instances.
5655         * metadata.c (inflated_method_in_image): Avoid calling 
5656         mono_method_signature () if the method does not already have a signature.
5658 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5660         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
5661         valuetype is compatible with target type, check by inheritance as a
5662         VT is not really compatible with System.ValueType, for example.
5664         * verify.c (do_invoke_method): Improve error message.
5666         * verify.c (do_box_value): If boxing a nullable, use the type argument
5667         on stack instead.
5669         * verify.c (do_newobj): Improve error message.  
5671         Fixes #469549.
5673 2009-02-03  Miguel de Icaza  <miguel@novell.com>
5675         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
5677 2009-02-03  Mark Probst  <mark.probst@gmail.com>
5679         * generic-sharing.c: Don't hold domain lock when calling
5680         instantiate_other_info().  Fixes #471958.
5682         * domain-internals.h, loader.c: Describe locking policy of domain
5683         lock vs loader lock.
5685 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5687         * verify.c (mono_delegate_signature_equal): Make it possible to check
5688         first-arg-bound delegates to static method.
5690         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
5691         static methods with the first arg bound.
5693         Fixes #469529.
5695 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5697         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
5698         errors.
5700         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
5701         under strict mode. Any type, when boxed can be seen as a reference type.
5703         Fixes #469528.
5705 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5707         * object.h: The lower bound of an array is a signed integer value.
5708         Introduce mono_array_lower_bound_t typedef. It should be used instead of
5709         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
5711         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
5712         calculate the upper bound.
5713         
5714         Fixes #471252.
5716 2009-02-02  Miguel de Icaza  <miguel@novell.com>
5718         From Paolo's work, refactored, cleared up:
5719         
5720         * threadpool.c, icall.c: ifdef code that requires a working socket
5721         stack.
5723         * metadata.c (mono_metadata_field_info): Do not attempt to return
5724         a value from a function declared as void.
5726         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
5727         from the console stack.
5729         * assembly.c: use strrchr instead of rindex.
5731         * class.c, object.c, marshal.c, icall.c, reflection.c: include
5732         alloca.h on systems that have it.
5734         * environment.c: Avoid code that uses stuff from
5735         HAVE_SYS_UTSNAME_H
5736         
5737         * appdomain.c: Include sys/time.h.
5739         * console-io.c: include sys/ioctl.h if it is available.
5741 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
5743         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
5745         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
5746         the method builder.
5748         * marshal.c: Set mb->skip_visibility instead of setting it on the method
5749         after it was created and cached, as the later is not thread safe.
5750         
5751 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
5753         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
5754         called while the debugging module is not initialized. Fixes #471669.
5756 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
5758         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
5760         Fixes #471255.
5762 2009-02-02  Mark Probst  <mark.probst@gmail.com>
5764         * generic-sharing.c (lookup_or_register_other_info): Make sure the
5765         loader lock is not taken while the templates lock is held.  Fixes
5766         #471089.
5768 2009-02-02  Mark Probst  <mark.probst@gmail.com>
5770         * metadata.c (type_in_image): Added a check to fix a monodis
5771         crash.
5773 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
5775         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
5776         nullable arguments.
5778         * object.c (mono_runtime_invoke_array): Ditto.
5779         
5780         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
5781         freeing wrappers of dynamic methods.
5783         * loader.c (mono_free_method): Call it. Fixes #463323.
5784         
5785         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
5786         methods taking vtype/byref arguments, to fix yet another bug caused by
5787         the sharing of runtime invoke wrappers. Partly fixes #471259.
5789 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
5791         * debug-mono-symfile.c (check_line): Return NULL instead of returning
5792         <first file in file table>:1 when the IL offset does not have an associated
5793         line number.
5795 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
5797         * mono-debug.c (mono_debug_lookup_locals): New function to return local
5798         variable info for a method.
5800         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
5801         
5802 2009-01-30  Jb Evain  <jbevain@novell.com>
5804         * pedump.c: reuse code from monodis to make sure pedump honors
5805         MONO_PATH, which is needed to verify net_2_1 assemblies.
5807 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
5809         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
5810         there is no line number info.
5812 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
5814         Avoid some MonoType allocations
5815         * reflection.c (mono_reflection_initialize_generic_parameter):
5816         Reuse MonoType from param->pklass rather than allocating one.
5817         (mono_dynamic_image_free): Update to changes.
5819 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
5821         Rearrange some code to improve consistency
5822         * reflection.c (mono_reflection_setup_generic_class): Move body ...
5823         (mono_reflection_initialize_generic_parameter): ... here.
5825 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
5827         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
5828         with type constraints as an experiment.
5830         * boehm-gc.c (on_gc_notification): Update mono_stats.
5832 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
5834         Avoid some allocations
5835         * class-internals.h (_MonoGenericInst::type_argv): Convert from
5836         pointer to tail array to avoid extra allocation.
5837         * metadata.c (free_generic_inst): Update to changes.
5838         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
5839         on-stack struct.
5841 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
5843         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
5844         return TRUE if the two type objects are the same.
5846 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
5848         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
5849         (mono_class_native_size): Use klass->marshal_info->min_align instead of
5850         klass->min_align, since klass->min_align contains the managed alignment,
5851         while the native alignment can be different, like for longs on x86.
5852         Fixes #469135.
5854         * class-internals.h (MonoMarshalType): Add a min_align field.
5856 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
5858         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
5859         the 1.0 format.
5861 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
5863         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
5864         some comments about the usage of the used_regs field.
5866         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
5867         Fixes #469217.
5869 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
5871         * appdomain.c: return NULL instead of throwing FileNotFoundException
5872         when LoadAssembly() fails.
5874 2009-01-23  Mark Probst  <mark.probst@gmail.com>
5876         * metadata.c (mono_metadata_generic_param_equal): Only compare the
5877         image if the owner is NULL.  Fixes the AOT failures.
5879 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
5881         * metadata.c (mono_metadata_load_generic_params): Initialize the 
5882         MonoGenericParam structure using memset so the image field is initialized
5883         as well.
5885 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5887         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
5888         a plain store.
5890 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
5892         * class.c (mono_class_setup_vtable_general): In the generic instance
5893         optimization, set method->slot for abstract virtual methods. Fixes part of
5894         #467834.
5896 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5898         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
5899         which signals that the unloading has started but all appdomain services must
5900         remain operational.
5902         * appdomain.c (mono_domain_unload): The initial state for unloading now
5903         is unloading_start and we switch to unloading after the managed call to
5904         AppDomain::DomainUnload has finished.
5906         The new unloading state has to be created because managed code in the
5907         DomainUnload event can depend on things like the threadpool still working.
5908         The domain must remain fully functional while the event executes.
5910         This shown as an issue due to Process::WaitForExit, which waits for
5911         async reads of stdout and stderr to complete. Since those are processed
5912         in the threadpool the code deadlocks because the DomainUnload callback 
5913         waits for the async read finished event, which should have been set by a
5914         threadpool job but has been discarded due to the domain been in unload
5915         state.
5917 2009-01-21  Mark Probst  <mark.probst@gmail.com>
5919         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
5920         image must match.
5922 2009-01-21  Mark Probst  <mark.probst@gmail.com>
5924         * reflection.c (resolve_object): For fields, inflate the class and
5925         then get the field in the inflated class.
5927 2009-01-20  Mark Probst  <mark.probst@gmail.com>
5929         * object-internals.h (struct _MonoException): Added a comment
5930         explaining the new use of trace_ips.
5932 2009-01-20  Mark Probst  <mark.probst@gmail.com>
5934         * generic-sharing.c (inflate_other_data): Inflate array methods
5935         correctly.
5937         * loader.c, class-internals.h: Rename search_in_array_class() to
5938         mono_method_search_in_array_class() and make it non-static.
5940 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
5942         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
5943         Hopefully fixes #458168.
5945 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
5947         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
5948         as it is performed elsewhere.
5950         Code is contributed under MIT/X11 license
5952 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
5954         * mono-perfcounters-def.h: Add counters for asp.net requests total and
5955         requests queued.
5956         * object.c (mono_raise_exception): Increment the exceptions total
5957         counter when an exception is thrown.
5958         * class-internals.h: Add a location for storing the total number of
5959         asp.net requests served.
5960         * mono-perfcounters.c: Implement update support for asp.net counters
5961         from the class libraries. Implement read support for asp.net counters
5962         and exceptions total counter.
5964 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
5966         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
5967         accessing klass->methods. Fixes #467385.
5969 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
5971         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
5972         for byval arguments without an [Out] attribute. Fixes #467212.
5974         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
5975         Fix compilation under android.
5976         
5977         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
5978         processed, scan them directly after they are copied, to achieve better locality
5979         and cache usage.
5981         * socket-io.c: Applied patch from Koushik Dutta
5982         (koush@koushikdutta.com). Disable IPV6 when running under android.
5984 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
5986         * icall.c (ves_icall_InternalExecute): Add write barriers.
5988         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
5989         the GC code.
5991         * sgen-gc.c: Implement write barriers in IL code.
5993 2009-01-17  Geoff Norton  <gnorton@novell.com>
5995         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
5997 2009-01-17  Geoff Norton  <gnorton@novell.com>
5999         * image.c: When unloading the image->references table, there can be gaps
6000         in it.  Ensure that we iterate every entry to avoid leaking assembly references
6001         when unloading an appdomain.
6003 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
6005         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
6006         speed up ptr-in-nursery checks.
6008         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
6009         threads_lock () to prevent deadlocks.
6011         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
6012         does not need to be scanned during minor collections, since writes to it
6013         must use write barriers.
6015 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
6017         * metadata-verify.c: Add pe nt header verification.
6018         
6019 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
6021         * gc.c: Fix a few warnings when using SGEN.
6023 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
6025         * metadata-verify.c: Add pe optional header verification.
6027 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
6029         * sgen-gc.c: Add support for user defined marker functions, used by
6030         MonoGHashTable to avoid registering a GC root for every hash node.
6032 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
6034         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
6035         non-pinned roots into separate hashes to avoid having to traverse them
6036         in functions which are only interested in one kind.
6038 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
6040         * metadata-verify.c: Add pe header machine field verification.
6041         
6042 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
6044         * metadata-verify.c: Add pe header size verification.
6046 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
6048         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
6049         using the GC, they don't contain references.
6051         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
6053 2009-01-13  Geoff Norton  <gnorton@novell.com>
6055         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
6056         AppDomains created on the native side can be cleaned up on the native side.
6058 2009-01-13  Geoff Norton  <gnorton@novell.com>
6060         * appdomain.c: Ensure that we call mono_context_init for the embedding api
6061         as well as the managed api.
6063 2009-01-13  Geoff Norton  <gnorton@novell.com>
6065         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
6066         with a MonoAppDomain initialized against it.
6068 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
6070         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
6071         
6072         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
6074         * marshal.c: Avoid setting the exception clauses after a method has been entered 
6075         into the wrapper caches. Fixes #465700.
6077         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
6078         method builder.
6079         (mono_mb_create_method): Set the clauses from the method builder.
6081 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
6083         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
6084         Patch from Makoto Kishimoto.
6086 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
6088         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
6089         encoding them as ROOT_DESC_COMPLEX.
6090         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
6092 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
6094         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
6095         no longer point to the nursery.
6097         * sgen-gc.c: Add a few comments/FIXMEs.
6098         
6099         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
6101         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
6102         initialization of the various _method variables thread safe. Fixes
6103         #465377.
6105 2009-01-12  Mark Probst  <mark.probst@gmail.com>
6107         * domain.c, domain-internals.h: Remove the shared_generics_hash
6108         and its lookup functions.
6110 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
6112         * socket-io.c:  Fixing the MSVC build. 
6114         Code is contributed under MIT/X11 license.
6116 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
6118         * metadata-verify.c: Add pe header watermark verification.
6120 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6122         * metadata-verify.c: Add lfanew verification.
6124 2009-01-12  Jb Evain  <jbevain@novell.com>
6126         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
6127         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
6129 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
6131         * socket-io.c: Fix the build.
6133         * environment.c: Fix an #ifdef.
6135 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6137         * threadpool.c (async_invoke_thread): Handle the wait function returning
6138         WAIT_IO_COMPLETION as well.
6139         (async_invoke_io_thread): Ditto.
6141 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
6143         * threads.c: Fixing the Windows build.
6145         Code is contributed under MIT/X11 license.
6147 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6149         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
6150         interrupt a wait.
6151         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
6152         the thread to wait again.
6154 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6156         * metadata-verify.c: Initial skeleton of the metadata verifier.
6158         * pedump.c: Add support for the metadata verifier.
6160         * verify-internal.h: Export the whole assembly metadata verifier function.
6162 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6164         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
6166 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6168         * Makefile.am: Upgrade dtrace-prelink.sh location.
6170 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
6172         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
6173         well. Otherwise the shutdown deadlock that happens on unix will can happen
6174         as well.
6175         If the main thread code finishes too fast it's possible that the finalizer
6176         thread won't have executed yet, won't record itself as the finalizer thread
6177         and the shutdown sequence will wait on it forever.
6179 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
6181         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
6182         with MSVC.
6184 2009-01-08  Miguel de Icaza  <miguel@novell.com>
6186         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
6187         Robert Jordan for pointing this out.
6189 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
6191         * icall.c
6192         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
6193         ves_icall_System_IO_DriveInfo_GetDriveType.
6195 2009-01-07  Miguel de Icaza  <miguel@novell.com>
6197         * icall.c: Wrap calls to mono_strtod in CriticalSection
6198         invocations when using eglib, to work around #464316.
6200 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
6202         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
6203         return value of GetCurrentDirectory to never access unitialized memory.
6205 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
6207         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
6208         return value of GetCurrentDirectory and expand the buffer if needed.
6210         Fixes #459094.
6212 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
6214         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
6215           Adding a call to mono_init_com_types.
6217         Code is contributed under MIT/X11 license.
6219 2009-01-07  Geoff Norton  <gnorton@novell.com>
6221         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
6222         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
6223         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
6224         be the value of the ip buffer.
6226 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6228         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
6229         interfaces_packed here.
6231         Fixes part of #463294.
6233 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6235         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
6237         Fixes part of #463294.
6239 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6241         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
6242         is a boxed complex as well.
6244         Fixes part of #463294.
6246 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6248         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
6249         control if a methodspec should be created for the generic method definition from external assemblies.
6250         Caching of methodspec is done using the handleref hash table.
6252         Fixes #462592.
6254 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
6256         * loader.c (find_method): When searching the interfaces of a class
6257         check the transitive closure of implemented interfaces.
6259         Fixes #463303.
6261 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
6263         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
6264         
6265 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
6267         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
6268         interfaces calculation to fill_valuetype_array_derived_types.
6270         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
6271         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
6272         for example.
6274         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
6275         interfaces for valuetypes if needed.    
6277         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
6278         for their basetype as well. Types are array expanded if rank is > 0.
6280         Fixes #400716.
6282 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
6284         * socket-io.h : Changing the signature of
6285           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
6286           the blocking state.
6288         * icall-def.h :  Changing the signature of
6289           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
6291         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
6292           For Windows only.  Avoid blocking when calling accept by
6293           querying for a connection via select.  The loop also queries
6294           the thread state every 1000 micro seconds for the thread
6295           stop state.  This will avoid the process hanging on shutdown
6296           when using a TcpChannel that is never connected to.
6298         Code is contributed under MIT/X11 license.
6300 2008-12-30  Marek Safar  <marek.safar@gmail.com>
6302         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
6304 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
6306         * class.c (get_implicit_generic_array_interfaces): Extract common
6307         code to a helper function making it a lot easier on the eyes.
6309 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
6311         * class.c (get_implicit_generic_array_interfaces): If the internal
6312         enumerator is an interface inflate System.Object instead of itself.
6314         Fixes #461261.
6316 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
6318         * object.c (mono_runtime_invoke_array): Don't assert with
6319         byref nullable types.
6321         * marshal.c (mono_marshal_get_runtime_invoke): To handle
6322         byref nullables we unbox the object and store it on the
6323         stack. 
6324         We can't use the boxed object since it is the T of Nullable<T>
6325         and the boxed representation of a nullable it's underlying type
6326         or null.
6327         We could cheat and create a boxed nullable and use the same
6328         machinery of other byref VTs but this feels like a hack and
6329         using the stack has the bonus of reducing heap pressure.
6331         Fixes #461941.
6333 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
6335         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
6336         return value.
6338         Fixes #461867.
6340 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
6342         * icall-def.h : Adding an internal call definition for 
6343           System.Environment.internalBroadcastSettingChange.
6345         * icall.c : Adding a Windows only implementation to broadcast a 
6346           WM_SETTINGCHANGE when an environment variable has changed.
6348         Code is contributed under MIT/X11 license.
6350 2008-12-19  Mark Probst  <mark.probst@gmail.com>
6352         * class.c, class-internals.h: Made
6353         mono_class_has_parent_and_ignore_generics() non-static.
6355 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
6357         * image.c: deal with the mmap failing when loading an image.
6359 2008-12-17  Geoff Norton  <gnorton@novell.com>
6361         * threadpool.c: Ensure that the io_queue_lock is initialized
6362         in all circumstances, as we always attempt to cleanup against it.
6364 2008-12-17  Miguel de Icaza  <miguel@novell.com>
6366         * icall.c (ves_icall_System_Environment_get_Platform): For
6367         compatibility reasons for existing client code we will keep
6368         returning 4 for a while.   
6370         For how long will depend on the documentation being updated, and
6371         for us to give client code a chance to be updated.
6373         This reverts the original decison on #433108 since we did not
6374         catch roughly 33 instances of the broken code in our own source
6375         code base, we did not catch failures on the buildbots, and QA did
6376         not bring this as a problem.
6378         Only today I found some customer's code breaking due to our own
6379         class libraries not being fully updated and tracked it down to
6380         this change.  I am reverting it because if we could not even get
6381         our story straight in our own code base, how can we hope that our
6382         end user code be fixed?
6384         As of this morning, our Wiki page that documents how to detect
6385         Unix had not been fixed.    
6387 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
6389         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
6391         * class.c (mono_class_get_fields): Handle loading errors.
6393 2008-12-12 Mark Mason <mmason@upwardaccess.com>
6395         * metadata.c (mono_type_stack_size_internal): If SIZEOF_REGISTER > SIZEOF_VOID_P then use SIZEOF_REGISTER as the size and alignment of the stack slots.
6396         
6397 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
6399         * mono-perfcounters.c: avoid warning.
6401 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6403         * reflection.c (ensure_runtime_vtable): Work on generic instances and
6404         make sure all interfaces have MonoClass::interface_id set.
6406         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
6407         method table is property set.
6409 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6411         * class.c: New function mono_class_setup_interface_id that setup
6412         MonoClass::interface_id if needed.
6414         * class-internals.h: Export new function.
6416 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6418         * class.c: Add code to sanity check the vtable after setup_vtable_general
6419         has done it's work.
6421 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
6423         * icall.c: make Assembly.GetExecutingAssembly work properly when
6424         reflection is used to invoke the method.
6425         Bug #321781 fixed.
6427 2008-12-11  Mark Probst  <mark.probst@gmail.com>
6429         * metadata/generic-sharing.c: Look for constraints in all type
6430         arguments, not just the first one.
6432 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
6434         * appdomain.c: return the correct CodeBase for an Assembly instance
6435         that was loaded from the shadow-copy directories.
6436         Bug #458190 fixed.
6438 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
6440         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
6442         * sgen-gc.c (check_object): New debugging helper function.
6444         * object.c: Fix calls to mono_value_copy_array ().
6446 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6448         * class.c (mono_class_setup_fields): If working on an inflated class
6449         first check if the generic definition did init with success.
6451         Fixes #445361.
6453 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6455         pedump.c (main): Fix a warning.
6457 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
6459         * object-internals.h : Adding a definition for 
6460           MonoReflectionComVisibleAttribute.
6462         * marshal.c (cominterop_com_visible) :  Method added to check the 
6463           ComVisible attribute of a class.
6465         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
6466           cominterop_raise_hr_exception added to consolidate common code 
6467           to raise hr exceptions.
6469         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
6470           if a managed class should support IDispatch.
6472         * marshal.c 
6473           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
6474           Added additional checks for managed object when getting 
6475           an IDispatch interface.
6477         Code is contributed under MIT/X11 license.
6479 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6481         pedump.c (main): Handle mono_get_method () returning NULL. 
6483 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
6485         * marshal.h: Fix a warning.
6487 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
6489         * marshal.c : Adding cominterop_release_all_rcws to release all
6490           runtime callable wrappers held by the runtime.
6492         * marshal.h : Adding declaration for cominterop_release_all_rcws.
6493           
6494         Code is contributed under MIT/X11 license.
6496 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
6498         * metadata.c (mono_image_alloc_lock): New helper function.
6499         (mono_image_alloc0_lock): Ditto.
6501         * metadata.c: Use the alloc_lock () helper functions for allocating
6502         memory from the image mempool.
6504 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
6506         * class.c (mono_class_from_generic_parameter): Document it's
6507         locking behavior. Fix double checked locking here, we stored in
6508         param->pklass a partially initialized MonoClass and no membar was used.
6510 2008-12-05  Marek Habersack  <mhabersack@novell.com>
6512         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
6513         (3) functions are present in the C library use them to do the
6514         job. If they are absent, make sure that the sum of int_part and
6515         dec_part is rounded before returning. This is necessary due to the
6516         division of dec_part by the power of 10 before the final addition
6517         is performed - if the result is not rounded in some cases it will
6518         yield invalid results.
6520 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
6522         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
6523         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
6524         instruction instead of a pointer constant.
6526 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
6528         * loader.c (mono_method_get_header): Do most of the work outside the
6529         loader lock, to avoid assembly load hook deadlocks.
6531         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
6532         (mono_metadata_parse_type_full): Ditto.
6534 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
6536         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
6537         Make the stack depth fixed. Ensure proper argument passing to the backtrace
6538         funtions. Finally, use a lock to produce well ordered output.
6540         The lock looks silly, as all calls to the corlib mempool should be guarded
6541         with the loader lock, but for some reason this fact doesn't help. 
6543         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
6545 2008-12-02  Mark Probst  <mark.probst@gmail.com>
6547         * socket-io.c: 64 bit big-endian fixes.
6549 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
6551         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
6552         targets that require strict compatibility between the types.
6554         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
6555         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
6556         Kill the strict argument and create a new one valuetype_must_be_boxed.
6558         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
6559         state that all valuetypes must be boxed.
6561         Fixes #448560.
6563 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
6565         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
6566         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
6568         Contributed under MIT/X11 license.
6570 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
6572         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
6573         the inflate_generic_type machinery should handle it.
6575         This avoids a crash when the field's flags is zero and it's type is
6576         a primitive.
6577         What happens is that mono_metadata_parse_type_full will see that opt_attrs
6578         is zero and will return one of the cached built-in primitive types. Since
6579         those types live in read-only memory, the code that copies it crashes.  
6581 2008-11-28  Mark Probst  <mark.probst@gmail.com>
6583         * object.c: Don't put function descriptors into generalized IMT
6584         thunks.
6586 2008-11-28  Mark Probst  <mark.probst@gmail.com>
6588         * class.c: Enable generic code sharing on PPC64.
6590 2008-11-27  Mark Probst  <mark.probst@gmail.com>
6592         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
6593         from mini/mini.c.
6595         * generic-sharing.c: Allocate the method template slists from the
6596         image mempool so it doesn't leak.
6598 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
6600         * class.c (generic_array_methods): Release the linked list.
6602 2008-11-27  Mark Probst  <mark.probst@gmail.com>
6604         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
6605         invocation to g_utf16_to_utf8().
6607 2008-11-26  Mark Probst  <mark.probst@gmail.com>
6609         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
6610         arguments on big endian archs.
6612 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
6614         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
6615         the type name (test added in corlib).
6617 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
6619         * pedump.c: initialize perf. counters. Fixes a segv.
6621 2008-11-25  Martin Baulig  <martin@ximian.com>
6623         * mono-debug-debugger.c
6624         (mono_debugger_runtime_invoke): Return the exception object if an
6625         exception was thrown.  Visual Studio displays the exception object
6626         in the locals window.
6628 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6630         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
6631         ftnptr.
6633 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6635         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
6636         MONO_TYPE_U are sizeof (gpointer), too.
6638 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6640         * marshal.c (mono_type_native_stack_size): Fixed size and
6641         alignment for reference types.
6643 2008-11-23  Mark Probst  <mark.probst@gmail.com>
6645         * class.c (mono_class_generic_sharing_enabled): Disable generic
6646         code sharing for PPC64.
6648 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
6650         * icall.c (mono_method_get_equivalent_method): Make sure
6651         method->klass->methods is inited before looping over it.
6653 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6655         * object.c: when calling ExecuteAssembly in a newly created domain,
6656         the configuration file and application base are already set up.
6657         Bug #446353 take 2 fixed.
6659 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
6661         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
6662         Fixes #444715. Fix a warning.
6664 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
6666         * appdomain.c: write the full path of the assembly to the .ini file
6667         created when "shadow-copying"
6668         Bug #446353 fixed.
6670 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
6672         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
6673         if signature==FALSE.
6675 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
6677         * marshal.h : Fix the cygwin build.
6678            marshal.c:12442: undefined reference to `_IID_IMarshal'
6679           
6680         Code is contributed under MIT/X11 license.
6682 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
6684         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
6685           free threaded marshaler when QueryInterface is called on a COM callable
6686           wrapper requesting the IMarshal interface.
6687           
6688         Code is contributed under MIT/X11 license.
6690 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
6692         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
6694         * reflection.c (mono_type_get_object): Special case the very common
6695         void type.
6697         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
6698         hold typeof(void).
6700 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
6702         * process.h : Adding method declaration for
6703           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
6704           
6705         * process.c : Adding implementation for
6706           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
6707           
6708         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
6709           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
6711         Code is contributed under MIT/X11 license.
6713 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
6715         * appdomain.c (unload_thread_main): Clean up threadpool by
6716         calling mono_thread_pool_remove_domain_jobs.
6718         * domain-internals.h (struct _MonoDomain): Add new fields to
6719         help coordinate the cleanup of the threadpool.
6721         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
6722         that cleans up the threadpool of all jobs associated with an appdomain.
6723         It does that by cleaning up the queues and making sure all active
6724         threads are accounted.
6726         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
6727         unloaded or in the process of. Take this is such way that there is
6728         no race condition between another thread starting the unload and the
6729         current thread acknowledging it.
6731         * threadpool.c (async_invoke_thread): Same.
6733         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
6734         firing the new thread.
6736         * threadpool.c (start_tpthread): Same.
6738         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
6740         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
6742 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
6744         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
6745         Add support for DuplicateHandle.
6746         
6747         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
6748         Add support for DuplicateHandle.
6749         
6750         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
6751         Add support for DuplicateHandle.
6753         Code is contributed under MIT/X11 license.
6755 2008-11-06  Mark Probst  <mark.probst@gmail.com>
6757         * class-internals.h: Make min_align into a whole byte.
6759         * class.c: Set min_align for SIMD types to 16.
6761 2008-11-05  Geoff Norton  <gnorton@novell.com>
6763         * attach.c: Default the attacher to enabled for all cases including
6764         embedded.
6766 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
6768         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
6769         change r117650.
6771 2008-11-04  Mark Probst  <mark.probst@gmail.com>
6773         * monitor.c, monitor.h: New function for querying offsets of
6774         members of MonoThreadsSync.
6776 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
6778         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
6779         to speed up this function and to avoid the boundless memory growth caused by
6780         the signature_dup () calls.
6782 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
6784         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
6785         wrapper.
6787         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
6788         by 1 bit.
6790         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
6792 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
6794         * appdomain.c:
6795         * domain-internals.h: made mono_set_private_bin_path_from_config()
6796         "internal".
6797         * object.c: call the above function after setting the configuration
6798         file path for the root domain.
6799         Fixes bug #314478.
6801 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
6803         * assembly.c: when the assembly is loaded from an absolute path, end
6804         basedir with a directory separator.
6805         Bug #440781 fixed.
6807 2008-10-30  Mark Probst  <mark.probst@gmail.com>
6809         * monitor.c (mono_monitor_get_fast_enter_method): If
6810         CompareExchange is not available, don't create the fastpath
6811         instead of asserting.  (The method is missing in the 1.1 profile.)
6813 2008-10-30  Mark Probst  <mark.probst@gmail.com>
6815         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
6817         * monitor.c, monitor.h: Code for generating Monitor.Enter and
6818         Monitor.Exit IL fastpaths.
6820 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
6822         * class.c (mono_class_create_from_typedef): Added Vector2ul.
6824 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
6826         * class.c (mono_class_create_from_typedef): Added Vector2l.
6828 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
6830         * class.c (mono_class_create_from_typedef): Added Vector2d.
6832 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
6834         * appdomain.c: translate \ into / for cache_path.
6835         * domain-internals.h: new mono_is_shadow_copy_enabled().
6836         * icall.c: (fill_reflection_assembly_name) do the same path
6837         manipulations that get_code_base does.
6838         (get_code_base) use mono_is_shadow_copy_enabled.
6840 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
6842         * appdomain.c: shadow-copied assemblies go to CachePath +
6843         ApplicationName when both are set. DynamicBase has nothing to do with
6844         shadow copies.
6845         Bug #406877 fixed.
6847 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
6849         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
6850         STANDALONESIG table.
6852         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
6853         standalone signatures.
6855         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
6856         comparison code: instead of comparing the signatures using a custom
6857         equals function, transform them to a common signature and compare that. This
6858         works better with AOT.
6860 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
6862         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
6864         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
6865         call for generic instances.
6866         (mono_class_setup_properties): Call setup_properties () before accessing
6867         gklass->properties.
6869         * class.c (mono_class_get_virtual_methods): New helper function to iterate
6870         over the virtual methods of a class using metadata if possible, avoiding the
6871         creation of MonoMethod's for non-virtual methods.
6872         
6873         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
6874         get_virtual_methods () to iterate over the virtual methods of classes.
6876 2008-10-25  Martin Baulig  <martin@ximian.com>
6878         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
6880 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
6882         * class.c (mono_class_create_from_typedef): Added Vector4i.
6884 2008-10-24  Mark Probst  <mark.probst@gmail.com>
6886         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
6887         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
6888         special-casing applies to eliminate the call completely.
6890 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
6892         * class.c (mono_class_create_from_typedef): Added Vector8s.
6894 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
6896         * class.c (mono_class_create_from_typedef): Added Vector16sb.
6898 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6900         * icall.c: get rid of annoying warning.
6902 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6904         * threadpool.c: in 1.x, if you change the background status of the
6905         threadpool thread, it's not reset.
6906         Remove unnecessary calls to SetState.
6908 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6910         * threadpool.c: asynchronously create a set of idle threads upon first
6911         use of the threadpool. SetMinThreads will now start the appropriate
6912         number of idle threads if they are not already running. The default is
6913         1 threadpool thread per CPU. Increased the maximum number of threads
6914         per CPU to 10.
6916 2008-10-22  Martin Baulig  <martin@ximian.com>
6918         Revert r116521 from Zoltan, it breaks the debugger:
6920         * class.c (mono_class_get_virtual_methods): New helper function to iterate
6921         over the virtual methods of a class using metadata if possible, avoiding the
6922         creation of MonoMethod's for non-virtual methods.
6923         
6924         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
6925         get_virtual_methods () to iterate over the virtual methods of classes.
6927 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6929         * threads.c: when creating a threadpool thread, set its state to
6930         'background'.
6931         * threadpool.c: reset the background state of a threadpool thread
6932         after finishing each work item
6933         Bug #437888 fixed.
6935 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
6937         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
6938         
6939         * class.c (mono_class_setup_vtable_general): Add an optimized version for
6940         generic instances which works by inflating the methods in the container
6941         class's vtable.
6943         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
6944         variant which doesn't make a copy if no inflation was done.
6945         (mono_class_setup_fields): Use it.
6947         * metadata.c (mono_metadata_get_shared_type): New helper function to
6948         return a shared instance of a given MonoType.
6950         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
6951         a copy of most non-generic types.
6953 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
6955         * threadpool.c: remove one more GetSystemInfo () call.
6957 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
6959         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
6960         use the code in mono-proclib.h to get processor information.
6962 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6964         * appdomain.c: fixed the logic that determines whether assemblies in a
6965         directory are "shadow-copied" or not. Bug #433483 fixed.
6967 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
6969         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
6970         warning.
6972 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
6974         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
6975         returning a vtype.
6977         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
6978         reflection.c: Use mono_field_get_name () for accessing a field's name.
6980         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
6981         class.c
6983         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
6984         field.
6986         * loader.c (find_method_in_class): Reenable the metadata optimization by
6987         not using it for generic instances.
6989         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
6990         data/def_type fields from MonoClassField into a separate structure.
6991         (struct MonoClassField): Remove data/def_type fields.
6992         (struct _MonoClass): Add a 'field_def_values' array to store the default
6993         values/RVA for fields.
6995         * class.c reflection.c: Update after the changes.
6996         
6997         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
6998         for accessing field->data.
7000         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
7002         * loader.c (find_method_in_class): Revert the last change for now as
7003         it breaks Mono.C5 unit tests.
7005         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
7006         'field_generic_types' and 'field_objects' which contain the information
7007         previously stored in MonoInflatedField.
7008         (MonoInflatedField): Delete.
7009         (struct _MonoClassField): Delete 'generic_info' field.
7011         * reflection.c: Store the information which was previously in 
7012         field->generic_info in MonoDynamicGenericClass instead.
7014         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
7015         MonoClassField changes.
7017 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
7019         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
7020         store the value inside the data array of the MonoMethodWrapper.
7021         This saves memory, is faster and fixes the lifetime issues (methods
7022         were never removed from the hash previously). May also fix bug#436996.
7024 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
7026         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
7027         generic instances, compute the type from the generic definition instead of
7028         looking in field->generic_info.
7030         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
7031         for inflated fields, the only user was get_fieldref_token () which no
7032         longer needs it.
7034         * class.c (mono_class_init): Revert the last change as it seems to cause
7035         crashes.
7037         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
7038         bytes on 64 bit platforms.
7040         * object.c (mono_class_create_runtime_vtable): Fix a warning.
7041         
7042         * object.c (mono_class_create_runtime_vtable): Don't initalize
7043         field->data/field->def_type here, it is done lazily by 
7044         mono_class_get_field_default_value ().
7046         * icall.c (ves_icall_get_enum_info): Call 
7047         mono_class_get_field_default_value () instead of directly accessing
7048         field->data and field->def_type.
7050         * object.c (get_default_field_value): Ditto.
7052         * class.c (mono_field_get_data): Ditto.
7053         
7054         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
7055         call for generic instances.
7057         * loader.c (find_method_in_class): If klass != from_class, then inflate
7058         the method with the context of from_class, since the caller assumes this.
7060 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
7062         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
7063         for accessing method->slot.
7065 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
7067         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
7069 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
7071         * class.c (mono_method_get_vtable_index): Use
7072         mono_method_get_vtable_slot () for accessing method->slot.
7074         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
7075         accessing klass->methods.
7077         * class.c (mono_method_get_vtable_slot): New helper function.
7078         (mono_class_get_vtable_entry): Ditto.
7079         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
7080         accessing method->slot.
7082         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
7083         method to get_inflated_method ().
7085         * class.c (mono_class_get_inflated_method): New helper method to obtain
7086         a method of an inflated class without calling setup_methods ().
7087         (mono_class_get_cctor): Use get_inflated_method.
7089         * generic-sharing.c (mono_class_get_method_generic): Ditto.
7090         
7091         * marshal.c image.c: Lazily create all the marshal caches.
7093         * image.c (mono_image_init): Move initialization of runtime_invoke
7094         caches to marshal.c.
7096         * marshal.c (get_cache): New helper function to lazily initialize a 
7097         wrapper cache.
7098         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
7100         * debug-helpers.c (mono_method_full_name): Include generic arguments.
7102 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
7104         * loader.c: fixed check for interface type.
7106 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
7108         * appdomain.c: check for NULL setup before it's referenced.
7111 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
7113         * class.c: remove the unused old vtable setup code.
7115 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
7117         * class.c: don't depend on interface order in
7118         setup_interface_offsets (bug #435777).
7119         * reflection.c: sort the InterfaceImpl table (patch from
7120         Jb Evain  <jbevain@novell.com>).
7122 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
7124         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
7125         the low level assemblies lock.
7127 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
7129         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
7130         object.c, reflection.c, socket-io.c, threads.c: introduced
7131         mono_framework_version () to return the major framewrok version,
7132         changed the code that was using more complex patterns to use it.
7133         Return the correct value for PlatformID for OSX.
7135 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
7137         * icall-def.h, process.h, process.c: added an icall to get info about
7138         processes using mono-proclib.
7140 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
7142         * mono-perfcounters.c: use the mono-proclib functions to
7143         access process information.
7145 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
7147         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
7148         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
7149         reflection.c: remove rawbuffer usage: mmap support is more sanely
7150         provided by utils/mono-mmap.
7152 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
7154         * gc.c: use posix semaphores when possible so that
7155         mono_gc_finalize_notify() is signal safe.
7157 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
7159         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
7160         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
7161         be #ifdef-ed out, the linker will remove the rest.
7163         * marshal.c: Implement DISABLE_COM.
7165         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
7167 2008-10-11  Miguel de Icaza  <miguel@novell.com>
7169         * locales.c (string_invariant_compare_char): Optimization: do not
7170         call g_unichar_type unless we actually need the information.
7172 2008-10-10  Mark Probst  <mark.probst@gmail.com>
7174         * object.c, class-internals.h: Also create remoting trampolines
7175         for generic methods.  Pass the domain to the remoting trampoline
7176         creation function, too.
7178 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
7180         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
7182 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
7184         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
7185         Vector4ui.
7187 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
7189         * assembly.c:
7190         * locales.c: remove the use of g_strdown. Fixes bug #322313.
7192 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
7194         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
7195         for the least possible amount of time (extending the fix in r113458).
7197 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
7199         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
7201 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
7203         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
7204         as possible simd intrinsic types.
7205         Optimized the test to check for the common prefix first.
7207 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
7209         * class.c: back out part of a broken optimization committed on
7210         May 23th (bug #433908).
7212 2008-10-09  Mark Probst  <mark.probst@gmail.com>
7214         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
7215         Win32.  Should fix #432388 for most cases until we have the new
7216         profiler on Win32.
7218 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
7220         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
7221         instead of using inst->id so the hash is stable for AOT.
7223 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
7225         * appdomain.c:
7226         * icall.c: create a .ini file for shadow-copied assemblies that
7227         contains the location of the original assembly. Use this to return the
7228         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
7229         Also fix the number of '/' for windows when returning the CodeBase.
7230         Fixes bug #430920.
7232 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7234         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
7236         Code is contributed under MIT/X11 license.
7238 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7240         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
7241           if if the class vtable needs initialized.
7243         Code is contributed under MIT/X11 license.
7245 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7247         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
7248           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
7249           STRING->BSTR, and CLASS->INTERFACE.
7251         Code is contributed under MIT/X11 license.
7253 2008-10-07  Marek Habersack  <mhabersack@novell.com>
7255         * sysmath.h: changed the declaration of the
7256         ves_icall_System_Math_Round2 icall by adding an extra
7257         away_from_zero parameter.
7259         * sysmath.c (ves_icall_System_Math_Round2): added support for
7260         away from zero rounding. The icall now takes an extra boolean
7261         parameter to signal that away from zero operation is requested.
7263 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
7265         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
7266         the delegate klass so it can work with full-aot.
7267         (mono_marshal_get_delegate_end_invoke): Ditto.
7268         (mono_marshal_get_delegate_invoke): Ditto.
7270 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
7272         * gc.c, attach.h, attach.c: remove a bad pattern:
7273         add_finalizer_callback () is not implemented correctly, it can't
7274         without adding more overhead to the finalizer loop and it's not
7275         even needed, since we know exactly what we need to call, so there is
7276         no need to do so through an expensive function pointer.
7278 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
7280         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
7281         for the no-gc case.
7282         * attach.c (mono_attach_init): Remove the #ifdef.
7284 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
7286         * attach.c (mono_attach_init): Don't use
7287         mono_gc_add_finalizer_thread_callback when compiling without GC.
7288         Fixes #432306.
7289         
7290         Code is contributed under MIT/X11 license.
7292 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
7294         * class.c (mono_class_create_from_typedef): Remove the 
7295         #ifndef DISABLE_SIMD stuff.
7297 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
7299         * class-internals.h (MonoClass): Added simd_type bit field.
7301         * class.c (mono_class_create_from_typedef): Check if type is a simd
7302         intrinsic.
7304 2008-10-03  Mark Probst  <mark.probst@gmail.com>
7306         * object.c (mono_method_add_generic_virtual_invocation): Only add
7307         instantiations to the thunk whose count is at least as large as
7308         the threshold.
7310 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
7312         * icall.c: changed the Type of the exception thrown when trying to
7313         invoke a constructor on an abstract class. Part of the fix for bug
7314         #324185.
7316 2008-10-02  Mark Probst  <mark.probst@gmail.com>
7318         * class.c, class-internals.h (mono_method_get_vtable_index): New
7319         function which returns the index into the vtable and properly
7320         handles inflated virtual generic methods.
7322 2008-10-01  Mark Probst  <mark.probst@gmail.com>
7324         * object.c, domain.c, object-internals.h, domain-internals.h:
7325         Generalize IMT thunk machinery to also handle thunks for virtual
7326         generic method invokes.  When a virtual generic method is invoked
7327         more than a number of times we insert it into the thunk so that it
7328         can be called without lookup in unmanaged code.
7330         * generic-sharing.c, class-internals.h: Fetching a
7331         MonoGenericInst* for a method from an (M)RGCTX.
7333 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
7335         * marshal.c (emit_marshal_string): Applied a variant of a patch by
7336         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
7337         marshalling. Fixes #431304.
7339 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
7341         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
7342           handle when ref is specified without In or Out.
7344         Code is contributed under MIT/X11 license.
7346 2008-09-30  Mark Probst  <mark.probst@gmail.com>
7348         * loader.c (mono_get_method_constrained): Don't expand method with
7349         the class's context, because it's already a method of that class.
7351 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
7353         * attach.c : should be correct build fix.
7355 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
7357         * attach.c: Fix the previous change.
7359 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
7361         * attach.c : quick w32 build fix.
7363 2008-09-27  Miguel de Icaza  <miguel@novell.com>
7365         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
7366         crashes MonoDevelop: #430455.
7368 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
7370         * domain-internals.h (struct _MonoDomain): Move most fields used only by
7371         the JIT do MonoJitDomainInfo in ../mini/mini.h.
7373         * domain.c: Remove initialization/cleanup of the removed fields.
7375 2008-09-27  Mark Probst  <mark.probst@gmail.com>
7377         * class.c (mono_class_generic_sharing_enabled): Enable generic
7378         code sharing for PPC.
7380 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
7382         * attach.c : Fixing the Windows builds.
7384         Code is contributed under MIT/X11 license.
7386 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
7388         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
7389         the default generic sharing mode to 'all'.
7391 2008-09-25  Mark Probst  <mark.probst@gmail.com>
7393         * generic-sharing.c, class-internals.h: New function for checking
7394         whether a method needs a static RGCTX invoke wrapper.  A few
7395         funtions moved from mini/generic-sharing.c.
7397         * icall.c: New function used.
7399 2008-09-25  Mark Probst  <mark.probst@gmail.com>
7401         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
7402         Static RGCTX invoke wrapping applies to value type methods, too.
7404         * class.c (mono_class_setup_vtable_general): In generic-shared
7405         value types, wrap methods with a static RGCTX invoke wrapper.
7407 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
7409         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
7410         osx build.
7412 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
7414         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
7415         register a callback which is called when the finalizer thread is woken
7416         up.
7417         (finalizer_thread): Call the callback if it exists.
7419         * attach.h attach.c: New files, implementing the attach mechanism.
7421         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
7422         
7423         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
7424         by the previous change.
7426 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
7428         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
7429         loader.c, marshal.c, metadata-internals.h, metadata.c,
7430         method-builder.c, object.c, reflection.c: introduced specific functions
7431         to allocate from the domain and image mempools and cleaned up most of
7432         the code to use them (still missing a few in reflection.c).
7433         Keep the loader bytes counter updated.
7435 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
7437         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
7438         loader-related counters.
7440 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
7442         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
7443         added more MS-compatible counters.
7445 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
7447         * class.c (mono_class_setup_fields): Call setup_fields before accessing
7448         class->blittable. Fixes #428217.
7450 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
7452         * reflection.c (mono_image_get_field_on_inst_token): Call 
7453         field_encode_signature () since that handles custom modifiers too.
7454         Fixes #424663.
7456 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
7458         * reflection.c (add_custom_modifiers): New helper function to merge custom
7459         modifiers stored in objects to a MonoType.
7460         (fieldref_encode_signature): Encode custom modifiers.
7461         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
7462         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
7464 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
7466         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
7467         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
7468         64-bit IL only images because imports are not resolved for IL only images.
7469         Special thanks to Bill Holmes for finding this bug and testing the patch.
7470         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
7472         Contributed under MIT/X11 license.
7474 2008-09-19  Miguel de Icaza  <miguel@novell.com>
7476         * mono-config.c (dllmap_start): Add support for the bits keyword
7477         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
7479 2008-09-19  Mark Probst  <mark.probst@gmail.com>
7481         * reflection.c (inflate_mono_method): When the class the method is
7482         to be inflated for is itself not inflated, just return the method.
7484 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
7486         * mono-perfcounters.c: use more user friendly process instance names.
7488 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
7490         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
7491           handle "[in] ref" and "[in][out] ref" cases.
7493         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
7494           to mono_mb_create_method.  This was causing problems calling native to
7495           managed passing Variants by value.
7497         Code is contributed under MIT/X11 license.
7499 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
7501         * class.c (can_access_internals): Call mono_assembly_load_friends ()
7502         before accessing the friend_assembly_names field.
7504         * assembly.c (mono_assembly_load_friends): Make this callable multiple
7505         times.
7506         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
7507         called lazily when it is needed.
7509         * metadata-internals.h (struct _MonoAssembly): Add 
7510         'friend_assembly_names_inited' flag.
7512 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
7514         * mono-perfcounters-def.h: fix the types of a few counters.
7515         * mono-perfcounters.c: implemented the instance names getter
7516         and a few bugfixes.
7518 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
7520         * culture-info-table.h : regenerated.
7522 2008-09-17  Robert Jordan  <robertj@gmx.net>
7524         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
7525         context bound objects. Fixes #415577.
7527         Code is contributed under MIT/X11 license.
7529 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
7531         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
7532         implementation (bug #423582).
7534 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
7536         * object.c (mono_object_get_virtual_method): Handle the case method->slot
7537         is not set. Fixes #426309.
7539 2008-09-16  Jb Evain  <jbevain@novell.com>
7541         * class.c (mono_class_from_name): fix the exported type look up
7542         when the type is defined in a referenced assembly.
7544 2008-09-16  Jb Evain  <jbevain@novell.com>
7546         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
7547         increment the next index counter on each iteration to make that work
7548         for more than one type forwarder. Unmanaged part to fix #422929.
7550 2008-09-15  Mark Probst  <mark.probst@gmail.com>
7552         * object-internals.h: enum ComInterfaceType in
7553         MonoInterfaceTypeAttribute is guint32, not guint16.
7555 2008-09-12  Mark Probst  <mark.probst@gmail.com>
7557         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
7558         writing code.
7560 2008-09-11  Mark Probst  <mark.probst@gmail.com>
7562         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
7563         not gboolean.
7565 2008-09-11  Mark Probst  <mark.probst@gmail.com>
7567         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
7568         Endianness fixes for MonoSymbolFileOffsetTable.
7570 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
7572         * process.c (complete_path) : Removing quotes from the 
7573           input path.  The glib file routines do not handle file paths
7574           that have quotes around them.
7576         Code is contributed under MIT/X11 license.
7578 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
7580         * socket-io.h : Adding a comment to provide locations where 
7581           changes to MonoSocketAsyncResult need to be synced.
7583         Code is contributed under MIT/X11 license.
7585 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
7587         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
7588         parameters as well. Fixes #425001.
7590 2008-09-08  Miguel de Icaza  <miguel@novell.com>
7592         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
7593         windows build.
7595 2008-09-07  Miguel de Icaza  <miguel@novell.com>
7597         * console-io.c: Add support for tracking the window size if it
7598         changes.
7600         The setup is very simple: the TtySetup function will now return a
7601         pointer to a location in memory that tracks the current console
7602         size.  The managed code checks its current value every time its
7603         queried against the last value set, and updates accordingly.
7605         With this setup we can work with multiple consoles, and we do not
7606         require to poke into managed code from a signal handler.
7608         Additionally, the environment for COLUMNS and LINES is now handled
7609         in unmanaged code.
7611         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
7613 2008-09-07  Mark Probst  <mark.probst@gmail.com>
7615         * marshal.c (mono_type_native_stack_size): Treat
7616         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
7618 2008-09-04  Jb Evain  <jbevain@novell.com>
7620         * class.c (mono_class_is_assignable_from): fix assignability of nullables
7621         to nullables.
7623 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
7625         * verify.c (verify_type_compatibility_full): Revert change
7626         to allow converting a native int to unmanaged pointer be verifiable
7627         under non-strict mode.
7628         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
7630         * verify.c: Added some TODOs.
7632 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
7634         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
7635           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
7636           Changed to use GlobalAlloc for the memory returned on Windows platforms.
7638         Code is contributed under MIT/X11 license.
7640 2008-09-02  Jb Evain  <jbevain@novell.com>
7642         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
7644 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
7646         reflection.c (typebuilder_setup_fields): Handle classes with
7647         explicit size.
7649 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
7651         class.c (mono_class_setup_events): Add memory barrier due to
7652         double checked locking.
7653         
7654         class.c (mono_class_setup_properties): Same.
7656 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
7658         * class.c (mono_class_is_assignable_from): Fix the build.
7659         
7660         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
7661         before accessing klass->interface_bitmap. Fixes #421744.
7663 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
7665         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
7666         the runtime into no-exec mode, useful when running the AOT compiler.
7668         * appdomain.c gc.c object.c: Avoid executing managed code when running
7669         in no-exec mode.
7670         
7671         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
7673         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
7674         special case when the mono_assembly_loaded () returns NULL because the 
7675         search hook is not installed.
7677 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
7679         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
7680         crashes in bstr marshalling on linux.
7682 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
7684         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
7685         with more than one parameter.
7687 2008-08-24  Miguel de Icaza  <miguel@novell.com>
7689         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
7690         start/stop flow control as well when turning off ICANON (allows
7691         C-s and C-q to be read by Console.ReadKey).
7693 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
7695         * class.c (mono_class_init): Move the initialization of nested classes
7696         into mono_class_get_nested_types (). Fixes #418433.
7698         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
7699         flag.
7701         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
7702         iterating tough the nested classes of a class.
7704 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
7706         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
7707         on arm.
7709 2008-08-22  Miguel de Icaza  <miguel@novell.com>
7711         * console-io.c (sigcont_handler): Support signal chaining for
7712         SIGCONT.
7714         (console_set_signal_handlers): Use best practices with sigaction,
7715         clear the structure before using it. 
7717 2008-08-22  Robert Jordan  <robertj@gmx.net>
7719         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
7720         Fix the Windows build.
7722 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
7724         * class.c (mono_class_generic_sharing_enabled): Make the default
7725         sharing mode 'corlib'.
7727 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
7729         * console-io.c (console_set_signal_handlers): Fix a warning.
7731         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
7732         method normally, the JIT will take care of avoiding recursion.
7734 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
7736         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
7738         Code is contributed under MIT/X11 license.
7740 2008-08-20  Miguel de Icaza  <miguel@novell.com>
7742         * console-io.c (sigcont_handler): We need to restore the entire
7743         termios state, not only the original settings, as things like echo
7744         can be controlled after this (Booish exposes this issue with its
7745         own ReadLine implementation).
7747         Additionally, we need to set the terminal back into keypad_xmit
7748         mode.
7749         
7750         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
7751         string as a paramter as well.   Otherwise we get different
7752         keyboard sequences.
7754 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
7756         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
7757         delegates with byref out parameter passing. Fixes #351520.
7759         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
7760         a generic context.
7761         (mono_type_get_desc): Add the type arguments for GENERICINST.
7762         (mono_method_full_name): Stringify the class name using mono_type_full_name
7763         so it picks up generic arguments.
7765 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
7767         * console-io.c: Removed debug output.
7769 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
7771         reflection.c (mono_reflection_create_runtime_class): Alloc
7772         the nested classes linked list using the dynamic image mempool.
7773         Fixes leak in corlib compilation.
7775 2008-08-19  Miguel de Icaza  <miguel@novell.com>
7777         * console-io.c: Fix incredibly annoying behavior on the console
7778         after resuming execution after control-z.   This affected every
7779         console application.
7781 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
7783         * mempool-internals.h: Header for mono private mempool functions. The first
7784         two function are for allocating glib linked lists using pools.
7786         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
7788         * Makefile.am: Added mempool-internals.h.
7790 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
7792         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
7793         (mono_domain_free): Ditto.
7795         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
7796         be used by the JIT to store its domain-specific information, instead of putting
7797         it directly into MonoDomain.
7799         * domain.c (mono_install_create_domain_hook): New helper function to install
7800         a hook which initializes domain->runtime_info.
7802         * domain.c (mono_install_free_domain_hook): Ditto.
7803         
7804 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
7806         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
7807         asserting if the ares parameter is null.
7809         * mono-perfcounters.c: Fix warnings.
7811         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
7812         is not needed, don't check for interruptions either.
7813         (mono_marshal_get_delegate_end_invoke): Ditto.
7815 2008-08-15  Marek Habersack  <mhabersack@novell.com>
7817         * mono-perfcounters.c (predef_readonly_counter): added support for
7818         reading the ASP.NET Requests Queued counter from another process.
7820 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
7822         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
7823         MonoImage to simplify the AOT code.
7825 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
7827         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
7828         marshalling. Fixes #416078.
7830 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
7831         
7832         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
7833         it is set, looking up the icall address is deferred to the JIT, since 
7834         in embedded scenarios, the icall might not be registered in the runtime
7835         doing the AOT compilation. Backported from the 2.0 branch.
7837 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
7839         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
7840         Fixes #415621.
7842 2008-08-05  Marek Habersack  <mhabersack@novell.com>
7844         * Makefile.am: added support for cross-compilation.
7846 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
7848         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
7850 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
7852         * mono-perfcounters.c: jitted methods and jitted bytes counters.
7854 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
7856         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
7857         mono-perfcounters.c: performance counters implementation.
7859 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
7861         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
7862         to gpointer, letting the AOT code decide what to store in it.
7864 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
7866         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
7867           mono_class_setup_methods if the methods are not initialized.
7869         Code is contributed under MIT/X11 license.
7871 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7873         * verify.c: Remove some debug code I commited by accident.
7875         * verify.c (mono_method_is_valid_in_context): Change the return value
7876         to make possible to distinguish between invalid and unverifiable.
7878         * verify.c (verifier_load_method): Don't return NULL for unverifiable
7879         methods.
7881 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7883         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
7884         constraints. Fixes regression in gtest-253.
7886 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7888         * verify.c (mono_verifier_verify_class): Don't allow generic types
7889         with explicit layout.
7891         * verify.c (mono_method_verify): Check locals and argument types.
7893 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
7895         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
7896         wait if the thread is in StopRequested state.
7898         * class.c (mono_class_from_name): Refactor the module searching code into
7899         a separate function so it can be reused in the AOT case too.
7901 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
7903         * verify.c (mono_type_is_valid_in_context): Improve the error message.
7904         Check both the type and it's generic type definition for loader errors.
7905         
7906         * verify.c (mono_method_is_valid_in_context): Don't generate another
7907         error when a type errors occur, this leads to the wrong exception been
7908         thrown.
7910 2008-07-28  Dick Porter  <dick@ximian.com>
7912         * icall-def.h
7913         * process.c
7914         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
7915         New internal calls to duplicate and close a process handle.
7917 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
7919         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
7921 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
7923         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
7925 2008-07-27  Robert Jordan  <robertj@gmx.net>
7927         * class.c (mono_class_init): Don't compute class.has_finalize for
7928         valuetypes. Fixes #412477.
7930 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
7932         * verify.c: Implement constraint equivalence checking.
7933         This is required when a generic parameter is used as
7934         argument to a constrained one.
7936         Fixes #410637.
7938 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
7940         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7942         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
7944         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
7945         synch with managed object layout.
7947 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
7949         * verify.c (do_branch_op): Handle valuetypes and generic
7950         arguments properly.
7952         * verify.c (do_cmp_op): Same.
7954         Fixes #410383.
7956 2008-07-24  Mark Probst  <mark.probst@gmail.com>
7958         * generic-sharing.c: Fix memory leaks.
7960         * class.c, class-internals.h: Make
7961         mono_class_inflate_generic_type_with_mempool() non-static.
7963 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
7965         * pedump.c (dump_verify_info): Dump full class name.
7967 2008-07-24  Mark Probst  <mark.probst@gmail.com>
7969         * generic-sharing.c: Removed some old code that didn't do anything.
7971 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
7972         * profiler.c: Added runtime_initialized_event,
7973         mono_profiler_install_runtime_initialized and
7974         mono_profiler_runtime_initialized. This new hook tells the profiler
7975         when the runtime is sufficiently initialized to be able to call
7976         mono_thread_attach on the root appdomain.
7977         * profiler.h, profiler-private.h: Likewise.
7979 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
7981         * verify.c (do_cast): Do boxing for generic arguments as well.
7983         * class.c (is_nesting_type): Drop generic instantiations before
7984         checking for nesting.
7986         * class.c (can_access_instantiation): Allow access to generic
7987         arguments.
7989 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
7991         * verify.c (verify_class_for_overlapping_reference_fields):
7992         On some cases, the field size might be zero, guard against that.
7993         Fix the explicit layout check to work as expected.
7995 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
7997         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
7998         mono_thread_resume () during shutdown, since the thread we want to abort
7999         might be suspended.
8001 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
8003         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
8004         warning.
8006         * debug-mono-symfile.c: Fix a warning.
8008         * mono-perfcounters.c (get_cpu_times): Fix a warning.
8010         * object.c (mono_class_vtable): Check if exception_type is set, and return
8011         NULL as defined by the function comments.
8013 2008-07-22  Mark Probst  <mark.probst@gmail.com>
8015         * mempool.c: Use malloc for every single mempool allocation if the
8016         configure option is set.  This makes it easier to track mempool
8017         allocations with tools like Valgrind.
8019 2008-07-22  Jb Evain  <jbevain@novell.com>
8021         * reflection.c (create_dynamic_mono_image): emit the same
8022         metadata version that SL2 does when creating a SL2 image.
8024 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
8026         * icall-def.h:
8027         * icall.c: New icall System.Enum:get_hashcode. This function
8028         avoids the overhead of boxing the enum to the underlying type.
8030 2008-07-21  Mark Probst  <mark.probst@gmail.com>
8032         * reflection.c (mono_method_get_object): Don't let static RGCTX
8033         invoke wrappers get into MonoReflectionMethods.
8035 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
8037         * object-internals.h:
8038         * object.c: New mono_runtime_class_init_full function
8039         that makes throwing the exception optinal.
8041         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
8042         for the case where the exception object is supplied.
8044 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
8046         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
8047         old ld versions.
8049         Contributed under MIT/X11 license.
8051 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
8053         * string-icalls.c (ves_icall_System_String_InternalSplit):
8054         Optimize array allocation by caching the MonoClass of the
8055         array type.
8057         * icall.c (ves_icall_Type_GetMethodsByName): Same.
8059         * reflection.c (mono_param_get_objects): Same.
8061 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
8063         * icall-def.h:
8064         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
8065         It inflates the given type using the class context.
8067 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
8069         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
8070         the vtable if it already exists.
8072         * object-internals.h: Add mono_class_try_get_vtable as part of the
8073         internal API.
8075         * reflection.c (mono_type_get_object): Use the MonoObject from the
8076         vtable when possible. Reduces locking contention on reflection heavy
8077         code.
8079 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
8081         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
8082         g_bit_nth_msf () since that macro is not implemented in eglib.
8084 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
8086         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
8087         on platforms which do not support it.
8089 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
8091         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
8093 2008-07-11  Martin Baulig  <martin@ximian.com>
8095         * mono-debug-debugger.h
8096         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
8098         * mono-debug-debugger.c
8099         (_mono_debugger_interruption_request): New global volatile variable.
8100         (mono_debugger_check_interruption): New public function.
8102         * threads.c
8103         (mono_thread_current_check_pending_interrupt): Call
8104         mono_debugger_check_interruption().
8105         (mono_thread_interruption_checkpoint_request): Likewise.
8107 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8109         * verify.c: Add more type checks for loaded types. Verify the result
8110         handle from ldtoken.
8112 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8114         * loader.c (field_from_memberref): Don't crash if the field
8115         wasn't found.
8117 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8119         * verify.c: Verify if type and method instantiations
8120         don't have invalid VAR or MVAR arguments.
8122 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8124         * verify.c: Fix double free of function pointer list.
8126 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8128         * object.c (mono_string_to_utf8): Comment the new code as it
8129         breaks under eglib.
8131 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
8133         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
8135 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
8137         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
8138           is not throw too many times.
8140         Code is contributed under MIT/X11 license.
8142 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
8144         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
8145         debugging is turned off.
8147 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
8149         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
8151 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8153         * class-internals.h, class.c: Added new generic sharing option:
8154         Share only stuff in System.Collections.Generic, which is now the
8155         default.
8157 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8159         * generic-sharing.c, class-internals.h: New function for getting a
8160         generic method in a generic class given the corresponding method
8161         for a different instantiation of the class.  Partly refactored
8162         from mini-trampolines.c.
8164         * class.c: Make sure generic methods have a class_inst if they are
8165         part of a generic class.
8167         * metadata.c (mono_type_stack_size_internal): Handle type
8168         variables.
8170 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8172         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
8173         Signifies whether information on the this/vtable/mrgctx variable
8174         is available.
8176 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8178         * object.c, object-internals.h, icall.c: New function
8179         mono_delegate_ctor_with_method(), which does the same as
8180         mono_delegate_ctor(), but takes an explicit method argument
8181         instead of taking the method from the jit info.
8183         * marshal.c: When creating a delegate with an inflated method take
8184         the "this" argument as the target class for the castclass.
8186 2008-07-03  Mark Probst  <mark.probst@gmail.com>
8188         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
8189         mono_jit_info_table_find() to perform very badly in some cases.
8191 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
8193         * icall.c (type_from_typename): Handle 'string'.
8195         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
8196         wrappers into the wrapper_hash, since the key is not a MonoMethod.
8198 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
8200         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
8202         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
8203         number of available managed allocator types.
8205         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
8206         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
8208 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
8210         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
8211         which is a low level lock protecting just the 'jit_code_hash' hash table.
8213         * domain.c: Initialize+cleanup jit_code_hash_lock.
8214         
8215 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
8217         * coree.c (mono_load_coree): Set coree_module_handle global variable only
8218         after initialization.
8220         * coree.h: Make MonoFixupExe internal.
8222         Contributed under MIT/X11 license.
8224 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
8226         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
8227         because that is platform independent. Check NumberOfRvaAndSizes in PE32
8228         as well.
8229         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
8230         image being loaded is a CLI image and _CorValidateImage gets called.
8232         * coree.h: Add MonoLoadImage.
8234         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
8235         instead of LoadLibrary.
8237         Contributed under MIT/X11 license.
8239 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
8241         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
8242         for any primitive type.
8244 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
8246         * object.c (mono_array_new_specific): Optimize this and the other allocation
8247         functions a bit.
8248         
8249         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
8250         domains too if mono_dont_free_domains is set.
8252         * domain-internals.h (mono_dont_free_domains): New internal option controlling
8253         whenever to free appdomain data after it has been unloaded.
8255         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
8256         
8257 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
8259         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
8260         (mono_method_get_equivalent_method): Fix a warning.
8262         * object.c (mono_message_init): Avoid looking up array types for each call.
8264 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
8266         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
8267         call.
8269         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
8270         even more.
8272         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
8273         each iteration.
8275         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
8276         fields of an enum.
8278 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
8280         * object.c (mono_value_box): Fix boxing of nullables.
8282 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
8284         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
8285         mono_module_handle that is defined by the linker; no initialization required.
8286         * coree.h: Remove mono_module_handle, add __ImageBase, update
8287         mono_image_open_from_module_handle.
8288         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
8289         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
8290         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
8291         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
8292         to 4 GB away from image base address. IA64 version is not tested but was very
8293         easy to implement and should work if we ever need it.
8294         * domain.c (mono_init_internal): Avoid system error message boxes.
8295         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
8296         with has_entry_point. Handle do_mono_image_load fauilre correctly.
8297         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
8298         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
8299         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
8301         Contributed under MIT/X11 license.
8303 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8305         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
8306         as part of the private mono API.
8307         
8308         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
8309         Do proper argument checking for methods that belong to generic classes.
8310         Do proper type resolution for GMFH/2.
8311         Fixes #377324.
8312         
8313 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8315         * verify.c (do_switch): Fix a memory corruption bug with
8316         the jump index is out of bound.
8318 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8320         * verify.c: Disable debug code.
8322 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8324         * reflection.c (mono_image_get_methodbuilder_token): Use
8325         mono_image_get_methodspec_token_for_generic_method_definition
8326         instead of mono_image_get_memberref_token. We cache more memberef
8327         entries now.
8329 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8331         * verify.c: Inflate exception clause types.
8332         Fixes #402606.
8333         
8334 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8336         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
8337         name.
8339         * reflection.c (mono_image_get_ctorbuilder_token): Same.
8341         * reflection.c (mono_image_create_method_token): Same.
8343 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8345         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
8346         It does the same as mono_image_get_methodref_token but works on
8347         MethodBuilder.
8349         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
8350         and always generate a methodspec. This follows the old behavior and fixes
8351         the regressions in System.Core. 
8353 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
8355         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
8356         don't event mono_class_get () succeeds. Fixes #402182.
8358 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
8360         * metadata-internals.h: Added MonoDynamicImage::methodspec
8361         hashtable to store methodspec tokens created for MethodBuilders.
8363         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
8364         MethodBuilders as open instantiations if a methodspec was requested.
8366         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
8368         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
8370         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
8372         Fixes bug #349190.
8374 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
8376         * loader.c (method_from_methodspec): Avoid crashing if the
8377         method lookup fails.
8379 2008-06-20  Dick Porter  <dick@ximian.com>
8381         * socket-io.c (get_socket_assembly): Cope with Moonlight network
8382         classes being in a different assembly.  Fixes bug 399184.
8384 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
8386         * loader.c (mono_loader_init): Make this callable multiple times.
8387         (mono_dllmap_insert): Call mono_loader_init () so this works even before
8388         the runtime is initialized. Fixes #401755.
8390 2008-06-19  Dick Porter  <dick@ximian.com>
8392         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
8393         Fixes bug 349688.
8395 2008-06-19  Dick Porter  <dick@ximian.com>
8397         * socket-io.c:
8398         * icall-def.h: Implement Socket generic Send() and Receive()
8399         methods.  Fixes bug 395168.
8401 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
8403         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
8405         Contributed under MIT/X11 license.
8407 2008-06-18  Martin Baulig  <martin@ximian.com>
8409         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
8410         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
8411         set to 80.0.  The debugger <-> runtime interface is now frozen as
8412         well.   
8414         * mono-debug.c
8415         (mono_debug_debugger_version): Bump to 4.
8417 2008-06-18  Martin Baulig  <martin@ximian.com>
8419         * debug-mono-symfile.c
8420         (load_symfile): Don't check the minor version.
8422         * debug-mono-symfile.h: Bump the version number to 50.0.
8424 2008-06-18  Martin Baulig  <martin@ximian.com>
8426         * debug-mono-symfile.c
8427         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
8428         minimum required version.
8430 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
8432         * reflection.c (mono_custom_attrs_from_property): Fix support for
8433         retriveving cattrs of dynamic inflated generic types.
8435         * reflection.c (mono_custom_attrs_from_event): Same.
8437         * reflection.c (mono_custom_attrs_from_field): Same;
8439         * reflection.c (typebuilder_setup_events): Same cattrs of events.
8441         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
8442         Moved to metadata.c.
8444         * metadata.c: New functions to retrive the equivalent field, event
8445         of property from the generic type definition.
8447         * metadata-internals.h: Added new functions from metadata.c.
8449 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
8451         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
8452         to cached in a mempool is used.
8454         * metadata.c (free_generic_class): In some situations field generic_info type
8455         is not properly dup'ed and leads to double free'ing.
8457         Fixes #400643.
8459 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8461         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
8462         this arguments (will be needed later for generic methods).
8463         Collect stats.
8465 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8467         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
8468         Create a static RGCTX invoke wrapper for methods which require it.
8470 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8472         * object.c, class-internals.h: New function for checking whether
8473         an individual field is special static.
8475 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
8477         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
8478         linear search since the table is sorted.
8480         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
8481         Fixes #324180.
8483 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
8485         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
8486         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
8488         * gc.c (mono_domain_finalize): Allow an infinite timeout.
8490         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
8491         
8492         * threads.c (mono_thread_request_interruption): Get rid of locking, use
8493         InterlockedCompareExchange to query and modify 
8494         thread->interruption_requested.
8496         * object-internals.h (struct _MonoThread): Change interruption_requested
8497         to a gint32 so it can be modified by atomic operations. Add 
8498         'critical_region_level' from the managed side, change small_id to a guint32,
8499         add new set of 'unused' fields.
8501         * appdomain.c: Bump corlib version.
8503 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
8505         * class.c (mono_class_from_name): Search modules as well. Fixes
8506         #322332.
8508 2008-06-13  Mark Probst  <mark.probst@gmail.com>
8510         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
8511         templates.  Templates are generalized with an additional type_argc
8512         argument.  RGCTX templates have type_argc==0, MRGCTX templates
8513         have type_argc>0.
8515         * domain-internals.h, domain.c: New hash table for looking up
8516         MRGCTXs.
8518         * metadata.c, metadata-internals.h: Rename hash and equal
8519         functions for MonoGenericInst's and make them public.
8521         * class-internals.h: New data structures for the MRGCTX.  Macros
8522         for distinguishing slots in the RGCTX and the MRGCTX.
8524 2008-06-13  Mark Probst  <mark.probst@gmail.com>
8526         * object.c (mono_method_get_imt_slot): Put the same methods of
8527         different instantiations of the same generic interface in the same
8528         IMT slots, to make generic sharing simpler.
8530 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8532         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
8534         * metadata.c (mono_metadata_field_info_with_mempool): Added.
8535         This function works just like mono_metadata_field_info, but
8536         accept a mempool as argument to be used allocating memory.
8538         * marshal.c (mono_marshal_load_type_info): Use new function
8539         to load marshal data into image mempool.
8541 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8543         * class.c (mono_class_inflate_generic_type_with_mempool):
8544         This function allows to inflate a generic type using
8545         a mempool.
8547         * class.c (inflate_generic_type): Take a mempool as argument
8548         and use it to do type dup'ing.
8550         * class.c (mono_class_setup_fields): Field type for generic
8551         generic classes are allocated from the image mempool.
8553         * metadata.c (free_generic_class): Inflated field type is
8554         now allocated in the image mempool.
8556 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8558         * threads.c (thread_cleanup): Free MonoThread::name.
8560 2008-06-12  Marek Habersack  <mhabersack@novell.com>
8562         * appdomain.c (ensure_directory_exists): avoid unnecessary
8563         mkdir(2) calls when the shadow directory already exists.
8564         (mono_make_shadow_copy): copy also satellite assemblies from the
8565         private bin directories.
8567 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
8569         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
8570         
8571         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
8572         a page boundary. Fixes #396219.
8574 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8576         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
8577         due to double-checked locking.
8579 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8581         * assembly.c (build_assembly_name): Release memory on failure.
8583         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
8585 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8587         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
8588         memory on failure.
8590 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8592         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
8593         memory on failure.
8595 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8597         * loader.c (field_from_memberref): Check if field signature type is equal
8598         to the non-inflated type of the field. Fixes #398980.
8600 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
8602         * assembly.c (mono_assembly_load_from_full): Call 
8603         mono_assembly_load_friends () outside the assemblies lock, since it can
8604         acquire the loader lock. Fixes #323696.
8606         * reflection.c (resolve_object): Inflate the inst with the context for
8607         FieldOnTypeBuilderInst. Fixes #399010.
8609 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8611         * reflection.c (mono_image_get_field_on_inst_token): Don't
8612         inflate the field to encode it's signature. If it's a
8613         VAR or MVAR it should stay that way in the signature.
8614         Fixes #399047.
8616 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8618         * reflection.c (resolve_object): Release memory of inflated types.
8620 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8622         * loader.c (mono_method_get_signature_full): Remove assert about
8623         loading a methodspec to a generic method. We have such methods, such as
8624         System.Threading.Interlocked::CompareExchange<T>.
8625         This assert was removed since it crashes the verifier when it checks
8626         methods calling CompareExchange<T>.
8628 2008-06-10  Marek Safar  <marek.safar@gmail.com>
8630         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
8631         of Type array and not MonoType.
8633 2008-06-10  Marek Habersack  <mhabersack@novell.com>
8635         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
8636         <lupus@ximian.com>
8638 2008-06-10  Martin Baulig  <martin@ximian.com>
8640         * debug-mono-symfile.h
8641         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
8642         changes to the file format, but we were generating incorrect
8643         source file indices in the line number table due to a bug, which
8644         made backtraces report an incorrect source file.
8646 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8648         * mono-debug.c: Moved mono_debug_free_method_jit_info from
8649         mini/debug-mini.c to here.
8651         * mono-debug.c (il_offset_from_address): Free memory from find_method.
8653         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
8654         use it to release structs returned by mono_debug_find_method.
8656 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
8658         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
8659         since it needs to set method->slot for all interface methods.
8661 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8663         * class-internals.h: Forgot to add.
8665 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8667         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
8669         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
8670         Lookup the custom attributes from property_hash.
8672         * reflection.c (mono_save_custom_attrs): Save the custom attributes
8673         in property_hash. Allocate all data using the image mempool.
8675         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
8676         for dynamic_custom_attrs to checks if the image is dynamic.
8678 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
8680         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
8681         assemblies array.
8682         
8683         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
8684         runtime functions while holding the domain assemblies lock.
8686 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8688         * verify.c: Reapplied the last bit of the reverted changes.
8690 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8692         * verify.c: Reapplied more of the reverted changes.
8694 2008-06-09  Martin Baulig  <martin@ximian.com>
8696         * debug-mono-symfile.c (load_symfile): Check the major version
8697         first; if it's wrong, don't print the minor version in the error message.
8699 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
8701         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
8702         lock instead of the domain lock to avoid deadlocks, since the thread might
8703         already hold the loader lock.
8705         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
8706         (mono_thread_attach): Ditto.
8708         * monitor.c: Use a TLS variable for holding the current thread id instead
8709         of calling pthread_self ().
8710         (mono_monitor_init_tls): New internal function to initialize the TLS
8711         variable.
8712         (mono_monitor_try_enter_internal): Put the owner == id check after the
8713         owner == 0 check.
8715         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
8716         missed optimizations when using gcc-4.3.
8718 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
8720         * reflection.c (mono_dynamic_image_free): Free the memory
8721         used by MonoGenericParam in MonoDynamicImage::gen_param.
8723         * reflection.c (mono_reflection_setup_generic_class): Allocate
8724         container from mempool.
8726         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
8727         container from mempool.
8729 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
8731         * threads.c (mono_set_pending_exception): New internal function to set the
8732         pending exception of the current thread.
8733         (mono_thread_get_and_clear_pending_exception): Check for 
8734         thread->pending_exception as well.
8736         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
8738         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
8739         it can trigger a collection.
8741 2008-06-06  Martin Baulig  <martin@ximian.com>
8743         Merged the `debugger-kahalo' branch.
8745         * mono-debug.h
8746         (MONO_DEBUGGER_VERSION): Bumped to 72.
8748         * debug-mono-symfile.h
8749         (MonoSymbolFileMethodIndexEntry): Removed.
8750         (MonoSymbolFileMethodEntry): New public typedef.
8751         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
8752         (MonoSymbolFileSourceEntry): Remove everything except `index' and
8753         `data_offset'.
8754         (MonoSymbolFileMethodEntry): Removed.
8755         (MonoSymbolFileLexicalBlockEntry): Removed.
8756         (MonoSymbolFileLineNumberEntry): Removed.
8757         (MonoDebugLexicalBlockEntry): Removed.
8758         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
8759         removed `num_il_offsets' and `il_offsets'.
8760         (MonoSymbolFile): Replace `version' with `major_version' and
8761         `minor_version'.
8762         (MONO_SYMBOL_FILE_VERSION): Replace with
8763         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
8764         `MONO_SYMBOL_FILE_MINOR_VERSION'.
8766         * debug-mono-symfile.c
8767         (mono_debug_symfile_lookup_location): Add support for the new line
8768         number table format.
8770 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8772         * metadata.c (free_generic_class): Release the inflated
8773         MonoClass of dynamic generic classes if it's not a generic
8774         type definition.
8776 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8778         * verify.c: Reapplied more of the reverted changes.
8780 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8782         * reflection.c (lookup_custom_attr): Clean the cached flag or
8783         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
8784         for SRE types.
8786 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8788         * verify.c: Reapplied a small part of the reverted changes.
8790 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
8792         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8794         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
8795         previously in managed code.
8796         (mono_monitor_exit): Ditto.
8797         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
8799         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
8800         the managed definition.
8802 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
8804         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
8806 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
8808         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
8809         
8810         * monitor.c: Add some micro optimizations.
8812         * icall.c (type_from_typename): Handle 'bool'.
8814 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
8816         * verify.c: Implement constructor verification per P III 1.8.1.4.
8817         Fixes #396716.
8819 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
8821         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
8822         holding the assemblies lock here too.
8824 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8826         * verify.c: Kill stack_top function.
8828 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8830         * verify.c: Kill stack_get function.
8832 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8834         * verify.c (mono_method_verify): Last change broke the build. Fixed.
8836 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8838         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
8839         more reliable.
8841         * verify.c (mono_method_verify): Inflate params and locals to avoid
8842         mismatch when checking for compatibility.
8844 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
8846         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
8847         Length prefix should be size in bytes. Fix bug #339530.
8848         
8849         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
8850         Length prefix should be size in bytes. Fix bug #339530.
8852         Code is contributed under MIT/X11 license.
8854 2008-06-05  Bill Holmes <billholmes54@gmail.com>
8856         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
8858         Contributed under MIT/X11 license.
8860 2008-06-05  Martin Baulig  <martin@ximian.com>
8862         * mono-debug-debugger.c
8863         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
8865 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
8867         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
8868         while holding the assemblies lock to prevent deadlocks. Handle the case
8869         where the search hook returns NULL but the assembly was still loaded.
8870         Fixes #323696.
8872         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
8873         modify domain state.
8875 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
8877         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
8878         * Makefile.am (pedump_LDADD): Post-process object files and
8879         add dtrace-generated object file, if necessary.
8881         Code is contributed under MIT/X11 license.
8883 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8885         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
8887 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8889         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
8891 2008-06-04  Mark Probst  <mark.probst@gmail.com>
8893         * threads.c: Try to free everything from the delayed free table
8894         when shutting down threads, and set the variable to NULL after the
8895         table is freed so that calling
8896         mono_thread_hazardous_try_free_all() when shutting down the root
8897         domain doesn't crash.
8899 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8901         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
8902         the caller if resulting type was inflated.
8904         * class.c (mono_class_create_from_typespec): Free the MonoType if it
8905         was inflated.
8907         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
8910 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
8912         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
8913         class library tests.
8915         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
8916         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
8917         #396989.
8919 2008-06-04  Mark Probst  <mark.probst@gmail.com>
8921         * domain.c, domain-internals.h: The JIT infos are now freed by the
8922         JIT info table code.  They are freed immediately if there only a
8923         single JIT info table in circulation.  If there is more, the free
8924         is delayed via a queue.
8926         * threads.c, threads-types.h: New hazard pointer function for
8927         freeing all freeable delayed items in one sitting.
8929 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8931         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
8933         * reflection.c (typebuilder_setup_properties): Same.
8935         * reflection.c (typebuilder_setup_events): Same.
8937 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8939         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
8940         and use it for allocating memory.
8942         * reflection.c (mono_marshal_spec_from_builder): Same.
8944         * reflection.c: Change code to use new signatures.
8946         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
8948 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8950         * decimal.c (rescale128): Put back one line which was accidently commented
8951         out.
8952         
8953         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
8954         to cause crashes.
8956 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8958         * reflection.c (mono_reflection_generic_class_initialize): Name must
8959         be always malloc'ed so we can free it later on. Do this for field, property
8960         and event.
8962         * metadata.c (free_generic_class): Free field, property and event names.
8964 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8966         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
8967         instead of g_memdup.
8969         * reflection.c (typebuilder_setup_fields): Same.
8971 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8973         * decimal.c (rescale128): Optimize this function a bit more.
8975 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8977         * metadata.c (free_generic_class): Release some memory from
8978         SRE generic classes.
8980 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8982         * reflection.c (mono_image_get_generic_field_token): No reference
8983         to name is kept, free it.
8985         * reflection.c (mono_reflection_generic_class_initialize): Free
8986         more memory of the inflated field.
8988 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8990         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
8991         code.
8993 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
8995         * reflection.c (mono_dynamic_image_free): Release memory used by
8996         MonoDynamicImage::array_methods elements.
8998         * reflection.c (assembly_add_win32_resources): Release memory after
8999         encoding.
9001 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
9003         * decimal.c (log2_32): Use an optimized version for this function too.
9004         
9005         * decimal.c (log2_64): Fix this on 32 bit machines.
9007 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
9009         * class.c (mono_dup_array_type): Implement allocation using a mempool.
9011         * class.c (mono_metadata_signature_deep_dup): Same.
9013         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
9014         a mempool.
9016         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
9018         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
9020         * metadata-internals.h: Added mono_metadata_signature_dup_full.
9022         * class-internals.h: Update signatures to take a MonoMemPool.
9024 2008-06-02  Dick Porter  <dick@ximian.com>
9026         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
9027         * icall-def.h: Add
9028         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
9029         FormatMessage API to get the error text.  Fixes bug 321827.
9031 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
9033         * decimal.c: Add some micro optimizations to make decimal operations faster.
9035 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
9037         * reflection.c (method_encode_clauses): Take a mempool
9038         as parameter and use it to allocate the clause array.
9040         * reflection.c (mono_image_get_field_on_inst_token): Free
9041         the inflated type after encoding it.
9043         * reflection.c (mono_dynamic_image_free): Free each element
9044         of MonoDynamicImage::gen_params.
9046         * reflection.c (reflection_methodbuilder_to_mono_method):
9047         Allocate the generic param array from the mempool.
9048         Allocate signature params from the mempool.
9050         * reflection.c (mono_reflection_generic_class_initialize):
9051         Free inflated fields after been used.
9053 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
9055         * icall.c: Reapply the memory leak fixes as they no
9056         longer make mono crash.
9058 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
9060         * reflection.c (mono_type_get_object): Don't store the suplied
9061         MonoType with type_hash. A caller which pass a type that
9062         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
9063         might end with a pointer to freed memory.
9064         The solution is to use byval_arg or this_arg from the associated
9065         MonoClass of the supplied type.
9067 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
9069         * icall.c: Revert the rest of the last change as it breaks the build too.
9071 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9073         * icall.c: Revert a leak fix as it's breaking the build.
9075 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9077         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
9079 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9081         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
9083 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9085         * icall.c: Fix some memory leaks.
9087 2008-05-29  Dick Porter  <dick@ximian.com>
9089         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
9090         async socket operations from the pending list when a socket
9091         closes.  Leaving it until the threadpool services the event
9092         exposes a race condition when a socket descriptor is reused.
9093         Fixes bug 377589.
9095 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9097         * object.c: Fix negative index check for array alocation.
9099 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9101         * icall.c, marshal.c: Delegate wrappers should skip visibility.
9102         This check is performed by the verifier for IL created delegates
9103         and by Delegate::CreateDelegate for programatically created ones.
9104         Fixes #372406.
9106 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9108         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
9109         Fix code to use mono_array_size_t instead of int.
9111         Based on patch by Luis F. Ortiz.
9112         Contributed under X11 license.
9113         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9115 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9117         * icall.c: Added ves_icall_System_Array_GetLongLength and
9118         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
9119         arrays.
9121         * icall.h: Export both new functions.
9123         Based on patch by Luis F. Ortiz.
9124         Contributed under X11 license.
9125         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9127 2008-05-28  Martin Baulig  <martin@ximian.com>
9129         The debugger now requires exactly r103463.
9131         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
9132         This version is not supported by the debugger, wait for 72.
9134 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9136         * object.h: Changed array related functions to use
9137         mono_array_size_t instead of guint32. Forgot to commit this file.
9139         Patch by Luis F. Ortiz.
9140         Contributed under X11 license.
9141         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9144 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9146         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
9147         don't define it. Use the number literal instead.
9149 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9151         * icall.c: Changed array related functions to use
9152         mono_array_size_t instead of guint32.
9154         * icall.c (ves_icall_System_Array_GetLength): Check for length
9155         overflow under MONO_BIG_ARRAYS.
9157         Based on patch by Luis F. Ortiz.
9158         Contributed under X11 license.
9159         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9161 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9163         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
9165         Based on patch by Luis F. Ortiz.
9166         Contributed under X11 license.
9167         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9169 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9171         * object.c, object.h: Changed array related functions to use
9172         mono_array_size_t instead of guint32.
9174         Patch by Luis F. Ortiz.
9175         Contributed under X11 license.
9176         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9178 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9180         * object.h: Introduced mono_array_size_t typedef. This must be used
9181         in all places an array length is expected. This is 64bits wide if
9182         MONO_BIG_ARRAYS is enabled.
9184         Patch by Luis F. Ortiz.
9185         Contributed under X11 license.
9186         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9188 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
9190         * security-manager.c class.c: Set the class exception info by calling
9191         mono_class_set_failure ().
9193         * class.c (mono_class_get_exception_data): New accessor function.
9194         (mono_class_set_failure): Store exception_data in the property hash.
9196         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
9197         the struct as a property.
9199         * loader.c (mono_get_method_full): Store the lookup result for method
9200         tokens in method_cache, the others in methodref_cache to decrease the memory
9201         usage of hash tables.
9203         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
9204         (mono_image_init): method_cache is lazy inited now.
9206         * metadata-internals.h (struct _MonoImage): Change method_cache to
9207         a MonoValueHashTable, add a separate methodref_cache.
9209 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
9211         * number-formatter.h: Fix tables to avoid arithemtic overflow in
9212           Double.ToString as exposed by Bug #383531.
9214 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
9216         * number-formatter.h: Make some tables static.
9218         * class.c (mono_method_set_generic_container): New accessor function.
9219         (mono_method_get_generic_container): Ditto.
9221         * class-internals.h (struct _MonoMethod): Remove rarely used 
9222         'generic_container' field, store it in the property hash instead. Add 
9223         'is_generic' boolean field instead.
9225         * image.c (mono_image_init): Initialize property_hash.
9226         (mono_image_close): Destroy property_hash.
9228         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
9229         hold rarely used fields of runtime structures belonging to this image.
9231         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
9232         to get/set method->generic_container.
9234         * loader.c (mono_get_method_from_token): Avoid loading the method header for
9235         generic methods.
9237 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
9239         * class.c (mono_class_inflate_generic_method_full): Don't increase
9240         mono_stats.inflated_method_count for methods found in the cache.
9242         * threads.c (mono_thread_request_interruption): Add a comment about 
9243         QueueUserAPC ().
9245 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
9247         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
9248         interface_offsets_packed table.
9249         
9250         * class.c (mono_class_init): Remove some dead code.
9252         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
9253         mono_class_setup_vtable () when CAS is active to detect security problems.
9255 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
9257         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
9259         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
9260         parameters as it's irrelevant for delegate checking.
9262 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
9264         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
9266         * class.c (mono_class_init): Control the creation of a generic vtable using
9267         a global which is true by default, but set to false by the runtime startup code.
9268         
9269         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
9270         Disabled for now since it breaks the embedding API.
9271         Move the setup of class->methods for arrays to mono_class_setup_methods ().
9272         (mono_class_setup_methods): Add a memory barrier.
9274         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
9275         when mono_class_init () doesn't compute the generic vtable.
9276         
9277 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
9278         * profiler.c: Added mono_profiler_install_statistical_call_chain,
9279         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
9280         to support call chains (backtrace) in the stat profiler.
9281         * profiler.c, profiler-private.h: Likewise.
9283 2008-05-22  Mark Probst  <mark.probst@gmail.com>
9285         * generic-sharing.c: Init generic class when a method of it is
9286         requested via a runtime generic context.
9288 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
9290         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
9292         * reflection.c (mono_type_get_object): Add a FIXME.
9294         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
9296         * class.c (mono_class_get_method_by_index): New helper function, returning an
9297         entry in the class->methods array.
9299 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
9301         * class.c (mono_class_init): Only do the array optimization for szarrays. 
9302         Avoid creating a generic vtable for generic instances as well.
9303         (mono_class_get_method_from_name_flags): Don't search in the metadata for
9304         generic instances.
9306 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
9308         * loader.c (mono_get_method_constrained): Inflate the signature
9309         with class context. Fix #325283.
9311 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
9313         * object.c (mono_class_create_runtime_vtable): Add a comment.
9315         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
9316         where needed.
9317         (setup_interface_offsets): Handle the case when this is called twice for arrays.
9318         (mono_class_setup_vtable_general): Add an assert.
9319         (mono_class_init): Avoid creating a generic vtable for arrays.
9321         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
9322         here, let mono_class_init () do that.
9324         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
9325         interfaces in mscorlib.
9327         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
9328         interfaces. Add some comments.
9329         (mono_class_init): Call mono_class_setup_methods () here since it is no
9330         longer called by mono_class_setup_vtable ().
9332         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
9333         not set in class->vtable.
9334         (mono_class_create_runtime_vtable): Reenable the disabled code.
9336         * object.c (mono_class_create_runtime_vtable): Disable the last change for
9337         now as it causes some test failures.
9339         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
9340         if using the vtable trampoline. Also remove some strange code which put the
9341         generic methods themselves into the vtable slots. Remove the AOT init_vtable
9342         stuff as it is no longer needed.
9344 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
9346         * pedump.c: Give make --verify all option check code as well.
9347         Using --verify code won't check for metadata now.
9349 2008-05-19  Martin Baulig  <martin@ximian.com>
9351         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
9353         * mono-debug.c
9354         (_mono_debug_using_mono_debugger): New global variable; it's set
9355         directly by the debugger, so mono_debug_using_mono_debugger() also
9356         works after attaching.
9358 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
9360         * object.c (mono_class_create_runtime_vtable): Use memory barriers
9361         as we do double checked locking on MonoClass::runtime_info and
9362         MonoClassRuntimeInfo::domain_vtables.
9364 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
9366         * debug-helpers.c (print_field_value): Fix a warning.
9368 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
9370         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
9371         set in the AOT case.
9373 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
9375         * class.c (mono_class_setup_vtable_general): Use memory barriers
9376         as we do double checked locking on MonoClass::vtable.
9378 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
9380         * reflection.c (resolve_object): Inflate only if the generic context
9381         is not null. Fixes #389886.
9383 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
9385         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
9386         instead of g_free.
9388         Code is contributed under MIT/X11 license.
9390 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9392         * class.c: Revert unrelated change.
9394 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9396         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
9397         a generic instantiation, use mono_class_from_mono_type instead of playing
9398         with MonoType directly.
9400 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9402         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
9403         checks must ignore generic instantiations, so mono_class_has_parent is not
9404         suitable. Fixes #390128.
9406 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
9408         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
9409         it to avoid registering tokens during metadata generation. Fixes #390023.
9411 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
9413         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
9414         consistent.
9416         Contributed under MIT/X11 license.
9418 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
9420         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
9421         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
9422         to fixup the EXE image.
9423         (mono_cleanup): Use mono_close_exe_image.
9424         (mono_close_exe_image): New function.
9425         * image.c: Include "marshal.h".
9426         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
9427         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
9428         counting when the image is loaded outside of mono_image_open_full. Set status
9429         based on GetLastError.
9430         * coree.c: Include required headers. Add init_from_coree.
9431         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
9432         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
9433         (_CorExeMain): Set init_from_coree.
9434         (CorExitProcess): Only call ExitProcess for now.
9435         (CorBindToRuntimeEx): New stub implementation.
9436         (CorBindToRuntime): New function.
9437         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
9438         (MonoFixupExe): ILONLY executables require no fixups.
9439         (mono_set_act_ctx): New function to set activation context.
9440         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
9441         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
9442         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
9443         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
9444         as MONO_INTERNAL.
9445         * domain-internals.h: Add mono_close_exe_image.
9447         Contributed under MIT/X11 license.
9449 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
9451         * metadata.c (mono_metadata_compute_size): Correctly calculate field
9452         size for generic param and event tables. Fixes #388977.
9454 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
9456         * loader.c (mono_method_signature): Use memory barriers because of the double
9457         checked locking pattern.
9459         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
9460         aborting or aborted as well. Fixes #376391.
9461         
9462         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
9463         existing runtime state in the Suspend handler during shutdown.
9465 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
9467         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
9469         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
9470         which are starting up or shutting down.
9472         * threads.c (mono_threads_set_shutting_down): Don't return a value since
9473         this function never returns if the runtime is already shutting down.
9475         * icall.c (ves_icall_System_Environment_Exit): Update after 
9476         mono_threads_set_shutting_down () signature change.
9477         
9478 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
9480         * class.c: Added can_access_instantiation to verify if the instantiation
9481         is visible. Fix access check for nested types as they returned TRUE
9482         before doing type and generic instantiation visibility checks.
9484 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
9486         * reflection.c (mono_reflection_create_generic_class): The created type
9487         must have a different container from its TypeBuilder. Otherwise they
9488         will end sharing generic arguments, which is wrong.
9490         Due to the sharing, making a generic instance of the created type using
9491         the TypeBuider generic arguments resulted in the generic type definition
9492         been returned, which is wrong as well.
9494         As a bonus the code was leaking the type_params array. This memory should
9495         be allocated from the image mempool.
9497         This fixes bug #354047.
9499 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
9501         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
9502         to here         as they are now used in assembly.c new code.
9503         Added a skipverification flag to MonoAssembly.
9504         New internal function mono_assembly_has_skip_verification.
9506         * assembly.c: New function mono_assembly_has_skip_verification. It checks
9507         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
9508         part of #387274.
9510 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
9512         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
9513         needed. Fixes #387034.
9515         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
9517 2008-05-06  Miguel de Icaza  <miguel@novell.com>
9519         * assembly.c (mono_assembly_load_reference): Prevent crash while
9520         disassembling Silverlight 2.0 executables while we still do not
9521         have GACed libraries.
9523 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
9525         * reflection.c: Special case generic type definitions as well. Fixes #383444.
9527 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
9529         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
9530         of the dynamic case. Fixes #387404.
9532 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9534         *verify.c (mono_verifier_is_class_full_trust): If under
9535         verify_all and the verifier mode was not set, only
9536         gac and corlib types are fulltrust. This makes --verify-all
9537         usable to detect unverifiable code, which is the expected
9538         use case.
9540 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9542         * verify.h: Ops, commited the header with debug
9543         enabled.
9545 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9547         * verify.c (merge_stack): Use the new value on unverifiable
9548         stack merges.
9550         * verify.c (verify_type_compatibility_full): Comparison
9551         of nullable types can't use mono_class_is_assignable_from.
9553         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
9554         that makes all verification errors be reported.
9556         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
9557         mono_method_verify.
9559 2008-05-05  Robert Jordan  <robertj@gmx.net>
9561         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
9562         support for value types. See #386415.
9564         * object.c: comments.
9566         Code is contributed under MIT/X11 license.
9568 2008-05-05  Martin Baulig  <martin@ximian.com>
9570         * debug-mono-symfile.h
9571         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
9572         for old pre-terrania symbol files.
9574 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
9576         * mono-config.c: Add ppc64 architecture.
9578         Code is contributed under MIT/X11 license.
9580 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
9582         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
9583           PPC64 uses function descriptors as well.
9585         Code is contributed under MIT/X11 license.
9587 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
9589         * object.c (compute_class_bitmap): Ignore literal static fields.
9591         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
9592         var has an invalid format.
9593         (describe_ptr): Add some sanity checks for the vtable.
9594         (add_nursery_frag): Clear unused nursery fragments.
9595         (major_collection): Clear all remaining nursery fragments.
9597 2008-05-03  Robert Jordan  <robertj@gmx.net>
9599         * image.c, metadata-internals.h: add thunk_invoke_cache.
9601         * marshal.c, marshal.h: implement
9602         mono_marshal_get_thunk_invoke_wrapper ().
9604         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
9606         Code is contributed under MIT/X11 license.
9608 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
9610         * verify.c (do_leave): Empty the stack.
9612 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
9614         * class.c (mono_class_is_assignable_from): Variance
9615         doesn't work between reference and value types. For example,
9616         given type C<T+>, C<int32> is not assignable to C<object>.
9617         Break the argument checking loop on first error. 
9619 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
9621         * icall.c : base64_to_byte_array() needs some more strict
9622           check for sequence of '=' characters. Patch by Santa
9623           Marta (http://deee.g.hatena.ne.jp/santamarta).
9625           Contributed under MIT/X11 license.
9626           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
9628 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
9630         * domain.c: Disable LoadLibrary support to fix Win32 build.
9632         Code is contributed under MIT/X11 license.
9634 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
9636         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
9637         to help with cache behaviour.
9639 2008-05-01  Miguel de Icaza  <miguel@novell.com>
9641         * appdomain.c (mono_domain_from_appdomain): Add new accessor
9642         method. 
9644 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
9646         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
9648 2008-05-01  Dick Porter  <dick@ximian.com>
9650         * process.c (process_get_fileversion): Only pass 16 bits of
9651         language ID to VerLanguageName.  Fixes bug 381204.
9653 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
9655         * verify.c (mono_method_verify): Fix the comparison
9656         operator for code bounds check.
9658 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
9660         * verify.c (mono_method_verify): Check the bounds of
9661         all access of the code array.
9663 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
9665         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
9667 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
9669         * image.c (mono_image_strong_name_position): Fix return value when the rva is
9670         not valid.
9672 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
9674         * loader.c (mono_get_method_from_token, mono_method_signature): Add
9675         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
9676         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
9677         fixup main EXE images when using mono.exe for mixed-mode assembly support.
9678         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
9679         mono_runtime_load.
9680         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
9681         runtime initialization from metadata.
9682         * assembly.c: Remove obsolete ceGetModuleFileNameA.
9683         (mono_set_rootdir): Use mono_get_module_file_name.
9684         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
9685         handles.
9686         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
9687         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
9688         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
9689         MonoCLIImageInfo. Add support for module handles.
9690         (load_cli_header): Update mono_cli_rva_image_map signature.
9691         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
9692         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
9693         (mono_image_rva_map): Add support for module handles.
9694         (mono_image_ensure_section_idx): Add support for module handles.
9695         (mono_image_close): Add support for module handles.
9696         (do_load_header): Add support for module handles.
9697         (mono_image_open_from_module_handle): New function for internal use.
9698         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
9699         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
9700         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
9701         handles.
9702         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
9703         * image.h: Add mono_image_fixup_vtable.
9704         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
9705         support.
9706         * coree.h: New file.
9707         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
9708         unsupported native code.
9709         (mono_marshal_set_callconv_from_modopt): New function splitted from
9710         mono_marshal_get_managed_wrapper.
9711         (mono_marshal_get_managed_wrapper): Use
9712         mono_marshal_set_callconv_from_modopt.
9713         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
9714         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
9715         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
9716         that results in a deadlock when the runtime is loaded in _CorDllMain.
9717         * Makefile.am: Add coree.c and coree.h.
9719         Contributed under MIT/X11 license.
9721 2008-04-28  Mark Probst  <mark.probst@gmail.com>
9723         * generic-sharing.c: Search for type arguments in array element
9724         types as well.
9726 2008-04-28  Mark Probst  <mark.probst@gmail.com>
9728         * class-internals.h, generic-sharing.c: New, small runtime generic context.
9730         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
9732         * object.c: Don't setup the RGCTX when the vtable is created,
9733         because we're setting it up lazily now.
9735 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
9737         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
9738         64 bit support.
9740 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
9742         * verify.c (verify_class_for_overlapping_reference_fields): 
9743         If class is under fulltrust allow reference types to overllap
9744         if they have the same RVA.
9746 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
9748         * pedump.c: Added new flag valid-only, that makes the verifier
9749         behaves just like --security=validil. It won't fail type load
9750         due to unverifiable restrictions.
9752 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
9754         * class-internals.h (struct MonoMethod): Added a verification_success
9755         field to cache verifier executions. Reduced MonoMethod:slot size by
9756         one bit.
9758 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
9760         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
9761         instead of a 'vt' argument to save an indirection and to allow these to be used
9762         for valuetypes.
9763         (scan_vtype): New helper function to scan an area using a gc descriptor.
9764         (mono_gc_wbarrier_value_copy): Implement this.
9765         (handle_remset): Add support for REMSET_VTYPE.
9766         (find_in_remset_loc): Ditto.
9767         (mono_gc_base_init): Allow some debugging options to be controlled through the
9768         use of the MONO_GC_DEBUG env variable.
9769         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
9770         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
9772 2008-04-23  Martin Baulig  <martin@ximian.com>
9774         * domain.c (mono_domain_create): Move the call to
9775         mono_debug_domain_create() down, after allocating the domain id.
9777 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
9779         verify.c (verify_class_for_overlapping_reference_fields): Skip
9780         static fields while verifying for overlapping fields as they
9781         don't matter at all.
9783 2008-04-23  Marek Habersack  <mhabersack@novell.com>
9785         * domain-internals.h: added a declaration of
9786         mono_make_shadow_copy.
9788         * assembly.c (mono_assembly_open_full): shadow copying of
9789         assemblies moved to here, so that all the assemblies within the
9790         application domain's private binary directories can be
9791         processed. Fixes bug #380546
9793         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
9794         mono_make_shadow_copy and made non-static. The decision whether
9795         to shadow-copy an assembly is made based on its location - it's
9796         copied if it's in one of the private application domain binary
9797         directories and its different to the target file in the shadow
9798         directory. Fixes bug #380546
9800 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
9802         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
9804         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
9805         types.
9807         * reflection.c (mono_image_create_token): Handle 
9808         Method/ConstructorOnTypeBuilderInst.
9809         (resolve_object): Ditto.
9810         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
9811         so it can be called from resolve_object. Also handle the case when the inflated
9812         class already has its methods setup.
9814 2008-04-21  Martin Baulig  <martin@ximian.com>
9816         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
9818 2008-04-20  Geoff Norton  <gnorton@novell.com>
9820         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
9821         pointer dereference.
9823 2008-04-15  Marek Habersack  <mhabersack@novell.com>
9825         * appdomain.c (try_load_from): if IOMAP is in effect, call the
9826         portability API to look up the assembly file. Fixes behavior in
9827         situations when the application has a bin/ directory, but the
9828         assembly search patch refers to Bin/ (and thus the requested file
9829         name is Bin/SomeLibrary.dll). Fixes bug #379888
9831 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
9833         verify.c (mono_type_is_generic_argument): Extracted this check
9834         from a dozen places to here.
9836         verify.c: Fixed all issues related to boxing generic arguments
9837         and their constraints.
9839 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
9841         verify.c (mono_class_interface_implements_interface): Fix win32 build.
9843 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
9845         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
9846         isn't finished yet. Fixes #363447.
9848 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
9850         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
9851         Fixes #346419.
9853 2008-04-13  Jb Evain  <jbevain@novell.com>
9855         * domain.c: update the 2.1 profile versions.
9856         Merged from the Moonlight 2 branch.
9858 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
9860         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
9861         mscorlibs for the non-refonly case as well.
9863         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
9864         in mono_assembly_load_from_full (). Fixes #378924.
9866 2008-04-11  Geoff Norton  <gnorton@novell.com>
9868         * icall.c: The global extern environ doesn't exist on Mac.  We
9869         need to call NSGetEnviron instead.
9871 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9873         verify.c: Add generic method constraint verification.
9875 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9877         class.c (mono_class_inflate_generic_method_full): Add a long
9878         explanation to the is_mb_open hack. Remove the FIXME.
9880 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9882         * verify.c (mono_method_verify): Mark all unknown opcodes
9883         as invalid. Mark jmp as unverifiable.
9885 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9887         * verify.c: Add code to do type constraint verification on class instances.
9889         * verify.c (mono_verifier_verify_class): Use the type constraint 
9890         verification code.
9892 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9894         * class.c (mono_class_get_field_default_value): Don't pass cindex
9895         as hint to mono_metadata_get_constant_index. The local is not initialized
9896         and should contain garbage most of the time. This could only work
9897         with a lot of luck.
9899 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
9901         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
9903 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
9905         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
9907         * class.c (mono_class_from_generic_parameter): Save the token of the
9908         generic param in MonoClass::sizes.generic_param_token.
9910         * reflection.c (mono_custom_attrs_from_class): If the class type is
9911         VAR or MVAR retrieve the attributes of the generic param.
9913 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9915         * class.c (mono_class_init): Do class verification if the verifier
9916         is enabled.
9918 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9920         * verify-internal.h: Added mono_verifier_verify_class.
9922         * verify.c: Added mono_verifier_verify_class. It checks for
9923         classes with explicit layout that have overlapping reference fields.
9925         * pedump.c: Init the verifier state prior to verification. Fixed
9926         command line arguments.
9928 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9930         * Makefile.am: Added verify-internals.h, hopefully fix the build.
9932 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
9934         * verify-internals.h: Fix a warning.
9936 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
9938         * verify-internals.h: New header with the verifier configuration
9939         extracted from mini.c.
9941         * verify.c: Implemented the new functions exported by verify-internals.h.
9943 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
9945         * verify.c: Add proper verification of ckfinite.
9947 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9949         * verify.c (do_conversion): Improved error message to something
9950         more meanfull.
9952         * verify.c (check_is_valid_type_for_field_ops): Fix to work
9953         with primitive types.
9955 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9957         * verify.c: Added tail prefix checking. Marked icall
9958         as unverifible.
9960 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9962         * verify.c: Fix the detection of branches to the middle
9963         of an instruction.
9965 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
9967         * verify.c: Implemented verification of volatile. and
9968         unaligned. prefix. Check if a type is valid after retrieving it.
9970 2008-04-01  Dick Porter  <dick@ximian.com>
9972         * process.c (process_get_fileversion): If there's no string block,
9973         set the file language to en_US.  Fixes the other new part of bug
9974         374600.
9976 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
9978         * class.c: New functions mono_method_can_access_field_full and
9979         mono_method_can_access_method_full. They perform type visibility
9980         and type site check.
9982         * class-internal.h: Added exported functions.
9984         * verify.c: Use new functions to implement proper visibility checks.
9986 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
9988         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
9990 2008-03-28  Dick Porter  <dick@ximian.com>
9992         * process.c (process_get_fileversion): Use the first language ID
9993         we see, rather than insisting on an invariant language.  Fixes bug
9994         374600.
9996 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
9998         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
9999         the streams to fix reading of invalid memory later.
10001         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
10002         to ease debugging.
10004 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
10006         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
10007         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
10009 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
10010         * threads.h: Added MonoThreadManageCallback type and
10011         mono_thread_set_manage_callback prototype
10012         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
10013         (used to store the mono_thread_manage callback).
10014         * threads.c: Added mono_thread_set_manage_callback, and handle
10015         "MonoThread->manage_callback" in build_wait_tids.
10017 2008-03-26  Dick Porter  <dick@ximian.com>
10019         * process.c (process_get_fileversion): Set FileVersionInfo strings
10020         to Empty when the resource doesn't have the particular info.
10021         Fixes bug 355717.
10023 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
10025         * verify.c (mono_method_verify): Proper prefix validation.
10027 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
10029         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
10030         itself in a separate argument instead of throwing them. Fixes #373448.
10032         * appdomain.c: Bump corlib version.
10034 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
10036         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
10038 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
10040         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
10041         version macros.
10043 2008-03-20  Mark Probst  <mark.probst@gmail.com>
10045         * generic-sharing.c, class-internals.h: Code for putting
10046         reflection types into the runtime generic context.
10048 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
10050         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
10051         Fixes #340662. 
10054 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
10056         * verify.c (VerifyContext): Added instruction prefix data to the struct.
10058         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
10060         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
10062         * verify.c (do_cast): Let the result value keep the boxed status.
10064         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
10066 2008-03-17  Jb Evain  <jbevain@novell.com>
10068         * reflection.c: when running on a 2.0 runtime, emit
10069         unconditionally the #~ header version as 2.0, and the
10070         CLI header version as 2.5, for symmetry's sake with csc.
10072 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
10074         * class.c: Remove the unused cache_interface_offsets stuff.
10076         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
10077         profiler.c: Fix warnings.
10079 2008-03-16  Mark Probst  <mark.probst@gmail.com>
10081         * generic-sharing.c, class-internals.h: Support for putting
10082         methods into the runtime generic context.
10084 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
10086         * class.c (mono_class_setup_fields): Ignore calls made to this function for
10087         classes which are generic instances of not-yet finished typebuilders. Fixes
10088         #351172.
10090         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
10092 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
10094         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
10096         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
10097         field, replace it with a hash table in MonoDynamicImage.
10099         * reflection.c (inflate_mono_method): Access the generic definition object from
10100         image->generic_def_objects instead of imethod->reflection_info.
10102         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
10104         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
10105         
10106         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
10107         function in reflection.c so it is easier to keep in sync with the dynamic image
10108         creation code.
10110         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
10111         mono_image_close ().
10113 2008-03-15  Mark Probst  <mark.probst@gmail.com>
10115         * class.c (mono_class_generic_sharing_enabled): Disable generic
10116         sharing for all architectures except AMD64 and x86 to fix build.
10118 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
10120         * verify.c: Use the generic definition MonoGenericContext when available.
10121         Remove code for checking generics instance compatibility in favor of
10122         mono_class_is_assignable_from.
10124 2008-03-14  Mark Probst  <mark.probst@gmail.com>
10126         * marshal.c, marshal.h, metadata-internals.h, image.c,
10127         wrapper-types.h: New wrapper for invoking a shared static method
10128         without having to pass the runtime generic context argument.
10130 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
10132         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
10134 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
10136         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
10137         
10138         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
10139         create a token from a FieldOnTypeBuilderInst.
10140         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
10141         (resolve_object): Ditto.
10143         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
10144         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
10146 2008-03-14  Martin Baulig  <martin@ximian.com>
10148         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
10150         * debug-mono-symfile.h
10151         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
10152         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
10154 2008-03-10  Martin Baulig  <martin@ximian.com>
10156         * debug-mono-symfile.h
10157         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
10158         `lexical_block_table_offset'.
10159         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
10160         `lexical_blocks'.
10161         (MonoSymbolFile): Added `version'.
10163         * mono-debug.h
10164         (MonoDebugLexicalBlockEntry): Removed.
10165         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
10166         `lexical_blocks'.
10168         * mono-debug.c (mono_debug_add_method): Don't compute lexical
10169         blocks here; the debugger now does this internally.
10171 2008-02-27  Martin Baulig  <martin@ximian.com>
10173         * object.c (mono_runtime_exec_main): Call
10174         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
10175         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
10177 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
10179         * verify.c (verify_type_compatibility_full): Allow native int to be converted
10180         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
10182 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
10184         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
10185         ldftn with a virtual method.
10187 2008-03-13  Geoff Norton  <gnorton@novell.com>
10189         * decimal.c:  Only include memory.h if the platform has it.
10191 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
10193         * assembly.c, class.c, metadata-internals.h: make sure public key
10194         tokesns are compared in a case-insensitive way. Also, all
10195         the lookups in the GAC use a lowercase public key token
10196         (gaacutil already does the lowercasing on install). Fixes
10197         bug #369541.
10199 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
10201         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
10202         and return value.
10204 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
10206         * image.c: when someone loads a mscorlib from a file, return the
10207         currently loaded mscorlib (fixes bug #369253).
10209 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
10211         * class.c: handle types with no parents by forcing them to have
10212         System.Object as a parent and marking them as broken (this currently
10213         allows the first part of bug #369173 to work as well, likely because
10214         we don't check for typeload exceptions everywhere yet).
10216 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
10218         * class.c: more complete check that types belong to corlib
10219         (fixes second part of bug #369173).
10221 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
10223         * generic-sharing.c:  Including glib.h for the MSVC builds to define
10224           "inline" to "__inline" before including mono-membar.h.
10225           
10226         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
10227           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
10228           MSVC builds.
10230         Contributed under MIT/X11 license.
10232 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
10234         * verify.c (do_invoke_method): Remove return type validation.
10236         * verify.c (do_ret): Do return type validation at return site instead of
10237         call site.
10239 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
10241         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
10243         * verify.c: Some todos cleaned and improved a few error messages.
10245 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
10247         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
10249 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
10251         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
10252         system types correctly.
10254         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
10255         function.
10257 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
10259         * assembly.c (build_assembly_name): Fix a warning.
10261 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
10263         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
10264         the called function takes an object type argument. Fixes storing or
10265         valuetypes across remoting as well as reducing memory usage.
10266         * image.c, metadata-internals.h: remove now unused ldfld_remote and
10267         stfld_remote wrapper caches.
10269 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
10271         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
10272         is not found.
10274         * reflection.c (mono_image_register_token): New helper function to save
10275         a token->object mapping.        
10277         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
10278         managed code.
10280         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
10281         one dimension arrays. Fixes #367670.
10282         (mono_reflection_get_type_internal): Ditto.
10284 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
10286         * marshal.c: mono_load_remote_field_new() always returns object.
10287         so use the proper signature (fixes bug #366445).
10289 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
10290         
10291         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
10292         add an 'inline_failure' flag instead.
10294 2008-03-04  Mark Probst  <mark.probst@gmail.com>
10296         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
10297         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
10298         contains the location of "this", used for exception handling.
10300 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
10302         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
10303         their size on all platforms for perf reasons.
10305 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10307         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
10308         object-internal.h
10310         * object-internal.h: Same.
10312 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10314         * reflection.h: Fix the build I just broke.
10316 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10318         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
10319         Test if a token is valid, this remove explicit usage of 
10320         MonoDynamicImage::tokens from the verifier code.
10322         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
10324         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
10325         instead of direct access to MonoDynamicImage::tokens.
10327 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10329         * verify.c (token_bounds_check): Fix the build I just broke.
10331 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10333         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
10335         * verify.c (verifier_load_method): Fixed the errors message.
10337         * verify.c (mono_method_verify): Fixed a debug message.
10339 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
10341         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
10342         mono-perfcounters.h, class-internals.h: support for predefined
10343         writable counters, query of categories and counters, bugfixes.
10345 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
10347         * verify.c (do_refanytype): Verify the refanytype opcode.
10349         * verify.c (mono_method_verify): Use do_refanytype.
10351 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
10353         * verify.c (do_mkrefany): Verify the mkrefany opcode.
10355         * verify.c (mono_method_verify): Use do_mkrefany.
10357 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
10359         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
10360         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
10361         implementation.
10363 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
10365         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
10366         the type load exception.
10368 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
10370         * verify.c: Added a few FIXME for method signatures
10372         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
10373         of mono_method_get_signature and get vararg call working. Removed unused
10374         checks for return value.
10376         * verify.c (do_refanyval): Verify the refanyval opcode.
10378         * verify.c (mono_method_verify): Implemented verification of arglist and
10379         use do_refanyval.
10381 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
10383         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
10384         vtypes to marshal.c.
10386         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
10387         it works for AOT as well.
10389 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
10391         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
10392         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
10393         the system time is adjusted.
10395 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
10397         * icall.c, icall-def.h: use the new time functions (fixes the
10398         non-monotonic behaviour of TickCount).
10400 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
10402         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
10403         it breaks the build.
10404         
10405         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
10406         cattr is not finished yet.
10408 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
10410         * verify.c: Proper token validation for field, method and type.
10412 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
10414         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
10416         * loader.c (method_from_memberref): Generate type load error instead of method missing
10417         if the type is not found.
10419 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
10421         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
10422         some of the conversions caused the generation of a marshal directive exception.
10424 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
10426         verify.c: Report which exception should be thrown by the JIT.
10427         Added a lot of FIXME notes.
10429 2008-02-22  Mark Probst  <mark.probst@gmail.com>
10431         * generic-sharing.c: Runtime generic context slots are not
10432         instantiated on init anymore.  Instead, provide function to do the
10433         instantiating on demand.
10435         * class-internals.h: Added vtable to runtime generic context.
10436         Macros for encoding direct and indirect slot offsets in one
10437         guint32.
10439 2008-02-21  Mark Probst  <mark.probst@gmail.com>
10441         * object.c, generic-sharing.c: Moved some generic sharing code
10442         from object.c to generic-sharing.c.
10444         * generic-sharing.c: Added support for extensible runtime generic
10445         context.
10447         * metadata-internals.h: Two new hash tables in MonoImage for
10448         extensible runtime generic context support.
10450         * domain.c: Unregister generic vtables upon domain unloading.
10452         * image.c: Destroy new hash tables upon image unloading.
10454         * metadata.c: Unregister generic subclasses upon image unloading.
10456         * class-internals.h: New data structure for runtime generic
10457         context template.  New fields in the runtime generic context for
10458         extensible part.
10460         * Makefile.am: Added generic-sharing.c.
10462 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
10464         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
10465         there is a pending loader exception, raise it.
10467         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
10468         same.
10470         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
10471         same.
10473         Fixes #363450.
10475 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
10477         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
10479         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
10480         
10481         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
10482         ref-only requests for compatibility with MS.
10484 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
10486         * reflection.c (mono_custom_attrs_from_method): Don't silently
10487         return an empty list for generic method instances.
10488         (mono_custom_attrs_from_param): Likewise.
10490 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
10491             Raja R Harinath  <harinath@hurrynot.org>
10493         Fix #354757
10494         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
10495         * class.c (mono_class_inflate_generic_method_full): Initialize it
10496         when a fully-open method is instantiated.
10497         * metadata.c (inflated_method_equal, inflated_method_hash): Update
10498         to new field.
10499         * reflection.c (inflate_mono_method): Don't create a temporary context.
10501 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
10503         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
10504         Compute correct value, to prepare for imethod->reflection_info going away.
10506 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
10508         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
10510 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
10512         * verify.c: Implement skip visibility flag.
10514 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
10516         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
10517         which contains an extra field to tell the kind of exception that should be thrown.
10519         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
10521 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
10523         * loader.c (mono_method_get_param_names): Initialize 'klass' after
10524         'method' is updated.
10526 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
10528         * class.c (mono_class_layout_fields): Set class->min_align for classes using
10529         explicit layout as well. Fixes #360375.
10531 2008-02-11  Geoff Norton  <gnorton@novell.com>
10533         * loader.c: Guard and dereference against inflated generic methods
10535 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
10537         * class.c: Include Retargetable spec in assembly name.
10538         * assembly.c: Always include PublicKeyToken spec in assembly name
10539         (with value "null" if assembly is not signed), and include
10540         Retargetable spec.
10541         * icall-def.h: Added icall for Assembly.get_fullname.
10542         * icall.c: Added icall returning the fullname of an assembly.
10544 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
10546         * class.c (mono_class_setup_vtable_general): Add a missing call to
10547         mono_class_setup_methods () which is needed in the AOT case.
10549 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
10551         * verify.c (mono_type_get_stack_name): Added. Return the name for the
10552         stack type of the given MonoType.
10554         * verify.c (verify_type_compatibility_full): Handle the void type.
10556         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
10557         way stack merging works.
10559         * verify.c (store_local): Improved verification message.
10561         * verify.c (do_branch_op): If the merging is invalid, the method
10562         is unverifiable and not invalid. Improved error message.
10564         * verify.c (merge_stacks): Properly merge a boxed valuetype and
10565         a reference type diferent than System.Object. Improved error
10566         message.
10568 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
10570         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
10572         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
10573         type of an enum even if the argument is byref.
10575         * verify.c: Replace all explicit uses of enumtype and enum_basetype
10576         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
10578         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
10580         *verify.c (verify_type_compatibility_full): Make enum types
10581         compatible with their base types.
10583         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
10584         types are compatible for the special case of a boxed valuetype and
10585         System.Object.
10587         * verify.c (verify_stack_type_compatibility): The function
10588         is_compatible_boxed_valuetype was extracted from here.
10590         * verify.c (push_arg): Only set ctx->has_this_store if the method
10591         is not static.
10593         * verify.c (do_ldelem): Fixed a typo in an error message and added
10594         strict check for mixing int32 and native int as the array type
10595         and ldelem type.
10597         * verify.c (merge_stacks): Consider boxed valuetypes in the
10598         compatibility checks.
10600 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
10601         * profiler.h: (MonoGCEvent): Added start-stop the world events.
10603 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
10604         *class.c: use_new_interface_vtable_code: renamed the env var to have
10605         a "MONO_" prefix, and fix the logic to enable it by default.
10607 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
10608         *class.c:
10609         mono_class_setup_vtable_general: rewrote the way in which interface
10610         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
10611         makes the code more maintainable.
10612         For now the old code is still there, and can be activated setting
10613         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
10615 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
10617         * verify.c: guarded some debug functions around and #ifdef.
10619         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
10621 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
10623         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
10624         changes for now since they seem to break too many things.
10626 2008-02-05  Mark Probst  <mark.probst@gmail.com>
10628         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
10629         mono_marshal_find_nonzero_bit_offset): Added macro and function
10630         for finding the byte- and bit-offset of a bitfield within a
10631         struct.
10633 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
10635         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
10636         (mono_marshal_get_struct_to_ptr): Ditto.
10638         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
10639         cctor_signature.
10641 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
10643         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
10644         between methods for non-corlib types.
10646 2008-02-02  Geoff Norton  <gnorton@novell.com>
10648         * loader.c (mono_method_get_param_names): Populate the parameter name for 
10649         generic parameters as well. (Fixes #342536)
10651 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
10653         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
10655         * verify.c (do_invoke_method): Fix for calling with byref structs.
10657         * verify.c (do_cast): push a boxed value type based on the type token and not
10658         the type of stack.
10660 2008-01-31  William Holmes  <billholmes54@gmail.com>
10662         * process.c (process_module_string_read): Check the size returned form 
10663           VerQueryValue to avoid out of memory exception. 
10665 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
10667         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
10668         Handle properly modules which are not in the moduleref table. Fixes
10669         #356938.
10671 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
10673         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
10674         the dynamic case which is now in managed code.
10675         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
10677         * marshal.c (mono_string_to_bstr): Fix a warning.
10678         (init_com_provider_ms): Ditto.
10680         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
10682         * exception.c (mono_get_exception_out_of_memory): New helper function.
10684 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
10686         * marshal.c: Add support for BSTR marshalling
10687         using other COM systems.
10689         Code is contributed under MIT/X11 license.
10691 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
10693         * object.c (mono_runtime_invoke_array): reverted previous
10694         commit as it breaks the build.
10696 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
10698         * object.c (mono_runtime_invoke_array): Verify arguments for
10699         invalid types. Fixes #348522.
10701 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
10703         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
10704         non-final virtual calls using call. 
10706         * verify.c (do_invoke): fixed some TODOs.
10708         * verify.c (push_arg): set has_this_store for "ldarga 0".
10710 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
10712         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
10713         which belong to an inflated class. Fixes #356531.
10715 2008-01-26  Robert Jordan  <robertj@gmx.net>
10717         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
10718         which resort to FindFirstFile when a certain error condition
10719         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
10720         Code is contributed under MIT/X11 license.
10722 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
10724         * marshal.c (emit_marshal_string): Fix out string marshalling
10725         to use specified encoding. Fixes #323900.
10727         Code is contributed under MIT/X11 license.
10729 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
10731         * class.c (mono_class_inflate_generic_method_full): Don't modify
10732         iresult->context after cache check.
10734 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
10736         * class.c (mono_class_inflate_generic_method_full): Change the
10737         struct assignments to memcpy for better visibility and add some comments.
10739 2008-01-23  Dick Porter  <dick@ximian.com>
10741         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
10742         procedure, and make it work on windows.
10744 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
10746         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
10747         a MonoReflectionTypeBuilder since it is always of that type.
10749         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
10751         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
10753         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
10754         
10755         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
10757         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
10759         * reflection.c (mono_reflection_create_runtime_class): Remove already created
10760         instantiations from the type cache.
10762 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10764         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
10766         * verify.c (do_unbox_value): push a controled mutability managed pointer.
10768 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10770         * verify.c (do_ldstr): added, verifies if the #US token is valid.
10772         * verify.c (mono_method_verify): removed old TODO
10774 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10776         * verify.c (do_newobj): add visibility check.
10778 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10780         * verify.c (do_load_function_ptr): add visibility check.
10782 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
10783         *class.c:
10784         mono_generic_class_get_class: hook profiler events.
10785         mono_field_get_offset: added to support heap-shot in the new profiler.
10786         *class.h: exported mono_field_get_offset.
10787         * reflection.c:
10788         mono_reflection_setup_internal_class: hook profiler events.
10790 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
10792         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
10793         argument here too and use it to avoid checking for pending exceptions if 
10794         possible.
10796 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
10798         * assembly.c (build_assembly_name): add arg for passing the assembly
10799         flags. Do not consider a PublicKey with value "null" valid.
10800         (mono_assembly_name_parse_full): added boolean argument that will be
10801         set if the assembly name contains a PublicKeyToken spec. Added support
10802         for the Retargetable spec for which only Yes or No are allowed as valid
10803         value. Consider assembly name invalid if Retargetable spec is set, but
10804         either version, culture or public key (token) are not specified.
10805         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
10806         with implementation in assembly.c.
10807         * icall.c (fill_reflection_assembly_name): also copy assembly flags
10808         from MonoAssemblyName.
10809         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
10810         introduced argument for mono_assembly_name_parse_full to know if the
10811         assembly name has a PublicKeyToken spec, and if it has instruct
10812         fill_reflection_assembly_name to use default value for keyToken (if
10813         PublicKeyToken is null).
10815 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
10817         * verify.c (mono_method_verify): fixed ovf ops with
10818         float values. They are unverifiable now.
10820 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
10822         * class.c (set_failure_from_loader_error): add BadImageException to the
10823         list of exceptions that can cause a type to fail to load.
10825         * class.c (mono_class_get_exception_for_failure): same.
10827 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
10829         * verify.c (in_any_exception_block): added, check if offset
10830         is part of any exception handling clause.
10832         * verify.c (get_stack_type): added VAR and MVAR types.
10834         * verify.c (do_stobj): better error messages.
10836         * verify.c (do_cpobj): added, check cpobj.
10838         * verify.c (do_initobj): added, check initobj.
10840         * verify.c (do_sizeof): added, check sizeof.
10842         * verify.c (do_localloc): added, check localloc.
10844         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
10846 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
10848         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
10849         save_lmf/restore_lmf opcodes.
10851         * threads.c (mono_threads_install_notify_pending_exc): New function to
10852         install a callback notifying the JIT there is a pending exception on a thread.
10853         (mono_thread_request_interruption): Call the new callback.
10854         (mono_thread_get_and_clear_pending_exception): New function to return the
10855         exception pending on a thread.
10857         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
10858         to turn off checking for pending exceptions.
10859         (mono_marshal_get_native_wrapper): Ditto.
10861 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
10863         * threads-types.h: Get rid of the unnecessary extern declarations.
10865 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
10867         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
10868         return field from parent class if not private.
10869         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
10870         returns fields from parent class if they are not private.
10871         (method_nonpublic): added function to determine if a given method
10872         should be considered non-public. Returns false for private methods
10873         on parent class, and internal methods from parent on the 1.0 profile.
10874         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
10875         use method_nonpublic function to determine whether method should be
10876         returned.
10877         (property_accessor_public): use newly introduced method_nonpublic
10878         function to determine whether accessor is non-public. 
10879         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
10880         event from parent class if not private. Only return static event if
10881         Static flag is set, and only return static event from parent class if
10882         FlattenHierarchy flag is set.
10883         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
10884         include non-private events from parent class.
10886 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
10888         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
10889         warning.
10891 2008-01-16  Wade Berrier <wberrier@novell.com>
10893         * security.c: Add assembly.h header to appease some warnings
10895 2008-01-16  Dick Porter  <dick@ximian.com>
10897         * process.c (process_module_string_read): Remove trailing null
10898         when saving string.
10900 2008-01-16  Mark Probst  <mark.probst@gmail.com>
10902         * class-internals.h: A new data structure describing the layout of
10903         a runtime generic context (MonoRuntimeGenericContextTemplate).
10905         * metadata-internals.h: Added a hash table to MonoDomain that maps
10906         from open generic classes to their runtime generic context
10907         templates.
10909         * object.c: Building of the runtime generic context, including
10910         proper handling of generic type arguments of superclasses.
10911         Building of the runtime generic context according to the template.
10913 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
10915         * class.c (mono_class_setup_fields): Set field.count for generic instances.
10916         Fixes #350856.
10918         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
10919         mono_portability_find_file (). Fixes #325466.
10920         (mono_image_get_public_key): Fix a warning.
10922 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
10924         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
10925         Fixes #353550.
10926         (mono_class_from_name_case): Ditto.
10928 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
10930         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
10931           common storage for the tables used in the System/NumberFormatter class.
10933 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
10935         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
10937 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
10939         * verify.c (get_boxable_mono_type): check if the token is valid.
10941         * verify.c (set_stack_value): changed to add an error if an
10942         invalid type is set on stack. Changed all callers due to signature change.
10944         * verify.c (do_stobj): implement stobj validation.
10946 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
10948         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
10949         set container->is_method, it was set earlier.
10951         * metadata.c (type_in_image): Handle MVARs which belong to not finished
10952         generic methods.
10954         * reflection.c (mono_reflection_initialize_generic_parameter): Set
10955         is_method of the generic container to TRUE for methods.
10957 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
10959         * metadata.c (type_in_image): Handle type parameters properly.
10961         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
10962         memory ownership of this structure.
10964 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
10966         * verify.c (get_boxable_mono_type): make typedref types been just
10967         unverifiable. check for void type.
10969         * verify.c (do_unbox_any): added, verify opcode unbox.any.
10971         * verify.c (do_load_function_ptr): accept method spec tokens.
10973 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
10975         * marshal.c (mono_class_native_size): Always set *align even if this is called
10976         recursively.
10978 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
10980         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
10981         out-of-date.
10983 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
10985         * verify.c: removed some old unused tables. A huge bunch of small fixes
10986         to things found while testing the verifier with mono basic.
10988         * verify.c (dump_stack_value): dump null literal flag to.
10990         * verify.c (verify_type_compatibility_full): fix comparison
10991         for types that have a generic super type.
10993         * verify.c (verify_stack_type_compatibility): fix compatibility
10994         between null literals and reference types. fix compatibility between
10995         boxed valuetypes and object. fix corner case test for enums.
10997         * verify.c (do_cmp_op): proper verification of cgt.un in case
10998         of reference types.
11000         * verify.c (do_invoke_method): fix error message.
11002         * verify.c (do_store_indirect
11004         * verify.c (check_is_valid_type_for_field_ops): proper verification
11005         of managed pointers to valuetypes and boxed valuetypes. proper verification
11006         of null literals.
11008         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
11009         allow token to be a reference type.
11011         * verify.c (do_cast): proper handling of boxes valuetypes.
11013         * verify.c (do_stelem): proper handling of storing a boxed valuetype
11014         in object[].
11016         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
11017         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
11018         fixed the decoding of unbox_any
11020 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
11022         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
11024 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
11026         * verify.c (do_newobj): do delegate verification.
11028         * verify.c (verify_delegate_compatibility): perform delegate
11029         verification.
11031         * verify.c (verify_ldftn_delegate): perform tests related to
11032         ldftn delegates.
11034         * verify.c (mono_delegate_signature_equal): perform the
11035         slightly diferent signature comparison required by delegates.
11037         * metadata.c (mono_metadata_type_equal_full): added and exported
11038         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
11039         allows signature only comparison.
11041         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
11042         as MONO_INTERNAL.
11044 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
11046         * verify.c: added a bunch of stack_slot_* functions to
11047         make access to stack slot type easier. This is required to
11048         allow optional flags, like null literal, boxed value and
11049         this pointer.
11050         All access paths to IlStackDesc::stype have been changed 
11051         to use these new funcions.
11052         Removed a bunch of unused functions and cleared all warnings.
11053         This patch introduces the usage of the this pointer and 
11054         boxed value flags.
11056 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
11058         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
11060 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
11062         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
11063         match managed version.
11065         * appdomain.c: Bump corlib version.
11066         
11067         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
11068         argument.
11070 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
11072         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
11073         Set public key token to zero-length byte array if assembly is not
11074         strongnamed.
11076 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
11078         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
11079         writing a vtype array elem.
11081 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
11083         * assembly.c (build_assembly_name): return FALSE if length of token is
11084         not 16 (if not "null").
11085         (mono_assembly_name_parse_full): return FALSE if value of version,
11086         culture, token or key is 0.
11087         * icall.c (fill_reflection_assembly_name): add boolean arguments to
11088         specify whether public key and public key token must be set to default
11089         value (zero-length byte array) if not available. Set versioncompat to
11090         SameMachine. If public key is available or the default is set, then
11091         set PublicKey flag.
11092         (ves_icall_System_Reflection_Assembly_FillName): if no public key
11093         is available, use empty byte array as default value. On the 2.0
11094         profile, use default value for public key token if not set.
11095         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
11096         profile, use default value for public key if not set. On the 2.0
11097         profile, use default value for public key token if not set.
11098         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
11099         default values for public key and public key token.
11101 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
11103         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
11104         field to keep it in synch with the managed object.
11106         * marshal.c (emit_marshal_object): Add support for byref marshalling of
11107         delegates. Fixes #351520.
11109         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
11110         contains defined memory.
11111         
11112         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
11114         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
11115         
11116         * sgen-gc.c (check_consistency): New helper function to do a consistency check
11117         of the GC data structures.
11119         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
11121         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
11122         
11123         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
11124         barrier.
11125         (mono_array_clone_in_domain): Ditto.
11126         (mono_array_clone_in_domain): Ditto.
11128         * threads.c (start_wrapper): Register the thread start argument as a GC root.
11129         (cache_culture): Use a write barrier.
11131         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
11132         (ves_icall_get_property_info): Ditto.
11134         * object.h (MONO_STRUCT_SETREF): New macro.
11136         * class-internals.h (MonoStats): Add some GC statistics.
11138         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
11140 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
11142         * exception.c (mono_exception_from_name_two_strings):
11143         Break from loop after method is found.
11145 2008-01-04  Dick Porter  <dick@ximian.com>
11147         * process.c (process_module_string_read): Rename variable to
11148         reflect correct usage, after fixing bug 345972.
11150 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
11152         * verify.c (mono_type_create_fnptr_from_mono_method): 
11153         created a MonoType function pointer instance to be used during
11154         verification. The verifier releases this memory at end.
11156         * verify.c (mono_method_is_constructor): extracted repeated
11157         checks for constructor into a single class.
11159         * verify.c (do_push_field): use new extracted method
11160         for constructor check.
11162         * verify.c (do_newobj): same.
11164         * verify.c (do_ldftn): renamed to do_load_function_ptr
11165         and make it verify ldvirtftn too.
11167         * verify.c (mono_method_verify: proper verification
11168         of ldvirtftn. release created MonoMethod instances.
11170 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
11172         * verify.c (token_bounds_check): added.
11174         * verify.c (do_ldftn): added.
11176         * verify.c (mono_method_verify): proper verificartion of ldftn.
11178 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
11180         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
11181         than the table row count. It's the resposibility of the caller to
11182         make the bounds check and raise the correct error.
11184         * metadata.c (mono_metadata_decode_row_col): Same.
11186         * loader.c (mono_get_method_from_token): perform bounds check
11187         on token for methoddef table.
11189 2007-12-29  Miguel de Icaza  <miguel@novell.com>
11191         * icall.c
11192         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
11193         assert into a negative result, the managed code already coped with
11194         that.
11196         Some folks on Windows reported this error. 
11198 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
11200         * appdomain.c: Bump corlib version.
11201         * icall.c:
11202         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
11203         CultureInfo.CreateCulture to create CultureInfo for name.
11204         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
11205         create CultureInfo for name. Fixes bug #347174.
11207 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
11209         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
11210         flags.
11212         * verify.c (is_valid_branch_instruction): allow branching to the
11213         first instruction of the protected block.
11215         * verify.c (is_valid_cmp_branch_instruction): same.
11217         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
11218         avoid double initialization.
11220         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
11221         detect which cases the eval stack should just be copied.
11223         * verify.c (mono_method_verify): check if the eval stack
11224         is empty when entering a protected block.
11226 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
11228         * verify.c: added is_clause_in_range, is_clause_inside_range,
11229         is_clause_nested and verify_clause_relationship. They perform
11230         the verifications stated in P1 12.4.2.7.
11232         * verify.c (mono_method_verify): remove some unused variables,
11233         add the new exception clause checks, add instruction border
11234         checks for protected block start/end, improved some error 
11235         messages and fixed a bug in the way invalid instruction access
11236         is detected.
11238 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
11240         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
11241         from GC 7.0 if available.
11243         * object.c: Remove an unused define.
11244         
11245         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
11247         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
11249         * null-gc.c (mono_gc_make_descr_for_array): Implement.
11251         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
11253         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
11254         to take the same arguments as the other make_descr functions.
11256         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
11258         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
11259         directly.
11261         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
11262         mini.c.
11264         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
11265         call to boehm-gc.c.
11267         * boehm-gc.c (mono_gc_register_root): Fix a warning.
11269         * null-gc.c (mono_gc_register_root): Fix a warning.
11271         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
11273         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
11274         (mono_gc_base_init): Call GC_init ().
11276         * null-gc.c: Define mono_gc_register_root () as a no-op.
11278         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
11280 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
11282         * verify.c: add prototype for merge_stacks at top
11284         * verify.c (do_switch): added.
11286         * verify.c (merge_stacks): on some cases the stack merging
11287         was not happening properly. Unequal stack sizes at merge
11288         points should be invalid.
11290         * verify.c (mono_method_verify): added more debug info on stack state.
11291         verify switch properly.
11293 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
11295         * method-builder.h: New file, moved the mono_mb_ declarations here from 
11296         marshal.h.
11298         * boehm-gc.c marshal.c: Include method-builder.h.
11300         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
11302         * marshal.c: Remove some code which is now in method-builder.c.
11304 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
11306         * method-builder.c: New file, extraction of the method builder functionality 
11307         from marshal.c.
11309         * marshal.c: Move the mb functions into method-builder.c.
11311         * marshal.h marshal.c: Export some mono_mb_... functions.
11313         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
11315         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
11316         the caller.
11318         * class.c (mono_class_get_full): Check the token type in the dynamic case.
11320         * loader.c (mono_field_from_token): Ditto.      
11322         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
11323         type as well.
11324         
11325         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
11326         Fixes #342565.
11328         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
11329         a helper function for setting it.
11331         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
11333         
11334         * assembly.c: Significally simplify code now that referenced assemblies are 
11335         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
11337         * threads.h: Don't include  the internal threads-types.h header file. Fixes
11338         #349952.
11340 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
11342         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
11343         instructions that were target of branches or are at protected block boundaries.
11345         * verify.c (in_same_block): handle filter clauses.
11347         * verify.c (is_valid_branch_instruction): added. checks the target of
11348         instructions br or brtrue/false.
11350         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
11351         binary branch instructions such as beq and bge.
11353         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
11354         and made it pin the instruction as been part of the exception block.
11356         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
11357         of in_same_block.
11359         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
11360         of in_same_block.
11362         * verify.c (do_ret): ret from a protected block is unverifiable and
11363         not invalid.
11365         * verify.c (do_static_branch): verify br and br.s instructions.
11367         * verify.c (merge_stacks): add extra param to support detection
11368         of branches in the middle of instructions.
11369         
11370         * verify.c (mono_method_verify): verify branches and exception blocks
11371         that target the middle of instructions. Proper verification of br and br.s.
11373 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
11375         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
11376         skip_visibility field.
11377         (reflection_methodbuilder_from_dynamic_method): Ditto.
11379         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
11380         registrations. Fixes #348193.
11382         * threads.h: Move the internal mono_thread_get_pending_exception () to
11383         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
11385 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
11387         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
11388         icall registration. Fixes #348193.
11390         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
11391         for corlib classes into object. Fixes #349621.
11393 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
11395         * icall.c (property_accessor_nonpublic): new function to determine
11396         whether an accessor allows a property to be considered non-public.
11397         Returns false for private accessor(s) from parent class, and internal
11398         accessor(s) from parent on 2.0 profile (and higher).
11399         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
11400         to determine whether property should be included if NonPublic flag
11401         is set. Fixes bug #349078.
11403 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
11405         * verify.c (init_stack_with_value): added.
11407         * verify.c (mono_method_verify): extracted common
11408         code for exception initialization into init_stack_with_value.
11410         * verify.c (mono_method_verify): initialize the exception
11411         for handler clauses as well.
11413         * verify.c (mono_method_verify): fix the exception clause
11414         ordering rules, it should use handler end offset and not
11415         start offset.
11417 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
11419         * rawbuffer.c: remove useless warning.
11421 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
11423         * threads.h, threads-types.h: move functions to the correct header
11424         (fixes bug#349952).
11426 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11428         * verify.c (mono_method_verify): proper verification
11429         of exception handling clauses ranges and fallthru in
11430         and out of protected blocks.
11432 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11434         * verify.c (mono_method_verify): fixed compilation issue.
11436 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11438         * verify.c (mono_method_verify): a printf slipped in, changed
11439         to use verifier debug macro.
11441 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
11443         * verify.c (is_correct_leave): check for filter clauses.
11445         * verify.c (do_filter): added.
11447         * verify.c (mono_method_verify): property verification of leave.
11450 2007-12-18  Mark Probst  <mark.probst@gmail.com>
11452         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
11453         Win32 build, until we figure out how to do the proper thing on
11454         Win32.
11456 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
11458         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
11459         by the previous patch.
11460         
11461         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
11462         the assembly resolve handler for refonly assemblies.
11464 2007-12-17  Mark Probst  <mark.probst@gmail.com>
11466         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
11467         Make sure only one thread is allowed to commence shutdown, and
11468         don't allow new threads to be started once shutdown is in
11469         progress.
11471 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
11473         * verify.c (is_correct_endfilter): added.
11475         * verify.c (is_unverifiable_endfilter): added.
11477         * verify.c (do_endfilter): added.
11479         * verify.c (mono_method_verify): property verification of endfilter
11480         and fixed a corner case or endfinally.
11482 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
11484         * verify.h: new flags to support fail fast of unverifiable code and
11485         do non-strict verification. Non-strict verification is required to
11486         have MS runtime compatibility. There are a huge amount of unverifiable
11487         code that it accepts as verifiable. The strict mode verifies the code
11488         as the specs says.
11489         Non-strict mode will be required in cases where code needs to be
11490         accepted as verifiable but fails under strict mode.
11492         * pedump.c: added support to fail fast and non-strict verification.
11494         * verify.c: added support for both fail fast and non-strict verification.
11496 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
11498         * verify.c (is_correct_endfinally): added.
11500         * verify.c (mono_method_verify): property verification of endfinally.
11502 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
11504         * verify.c (in_any_block): check for filter clauses.
11506         * verify.c (is_correct_rethrow): added.
11508         * verify.c (mono_method_verify): property verification of rethrow.
11510         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
11512 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
11514         * verify.c (do_throw): added.
11516         * verify.c (mono_method_verify): property verification of throw
11518 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
11520         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
11521         assemblies. Fixes #346425.
11523 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
11525         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
11526         FieldBuilders.
11528         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
11530         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
11531         prevent asserts when this is called with a token which might not be valid.
11533         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
11534         lookup_dynamic_token_class with valid_token == FALSE.
11536         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
11538         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
11540         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
11541         
11542 2007-12-10  Mark Probst  <mark.probst@gmail.com>
11544         * gc.c: Don't delay threadpool thread finalization unless Mono is
11545         shutting down.
11547 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
11549         * threads.c: turn an assert into a non-fatal warning.
11551 2007-12-09  Robert Jordan  <robertj@gmx.net>
11553         * icall.c (GetVirtualMethod): Add missing argument validation.
11555 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11557         * verify.c (do_cast): added.
11559         * verify.c (mono_method_verify): property verification of castclass and isinst.
11562 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11564         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
11566         * verify.c (do_stelem): added.
11568         * verify.c (mono_method_verify): property verification of stelem.X.
11570 2007-12-07  Mark Probst  <mark.probst@gmail.com>
11572         * class.c, class-internals.h: Introduce an environment variable
11573         (MONO_GENERIC_SHARING) through which the extent of generic code
11574         sharing can be controlled (share all classes, share only corlib
11575         classes, or share nothing).
11577         * object.c: Only create runtime generic context for classes for
11578         which sharing is enabled.
11580 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11582         * verify.c (do_ldelem): refactor it to work with ldelem.any.
11584         * verify.c (mono_method_verify): property verification of ldelem.any.
11586 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11588         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
11589         added ldelem.X opcodes.
11591         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
11593         * verify.c: proper verification of ldelem.X 
11595 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
11597         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
11599 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
11601         * verify.c (mono_method_verify): null literal requires special handling,
11602         the value pushed on stack need to be flagged as so.
11604         * verify.c (do_ldelema): Verify ldelema properly.
11606 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
11608         * verify.c: Verify ldlen properly.
11610 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
11612         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
11613         to the target object's type. Fixes #346160.
11615 2007-12-05  Dick Porter  <dick@ximian.com>
11617         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
11618         Solaris needs the same workaround as BSD-derived systems.  Fixes
11619         bug 323524, patch by Burkhard Linke
11620         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
11622 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
11624         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
11625         handle to use when error dialog is shown; otherwise, update mask
11626         to show no error dialog when an error occurs.
11628 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
11630         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
11632         * class.c (mono_class_get_field_default_value): New helper function to initialize
11633         field->def_type and field->data.
11635 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
11637         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
11638         the general one.
11640         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
11642         * marshal.c: Avoid depending on delegate->method_info being set.
11644         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
11645         
11646         * object.c (mono_delegate_ctor): Set delegate->method.
11648         * object-internals.h (struct _MonoDelegate): Add 'method' field.
11650         * appdomain.c: Bump corlib version.
11652 2007-11-27  Raja R Harinath  <harinath@gmail.com>
11654         * metadata.c (mono_generic_inst_equal_full): Short-circuit
11655         equality check if we're comparing canonicalized MonoGenericInsts.
11657 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
11659         * class.c (generic_array_methods): Call mono_class_setup_methods () before
11660         accessing class->methods.
11662 2007-11-22  Dick Porter  <dick@ximian.com>
11664         * threads.c: Ensure that the synch_cs is set before trying to use
11665         it.
11667 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
11669         * profiler.c: r89126 broke the statistial profiler, unbreak.
11671 2007-11-22  Martin Baulig  <martin@ximian.com>
11673         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
11675         * mono-debug.c
11676         (mono_debug_debugger_version): Bump to 3.
11677         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
11678         -> mono_debugger_class_initialized().
11680         * mono-debug-debugger.c
11681         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
11683         * class.c
11684         (mono_debugger_start_class_init_func): Removed.
11685         (mono_debugger_class_loaded_methods_func): Added.
11686         (mono_class_setup_methods): Call it here.
11688 2007-11-22  Martin Baulig  <martin@ximian.com>
11690         * mono-debug.c
11691         (mono_debug_add_delegate_trampoline): New public method.
11692         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
11694         * mono-debug.h
11695         (MonoSymbolTable): Added `global_data_table'.
11696         (MonoDebuggerTypeKind): Removed.
11698 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
11700         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
11701         these methods.
11703         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
11704         
11705 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
11707         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
11709 2007-11-20  Martin Baulig  <martin@ximian.com>
11711         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
11713         * mono-debug-debugger.c
11714         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
11715         (mono_debugger_remove_breakpoint): Likewise.
11716         (mono_debugger_check_breakpoints): Likewise.
11717         (mono_debugger_register_class_init_callback): New public method.
11718         (mono_debugger_remove_class_init_callback): Likewise.
11719         (mono_debugger_add_type): Likewise.
11721         * mono-debug-debugger.h
11722         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
11724 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
11726         * class.c: more interface implementations needed for the
11727         array enumerator (fixes bug #341112).
11729 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
11731         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
11732         fix ParamName of ArgumentNullExceptions.
11734 2007-11-17  Miguel de Icaza  <miguel@novell.com>
11736         * reflection.c (mono_reflection_encode_sighelper): Generate the
11737         modopts and modreqs.   I have a useless test that crashes monodis,
11738         but that shows the code working.
11740 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
11742         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
11743         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
11745 2007-11-15  Dick Porter  <dick@ximian.com>
11747         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
11748         When joining a thread, it's the thread that's calling Join that
11749         gets WaitSleepJoin state not the target.  Fixes the standalone
11750         test case in bug 334740, and hopefully the whole bug too.
11752 2007-11-15  Dick Porter  <dick@ximian.com>
11754         * process.c: Read file version info from the files pointed at by
11755         process modules, not the current process.  Fixes bug 315969.
11757         Use windows typedef names in some places to fix warnings on the
11758         windows build.
11760 2007-11-15  Mark Probst  <mark.probst@gmail.com>
11762         * image.c, metadata-internals.h: Added a generic_class_cache hash
11763         to MonoImage for looking up generic classes when sharing generics.
11765 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
11767         * sgen-gc.c: warning cleanups.
11769 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
11771         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
11772         inherited properties.
11774 2007-11-14  Mark Probst  <mark.probst@gmail.com>
11776         * object.c, class-internals.h: Added more information to the
11777         runtime generic context.
11779 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
11781         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
11782         instead of just the target method. Generalize the abstract method handling to
11783         handle any non-static method.
11785         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
11786         mono_marshal_get_delegate_invoke () signature change.
11788 2007-11-13  Mark Probst  <mark.probst@gmail.com>
11790         * class.c, class-internals.h: Made
11791         mono_type_get_basic_type_from_generic () public.  Fixed member
11792         access check for shared generics.
11794         * loader.c: Don't insert field into field cache if it's part of a
11795         non-inflated generic class.
11797         * domain.c, domain-internals.h: The generic sharing context is now
11798         part of the jit info data structure.  Added two accessor
11799         functions.
11801 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
11803         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
11804         the array Get/Set/Address methods, since the JIT inlines them.
11806         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
11808         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
11809         (mono_image_init): Initialize runtime_invoke_direct_cache.      
11811         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
11812         mono_marshal_get_delegate_invoke signature change.
11814         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
11815         an additional argument. Add support for invoking abstract methods.
11817         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
11819         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
11821 2007-11-09  Mark Probst  <mark.probst@gmail.com>
11823         * class.c: Do field layout for open generic classes as well.
11825 2007-11-09  Mark Probst  <mark.probst@gmail.com>
11827         * gc.c, gc-internal.h: Don't finalize threadpool threads with
11828         other objects, because the threadpool is still around.  Put them
11829         in a list instead and after finalizing all other objects in the
11830         root domain shut down the thread pool and then finalize the
11831         threads.  Fixes bug #337383.
11833         * threads.c, thread-types.h: New mono_thread_create_internal()
11834         function for marking a thread with the threadpool flag before it
11835         started.  Set synch_cs to NULL after freeing it.
11837         * threadpool.c: Mark threadpool threads before they start.
11839 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
11841         * reflection.h, reflection.c: don't export random functions
11842         and lazy load dbnull and missing objects.
11844 2007-11-07  Jonathan Chambers <joncham@gmail.com>
11846         * class.c: Initialize COM types if COM interfaces
11847         are present (not just COM classes).
11848         
11849         Code is contributed under MIT/X11 license.
11851 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
11852         * reflection.c:
11853         create_dynamic_mono_image: hook module profiler events (dynamic case).
11854         mono_image_basic_init: hook assembly profiler events (dynamic case).
11856 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
11857         * profiler.c:
11858         simple_appdomain_unload: completely terminate the profiler
11859         instead of only processing the statistical samples.
11860         simple_shutdown: make sure this is really called exactly once,
11861         even in multithreaded applications, and always listen to
11862         appdomain events.
11863         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
11864         here, the "[un]load" functions will do it.
11865         Fixes bugs #333791 and #325261.
11867 2007-11-07  Geoff Norton  <gnorton@novell.com>
11869         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
11870         rather than depend on __APPLE__.
11872 2007-11-07  Mark Probst  <mark.probst@gmail.com>
11874         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
11876 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
11878         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
11879         UTF16 MonoString. Fix the crash from bug #335488
11881 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
11883         * marshal.c: Correct (for non-Win32 OS) length != size in 
11884         mono_string_from_bstr. Fix #339530.
11886 2007-11-06  Geoff Norton  <gnorton@novell.com>
11888         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
11889         to succeed
11891 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
11893         * process.c: Added run-time GetProcessId API detection for Windows.
11895 2007-11-04  Miguel de Icaza  <miguel@novell.com>
11897         * reflection.c  (mono_param_get_objects): If a parameter has the
11898         attribute [System.Runtime.InteropServices.Optional] we should
11899         set the DefaultValue of the ParameterInfo to be
11900         System.Reflection.Missing instead of DBNull.
11902         See bug #339013.
11904         (mono_get_reflection_missing_object): New method,
11905         returns the System.Reflection.Missing.Value singleton instance.
11907 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
11909         * culture-info-table.h : regenerated.
11911 2007-11-02  Jonathan Chambers <joncham@gmail.com>
11913         * icall.c: Use GetEnvironmentStrings on windows
11914         so we are using the same environment block as 
11915         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
11916         #333740.
11917         
11918         Code is contributed under MIT/X11 license.
11920 2007-10-31  Martin Baulig  <martin@ximian.com>
11922         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
11924         * mono-debug-debugger.h
11925         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
11927 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
11929         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
11930         classes.
11932 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
11934         * culture-info-table.h : regenerated.
11936 2007-10-30  Robert Jordan  <robertj@gmx.net>
11938         * icall-def.h, icall.c:
11939         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
11941         Code is contributed under MIT/X11 license.
11943 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
11945         * class.c (mono_class_setup_vtable): Find the inflated methods in the
11946         inflated class instead of inflating them again.
11947         
11948         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
11949         dynamic case.
11951         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
11952         Call setup_supertypes () after klass->parent is set.
11953         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
11955         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
11956         for inflated instances of not yet created dynamic generic classes.
11957         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
11958         times from inflated_method.
11959         (methodbuilder_to_mono_method): Ditto.
11961 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
11963         * gc.c: code cleanup and removed old untested option of not creating the
11964         finalizer thread.
11966 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
11968         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
11969         creating a jump trampoline for dynamic methods.
11971 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
11973         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
11974         generic TypeBuilders when called from another method of the same type (bug #335131).
11977 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
11979         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
11980         doesn't seem to work perfectly.
11981         
11982         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
11983         called multiple times.
11984         (methodbuilder_to_mono_method): Ditto.
11985         (resolve_object): Inflate FieldBuilder's.
11987 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
11989         * string-icalls.c, string-icalls.h, appdomain.c: patch from
11990         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
11991         RemoveEmptyEntries in the string.Split implementation (bug #322375).
11993 2007-10-26  Dick Porter  <dick@ximian.com>
11995         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
11996         Thread initialisation changes
11998 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
12000         * verify.c: fix compatibility check between arrays and System.Array
12002 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
12004         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
12005         too. Fixes #336999.
12007 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
12009         * object.c (mono_value_box): Use typed allocation here.
12011 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
12013         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
12014         trampoline instead of compiling the method right away.
12016         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
12018 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
12020         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
12021         related fields for dynamic classes. Fixes #334493.
12023 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
12025         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
12026         
12027         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
12029         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
12030         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
12032         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
12034         * reflection.c (create_generic_typespec): Initialize klass->generic_container
12035         if needed.
12036         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
12038 2007-10-18  Jonathan Chambers <joncham@gmail.com>
12040         * marshal.c: Use correct key when removing item
12041         from ccw_hash.
12042         
12043         Code is contributed under MIT/X11 license.
12045 2007-10-17  William Holmes  <billholmes54@gmail.com>
12047         *marshal.c: Adding a case to marshal booleans to U1
12049         Code is contributed under MIT/X11 license.
12051 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
12053         * class.c (mono_class_from_name): Search the modules compromising dynamic
12054         assemblies. Fixes #331601.
12056 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
12058         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
12059         exception if the type name contains an assembly component. Fixes #334203.
12061         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
12062         modules inside dynamic assemblies. Fixes #334200.
12063         
12064         * reflection.c: Set image->public_key and image->public_key_length;
12066         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
12067         fields.
12069         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
12070         
12071 2007-10-16  Mark Probst  <mark.probst@gmail.com>
12073         * metadata.c: Implemented correct comparing of generic classes.
12074         An inflated generic class can be equal to a non-inflated one if it
12075         is inflated with generic type variables as type arguments.  Fixes
12076         bug #333798.
12078 2007-10-15  Dick Porter  <dick@ximian.com>
12080         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
12081         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
12082         81646.
12084         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
12085         instead of a monitor lock.  This means that monitor_try_enter and
12086         co can set the thread state safely.
12087         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
12088         thread_interrupt_requested, so interrupt actually works.
12090         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
12091         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
12092         state accessor function
12094 2007-10-15  Martin Baulig  <martin@ximian.com>
12096         * mono-debug.h
12097         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
12098         the debugger with the current runtime.
12100 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
12102         * object.c, object-internals.h: added the ability to set a single
12103         trampoline for all the slots in a vtable.
12105 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12107         * marshal.c: deal with a possible race condition during multicast
12108         delegate invocation.
12110 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12112         * class.c: ensure value type methods don't have the synchronized
12113         flag set.
12115 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
12117         * string-icalls.c, string-icalls.h: reverted unapproved patch that
12118         breaks the build.
12120 2007-10-11  Joel Reed  <joelwreed@comcast.com>
12122         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
12123         to take an options parameter so that empty entries can be removed during
12124         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
12126 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12128         * marshal.c: make sure we don't store the signature from a dynamic
12129         method into the runtime invoke cache (bug #327189).
12131 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12133         * marshal.c: make sure the wrapper methods are properly initialized.
12135 2007-10-11  Mark Probst  <mark.probst@gmail.com>
12137         * metadata.c, metadata-internals.h: Generalized
12138         mono_type_stack_size() to mono_type_stack_size_internal() which
12139         takes an additional argument specifying whether it allows open
12140         types.
12142 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
12144         * verify.c (do_invoke_method): handle typedbyref params
12145         correctly and check for unverifiable return values.
12147         * verify.c (do_newobj): fix a warning.
12149 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
12151         * verify.c: don't tread typedbyref as allways unverifable,
12152         so uses, like (ld/st)loc.0 are valid. verify for the cases
12153         that it matters, like boxing related operations.
12155 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
12157         * verify.c: add verification of the newobj opcode. verification
12158         of delegate instantation still missing due ldftn and virldftn not
12159         pushing the function type on stack
12161 2007-10-08  Mark Probst  <mark.probst@gmail.com>
12163         * class-internals.h: Runtime generic context data structure
12164         definition.
12166         * object.c: Initialization of runtime generic context at runtime
12167         vtable creation time.
12169 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
12170         * class.c (mono_class_create_from_typedef,
12171         mono_class_from_generic_parameter, mono_ptr_class_get,
12172         mono_fnptr_class_get, mono_bounded_array_class_get)
12173         * domain.c (mono_domain_create, mono_domain_free)
12174         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
12175         * image.c (do_mono_image_load, mono_image_close):
12176         Hooked up load-unload profiler events.
12178 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
12180         * domain.c: track statistics about the actual amount of native code
12181         allocated.
12183 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
12185         * class.c: the valuetype enumerators don't have the additional
12186         supertypes interfaces.
12188 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12190         * class.c: need more interfaces setup for the IEnumerator<T>
12191         object created for arrays (tests/ienumerator-interfaces.2.cs).
12193 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
12195         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
12197 2007-10-05  Alp Toker  <alp@atoker.com>
12199         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
12200         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
12201         #315863.
12203 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
12205         * verify.c (verify_type_compatibility_full): verification of
12206         compatibility improved, validates correctly non-strict checks between
12207         native int and I4 types different than (unsigned)int32.
12209         * verify.c (do_store_indirect): added, do all verification of
12210         ldind.X opcodes. 
12212         * verify.c (get_load_indirect_mono_type): renamed to
12213         get_indirect_op_mono_type, as it now returns the MonoType for 
12214         ldind.X and stind.X opcodes.
12216 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
12218         * reflection.c: Fix the encoding of generic type definition for
12219         TypeBuilders.
12221         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
12222         mono_image_typedef_or_ref but allows to specify if typespec lookups should
12223         be made. Typespec check is done prior to typeref cache lookup.
12225         * reflection.c (mono_image_typedef_or_ref): now just delegate to
12226         mono_image_typedef_or_ref_full.
12228         * reflection.c (encode_generic_class): encode the generic class
12229         directly instead of calling encode_type.
12231         * reflection.c (encode_type): encode the generic type definition
12232         MonoClass as a generic instantiation.
12234         * reflection.c (create_typespec): cache typespec tokens in
12235         the assembly->typespec cache. Don't create typespec for a generic
12236         instance MonoClass. Create typespec for the generic type defintion.
12238         * reflection.c (create_generic_typespec): encode the generic
12239         class directly instead of calling encode_type.
12241         * reflection.c (mono_image_create_token): encode the generic
12242         type definition not using a typespec for MonoType instances.
12245 2007-10-04  Raja R Harinath  <rharinath@novell.com>
12247         Fix #328812
12248         * class.c (mono_image_init_name_cache): Don't return nested
12249         'protected internal' classes.
12250         (mono_class_from_name_case): Likewise.
12252 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
12254         * icall-def.h, icall.c : get_bundled_machine_config() is now the
12255           common function used by both DefaultConfig in System.dll and
12256           InternalConfigurationHost in System.Configuration.dll.
12258 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12260         * class.c: automatically add to vectors only a few essential explicit
12261         generic interfaces. The rest of the interfaces that arrays should
12262         provide are currently implicitly added (but still not lazily, see the
12263         design in the discussion of bug#325495 for the details of what is
12264         needed for that). Additionally, implicit interfaces are assigned the
12265         same vtable slot as the explicit interfaces (as they are compatible):
12266         this enables huge memory savings since we don't need to instantiate
12267         as many memthods and as large vtables anymore. Also, Since
12268         GetEnumerator<T> returns an instance of a type that is required to
12269         support a similarly large set of interfaces as arrays, we add
12270         implicit interfaces and interface offset sharing support to those
12271         types, too. This change adds all the required interfaces so that
12272         the anonarray.cs test case in the bug report works (we don't add
12273         all the interfaces to arrays of arrays 3-level deep and more because
12274         of the memory requirements explained in the bug and since they are much
12275         less common: the lazy-loading support will enabled them to work, too).
12277 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
12279         * verify.c (merge_stacks): major clean up, all type compatibility
12280         checks are done by verify_type_compatibility. This fix my earlier lack
12281         of understanding of the CLR type system and merge_stacks no longer looks
12282         scary.
12284         * verify.c: fixed some bad spelling.
12286 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
12288         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
12289         a given stack slock.
12290         
12291         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
12292         verify_type_compatibility_full. This removed a near indentical function and fixed
12293         handling of Int32 and IntPtr across all opcodes.
12295 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12297         * class.c: only vectors have the additional generic interfaces.
12299 2007-10-01  Jonathan Chambers <joncham@gmail.com>
12301         * mono-config.c: Use g_strcasecmp instead of
12302         strcasecmp like everywhere else to fix
12303         compilation with MSVC.
12304         
12305         Code is contributed under MIT/X11 license.
12307 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12309         * object.c, object-internals.h: refactored the IMT code to enable
12310         building a single slot at a time and lazily creating the IMT trampolines
12311         and thunks.
12313 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
12315         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
12317         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
12318         Fixes #328501.
12319         
12320 2007-09-29  Raja R Harinath  <harinath@gmail.com>
12322         * loader.c (method_from_methodspec): Rearrange to avoid
12323         un-necessary exposition.  Don't assert out if the method's
12324         declaring type is a generic type definition.
12326 2007-09-28  Martin Baulig  <martin@ximian.com>
12328         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
12330 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
12332         * class-internals.h: optimize field layout of MonoClass to
12333         requires less cachelines at runtime and save a few bytes on 64 bit
12334         systems.
12336 2007-09-28  Jb Evain  <jbevain@novell.com>
12338         * reflection.c: when encoding type names in custom attributes,
12339         if the type is a closed generic type, its generic arguments
12340         have to be serialized as AssemblyQualifiedName, so that when
12341         they are deserialized, it's possible to re-create them properly.
12342         Fixes #329450.
12345 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
12347         * object.c, class-internals.h: added delegate-creation counter.
12349 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
12351         * class.c: cleanup of the code that synthetizes interfaces for
12352         arrays in 2.0: saves quit a bit of corlib mempool memory.
12353         Code to fix bug #325495 ifdeffed out for now until the issues
12354         with memory usage and O(n^2) behaviour are fixed.
12356 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
12358         * marshal.c: when possible, do not duplicate the name of the methods
12359         in the method builder and in the generated MonoMethod.
12361 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
12362         * verify.c: added support for type checking ldind_* opcodes.
12364 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
12366         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
12367         which is used to distinguish the fully open instantiation of a TypeBuilder
12368         with the rest. This temporary hack is required to restore the property that
12369         the fully open instantiation is the same type of the generic type definition.
12371         * class-internals.h (mono_generic_class_is_generic_type_definition):
12372         new function as part of the internal API.
12374         * class.c (inflate_generic_type): return NULL when the generic inst is
12375         fully open. The fully open generic type is now the same as the generic type
12376         definition for non TypeBuilder types.
12378         * class.c (mono_generic_class_get_class): removed assert since it is
12379         no longer valid, gklass->cached_class can point to the generic type definition.
12381         * class.c (mono_generic_class_is_generic_type_definition): new.
12383         * metadata.c (mono_generic_class_hash): added is_tb_open field
12384         to the hash calculation.
12386         * metadata.c (free_generic_class): if the generic class is associated
12387         with the generic type definition, its field will come from the mempool and
12388         must not be freed.
12390         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
12391         new, this function identifies the corner case of a TypeBuilder fully open
12392         instantiation.
12394         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
12395         for lookup. Set gclass->cached_class to be the container class in case of
12396         the fully open instantiation of non TypeBuilder types.
12398         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
12399         to compare generic classes.
12401         * reflection.c (method_encode_methodspec): remove assert that
12402         no longer is valid.
12404         * reflection.c (mono_reflection_generic_class_initialize): add
12405         an aditional assert to ensure the proper type is used.
12407 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
12409         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
12410         to enjoy it.
12412 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
12414         * verify.c (push_arg): Fixed support for ldarga
12415         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
12416         MonoType used as first arg in case of instance calls.
12418 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
12420         * verify.c: Support for verifying VAR and MVAR types, 
12422 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
12424         * icall.c (ves_icall_get_property_info): Set the reflected type of the
12425         accessors correctly.
12427 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
12429         * threads.c: support OSX and other systems in
12430         mono_thread_get_stack_bounds (bug #328026).
12432 2007-09-25  Martin Baulig  <martin@ximian.com>
12434         * mono-debug.h
12435         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
12437 2007-09-24  Martin Baulig  <martin@ximian.com>
12439         * mono-debug.h
12440         (MonoDebugClassEntry): Moved the definition of this struct into
12441         mono-debug.c to make it private.
12443         * mono-debug.c
12444         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
12445         type table per symbol file, we don't need to store the symfile id
12446         any longer.
12448 2007-09-24  Martin Baulig  <martin@ximian.com>
12450         Create one type table per symbol file, since a `MonoClass *' gets
12451         invalid when its image is unloaded.
12453         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
12454         (MonoDebugHandle): Added `type_table'.
12456 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
12458         * mempool.c, mempool.h: added mono_mempool_new_size () API
12459         to be able to specify a smaller initial size for the pool.
12460         Adjusted the code to slowly increase pool size before using
12461         the previous default size.
12462         * image.c: use a small initial size for image mempools.
12464 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
12466         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
12467         Fixes ##320990.
12469         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
12470         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
12472 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
12474         * metadata.c (mono_type_create_from_typespec): Remove an invalid
12475         free. Fixes #327438.
12477 2007-09-21  Raja R Harinath  <harinath@gmail.com>
12479         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
12480         generic instantiations, etc.
12481         <MONO_TYPE_ARRAY>: Likewise.
12483 2007-09-21  Martin Baulig  <martin@ximian.com>
12485         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
12486         these structs were never defined.
12487         (MonoDebugHandle): Removed the `_priv' field, it was never used.
12489 2007-09-21  Martin Baulig  <martin@ximian.com>
12491         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
12493 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
12495         * image.c: removed the guid hash tables: we can get the same info
12496         without the additional memory usage hit (partially fixes also bug #327052).
12498 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12500         * profiler.h, profiler-private.h, profiler.c: add a new profiler
12501         event to handle unloading methods. After the event is called, the
12502         corresponding MonoMethod* must be considered invalid.
12503         * loader.c (mono_free_method): call the new mono_profiler_method_free
12504         event.
12506 2007-09-20  Mark Probst  <mark.probst@gmail.com>
12508         * domain-internals.h: New flag in MonoJitInfo which marks shared
12509         generic methods.  New hash table (shared_generics_hash) in
12510         MonoDomain to keep track of shared generic methods.  Prototypes
12511         for functions to register and lookup shared generic methods.
12513         * domain.c: Support for registering and looking up shared generic
12514         methods via a hash table (shared_generics_hash) in MonoDomain.
12516         * class-internals.h: New exception to signal failure of shared
12517         compilation of a generic method.  New counters for generics
12518         sharing in MonoStats.
12520 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
12522         * image.c, metadata-internals.h: don't keep a file descriptor open
12523         for loaded assemblies (bug#325988).
12525 2007-09-19  Raja R Harinath  <rharinath@novell.com>
12527         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
12528         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
12529         use the corresponding datatypes.
12530         (type_in_image): Update to changes.
12531         (CleanForImageUserData): Simplify.
12532         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
12533         Avoid quadratic behaviour in handling the "stolen" list by
12534         separating the filter predicate out, and by prepending the stolen
12535         items rather than appending them.
12536         (steal_ginst_in_image): Likewise.
12537         (mono_metadata_clean_for_image): Update to changes.
12539 2007-09-19  Martin Baulig  <martin@ximian.com>
12541         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
12543 2007-09-19  Martin Baulig  <martin@ximian.com>
12545         * mono-debug.c (mono_debug_cleanup): Don't call
12546         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
12548 2007-09-19  Raja R Harinath  <harinath@gmail.com>
12550         Fix crash on 'make run-test' in mcs/errors
12551         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
12552         Avoid more potential allocations in mono_class_from_mono_type.
12553         (ginst_in_image): Update to changes.
12554         (gclass_in_image): Rearrange slightly.
12556 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
12558         * class.c (mono_class_init): Move the code that sets up class->methods to 
12559         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
12561         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
12562         canonical instance of an inflated generic signature.
12563         (mono_type_create_from_typespec): Remove an invalid free.
12565         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
12567 2007-09-18  Marek Habersack  <mhabersack@novell.com>
12569         * domain-internals.h: added a declaration of the
12570         mono_assembly_load_full_nosearch internal function.
12572         * assembly.c (mono_assembly_load_with_partial_name): use
12573         mono_try_assembly_resolve return value properly.
12574         (mono_assembly_load_full_nosearch): copied the function body from
12575         mono_assembly_load_full, without the code to invoke assembly
12576         search hooks.
12577         (mono_assembly_load_full): calls the above new function and if the
12578         assembly is not resolved, invokes the search hooks.
12580         * appdomain.c (mono_runtime_init): restore the global postload
12581         assembly search handlers.
12583 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
12585         * class.c (mono_class_init): Make sure class->methods and class->properties
12586         are never NULL in the generics case.
12588         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
12590 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
12592         * metadata.c (free_generic_class): Disable some code to fix the build.
12594         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
12596         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
12597         from the image mempool.
12599         * metadata.c (free_generic_class): Free more data from the inflated class.
12601         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
12603         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
12604         mempool.
12605         (mono_type_create_from_typespec): Ditto.
12607         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
12608         MonoImage to the caller.
12609         (mono_init_internal): Save the opened image in a global variable.
12610         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
12612         * reflection.c (resolve_object): Fix a leak.
12614         * metadata.c: Fix the freeing of data in the generics caches.
12615         
12616         * metadata.c (free_generic_inst): Comment this out to fix the build.
12617         (free_generic_class): Ditto.
12619         * metadata.c: Free cached generic methods, instantinations and classes when
12620         they are removed from the caches.
12621         (mono_metadata_free_type): Free the type itself.
12623         * class.c: Free the result of mono_class_inflate_generic_type () in a few
12624         places.
12626 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12628         * boehm-gc.c: restrict managed allocs to __thread supporting
12629         architectures.
12631 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
12633         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
12634         (mono_generic_class_get_class): Fix a leak.
12636         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
12637         mono_metadata_free_type ().
12638         (mono_metadata_inflate_generic_inst): Fix a leak.
12640 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12642         * mono-debug.c (free_header_data): Fix a leak missed earlier.
12644         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
12645         mempool.
12647         * mono-debug.c (mono_debug_close_image): Fix call to 
12648         g_hash_table_remove ().
12650 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
12652         * icall-def.h: redirect all the string ctor to the managed
12653         CreateString () methods.
12654         * string-icalls.c, string-icalls.h: removed dead code for string
12655         ctors and icalls.
12657 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12659         * mono-debug.c: Fix memory leaks.
12661 2007-09-14  Jonathan Chambers <joncham@gmail.com>
12663         * threads-types.h: Implement mono_hazard_pointer_set and 
12664         mono_hazard_pointer_clear macros using do/while(0) to fix
12665         compilation with MSVC.
12666         
12667         Code is contributed under MIT/X11 license.
12669 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12671         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
12672         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
12674 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12676         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
12677         icalls.
12679 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12681         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
12682         managed-code allocated as well.
12684 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
12686         * class.c (mono_class_is_assignable_from): Add support for generic variance.
12688 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
12690         * boehm-gc.c: fixed the build after the AOT changes.
12692 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
12694         * wrapper-types.h: Add an ALLOC wrapper type.
12696         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
12697         reference managed allocator methods.
12699 2007-09-12  Marek Safar  <marek.safar@gmail.com>
12701         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
12702         of Type array and not MonoType, a fix suggested by Hari.
12703         
12704 2007-09-12  Jonathan Chambers <joncham@gmail.com>
12706         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
12707         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
12708         
12709         Code is contributed under MIT/X11 license.
12711 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12713         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
12715 2007-09-12  Marek Habersack  <mhabersack@novell.com>
12717         * image.c (do_mono_image_open): if assembly file fails to open and
12718         MONO_IOMAP is in effect, try to find the path in a
12719         case-insensitive way.
12721         * appdomain.c (mono_runtime_init): do not install postload hooks -
12722         tests show that MS.NET doesn't use anything of that sort to
12723         trigger the AppDomain.AssemblyResolve event.
12724         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
12725         made non-static.
12726         (mono_runtime_init): init portability helpers here.
12728         * assembly.c (mono_assembly_load_with_partial_name): if other   
12729         attempts fail, trigger the AppDomain.AssemblyResolve event handler
12730         to resolve the assembly.
12732         * domain-internals.h: added mono_try_assembly_resolve and marked
12733         it as internal.
12735 2007-09-11  Jb Evain  <jbevain@novell.com>
12737         * object-internals.h (MonoReflectionDynamicMethod): add
12738         a `MonoReflectionType *owner` field. The owner is used
12739         * reflection.c:
12740         (mono_reflection_create_dynamic_method): use the owner of the dynamic
12741         method as the class declaring the dynamic method.
12742         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
12743         dynamic method to the declaring type of the methodbuilder.
12745 2007-09-11  Mark Probst  <mark.probst@gmail.com>
12747         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
12748         rules for calling methods via reflection.
12750 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
12752         * reflection.c (resolve_object): Add support for MonoGenericClass. 
12753         Inflate MonoType's.
12755 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
12757         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
12758         provide a managed method that does fast allocations without needing
12759         a managed->unmanaged transition. Boehm GC implementation currently
12760         enabled for ptrfree objects on sane architectures.
12762 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
12764         * marshal.c, marshal.h: exported a couple of useful functions and
12765         added mono_mb_get_label () to easily handle backward branches.
12767 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
12769         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
12771 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12773         * loader.c (find_method): Fixed the regression introduced while
12774         fixing bug #81466.
12776 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
12778         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
12779         well.
12780         
12781         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
12782         icall.c reflection.c: Pass a MonoGenericContext argument to 
12783         mono_lookup_dynamic_token ().
12785         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
12786         #82744.
12787         
12788 2007-09-09  Robert Jordan  <robertj@gmx.net>
12790         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
12791         for generic methods.
12793         * object.c (mono_object_get_virtual_method): Handle generic methods.
12794         Fixes bug #78882.
12796         Code is contributed under MIT/X11 license.
12798 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
12800         * image.c: fix locking in mono_image_load_file_for_image ().
12802 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
12804         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
12805         used only as a cache: added an icall to fill it.
12807 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
12809         * reflection.h: exposed mono_reflection_free_type_info
12810         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
12811         since mono_reflection_bind_generic_parameters makes a copy of it.
12812         * reflection.c (free_type_info): subinfos should be freed.
12813         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
12814         made non static.
12815         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
12816         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
12817         this fixes #82695 and #81726.
12818    
12820 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
12822         * process.h, process.c:  added support for user profile/info in
12823           ProcessStartInfo. For now only Windows works.
12825 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12827         * metadata.c: consider the generic arguments when comparing
12828         signatures (bug #82614).
12830 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12832         * cil-coff.h, image.c: updated assembly loader to cope with the
12833         PE32+ 64 bit file format.
12835 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12837         * assembly.c, class.c, domain.c, loader.c: remove useless
12838         inclusion of cil-coff.h.
12840 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
12842         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
12843         if interface is marked with CoClassAttribute. 
12844    
12845         Code is contributed under MIT/X11 license.
12847 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12849         * sgen-gc.c: ensure no object from the to space is copied again or finalized
12850         if it's seen twice in major collections.
12852 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
12854         * sgen-gc.c: big objects are not copied to the gray area, but they
12855         need to be considered for scanning, too, if they are brought alive
12856         by an object ready for finalizations or a survived one.
12858 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12860         * sgen-gc.c: properly account the number of disappearing links when
12861         they are nullified.
12863 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
12865         * sgen-gc.c: share the code to scan the registered roots between the
12866         different types of collections.
12868 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
12870         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
12872 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
12874         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
12875         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
12877 2007-08-28  Mark Probst  <mark.probst@gmail.com>
12879         * security-manager.c (mono_security_manager_get_methods):
12880         LinkDemandSecurityException now has 2 arguments instead of 3.
12882 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
12884         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
12885         platforms which need it.
12887 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
12889         * sgen-gc.c: unregister thread data structures with a pthread_key_t
12890         dtor.
12892 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
12894         * threads.c: free the thread static data on thread exit.
12896 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
12898         * class.c: walk the hierarchy to find the generic definition for
12899         a class (fixes runtime part of bug #82498).
12901 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
12903         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
12904         ...
12906         * image.c (mono_image_close): Here. Hopefully fixes #82510.
12908 2007-08-24  Mark Probst  <mark.probst@gmail.com>
12910         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
12912 2007-08-24  Robert Jordan  <robertj@gmx.net>
12914         * appdomain.c: don't perform the ':'->';' substitution on Win32.
12916 2007-08-24  Jb Evain  <jbevain@novell.com>
12918         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
12919         for byref types.
12921 2007-08-24  Mark Probst  <mark.probst@gmail.com>
12923         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
12924         #82286.
12926 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
12928         * assembly.c: Fix a warning.
12929         
12930 2007-08-23  Marek Habersack  <mhabersack@novell.com>
12932         * appdomain.c: parse the <runtime> section looking for the probing
12933         element with the 'privatePath' attribute, which sets additional
12934         directories in which the runtime should look for assemblies.
12936 2007-08-23  Robert Jordan  <robertj@gmx.net>
12938         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
12939         Fixes #82499.
12941 2007-08-23  Martin Baulig  <martin@ximian.com>
12943         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
12944         _mono_debug_init_corlib() and remove it from the header file.
12946 2007-08-23  Martin Baulig  <martin@ximian.com>
12948         * mono-debug-debugger.c
12949         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
12950         don't notify the debugger about it.
12952         * mono-debug-debugger.h
12953         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
12955 2007-08-23  Robert Jordan  <robertj@gmx.net>
12957         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
12958         Code is contributed under MIT/X11 license.
12960 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
12962         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
12964 2007-08-22  Martin Baulig  <martin@ximian.com>
12966         * mono-debug.c: Store debugging info on a per-domain basis and
12967         free it on domain unload.  Add support for unloading symbol files.
12969         * mono-debug.h
12970         (MonoDebugList): New typedef.
12971         (MonoSymbolTable):
12972         - add `data_tables and `type_table'.
12973         - replace 'symbol_files' and `num_symbol_files' with a
12974           `MonoDebugList *'.
12975         (mono_debug_data_table): Removed.
12976         (mono_debug_list_add): New public function.
12977         (mono_debug_list_remove): New public function.
12978         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
12979         (mono_debug_init_2_memory): Renamed into
12980         mono_debug_open_image_from_memory().
12981         (mono_debug_close_image): New public function.
12982         (mono_debug_domain_create): Likewise.
12983         (mono_debug_domain_unload): Likewise.
12984         (MONO_DEBUGGER_VERSION): Bump to 60.
12986         * mono-debug-debugger.h
12987         (MonoDebuggerEvent):
12988         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
12989         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
12990         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
12991         - rename `THREAD_CREATED' and `THREAD_EXITED' into
12992           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
12993         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
12994           meaning.
12995         (mono_debugger_add_symbol_file): Removed.
12996         (mono_debugger_add_type): Removed.
12997         (mono_debugger_lookup_type): Removed.
12998         (mono_debugger_lookup_assembly): Removed.
13000         * domain.c
13001         (mono_domain_create): Call mono_debug_domain_create().
13002         (mono_init_internal): Call mono_debug_init_corlib().
13004         * assembly.c
13005         (mono_assembly_close): Call mono_debug_close_image().
13007 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
13009         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
13010         mmap call.
13012 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
13014         * sgen-gc.c: ensure section->pin_queue_end is initialized
13015         correctly when non pinning objects in the section have been found.
13017 2007-08-22  Marek Habersack  <mhabersack@novell.com>
13019         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
13020         containing a list of directories separated by ':'. MSDN docs say
13021         the directories should be separated with ';'. Part of a bugfix for
13022         bug #81446
13024 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
13026         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
13027         it should MonoType and not MonoClass.
13029 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
13031         * culture-info-table.h : regenerated.
13033 2007-08-20  William Holmes  <billholmes54@gmail.com>
13035         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
13036          to call ReplaceFile Kernel32 on windows or in io-layer.
13037         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
13038         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
13039          as an internal call.
13041         Code is contributed under MIT/X11 license.
13043 2007-08-20  Jb Evain  <jbevain@novell.com>
13045         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
13046         and MONO_EXCEPTION_FIELD_ACCESS.
13048         * debug-helpers.[c|h]: new mono_field_full_name function.
13050 2007-08-20  Mark Probst  <mark.probst@gmail.com>
13052         * class.c: Removed class_security_level() and moved it to
13053         security-core-clr.c.
13055         * security-core-clr.c, security-core-clr.h: class_security_level()
13056         is now public and renamed to mono_security_core_clr_class_level().
13057         It also looks for security attributes in the classes a class is
13058         nested in.
13060 2007-08-20  Mark Probst  <mark.probst@gmail.com>
13062         * security-core-clr.c, security-core-clr.h: CoreCLR security
13063         utility functions.
13065         * Makefile.am: Added security-core-clr.[ch].
13067         * security-manager.c, security-manager.h: Functions and enum for
13068         setting and getting the security mode.
13070         * class.c: CoreCLR security checks.
13072 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
13074         * icall-def.h, process.c, process.h: implemented icall to get
13075         user/system processor times.
13077 2007-08-17  Mark Probst  <mark.probst@gmail.com>
13079         * domain.c, threads.c, class-internals.h, domain-internals.h: New
13080         reader-lock-free jit_info_table.
13082 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
13084         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
13086         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
13088         * object-internals.h (MonoException): Add missing _data member.
13090 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
13092         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
13093         checking that only methods with matching qname or fqname are picked
13094         from implemented interfaces.
13096 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13098         * verify.c (do_newarr):added, do type verification of
13099         newarr ops, push the right value on the eval stack.
13100         * verify.c (mono_method_verify): use do_newarr
13103 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13105         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
13106         factored the common code into get_boxable_mono_type, which
13107         is now using mono_type_get_full, this fixed byref related tests.
13109 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13111         * class.c: added mono_type_get_full, this function has the same
13112         behavior of mono_class_get_full but the returned MonoType has
13113         all metadata of the associated token in case of a typespec token.
13114         * class.c: added mono_type_retrieve_from_typespec, used by 
13115         mono_type_get_full to retrieve the token type.
13116         * class.c (mono_class_create_from_typespec): changed to use
13117         mono_type_retrieve_from_typespec.
13118         * class.c (mono_ldtoken): changed to use mono_type_get_full
13119         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
13120         * class-internals.h: exported mono_type_get_full for internal use.
13122 2007-08-16  Jb Evain  <jbevain@novell.com>
13124         * domain.c (supported_runtimes): add entry for
13125         the 'moonlight' runtime version.
13127 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13129         * verify.c (mono_method_verify): small typo sliped in.  
13131 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13133         * verify.c (do_unbox_value): added, do type verification of
13134         unboxing ops
13135         * verify.c (mono_method_verify): use do_unbox_value
13138 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13140         * verify.c (dump_stack_value): fixed typo, was printing string
13141         instead of object on stack.
13142         * verify.c (do_box_value): moved the byref check up as it leads
13143         to invalid code and should be done earlier.
13144         * verify.c: improved error messages for and ldobj
13146 2007-08-15  William Holmes  <billholmes54@gmail.com>
13148         * marshal.c (emit_marshal_custom): Omit the call to 
13149           marshal_native_to_managed when calling native to managed 
13150           and the argument is specified as an out argument.
13152         Code is contributed under MIT/X11 license.
13154 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13156         * verify.c: fixed the type checks for generics, function pointers and vectors.
13157         Added type verification for ldobj and ldtoken. The verifier
13158         would segfault if header or signature of a method contained references
13159         to non-existant types.
13161 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
13163         * marshal.c (cominterop_get_ccw): Patch from
13164         Bill Holmes to no walk up interface hierarchy. 
13165         All parent methods should be present in the interface for COM.
13166    
13167         Code is contributed under MIT/X11 license.
13169 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
13171         * marshal.c (emit_marshal_com_interface): Patch from
13172         Bill Holmes to handle COM Interfaces as return values
13173         for native->managed calls.
13174    
13175         Code is contributed under MIT/X11 license.
13177 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
13179         * marshal.c (cominterop_get_idispatch_for_object): Implement
13180         for runtime callable wrappers.
13181    
13182         Code is contributed under MIT/X11 license.
13184 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
13186         * pedump.c (main): changed from mono_init to mono_init_from_assembly
13187         so 2.0 types are accessible
13190 2007-08-13  Miguel de Icaza  <miguel@novell.com>
13192         * domain.c (mono_init_internal): Call mono_assembly_load_friends
13193         once we load mscorlib.   Due to the order in which we initialize,
13194         the mono_assembly_load_full routine that loads mscorlib did not
13195         load friends.   We now load it once we load the
13196         mono_defaults.internals_visible_class class. 
13198         * assembly.c: Expose the mono_load_friend_assemblies method.
13200 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
13202         * verify.c: improved the handling of boxing, better
13203         type checking for unary ops and conversion. Fix bug
13204         regarding managed pointer compatibility checking
13206 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
13208         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
13210         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
13212 2007-08-09  Raja R Harinath  <rharinath@novell.com>
13214         * reflection.c (dup_type): Remove.
13215         * class.c (dup_type): Remove.
13216         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
13217         instead of the dodgy 'dup_type'.
13218         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
13219         handle the case where 'dup_type' needed the second argument.
13221 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
13223         * domain.c: Fix a warning.
13225 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
13227         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
13228         checking that methods with the same fqname are not overridden
13229         with a method from an ancestor.
13231 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
13233         * threads.c (free_thread_static_data_helper): Avoid a crash if
13234         thread->static_data is not yet set.
13236 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
13238         * marshal.c: Use correct image when emitting
13239         native wrapper for COM calls.
13240    
13241         Code is contributed under MIT/X11 license.
13243 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
13245         * icall-def.h, security.c, security.h :
13246           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
13248 2007-08-07  Martin Baulig  <martin@ximian.com>
13250         * mono-debug-debugger.h
13251         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
13253         * domain.c (mono_domain_free): Call
13254         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
13256 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
13258         * verify.c (check_underflow, check_overflow): error message now returns IL offset
13259         * verify.c (in_same_block): code should test if either offset is inside the clauses
13260         * verify.c (mono_method_verify): push the exception into the eval stack of exception
13261         and filter blocks
13263 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
13265         * image.c (mono_image_close): Fix a leak.
13267         * object.c (mono_runtime_invoke_array): Avoid using alloca.
13269         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
13271 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
13273         * domain.c, threads.c, threads-types.h: fix memory retention issue
13274         with thread static variables not being cleared on domain unload.
13275         Reuse thread static slots after domain unload.
13277 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
13279         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
13280         nullable type.
13282         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
13283         now done in mono_runtime_invoke_array.
13285         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
13286         receiver is a nullable type.
13288         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
13289         generic parameter.
13291 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
13293         * marshal.c: Implement COM Objects as return type for 
13294         managed->unmanaged calls. Added Release calls for COM Object
13295         out/return values in managed->unmanaged calls.
13297         Code is contributed under MIT/X11 license.
13299 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
13301         * threads.h, threads-type.h: move the hazard pointer declarations
13302         to the private header.
13304 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
13306         * file-io.c, appdomain.c: memory leak fixes.
13308 2007-08-02  Dick Porter  <dick@ximian.com>
13310         * socket-io.c
13311         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
13312         SO_REUSEADDR setting into io-layer/sockets.c.
13314 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
13316         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
13317         from Object when called on a generic parameter. Fixes #82211.
13319 2007-08-01  Dick Porter  <dick@ximian.com>
13321         * file-io.c (convert_share): Test FileShare values bit-by-bit.
13322         Fixes bug 79250 yet again.
13324 2007-07-30  Martin Baulig  <martin@ximian.com>
13326         Merged the `debugger-dublin' branch.
13328         * mono-debug.h
13329         (MonoDebugDataTable): New typedef.
13330         (MonoDebugMethodAddressList): New typedef.
13331         (MonoDebugWrapperData): Removed.
13332         (MonoDebugSymbolTable): Removed `current_data_table',
13333         `current_data_table_size', `current_data_table_offset'.
13334         (MonoDebugDataItemType): Moved into mono-debug.c.
13335         (MonoDebugMethodJitInfo): Remove `address'.
13336         (mono_debug_data_table): New global variable.
13337         (mono_debug_lookup_method_addresses): New public function.
13338         (mono_debug_find_method): Take a `MonoMethod *', not a
13339         `MonoDebugMethodInfo *'.
13341         * mono-debug.c: Drop support for the old symbol tables.
13343 2007-06-28  Martin Baulig  <martin@ximian.com>
13345         * mono-debug.c (mono_debug_debugger_version): New public variable.
13347 2007-07-31  William Holmes  <billholmes54@gmail.com>
13349         * metadata.c Changed mono_type_create_from_typespec to not insert
13350           the type into the hash map until after
13351           do_mono_metadata_parse_type has completed.
13352         Fixes Bug #82194
13353         Code is contributed under MIT/X11 license.
13355 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
13357         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
13358         generic parameter. Fixes #82211.
13360 2007-07-27  Jb Evain  <jbevain@novell.com>
13362         * pedump.c (dump_metadata, dump_metadata_header): dump
13363         versions contained in the metadata header.
13365 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13367         * threads.c: register small_id_table with the GC.
13369 2007-07-27  Mark Probst  <mark.probst@gmail.com>
13371         * threads.c, threads.h, class-internals.h, object-internals.h:
13372         Hazard pointers, to be used by lock-free parallel algorithms.
13374 2007-07-26  Dick Porter  <dick@ximian.com>
13376         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
13377         routine on non-windows platforms, as I've not managed to think of
13378         a non-kludgy way of doing this.  Finishes off bug 78739.
13380 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
13382         * object.c: properly setup interface_bitmap in proxy vtables.
13384 2007-07-25  Marek Habersack  <mhabersack@novell.com>
13386         * appdomain.c (get_shadow_assembly_location): do not use TickCount
13387         to create unique shadow copy target directories, use the domain's
13388         serial number instead. Each domain gets a unique target directory
13389         that way.
13391         * domain.c (mono_domain_create): added code to increment domain
13392         shadow copy serial number and cache the value in the current
13393         domain structure.
13395         * domain-internals.h (struct _MonoDomain): added a new field -
13396         shadow_serial to hold the serial number used in generation of
13397         shadow-copy directories. This is to make sure that the directory
13398         name is unique for each and every domain created. We avoid a race
13399         condition with overriding assemblies already in use by other app
13400         domains.
13402 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
13404         * class.c (mono_bounded_array_class_get): fixed memory leak when 
13405         binding generic parameters.
13407 2007-07-24  Raja R Harinath  <rharinath@novell.com>
13409         * metadata.c (do_mono_metadata_parse_generic_class): Use
13410         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
13411         error.
13413 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
13415         * loader.c, class-internals.h, reflection.c: removed the per-method
13416         generics hashtable: we use the global one through the call of
13417         mono_class_inflate_generic_method ().
13419 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
13421         * class.c, metadata.c, class-internals.h: introduce yet another
13422         generics global cache for inflated methods (fixes 98% of the perf
13423         issue in bug #81806).
13425 2007-07-23  Raja R Harinath  <rharinath@novell.com>
13427         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
13428         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
13429         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
13430         return a MonoGenericInst containing (a copy) of those types.
13431         (mono_metadata_inflate_generic_inst): Update to changes.
13432         (mono_metadata_parse_generic_inst): Likewise.
13433         (mono_get_shared_generic_inst): Likewise.
13434         * reflection.c (mono_class_bind_generic_parameters): Likewise.
13435         (mono_reflection_bind_generic_method_parameters): Likewise.
13436         * metadata-internals.h: Likewise.
13437         * icall.c (free_generic_context): Kill.
13438         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
13440         * reflection.c (reflection_methodbuilder_to_mono_method): Use
13441         mono_metadata_type_dup.
13442         * marshal.c (mono_mb_create_method): Likewise.
13444         * metadata.c (mono_metadata_type_dup): Rename from
13445         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
13446         MonoImage.  Handle a few more cases, esp. when no mempool is given.
13447         * marshal.c, metadata-internals.h: Update to changes.
13449 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13451         * class.c: fixed a small leak for array classes and removed warning.
13453 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
13455         * loader.c (mono_method_get_param_token): Make this work on generic methods.
13456         Return 0x8000000 for return parameters. Fixes #82161.
13458 2007-07-21  Marek Habersack  <grendello@gmail.com>
13460         * appdomain.c (get_shadow_assembly_location): append the current
13461         ticks value to the path. Avoids overwriting the same assemblies by
13462         several threads at the same time.
13464 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
13465         and Raja R Harinath  <rharinath@novell.com>
13467         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
13468         Simplify slightly.
13469         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
13470         property for testing if a method is a generic method definition.
13472 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
13474         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
13476 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13478         * verify.c: used function from private branch, reverted to the one in class.h 
13480 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13482         * verify.c: a typo slipped in and the code wont compile
13484 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13486         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
13487         disabled box instruction as it is doing the wrong thing
13488         improved stack dump messages, now it is easier to debug type related issues
13491 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
13493         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
13495 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13497         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
13498         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
13499         grouped with class and valuetype. This change will simply 
13500         the code as it should be handled just like unmanaged pointers.
13502 2007-07-19  Mark Probst  <mark.probst@gmail.com>
13504         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
13506 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13508         * verify.c: several stack merge issues fixed, reference comparisons now
13509         check the type size. strict type check now works correctly.
13510         added more uses of IS_MANAGED_POINTER macro.
13511         fixed issues pointed by running the test suite against .net.
13512         
13514 2007-07-19  Mark Probst  <mark.probst@gmail.com>
13516         * class.c, loader.c, class-internals.h: Removed the
13517         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
13518         defines.
13520         * icall.c: Better error checking in some internal reflection
13521         methods.
13523 2007-07-18  William Holmes  <billholmes54@gmail.com>
13525         * filewatcher.c : removed unused variable 'filename' in 
13526           ves_icall_System_IO_FSW_SupportsFSW
13528 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
13530         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
13531         obsolete, removed.
13533 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
13535         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
13536         
13537         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
13539 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
13541         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
13542         Implement generics support.
13543         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13545         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
13546         type_args and method_args arguments.
13547         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
13548         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13549         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
13551 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
13553         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
13554           It adds a rootimage parameter to mono_reflection_get_type_internal,
13555           adds new function mono_reflection_get_type_with_rootimage and use
13556           the rootimage to resolve the types instead of the current image
13558 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
13560         * culture-info-table.h: Forgot to update after r78304.
13562 2007-07-13  Raja R Harinath  <rharinath@novell.com>
13564         * class.c (mono_class_is_open_constructed_type)
13565         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
13567 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
13569         * class.c (mono_bounded_array_class_get):  method fails if used with
13570         an incomplete TypeBuilder enum (no basetype field), fixed it by 
13571         avoiding calculating the size for such array as it cannot be instantiated.
13572         Fix bug #82015
13574 2007-07-12  Raja R Harinath  <rharinath@novell.com>
13576         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
13577         field.
13578         * metadata.c, reflection.c: Update to changes.
13580 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
13582         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
13583         mono_class_is_valid_enum, they are used to valide a enum when loading.
13584         * reflection.c: used new functions to throw TypeLoadException when and
13585         invalid enum is build with TypeBuilder. Fixes #82018
13586   
13587 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
13589         * object.c: forgot commit of mono_class_setup_methods () to access
13590         iface->methods.
13591         * object-internals.h: added a few more handy fields to
13592         MonoIMTCheckItem.
13594 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
13596         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
13597         iface->methods.
13599 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
13601         * class-internals.h, object-internals.h, object.c: IMT-based
13602         interface invocation core from Massimiliano Mantione
13603         (massi@ximian.com) with a reworked arch-specific interface,
13604         bsearch implementation and a few bugfixes and memory savings by me.
13606 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
13608         * class.c (mono_class_create_from_typedef): mono would segfault if 
13609         an enum did not have a __value field. It now throws a TypeLoadException
13610         for such cases. Fix bug #82022
13612 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
13614         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
13616 2007-07-09  Mark Probst  <mark.probst@gmail.com>
13618         * class.c (mono_class_init): If a class is already inited but has
13619         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
13621 2007-07-09  Mark Probst  <mark.probst@gmail.com>
13623         * class.c: Properly handle the case of an unimplemented interface
13624         method.  Fixes: 81673.
13626 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
13628         * class-internals.h, object.c: cleanup patch from massi: use
13629         MonoVTable->interface_bitmap since the vtable interfaces offset array
13630         is going away.
13632 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
13634         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
13635         GetMDStreamVersion icall instead.
13637 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
13639         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
13640         not use mono_dl_build_path() with a full library name: makes
13641         fallbacks to libgaim and libfam work.
13643 2007-07-06  William Holmes  <billholmes54@gmail.com>
13645         * assembly.c: Added a continue statement in probe_for_partial_name when
13646          parse_assembly_directory_name fails.  Fixes : 82002
13648 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
13650         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
13651         and added a verification  for TYPEDBYREF.
13652         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
13653         make native int interchangeable with int32 and some small cleanup and formating.
13654         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
13655         handle byref of byref.
13656         * verify.c (push_local): handle byref of byref.
13657         * verify.c (do_binop): invalid mix of values is unverifiable
13658         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
13659         added visibility checks
13660         * verify.c (field related method): added visibility checks
13661         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
13663 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
13665         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
13666         string.
13668 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
13670         * profiler.c (mono_profiler_load): Fix an off-by-one error.
13672         * marshal.c (emit_marshal_string): When returning a string from managed code,
13673         allways make a copy even for unicode strings. Fixes #81990.
13675 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
13677         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
13678         of byref generic inst types (bug #81997).
13680 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
13682         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
13683         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
13685 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
13687         * marshal.c (emit_marshal_string): Add support for unicode strings in
13688         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
13690 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
13692         * verify.c: field load/store are now verified, missing only access checks now
13694 2007-06-28  Martin Baulig  <martin@ximian.com>
13696         * mono-debug.c (mono_debug_debugger_version): New public variable.
13698 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
13700         * locales.c: When constructing DateTimeFormat or NumberFormat for
13701         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
13702         MonoCultureInfo contructed from the current locale is always
13703         read-only and has UseUserOverride set to true. All MonoCultureInfo
13704         instances returned for GetCultures have both IsReadOnly and
13705         UseUserOverride set to true. Fixes part of bug #81930.
13707 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
13709        * icall-def.h: Update System.__ComObject icalls
13710        * marshal.c: Avoid managed transition (and object creation)
13711        when looking up COM interface in RCW.
13712        * marshal.h: Ditto.
13713        
13714        Code is contributed under MIT/X11 license.
13716 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
13718         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
13719         to avoid crashes during assembly unloading.
13721 2007-06-22  Raja R Harinath  <rharinath@novell.com>
13723         Fix MethodInfo.IsGenericMethodDefinition
13724         * reflection.c (mono_reflection_bind_generic_method_parameters):
13725         Rearrange code to ensure we always uses a generic method definition.
13726         * class.c (mono_class_inflate_generic_method_full): Set
13727         'generic_container' field only for generic method definitions.
13728         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
13729         Use presense of 'generic_container' field as indication of being a
13730         generic method definition.
13732 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
13734         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13736         * object-internals.h: Reflect changes in the layout of the managed Delegate
13737         class.
13738         
13739         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
13740         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
13741         runtime memory used by the dynamic method. Fixes #77146.
13743 2007-06-21  Dick Porter  <dick@ximian.com>
13745         * file-io.h: 
13746         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
13747         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
13748         81767.
13750 2007-06-21  Raja R Harinath  <rharinath@novell.com>
13752         * reflection.c (method_encode_methodspec): Add a tripwire.
13753         * class.c (inflate_generic_type): The fully open generic type is
13754         not the same as the generic type definition.
13756 2007-06-21  Martin Baulig  <martin@ximian.com>
13758         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
13760         * mono-debug-debugger.h
13761         (MonoDebuggerBreakpointInfo): Removed.
13762         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
13763         (mono_debugger_remove_breakpoint): Likewise.
13764         (mono_debugger_breakpoint_callback): Likewise.
13765         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
13767 2007-06-21  Raja R Harinath  <rharinath@novell.com>
13769         * metadata.c (mono_metadata_lookup_generic_class): The fully open
13770         generic type is not the same as the generic type definition.
13771         * class.c (mono_generic_class_get_class): Likewise.
13773 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
13775         * icall.c: The second argument to 
13776         System.Reflection.MethodBase.GetMethodFromHandleInternalType
13777         is a MonoType not a MonoClass.
13779 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
13781         * verify.c: support for function pointers in the verifier
13783 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
13785         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
13787 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
13789         * assembly.c: removed Mono.Data.SqliteClient from the list of
13790         forward-compatible assemblies as it breaks the ABI (bug #81899).
13792 2007-06-19  Raja R Harinath  <rharinath@novell.com>
13794         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
13795         lookup/update with the loader lock.
13796         * reflection.c (mono_class_bind_generic_parameters): No need to
13797         protect mono_metadata_lookup_* with the loader lock.
13798         * class.c (inflate_generic_type): Likewise.
13799         
13800         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
13801         on a generic instantiated type.
13803 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
13805         *verify.c: produce meanfull error messages on verification error
13806         *verify.c: fixed some cases of verification errors reported as validation errors
13807         *pedump.c: fixed the error name array, now it shows validation errors properly
13808         *verify.h: fixed the contant that should be used for verification errors
13810 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
13812         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
13813         for bug #77596, 81858 and 80743 (generics data structures on domain
13814         unload).
13816 2007-06-15  Raja R Harinath  <rharinath@novell.com>
13818         Avoid allocating 'MonoGenericContext' on the heap.
13819         * class-internals (_MonoMethodInflated::context): Make field
13820         inline, not a pointer.
13821         * loader.c (method_from_methodspec): Allocate 'new_context' on the
13822         stack.  Use the context embedded within the inflated method as the
13823         hash key, rather than 'new_context'.
13824         * class.c (inflate_generic_context): Simplify.  Return a struct
13825         rather than allocating on the heap.
13826         (mono_class_inflate_generic_method_full): Update to changes.  Now,
13827         doesn't salt away a copy of the context -- simplifying the
13828         lifetime rules of a 'MonoGenericContext *'.
13829         (mono_method_get_context): Return pointer to embedded context.
13830         (setup_generic_array_ifaces): Allocate temporary context on stack.
13831         * reflection.c (inflate_mono_method): Likewise.
13832         (mono_reflection_bind_generic_method_parameters): Likewise.
13833         Use the context embedded within the inflated method as the hash key.
13835         Avoid a source of allocation of 'MonoGenericContext'.
13836         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
13837         and 'cached_context' fields into embedded 'MonoGenericContext' field.
13838         * class.c: Update to changes.
13839         (mono_generic_class_get_context): Simplify drastically.  Now just
13840         returns a pointer to the field.
13841         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
13842         argument as a const pointer.
13843         (mono_metadata_generic_context_equal): Likewise.
13844         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
13845         Update to changes.
13847 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
13849         * verify.c improved the handling of brtrue/brfalse, factored out common code
13851 2007-06-14  Raja R Harinath  <rharinath@novell.com>
13853         Kill MonoGenericMethod.
13854         * class-internals.h (MonoGenericContext::method_inst): Rename from
13855         'gmethod' and convert to a MonoGenericInst.
13856         (MonoGenericMethod): Remove.
13857         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
13858         * loader.c (method_from_methodspec): Update to changes.  Use a
13859         MonoGenericContext as the key to the hashtable.
13860         * metadata.c (mono_metadata_generic_context_equal): Rename from 
13861         'mono_metadata_generic_method_equal' and take MonoGenericContext.
13862         (mono_metadata_generic_context_hash): Likewise from
13863         'mono_metadata_generic_method_hash'.  Change hash function.
13864         (mono_metadata_load_generic_params): Update to changes.
13865         (mono_get_shared_generic_method): Remove.
13866         * metadata-internals.h (mono_get_shared_generic_method): Remove.
13867         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
13868         (inflate_generic_context): Likewise.
13869         (mono_class_inflate_generic_method_full): Likewise.
13870         (setup_generic_array_ifaces): Likewise.
13871         (mono_class_create_from_typespec): Likewise.
13872         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
13873         (method_encode_methodspec): Update callsite.
13874         (reflection_methodbuilder_to_mono_method): Update to changes.
13875         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
13876         MonoGenericContext as the key to the hashtable.
13877         (inflate_mono_method): Update to changes.
13879         * class-internals.h (MonoGenericMethod::container): Remove.
13880         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
13882 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
13884         * profiler-private.h, profiler.c, profiler.h: added API to profile
13885         exception events.
13887 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
13889         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
13891 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
13893         * verify.c: method invocation is now validated, now we verify parameter types on stack.
13894         Fixed overflow and underflow not aborting the verification process.
13896 2007-06-13  Mark Probst  <mark.probst@gmail.com>
13898         * class-internals.h (MonoStats): Added stats entries for dynamic
13899         code allocations.
13901 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
13903         * loader.c (mono_free_method): Free header->locals and header->clauses.
13905         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
13906         dynamic case.
13908         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
13910         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
13912 2007-06-12  Raja R Harinath  <rharinath@novell.com>
13914         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
13915         the tables.
13917 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13919         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
13921 2007-06-11  Raja R Harinath  <harinath@gmail.com>
13923         MonoGenericMethod on a diet
13924         * class-internals.h (_MonoMethodInflated::reflection_info): Move
13925         here ...
13926         (_MonoGenericMethod::reflection_info): ... from here.
13927         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
13928         Update to changes.
13929         * reflection.c (inflate_mono_method): Likewise.
13930         (mono_reflection_bind_generic_method_parameters): Likewise.
13932 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13934         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
13935         *verify.c: factored long ldarg forms to share code with short forms
13937 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13939         *verify.c: fixed code formating factored some duplicate code
13940         into a new function
13942         *verify.h: fixed binary incompatibility introduced earlier
13944         *pedump.c: fixed formating
13946 2007-06-11  Raja R Harinath  <harinath@gmail.com>
13948         Fix assertion when disassembling Mono.C5.dll
13949         * loader.c (method_from_methodspec): Avoid inflating a method
13950         twice with the same context.  If the methodref is inflated, use
13951         the declaring method instead.
13953         * class.c (mono_class_from_generic_parameter): Fix case similar to
13954         bug #81830 handled below, but for method containers.
13956 2007-06-10  Raja R Harinath  <harinath@gmail.com>
13958         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
13959         get_shared_generic_class.  Directly inflate the instance.
13960         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
13961         (inflate_generic_class): Delete.
13962         (get_shared_generic_class): Delete.  Move setting of
13963         'cached_class' and 'cached_context' ...
13964         * metadata.c (mono_metadata_lookup_generic_class): ... here.
13966         * metadata.c (mono_metadata_lookup_generic_class): Change
13967         signature to take the components of a MonoGenericClass rather than
13968         an allocated MonoGenericClass.  Change semantics to be intern-like.
13969         * reflection.c (mono_class_bind_generic_parameters): Update to
13970         changes.  Make locking region tighter.
13971         * class.c (inflate_generic_class): Update to changes.
13972         (get_shared_generic_class): Likewise.
13973         * metadata-internals.h: Likewise.
13975         * reflection.c (mono_class_bind_generic_parameters): Take and
13976         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
13977         (mono_reflection_bind_generic_parameters): Use
13978         'mono_class_bind_generic_parameters' rather than duplicate the code.
13979         * class.c (mono_bounded_array_class_get): Update to changes.
13980         * object-internals.h: Likewise.
13982         * reflection.c (mono_class_bind_generic_parameters): Only support
13983         parameterizing generic type definitions.  Remove support for other
13984         open types.
13986 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
13988         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
13990         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
13991         in the dynamic case.
13993 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
13995         * threads.c: When cleaning up thread, reset the Background bit.
13996         Fixes bug #81720.
13998 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
14000        * metadata.c: Move variable declarations to top of scope.
14001        * verify.c: Move variable declarations to top of scope.
14003        Code is contributed under MIT/X11 license.
14005 2007-06-08  Raja R Harinath  <rharinath@novell.com>
14007         * reflection.c (mono_class_bind_generic_parameters): Replace
14008         open-coded loop with mono_metadata_inflate_generic_inst.
14010         * class.c (get_shared_generic_class): Don't call
14011         mono_get_shared_generic_inst.  Use the container's own
14012         'class_inst'.
14014         * metadata.c (mono_metadata_load_generic_params): Move
14015         initialization of 'context' field here from ...
14016         * class.c (mono_class_create_from_typedef): ... here, and ...
14017         * loader.c (mono_get_method_from_token): ... here.
14019         * class.c (get_shared_generic_class): Rename from
14020         mono_get_shared_generic_class and make static.
14021         (mono_get_shared_generic_inst): Move to metadata.c.
14022         * loader.c (mono_get_shared_generic_method): Likewise.
14023         * class-internals.h, metadata-internals.h: Update to changes.
14025         Fix #81830
14026         * class.c (mono_class_from_generic_parameter): Don't assume a
14027         generic container owner exists.  Generic containers from monodis
14028         don't have any.
14030 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
14032         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
14033         * verify.h: new typedefs to returns the non-verifiable status
14034         * verify.c: initial implementation of generics, stack merging and object compatibility check
14036 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14038         * class.c, image.c, class-internals.h (MonoImage): class_cache is
14039         a MonoInternalHashTable again (fixed bug in internal hash table
14040         code).
14042 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14044         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
14045         MonoInternalHashTable again (fixed bug in internal hash table
14046         code).
14048 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14050         * class.c, image.c, class-internals.h, domain.c,
14051         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
14052         changes.  Have to figure out what makes them break the SWF
14053         regression.
14055 2007-06-04  Mark Probst  <mark.probst@gmail.com>
14057         * class.c, image.c, class-internals.h (MonoImage): class_cache is
14058         a MonoInternalHashTable now.
14060 2007-06-04  Mark Probst  <mark.probst@gmail.com>
14062         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
14063         MonoInternalHashTable now.
14065 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
14067         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
14068         invoke_impl code.
14070         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
14072         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
14073         dependent trampoline.
14075         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
14077         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
14079 2007-05-29  Robert Jordan  <robertj@gmx.net>
14081         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
14083 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
14085         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
14087 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
14089        * marshal.c: Fix interface lookup loops for
14090        cominterop_get_com_slot_for_method and 
14091        cominterop_get_method_interface. Only need to lookup
14092        if type is a class, else use interface type method is on.
14094        Code is contributed under MIT/X11 license.
14096 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
14098         * reflection.c: HasSecurity can be present even if no specially 
14099         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
14100         SecurityAttribute). Fix CAS regression tests on buildbot.
14102 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
14104        * appdomain.c: Add configure checks for header files.
14105        * image.c: Add configure checks for header files.
14106        * file-io.c: Add configure checks for header files.
14107        * debug-mono-symfile.c: Add configure checks for header files.
14108        * threadpool.c: Add configure checks for header files.
14109        * console-io.c: Add configure checks for header files.
14110        * profiler.c: Add configure checks for header files.
14111        * rawbuffer.c: Add configure checks for header files.
14112        * icall.c: Add configure checks for header files.
14113        * rand.c: Add configure checks for header files.
14114        * socket-io.c: Add configure checks for header files.
14116        Code is contributed under MIT/X11 license.
14118 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
14120         * reflection.c (mono_custom_attrs_from_builders): Remove the 
14121         assertion as it breaks the build.
14122         
14123         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
14125         * reflection.c (lookup_custom_attr): Make a copy here too.
14127         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
14128         dynamic images.
14130         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
14131         images.
14133         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
14134         info.
14136 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
14138         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
14139         (load_cattr_value): Ditto.
14141 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
14143         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
14145 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
14147         * threads.c: In "start_wrapper", set apartment_state to MTA if
14148         apartment_state is Unknown and we're running on 2.0 profile or
14149         higher.
14150         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
14151         to main method, then set apartment_state to Unknown on 1.0 profile,
14152         and MTA on 2.0 profile.
14154 2007-05-16  Jb Evain  <jb@nurv.fr>
14156         * class-internals.h (MonoDefaults): Add an attribute_class and
14157           customattribute_data_class.
14158         * domain.c (mono_init_internal): Populate them.
14159         * reflection.c: Use them to remove duplicates. Make a vew
14160         MonoClass variables `static'.
14162 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
14164         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
14165         step in implementing IMT, so that all isinst checks now can go
14166         through the bitmap.
14167         This was needed because vtables for TransparentProxy need to look
14168         like the vtable of the "target" class, so they need to point to
14169         its interface bitmap directly.
14171         * object.c: inside "mono_class_create_runtime_vtable" and
14172         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
14174 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
14176         * object-internals.h
14177           culture-info.h : added territory field in MonoCulture and
14178           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
14179         * locales.c : fill territory field above too.
14180         * culture-info-table.h : regenerated.
14182 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
14184         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
14185         Fixes #81599.
14187 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
14189         * object.c: Always initialize apartment, even if 
14190         there is no custom attributes on entry point.
14191         
14192         Code is contributed under MIT/X11 license.
14194 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
14196         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
14197         * metadata.c: If no encoding is set, check for unicode
14198         on class.
14199         
14200         Code is contributed under MIT/X11 license.
14202 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
14204         * threads.c: Handle if mono_thread_current returns NULL 
14205         
14206         Code is contributed under MIT/X11 license.
14208 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
14210         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
14211         in start_wrapper. Added mono_thread_init_apartment_state and
14212         mono_thread_cleanup_apartment_state.
14213         * object.c: Initialize thread apartment state on main thread
14214         by checking for STAThreadAttribute on entry point.
14215         * object-internals.h: Add apartment_state field to MonoThread.
14216         * threads-types.h: Add unmanaged definition of 
14217         System.Threading.ApartmentState, MonoThreadApartmentState.
14218         
14219         Code is contributed under MIT/X11 license.
14220         
14221 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
14223         * class.c: Fix windows build.
14224         * class-internals.h: Fix windows build.
14225         
14226         Code is contributed under MIT/X11 license.
14228 2007-05-08  Robert Jordan  <robertj@gmx.net>
14230         * process.c (CreateProcess_internal):
14231         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
14232         .CreateNoWindow was specified. Fixes #81496.
14234 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
14236         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
14237         step in implementing IMT, replaced it with two compact arrays
14238         (interfaces_packed and interface_offsets_packed) and a bitmap that
14239         is used for isinst checks (interface_bitmap).
14241         * class.c: (compare_interface_ids): compare function to pass to
14242         bsearch when looking for an interface with a given id.
14243         (mono_class_interface_offset): reimplemented using bsearch on
14244         interfaces_packed, getting the offset from interface_offsets_packed.
14245         (print_implemented_interfaces): utility debugging function.
14246         (setup_interface_offsets): reworked to initialize interfaces_packed,
14247         interface_offsets_packed and interface_bitmap.
14249         * object.c: replaced all accesses to "MonoClass.interface_offsets"
14250         with uses of interfaces_packed and interface_offsets_packed.
14252 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
14254         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
14255         mono_class_interface_offset prototype to wrap all accesses to
14256         "MonoClass.interface_offsets".
14258         * class.c: Implemented mono_class_interface_offset, and wrapped all
14259         accesses to "MonoClass.interface_offsets".
14261         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
14262         "MonoClass.interface_offsets".
14264 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
14266         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
14267         GetMethodFromHandle overloads (bug #78637).
14269 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
14271         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
14272         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
14274 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
14276         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
14277         #81498.
14279         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
14280         gracefully.
14281         (mono_custom_attrs_from_index): Ditto.
14283         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
14284         Fixes #81501.
14286 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
14288         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
14289         is now allocated from a mempool.
14291 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
14293         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
14294         caller holds threads_lock, leading to deadlocks. Fixes #81476.
14296 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
14298         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
14299         mono_loader_clear_error () too late. Fixes #81463.
14301 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
14303         * culture-info-table.h : regenerated.
14305 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
14307         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
14308         is missing.
14310 2007-04-25  Dick Porter  <dick@ximian.com>
14312         * Makefile.am: Put the mingw enforced-optimisation back into the
14313         PLATFORM_WIN32 section.
14315 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
14317         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
14318         patch.
14320         * image.c (mono_image_load_module): New API function to load a module reference.
14322         * image.c (load_modules): Load modules lazily. Fixes #80812.
14324         * class.c (mono_class_from_typeref): Use mono_image_load_module.
14325         
14326         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
14328         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
14329         to mono_image_load_module_dynamic.
14331 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
14333         * marshal.c: Fix calling convention for CCW on non-windows
14334         platforms. STDCALL on windows, CDECL everywhere else to work 
14335         with XPCOM and MainWin COM.
14336         
14337         Code is contributed under MIT/X11 license.
14339 2007-04-23  Martin Baulig  <martin@ximian.com>
14341         Fix #80969.
14343         * loader.c
14344         (method_from_memberref): Added `gboolean *used_context' argument.
14345         (mono_get_method_from_token): Likewise.
14346         (mono_get_method_full): Don't insert the method in the cache when
14347         `used_context' is true.
14349 2007-04-23  Raja R Harinath  <rharinath@novell.com>
14351         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
14353         * reflection.c (mono_reflection_bind_generic_parameters): Don't
14354         create new MonoTypes for returned types.
14355         * class.c (mono_generic_class_get_class): Export mono-internal.
14356         * class-internals.h: Update to changes.
14358 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
14360         * threadpool.c, threadpool.h, icall-def.h: patch from
14361         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
14363 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
14365         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
14366         
14367         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
14369         * threads.c (mono_thread_get_stack_bounds): New helper function.
14371         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
14372         Correctly compute stack bounds when attaching. Fixes #81394.
14374 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
14376         * reflection.c: fix handling of doubles in custom attributes
14377         for the arm-fpa format (bug #81368).
14379 2007-04-18  Raja R Harinath  <rharinath@novell.com>
14381         * reflection.c (assembly_add_win32_resources): Mildly relax an
14382         bounds check to let the end pointer point just past the end of the
14383         allocated buffer.  (may fix #81384)
14385 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
14387         * culture-info-table.h : regenerated.
14389 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
14391         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
14392         the thread is aborted early.
14394 2007-04-05  Dick Porter  <dick@ximian.com>
14396         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
14397         FindFirstFile()/FindNextFile() to find entries.  This lets the
14398         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
14399         81038.
14401         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
14402         the parameters of
14403         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
14405 2007-04-04  Martin Baulig  <martin@ximian.com>
14407         * debug-helpers.c
14408         (mono_method_desc_full_match): Add support for nested classes.
14410 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
14412         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
14414 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
14416         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
14417         waiting for too many threads.
14419 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
14421         * environment.c: Fix return value check on uname so we can get the 
14422         executing version on Solaris operating systems.
14424 2007-03-28  Jb Evain  <jbevain@gmail.com>
14426         * class.c (mono_type_get_name_recurse): Complete the
14427         fix for the creation of assembly qualified names for
14428         pointer types. Fixes #81208.
14430 2007-03-27  Dick Porter  <dick@ximian.com>
14432         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
14433         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
14434         changed.
14436         * threads.c
14437         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
14438         the value of ReleaseMutex().
14440 2007-03-27  Dick Porter  <dick@ximian.com>
14442         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
14443         in little-endian order, not network endian, so must be converted
14444         to host endian here.  Fixes bug 80593.
14446 2007-03-22  Jb Evain  <jbevain@gmail.com>
14448         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
14449         qualified names for pointer types. Fixes #81208.
14451 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
14453         * marshal.c: Add support for PreserveSigAttribute. 
14454         
14455         Code is contributed under MIT/X11 license.
14457 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
14459         * process.c: Fix endianness issues. Fixes #81126.
14461         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
14462         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
14464         * image.c (mono_image_lookup_resource): Make this work on big-endian
14465         machines.Change API contract so the caller needs to free the return value.
14466         
14467         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
14468         API change.
14469         
14470 2007-03-14  Martin Baulig  <martin@ximian.com>
14472         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
14473         mono_type_get_desc() as well.
14475 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
14477         * icall.c:  Fix environ access in VS.  
14478         
14479 2007-03-13  Alp Toker  <alp@atoker.com>
14481         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
14482         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
14483         #63841.
14485 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
14487         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
14488         circular references among dynamic methods. Fixes #81091.
14490         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
14492 2007-03-09  Martin Baulig  <martin@ximian.com>
14494         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
14496 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
14498         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
14499         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
14500         
14501         Code is contributed under MIT/X11 license.
14502         
14503 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
14505         * loader.c: Reapply patch for bug #79424.
14507 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
14509         * metadata.c (mono_type_to_unmanaged): Only convert object to
14510         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
14512 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
14514         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
14515         (and incorrectly set) is_reference field from MonoGenericInst.
14517 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
14519         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
14520         a little earlier.
14522         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
14524         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
14526 2007-03-05  Miguel de Icaza  <miguel@novell.com>
14528         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
14529         FileOptions.1 value to mean "temporary", map that to
14530         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
14532         Fixes 80688
14534 2007-03-03  Marek Habersack  <mhabersack@novell.com>
14536         * appdomain.c: implement MS .Net style shadow copying. Copies of
14537         the assemblies are made in a subdirectory of the dynamic base
14538         directory, the assembly names are preserved.
14539         Copy .mdb and .config files along with the assemblies being shadowed.
14541 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
14543         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
14544         (emit_marshal_handleref): Ditto.
14546         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
14547         on Visual C++. Fixes #80671.
14549 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
14551         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
14552         for clone operations.
14554 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
14556         * marshal.c: Fix warnings.
14558 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
14560         * loader.c: allow case-insensitive matching of the dll name
14561         in dllmap handling when prefixed with "i:".
14563 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
14565         * threads.c: Fix #ifdef for dummy_apc function for VS.
14567 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
14569         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
14571 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
14572         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
14573         giving precedence to the methods with a fully qualified name
14574         (InterfaceName.MethodName) when building the interface sections
14575         of the vtable.
14577 2007-02-16  Dick Porter  <dick@ximian.com>
14579         * threadpool.c (append_job): Fix fast-path array handling, so it's
14580         less likely the array will grow exponentially when the load is
14581         heavy.
14583 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
14585         * metadata-internals.h, loader.c: fix dllmap lookup order
14586         for non-function maps, too, and prepare for fallback code.
14588 2007-02-12  Robert Jordan  <robertj@gmx.net>
14590         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
14591         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
14592         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
14593         GlobalFree. Fixes a part of bug #77075.
14595 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
14597         * loader.c: implemented typedef parent in field memberref.
14599 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
14601         * marshal.c: Fix warnings and remember to call Release on
14602         IUnknown of RCW.
14603         
14604         Code is contributed under MIT/X11 license.
14606 2007-02-10  Miguel de Icaza  <miguel@novell.com>
14608         * class-internals.h: Add MonoHandleRef definition, and
14609         handleref_class to mono_defaults. 
14611         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
14612         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
14614         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
14615         (do nothing on this stage)
14616         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
14617         (emit_marshal_handleref): New method, used for argument handling
14618         of HandleRefs. 
14620 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
14622         * class.c (mono_class_setup_parent): Lazily init com types.
14623         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
14624         init com types.
14625         * object.c (mono_remote_class_vtable): Lazily init com types.
14626         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
14627         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
14628         * domain-internals.h: Expose mono_init_com_types.
14629         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
14630         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
14631         Add support for COM Callable Wrapper marshalling.
14632         * marshal.h: Add icall definitions.
14633         * gc.c: Handle freeing of CCWs in finalizer code.
14634         
14635         Code is contributed under MIT/X11 license.
14637 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
14639         * reflection.c: changed all the signature encoding code to use
14640         a variable-sized buffer.
14642 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
14644         * marshal.c: locking fixes: never take the loader lock
14645         or other runtime locks when holding the marshal lock
14646         (fixes bug#80664).
14648 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
14650         * marshal.c: make the delegate function pointer mapping
14651         work for the moving GC.
14653 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
14655         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
14656         for bug #80618.
14658 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
14660         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
14661         gmodule.
14663 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
14665         * threadpool.c: made the code moving-GC safe.
14667 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
14669         * assembly.c, boehm-gc.c, class-internals.h, class.c,
14670         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
14671         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
14672         warning cleanup.
14673         * reflection.c: warning cleanup, some threading and moving GC fixes.
14675 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
14677         * class.c, loader.c: create the needed Set/Get/Address array methods
14678         as well as the .ctors in mono_class_init (), fixes bug #80567.
14680 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
14682         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
14683         we doesn't decrease its alignment. Should fix the sparc build.
14685 2007-01-24  Dick Porter  <dick@ximian.com>
14687         * socket-io.c
14688         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
14689         Create the returned object if we need to ignore an unsupported
14690         socket option.  Fixes a segfault reported by Atsushi.
14692 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
14694         * class.c, object.c: restrict GC-tracked fields to
14695         UIntPtr fields used inside corlib, so we provide better
14696         type info to the GC and also allow broken packing as in
14697         bug #80580.
14699 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
14701         * sgen-gc.c: removed duplicated function.
14703 2007-01-19  Miguel de Icaza  <miguel@novell.com>
14705         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
14706         value that means that the value is not supported, but that we
14707         should not return a failure, but instead report this as a
14708         successful operation.
14710 2007-01-19  Raja R Harinath  <rharinath@novell.com>
14712         Fix tests/bug79956.2.il
14713         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
14714         (mono_generic_class_get_class): If the generic definition in an
14715         enum, copy over other fields related to it.
14717 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
14719         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
14720         genericinst enums (bug #79215).
14722 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
14723         * class.c: Fix bug 80307.
14725 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
14727         * image.c: if the file table is not present, try to load
14728         all the modules, since we don't have info about them
14729         having or not metadata (bug #80517).
14730         * assembly.c: allow mono_assembly_load_references () to
14731         work for netmodules.
14733 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
14735         * image.c, metadata-internals.h, object.c: execute module
14736         cctors when running on the 2 runtime if present (bug #80487).
14738 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
14740         * icall.c: optimized InitializeArray() on bigendian.
14742 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
14744         * icall.c: fix for the broken ARM FPA double format.
14746 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
14748         * icall.c: handle endian issues for r4 and r8 types, too, in
14749         the InitializeArray() icall.
14751 2007-01-15  Miguel de Icaza  <miguel@novell.com>
14753         * loader.c (mono_loader_error_prepare_exception): Clear the error
14754         once we have extracted the information from it, do this before we
14755         call into the JIT's class loading mechanisms.
14757         * object.c (mono_class_create_runtime_vtable): Do not clear the
14758         loader error before calling mono_class_get_exception_for_failure
14759         as the loader error is needed inside
14760         mono_class_get_exception_for_failure to throw the error (thinko).
14762         Fixes #80521
14763         
14764 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
14766         * reflection.c: align fields rva data so it's faster to load at
14767         runtime.
14769 2007-01-12  Raja R Harinath  <rharinath@novell.com>
14771         Prepare to simplify GenericMethod handling.
14772         * class-internals.h (mono_method_get_context): New accessor function.
14773         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
14774         rather than directly accessing '->context' field.
14776         * class-internals.h (_MonoGenericParam.method): Move ...
14777         (_MonoGenericContainer): ... here.  Add into union with klass field.
14778         * class.c, icall.c, loader.c, metadata.c, reflection.c:
14779         Update to changes.
14781 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
14783         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
14784         the wrapper type enum and reduce relocations.
14786 2007-01-12  Raja R Harinath  <rharinath@novell.com>
14788         * reflection.c (inflate_mono_method): Reuse method instantiation
14789         from the generic method, if available.
14791 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
14793         * marshal.c (emit_marshal_variant): Fix conv_arg
14794         type in last commit, based on whether parameter is byref.
14795         
14796 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
14798         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
14799         marshalling.
14800         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
14801         MONO_TYPE_OBJECT back for VARIANT support.
14803 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
14805         * marshal.c, marshal.h, icall-def.h: Implement 
14806         Marshal.ReAllocCoTaskMem.
14808 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
14810         * marshal.c: memory retention fixes: use the proper
14811         image cache for runtime_invoke method lookups.
14813 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
14815         * mempool.c: added code to help debug mempool allocations.
14817 2007-01-11  Dick Porter  <dick@ximian.com>
14819         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
14820         support (experimenting with faking it with IP_MTU_DISCOVER for
14821         systems that don't have IP_DONTFRAGMENT.)
14822         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
14823         icall.
14825         * icall-def.h: new System.Net.Sockets.Disconnect icall.
14827         * socket-io.h: Add new fields to MonoSocketAsyncResult
14828         corresponding to the new ones in Socket.cs.
14830 2007-01-11  Raja R Harinath  <rharinath@novell.com>
14832         Fix IronPython regression mentioned in #80249
14833         * metadata.c (do_mono_metadata_parse_generic_class): Clear
14834         'cached_context' field, since it may have been initialized as a
14835         side-effect of metadata parsing.
14837         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
14838         (_MonoGenericClass.cached_class): Move here and rename from lone
14839         remaining field of ...
14840         (_MonoInflatedGenericClass): ... this.  Remove.
14841         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
14842         to changes.
14844         Fix mcs/tests/test-128.cs regression.
14845         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
14846         2007-01-10 change below.
14847         [MONO_TYPE_OBJECT]: Recurse into array case.
14849 2007-01-11  Raja R Harinath  <harinath@gmail.com>
14851         * class-internals.h (mono_get_inflated_generic_class): Remove.
14852         * class.c (mono_get_inflated_generic_class): Remove.
14853         (mono_generic_class_get_class): Rename from
14854         mono_class_create_generic.
14855         (mono_class_from_mono_type) [GENERICINST]: Use it.
14856         * reflection.c, metadata.c: Update to changes.  Use
14857         'mono_class_from_mono_type'.
14859 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
14861         * reflection.c: use passed type when encoding an array element
14862         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
14864 2007-01-09  Robert Jordan  <robertj@gmx.net>
14866         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
14867         result arguments (someDelegate.EndInvoke (unrelatedAres)).
14868         Fixes bug #80392.
14870 2007-01-09  Raja R Harinath  <rharinath@novell.com>
14872         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
14874         * object.c (set_value): Avoid aliasing between type->data.klass
14875         and type->data.generic_class.
14877         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
14879 2007-01-08  Raja R Harinath  <rharinath@novell.com>
14881         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
14882         between type->data.klass and type->data.generic_class.
14884 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
14886         * marshal.c: In MS.NET, StringBuilder objects are not copied by
14887         value in out parameters.
14889 2007-01-08  Raja R Harinath  <rharinath@novell.com>
14891         Simplify invariant for MonoGenericClass::klass field.
14892         * class.c (mono_class_create_generic): Verify 'klass' is null.
14893         * metadata.c (do_mono_metadata_parse_generic_class): Don't
14894         initialize 'klass' field.
14896 2007-01-05  Raja R Harinath  <rharinath@novell.com>
14898         Ongoing work to avoid redundant data and simplify invariants.
14899         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
14900         'generic_class', and change type to a GenericInst.
14901         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
14902         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
14904 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
14906         * class.c : skip io-layer under PLATFORM_WIN32.
14908 2007-01-03  Tor Lillqvist  <tml@novell.com>
14910         Fix #80305: In a bundled executable, look in the bundled exe
14911         assembly to determine the runtime version. Add the possibility to
14912         bundle also the machine.config file.
14913         
14914         * assembly.c (mono_assembly_open_from_bundle): Make
14915         non-static. Allow being called even if we have no bundled
14916         assemblies, and return NULL right away in that case.
14918         * domain-internals.h: Declare mono_assembly_open_from_bundle()
14919         here.
14921         * domain.c (app_config_parse): Take an assembly exe file name as
14922         parameter instead of a config file name. Check for a bundled
14923         config file for that assembly by calling
14924         mono_config_string_for_assembly_file() (see below) before looking
14925         for one in the file system.
14926         (get_runtimes_from_exe): Corrsponding change to call of
14927         app_config_parse().
14928         (get_runtimes_from_exe): Check for bundled assembly exe file first
14929         by calling mono_assembly_open_from_bundle(). If no bundled
14930         assembly exe file is found, call mono_image_open() as before to
14931         look it up in the file system.
14933         * mono-config.c: Add variable bundled_machinec_onfig.
14934         (mono_config_string_for_assembly_file): New function.
14935         (mono_config_for_assembly): Move code snippet that looks for a
14936         bundled assembly .config file into the above new function. Call
14937         it.
14938         (mono_register_machine_config, mono_get_machine_config): New
14939         functions to set and retrieve
14941         * assembly.h: Declare mono_register_machine_config().
14943         * mono-config.h: Declare mono_get_machine_config() and
14944         mono_config_string_for_assembly_file().
14946         * icall.c: No declaration of environ necessary on Win32. It is
14947         declared (as a macro expanding to a function call) in stdlib.h.
14948         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
14949         New internal mono function. Returns the value of
14950         mono_get_machine_config() as a Mono string.
14952         * icall-def.h: Add get_bundled_machine_config().
14954 2007-01-04  Raja R Harinath  <rharinath@novell.com>
14956         Remove redundant field
14957         * class-internals.h (_MonoGenericContext.container): Remove field.
14958         * loader.c (mono_method_get_signature_full): Don't parse a
14959         "container" for a signature parse when the signature is inflated
14960         immediately.
14961         (method_from_methodspec): Likewise, for a generic_inst.
14962         * class.c, metadata.c, reflection.c: Update to changes.
14964 2006-01-04  Raja R Harinath  <rharinath@novell.com>
14966         * class-internals.h (_MonoGenericClass): Rename 'context' field to
14967         'cached_context', and change semantics -- it starts off NULL, and
14968         is initialized on demand.
14969         * class.c (mono_generic_class_get_context): New accessor to
14970         replace 'context' field accesses.
14971         (mono_class_get_context): New helper.
14972         (*): Update to changes.
14973         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
14975 2007-01-03  Miguel de Icaza  <miguel@novell.com>
14977         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
14978         before the memcpy.   Fixes Marshal2 regression.
14980 2007-01-02  Jb Evain  <jbevain@gmail.com>
14982         * blob.h: add a MONO_TYPE_ENUM definition
14983         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
14984         fix the encoding of arrays of enums in custom attributes.
14986         Fixes #79666.
14988 2007-01-01  Miguel de Icaza  <miguel@novell.com>
14990         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
14991         string is null terminated, but only cut the string short if it
14992         overflows the buffer.   
14993         
14994         (mono_string_to_byvalstr): Also fix this routine.   The code here
14995         was not properly terminating a string (it was only terminated
14996         because of the previous catch-all memset). 
14998         I left the memset, because I do not know if applications expect
14999         the runtime to clear this region. 
15001         Fixes #79944.
15003         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
15004         Clear the error before returning to unmanaged code to prevent the
15005         runtime from being confused later on (fixes  80420).
15006         (ves_icall_type_from_name): Always call mono_loader_clear_error
15007         after parsing a type that could have failed.
15008         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
15010         * loader.c (mono_loader_clear_error): Fix indentation.
15012 2006-12-28  Martin Baulig  <martin@ximian.com>
15014         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
15016 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
15018         * reflection.c: patch from Rolf Bjarne Kvinge to fix
15019         getting a token for an EnumBuilder.
15021 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
15023         * reflection.c: be more careful in case resource generation
15024         fails to create the data array.
15026 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
15028         * sgen-gc.c: write barrier for clone and fix unregister handles.
15030 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
15032         * reflection.c: some fixes needed in the generics code for the moving GC.
15034 2006-12-22  Robert Jordan  <robertj@gmx.net>
15036         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
15037         account. Fixes bug #80299.
15039 2006-12-21  Raja R Harinath  <rharinath@novell.com>
15041         Fix WaitHandle usage in delegates.
15042         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
15043         * object.c (mono_wait_handle_new): Use the property set method to
15044         initialize the handle.
15045         (mono_wait_handle_get_handle): New.
15046         * threadpool.c (mono_async_invoke): Use it.
15047         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
15048         Likewise.
15049         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
15051 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
15053         * marshal.c (emit_marshal): Call emit_marshal_variant and
15054         emit_marshal_com_interface when applicable.
15055         (emit_marshal_variant, emit_marshal_com_interface): Add
15056         methods for this case and remove if's from emit_marshal_object.
15057         
15058 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
15060         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
15062 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
15064         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
15065         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
15066         and GlobalFree on Windows. Remove FIXME.
15068 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
15070         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
15071         implementation for managed objects.
15073 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
15075         * object.c: implemented code to be used for checking
15076         that no reference field overlaps with non-references.
15078 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15080         * threadpool.c: fix queue code to be compatible with the
15081         moving GC.
15083 2006-12-18  Miguel de Icaza  <miguel@novell.com>
15085         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
15086         in structures by throwing ArgumentNullException.
15088         (emit_marshal_safehandle): Also when they are null parameters.
15090         (emit_marshal_safehandle): Add support for ref
15091         SafeHandles parameters
15093 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
15095         * profiler.c: updated to use the mono-dl API instead of
15096         gmodule.
15098 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15100         * profiler.c: updated to use the mono-dl dynamic loading
15101         API instead of gmodule.
15103 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
15105         * profiler.c: use readlink, older versions of glib don't have
15106         g_file_read_link ().
15108 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
15110         * profiler.c: try to detect the path to mono if libc fails to provide
15111         a useful name (bug #80286).
15113 2006-12-16  Raja R Harinath  <rharinath@novell.com>
15115         Fix #80242
15116         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
15117         instance, use the generic type definition instead.
15118         (ves_icall_Type_GetNestedTypes): Likewise.
15119         * class.c (mono_class_create_generic): Always set the
15120         nested_classes of a generic instance to NULL, even if the generic
15121         type definition has nested types.
15123 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
15125         * marshal.c (mono_string_from_bstr): Revert previous Windows change
15126         and fix on Linux.
15127         
15128 2006-12-15  Miguel de Icaza  <miguel@novell.com>
15130         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
15131         my arguments were in the wrong order.   I also fixed the Windows
15132         version which seems to have had the same issue.
15134         (mono_free_bstr): On Unix, this is g_free.
15135         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
15136         conversions (for the tests in corlib to pass).
15138 2006-12-14  Miguel de Icaza  <miguel@novell.com>
15140         * marshal.c (emit_ptr_to_object_conv): For now, ignore
15141         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
15142         exception if a ref SafeHandle in a struct has changed).
15143         
15144         (emit_struct_conv): Do not perform layout checks for classes
15145         derived from SafeHandle, as those are specially handled. 
15147         (emit_object_to_ptr_conv): Add support for
15148         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
15150         (emit_marshal_safehandle): Implement conversion of return values
15151         of safehandles (MARSHAL_ACTION_CONV_RESULT).
15152         
15153         * threads.c: WaitHandle now is compiled with two different handles
15154         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
15155         for 2.0.
15156         
15157         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
15158         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
15159         these routines to cope with both kinds of fields.
15161 2006-12-12  Miguel de Icaza  <miguel@novell.com>
15163         * metadata.c (mono_type_to_unmanaged): Handle the case where
15164         type->data.klass is a SafeHandle, and in that case, return the
15165         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
15166         MONO_MARSHAL_CONV_SAFEHANDLE. 
15168 2006-12-11  Miguel de Icaza  <miguel@novell.com>
15170         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
15171         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
15172         calling emit_marshal_object.
15174         (emit_marshal_safehandle): Implement marshalling of
15175         SafeHandle parameters (no ref support yet).
15177         (MarshalAction): Document the defines as I implement
15178         them for SafeHandle.
15180         (emit_marshal_object): indentation police.
15182         * class-internals.h: Define MonoSafeHandle.
15183         Add safehandle_class to MonoDefaults type.
15185         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
15186         list of classes to check for fields. 
15188         * domain.c (mono_init_internal): Add SafeHandle to the list of
15189         mono_defaults loaded.
15191 2006-12-15  Raja R Harinath  <rharinath@novell.com>
15193         Fix #80253
15194         * reflection.c (mono_reflection_bind_generic_parameters): If the
15195         generic type definition is a type builder, ensure that it is fully
15196         initialized before instantiating it.  Kill some dead code.
15198 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
15200         * object.c: clear the loader_error () before loading
15201         more metadata stuff (bug #80258).
15203 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
15205         * icall.c, icall-defs.h: type modifiers icalls for
15206         parameters and properties.
15208 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
15210         * object.c, icall.c: fixed warnings.
15212 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
15214         * marshal.c: fixed a couple of leaks and coding style in a few places.
15216 2006-12-08  Dick Porter  <dick@ximian.com>
15218         * process.c: Cope with NULL ProcessStartInfo arguments on windows
15219         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
15220         80173.
15222 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
15224         * process.c: ProcessStartInfo may have only filename set and
15225         arguments can be NULL.
15227 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
15229         * icall.c: fix leak found by Robert Jordan.
15231 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
15233         * marshal.c, marshal.h: generate managed method to access an element
15234         of a multi-dimensional array.
15236 2006-11-30  Paolo Molaro (lupus@ximian.com)
15238         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
15240 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15242         * icall.c: back out GetFields () fix until the serialization code is
15243         fixed to not depend on the incorrect behaviour.
15245 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
15247         * profiler.c: provide defaults if none are set.
15249 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
15251         * Makefile.am, attrdefs.h: new public header file with
15252         constants for attributes for use by embedders.
15254 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
15256         * icall.c: GetFields () fix for bug #80064.
15258 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
15260         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
15261         removed long unused icalls.
15263 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
15264   
15265         * marshal.c: 
15266                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
15267                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
15268                 can be generated without a delegate class.
15269                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
15270         
15271         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
15273 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15275         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
15276         #80069.
15278 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
15280         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
15281         icall-def.h: added icalls needed by System.GC.
15283 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
15285         * loader.c: ensure the class in catch clauses is handled
15286         correctly for generics methods (fixes bug#79980).
15288 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
15290         * monitor.h, monitor.c: added mono_locks_dump () function
15291         to help debug deadlocks involving managed locks.
15293 2006-11-13  Dick Porter  <dick@ximian.com>
15295         * file-io.c (get_file_attributes): If the file is a symlink try
15296         and get the stat data for the target, but also add the
15297         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
15298         the specs for the windows symlink support, but will probably have
15299         to be reworked when I have test data from a vista machine.  Fixes
15300         bug 79887.
15302 2006-11-13  Dick Porter  <dick@ximian.com>
15304         * gc.c (mono_domain_finalize): 
15305         * marshal.c (mono_delegate_begin_invoke): 
15306         * threadpool.c (socket_io_init, mono_thread_pool_init)
15307         (mono_thread_pool_finish): 
15308         * monitor.c (mono_monitor_try_enter_internal): 
15309         * threads.c (mono_thread_resume, mono_thread_init)
15310         (mono_thread_suspend_all_other_threads)
15311         (mono_thread_execute_interruption): 
15312         * appdomain.c (mono_domain_unload): Check for NULL error returns
15313         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
15314         75733.
15316 2006-11-11  Miguel de Icaza  <miguel@novell.com>
15318         * process.c
15319         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
15320         Only close the handle if the value of the handle is not
15321         INVALID_HANDLE_VALUE.  This just makes the process a bit more
15322         robust.
15324         Improvement for #75733, so that we do not run into this problem. 
15326         
15327         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
15328         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
15329         internal variables.  Fixes #79462 
15330         
15332 2006-11-09  Dick Porter  <dick@ximian.com>
15334         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
15335         Use poll() not select().  Fixes bug 79397.
15337 2006-11-09  Raja R Harinath  <rharinath@novell.com>
15339         Fix #79872
15340         * assembly.c (mono_assembly_load_from_full): Check that the given
15341         image has an assembly manifest.
15343 2006-11-09  Ankit Jain  <jankit@novell.com>
15345         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
15346         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
15347         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
15349 2006-11-07  Dick Porter  <dick@ximian.com>
15351         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
15352         Put the old resolver behaviour back for pre-2.0 profiles.
15354 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
15356         * threadpool.c: precise GC and locking fixes.
15358 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
15360         * class.c: don't load types that have an explicit unaligned
15361         managed reference. Provide better info in the TypeLoad exception.
15362         Part of the fix for bug #79744.
15363         * object.c: use the correct check for class type load issues.
15365 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
15367         * class.c: enforce alignment of fields with managed references
15368         even when Pack=1 is forced by the user (bug #77788).
15370 2006-11-03  Dick Porter  <dick@ximian.com>
15372         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
15373         If the address reverse lookup fails, return it as the hostname
15374         anyway.  Fixes bug 79721.
15376 2006-11-03  Dick Porter  <dick@ximian.com>
15378         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
15379         Fix build on Windows.
15381 2006-11-02  Dick Porter  <dick@ximian.com>
15383         * icall-def.h: 
15384         * object-internals.h: 
15385         * exception.c (mono_get_exception_thread_interrupted): 
15386         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
15387         Fixes bug 74525.
15389         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
15390         Check for pending Thread.Interrupt.
15392 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
15393         * loader.c: Fixed bug 79684.
15395 2006-10-27  Dick Porter  <dick@ximian.com>
15397         * file-io.c (get_file_attributes): Force symlinks to directories
15398         to be returned as a regular file.  Fixes bug 79733.
15399 2006-10-26  Dick Porter  <dick@ximian.com>
15401         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
15402         CreateFile to open a directory then we need to set the
15403         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
15405 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
15407         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
15408         friends.
15410 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15412         * sgengc.c: small cleanup of timer code.
15414 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
15416         * sgen-gc.c: fix some warnings and start adding support for
15417         complete object removal on domain unload.
15419 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
15421         * assembly.c: build_assembly_name should not consider a version
15422         number without build or revision number invalid. Fixes bug #79715.
15424 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
15426         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
15427         call kernel32 function OutputDebugString directly.
15428         
15429         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
15430         
15431 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
15433         * reflection.c: small cleanup, using a function to insert a MonoString
15434         in the string heap.
15436 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
15438         * reflection.c: moving GC fixes.
15440 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
15442         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
15443         all the objects with finalizers belonging to an unloading appdomain.
15445 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
15447         * sgen-gc.c: added ability to allocate even when the nursery is fully
15448         pinned and fixed a couple of bugs.
15450 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
15452         * threads.h: Revert the last change for now.
15454         * threads.h (mono_thread_get_pending_exception): Rename this to
15455         mono_thread_get_undeniable_exception ().
15457 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
15459         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
15460         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
15461         when fname does not refer to valid assembly. This result in a more
15462         meaningful error message.
15463         * exception.c: added mono_get_exception_bad_image_format2 which 
15464         constructs a BadImageFormatException using the ctor taking a custom
15465         message and the file name. Passing in a NULL msg results in a default
15466         message.
15467         * exception.h: define mono_get_exception_bad_image_format2 function.
15468         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
15469         when file name pointed to an invalid IL image. Use 
15470         mono_get_exception_file_not_found2 to construct FileNotFoundException,
15471         as this results in a more meaningful error message.
15473 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
15475         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
15476         #79465.
15478 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
15480         * metadata.c (mono_type_size): Change the align parameter to guint32 for
15481         consistency with the other _size functions.
15482         (mono_type_stack_size): Ditto.
15484         * class.c object.c icall.c: Fix warnings caused by the above change.
15486         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
15488         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
15490         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
15492 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
15494         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
15495         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
15496         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
15497         threadpool.h, threads-types.h: mark more internal functions.
15499 2006-10-11  Dick Porter  <dick@ximian.com>
15501         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
15502         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
15503         reproduce the bug even before applying the fix.)
15505 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
15507         * reflection.c: allow retrieving attributes for arguments in generic
15508         methods (bug #79241).
15510 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
15512         * debug-mono-symfile.c: properly check fopen () result (found by
15513         coverity).
15515 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
15517         * reflection.c: make error message clearer and fixed two
15518         issuelets found by Coverity.
15520 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
15522         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
15524 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
15526         * object-internals.h, gc-internal.h, profiler-private.h:
15527         mark internal functions.
15529 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
15531         * reflection.c: put data in the text section.
15532         * icall.c: recognize more types in type_from_typename ().
15533         * process.c, marshal.c: added some GC FIXMEs.
15535 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
15537         * loader.c: check for NULL before initializing.
15539 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
15541         * gc.c (finalizer_thread): Use a non-alertable wait here.
15543         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
15544         until the correct solution is found.
15546 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
15548         * reflection.c (mono_module_get_object): Avoid an assert when operating on
15549         modules with no metadata. Fixes #79596.
15551         * image.c (load_metadata_ptrs): Put back the error message when
15552         the #- heap is encountered since the support is not complete yet.
15554 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
15556         * gc.c: do not allow the user to SuppressFinalize () a
15557         delegate because it would leak the trampoline if present.
15559 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
15561         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
15562         PropertyPtr table.
15564 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
15566         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
15568         * metadata.c (mono_metadata_get_param_attrs): Ditto.
15570         * row-indexes.h: Add definitions for *Ptr tables.
15572         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
15574         * metadata.c (mono_metadata_translate_token_index): New helper function to
15575         translate table indexes used in uncompressed metadata.
15576         (mono_metadata_decode_table_row): Ditto.
15577         (mono_metadata_decode_table_row_col): Ditto.
15579         * metadata.c: Add table schema for *Ptr tables.
15581         * class.c loader.c: Use the new helper function to access the affected metadata
15582         tables.
15583         
15584         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
15585         #38532.
15586         
15587 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
15589         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
15590         sequences which can be unbounded in size. Fixes #79583.
15592 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
15594         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
15595         static initialization.
15597         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
15599         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
15601         * domain.c (mono_domain_free): Free up type_init_exception_hash.
15603         * object.c (mono_runtime_class_init): Implement correct semantics when a static
15604         ctor fails, i.e. throw the same exception on subsequent accesses.
15605         
15606 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
15608         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
15609         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
15610         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
15611         Handle marshalling of interfaces and VARIANTs contained in structs.
15612         
15613         Code is contributed under MIT/X11 license.
15614         
15615 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
15617         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
15618         
15619         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
15620         mempool.
15622 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15624         * console-io.c: ignore previous SIGINT handler.
15626 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
15628         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
15629         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
15630         #79460, #79461, #79485.
15632         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
15634         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
15635         #79217.
15637 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
15639         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
15640         could be generated from it.
15642 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
15644         * rand.c: fix read loop to correctly handle EINTR.
15646 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15648         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
15649         internal calls are defined to keep methods closer to the declaring
15650         type and allow a significant reduction in runtime relocations and
15651         memory usage.
15653 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
15655         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
15656         exception message to have FileNotFoundException use the default
15657         assembly load error message. Fixes bug #79426.
15658         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
15660 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15662         * threadpool.c: (start_thread_or_queue) use the root domain when
15663         creating the thread instead of the async object one.
15665 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
15667         * class.c, object.c, class-internals.h, reflection.c:
15668         for arrays, store element_size inside MonoClass (speedup
15669         for array object creation).
15671 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
15673         * icall.c: fixed CodeBase to use the file name and not the module
15674         name (bug #79365).
15676 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
15678         * mono-debug.c, mono-debug.h: export find_method as
15679         mono_debug_find_method ().
15681 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15683         * debug-helpers.c, class-internals.h: added a few functions useful
15684         when debugging under gdb.
15686 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15688         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
15689         characters that need special handling.
15691 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
15693         * mono-config.c: make the os/cpu specification more flexible,
15694         allowing lists and negation.
15696 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
15698         * marshal.c: COM Interop fixes. Handle case where method->klass.
15699         is interface. Handle BSTR/MonoString when null. Use CDECL as 
15700         calling convention on non-windows platforms. This is for
15701         compatibility with XPCOM and MainWin COM.
15702         
15703         Code is contributed under MIT/X11 license.
15704         
15706 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
15708         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
15709         correctly. Fixes #79217.
15711         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
15713 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
15715         * mono-config.c: allow both an os and cpu attribute for dllmap
15716         and dllentry elemnets to enable a single config file to be used
15717         for multiple architectures.
15719 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
15721         * loader.c: MonoLoaderError was cleared too soon on load failure.
15722         Fixes bug #79424.
15724 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
15726         * icall.c: use the defining class vtable when accessing a
15727         static field, not a pobblibly derived class.
15729 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
15731         * icall.c string-icalls.c: Remove references to unicode.h.
15733         * unicode.h unicode.c Makefile.am: Remove these unused source files.
15735         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
15737         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
15738         indicating the image where custom marshaller types should be looked up.
15739         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
15740         custom marshallers, instead of corlib. Fixes #79425.
15742 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
15744         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
15746 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
15748         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
15749         Implement Environment.ProcessorCount.
15750         
15751         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
15752         Implement Environment.ProcessorCount.
15753         
15754         * icall.c: 
15755         Add Environment.ProcessorCount icall.
15756         
15757         Patch by Jason McFall.
15759 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15761         * assembly.c: don't append .exe/.dll when the filename already contains
15762         one of those extensions.
15764 2006-09-12  Martin Baulig  <martin@ximian.com>
15766         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
15767         to array interfaces.
15769 2006-09-11  Martin Baulig  <martin@ximian.com>
15771         * reflection.c (mono_image_build_metadata): Create the
15772         MethodImpl's after emitting all types and methods, so we don't
15773         need another fixup pass for them.
15775 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
15777         * class.c (mono_class_from_name_case): Fix regression introduced by the last
15778         change.
15780 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
15782         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
15783         unload.
15785 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
15787         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
15788         args is not set. Fixes #78926.
15790 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
15792         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
15794         * image.c (load_class_names): Move this to class.c, and rename it to 
15795         'mono_image_init_name_cache'.
15796         (load_modules): Fix a warning.
15798         * class.c icall.c image.c: Initialize image->name_cache lazily.
15800         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
15801         on its name using information in the AOT file.
15803         * class.c (mono_class_from_name): Use the new hook function.
15805 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
15807         * reflection.c (mono_param_get_objects): Handle enum default parameter values
15808         correctly.
15810         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
15811         Fixes #79289.
15812         
15813 2006-09-06  Martin Baulig  <martin@ximian.com>
15815         * icall.c (mono_lookup_internal_call): Small fix.
15817 2006-09-05  Raja R Harinath  <rharinath@novell.com>
15819         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
15820         double g_free.
15822 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
15824         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
15825         when --debug is specified.
15827 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
15829         * class.c (setup_generic_array_ifaces): Fix a warning.
15831 2006-09-04  Miguel de Icaza  <miguel@novell.com>
15833         * Temporarily remove the patch to assemly.c that checks the
15834         assembly versions as it breaks our gacutil.
15836 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
15838         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
15840         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
15841         a net 1.0 runtime.
15843         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
15844         created using the default ctor. Fixes #79152.
15845         (mono_string_builder_to_utf16): Ditto.
15847 2006-09-01  Martin Baulig  <martin@ximian.com>
15849         Fix handling of the generic array interfaces.
15851         * class-internals.h
15852         (MonoDefaults): Removed `generic_array_class' and added
15853         `generic_ilist' class.
15855         * class.c
15856         (mono_bounded_array_class_get): Add the new generic array interfaces.
15857         (setup_generic_array_ifaces): New static method; create vtable
15858         entries for each method in the generic array interfaces.
15860         * metadata.c
15861         (select_container): Allow "parent-less" generic methods.
15863         * marshal.c
15864         (mono_marshal_get_generic_array_helper): New public method.
15866         * icall.c
15867         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
15868         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
15869         moved the interncall into System.Array.
15871 2006-09-01  Raja R Harinath  <rharinath@novell.com>
15873         A few more cases of avoiding work on types with ->byref set.
15874         Has the real fix for #79238
15875         * icall.c (is_generic_parameter): New helper.
15876         (ves_icall_Type_GetGenericParameterPosition): Use it.
15877         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
15878         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
15879         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
15880         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
15881         reference types.
15882         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
15883         reference types.
15884         (ves_icall_Type_get_IsGenericInstance): Likewise.
15885         (ves_icall_Type_get_IsGenericType): Likewise.
15887 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
15889         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
15890         class if possible.
15892         * mempool.h (mono_mempool_get_allocated): New helper function.
15894         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
15895         change.
15897         * mempool.c: Fix warnings and the calculation of stats.
15899         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
15901         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
15903         * loader.c (mono_get_method_from_token): Update method_count stat.
15905         * class-internals.h (MonoStats): Add some stats.
15907 2006-08-31 Robert Jordan  <robertj@gmx.net>
15909         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
15910         with managed variants.
15911         All code is contributed under the MIT/X11 license.
15912         
15913 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
15915         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
15916         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
15918         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
15920         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
15921         with cycles in classes.
15923         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
15925         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
15926         missing a [MarshalAs] directive. Fixes #79203.
15928         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
15929         klass->marshal_info. Fixes #79217.
15931 2006-08-30  Martin Baulig  <martin@ximian.com>
15933         Committing a patch from Joachim Ante <joe@otee.dk>:
15934         Add support for binary data symbol stores.
15936         * debug-mono-symfile.c
15937         (mono_debug_open_mono_symbol_file): Renamed into
15938         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
15939         arguments.
15941         * mono-debug.c
15942         (mono_debug_open_image): Added `raw_contents' and `size' args.
15943         (mono_debug_init_2_memory): New public function.
15945 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
15947         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
15949 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15951         * appdomain.c: implement support for ShadowCopyFiles.
15953 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
15955         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
15956         when value is NULL (and should remove CID #51).
15958 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15960         * image.c: moved 2 functions to ../utils.
15962 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
15964         * gc.c: cope with the target object of a GC handle being NULL
15965         (bug #78877).
15967 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
15969         * class.c: recursively check parent's explicit implementations
15970         of interface methods (fixes bug #79125).
15972 2006-08-19  Miguel de Icaza  <miguel@novell.com>
15974         * filewatcher.c: Avoid warnings when building, do not redefine
15975         constants that are defined.
15977         Remove warnings.
15979 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15981         * image.c: don't fail when the link points to an absolute path.
15983 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
15985         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
15986         Fix CID #3.
15988 2006-08-17  Miguel de Icaza  <miguel@novell.com>
15990         * image.c (full_path): A new method used to obtain the actual path
15991         of an assembly even in the presence of symbolic links.  
15993         This is necessary for the case where we are running a binary that
15994         has been GACed, but we are using the "published" path name
15995         ($prefix/mono/1.0/blah.exe) which happens to point to the real
15996         file in the GAC.
15998         This was the source of the failure for the `xsp' command with the
15999         recent AppDomain changes, as far as the runtime was concerned,
16000         there were two different assemblies: $prefix/mono/1.0/blah.exe and
16001         $prefix/mono/gac/blah/version/blah.exe.
16003         (do_mono_image_open): use full path
16005 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16007         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
16009 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
16011         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
16012         domain_id is supplied. Fix CID #241 and corlib's unit tests.
16014 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16016         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
16017         small structures. Fixes #78990.
16019 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16021         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
16023         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
16025 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16027         * appdomain.c:
16028         * marshal.c: don't load all the assemblies from a domain into newly
16029         created ones. The new domains might have different rules and load
16030         assemblies from different locations. Fixes bug #76757.
16032         Patch by Lluis. Conflicts resolved by Brian Crowell.
16034 2006-08-16  Alp Toker  <alp@atoker.com>
16036         * socket-io.c: First half of the fix for #79084.
16037         Set sa_size to the length of the content, not that of the struct.
16038         Don't add NULL suffix to the content, this should be done in
16039         managed code if needed.
16041 2006-08-14  Raja R Harinath  <rharinath@novell.com>
16043         Fix part of #79012
16044         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
16045         mono_metadata_parse_type returns NULL.
16047 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
16049         * normalization-tables.h : new file for string normalization data.
16050         * locales.c, locales.h, icall.c :
16051           added load_normalization_resource() for string normalization,
16052           and icall as well.
16053         * Makefile.am : added normalization-tables.h to the sources.
16055 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
16057         * marshal.c: Add more helper functions to reduce code duplication and use them
16058         everywhere.
16060 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
16062         * marshal.c: Fix non-x86 stdcall warnings.
16063         
16064         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
16065         them everywhere.
16067 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
16069         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
16070         type check on multi-dimensional arrays. Fixes #79000.
16072 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
16074         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
16075         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
16076         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
16077         * class-internals.h: add is_com_object to class structure.
16078         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
16079         null checks to COM object marshalling. Fix .ctor call on RCW.
16080         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
16081         
16082         All code is contributed under the MIT/X11 license.
16084 2006-08-09  Dick Porter  <dick@ximian.com>
16086         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
16087         racing mono_monitor_allocator_lock() somewhere, so don't delete
16088         the critical section for now.  Found by running and exiting
16089         monodevelop.
16091 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
16093         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
16094         (ves_icall_System_ComObject_FindInterface): Ditto.
16095         (ves_icall_System_ComObject_CacheInterface): Ditto.
16097         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
16098         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
16100 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16102         * threadpool.c: treat pipes from process asynchronous reads as sockets
16103         when reading from them, so we get select/poll or epoll to wait for
16104         data.
16106 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
16108         * loader.c: Fix a typo (CID #233) in the null check.
16110 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
16112         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
16113         Hopefully fixes #78949.
16114         
16115         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
16116         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
16117         bytes. Fixes #78972.
16119 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16121         * filewatcher.c: we need to set errno here.
16123 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16125         * filewatcher.c: let Win32Exception get the error value.
16127 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16129         * filewatcher.c: translate errno into win32 errors for Win32Exception
16130         to know what happened.
16132 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
16134         * threadpool.c: Fix more warnings.
16136         * assembly.c (search_loaded): Fix warnings.
16138         * threadpool.c (mono_thread_pool_finish): Fix warnings.
16139         (mono_async_invoke): Ditto.
16141 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
16143         * object.c (mono_remote_class_vtable): Need to create proxy vtable
16144         entries for __ComObject type in addition to ComImport types.
16145         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
16146         about hash table.
16147         
16148         All code is contributed under the MIT/X11 license.
16150 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
16152         * image.c: avoid tentative loading of modulerefs that contain
16153         no metadata (P/Invoke library names).
16155 2006-07-28  Dick Porter  <dick@ximian.com>
16157         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
16158         mono_loader_lock() somewhere, so don't delete the critical section
16159         for now.  Found by running and exiting monodevelop.
16161 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16163         * filewatcher.c: define the inotify syscalls when we're building on
16164         linux and have sys/syscall.h. The build system might not have support
16165         for inotify but the target system might have it.
16167 2006-07-26  Miguel de Icaza  <miguel@novell.com>
16169         * domain.c: Documentation updates.
16171         * loader.c (mono_free_method): Do not release the method
16172         information if we are being profiled, as profilers will use this
16173         information at shut down to present some data to the user.
16175         This is needed so that the profiler does not crash, as the
16176         profiler tends to keep MonoMethods around, and they might become
16177         invalid if we free these.
16179         (mono_get_method_constrained): Return the original CIL stream
16180         method as well, so verification can be performed against it.
16182 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16184         * filewatcher.[ch]: support for inotify file system watcher.
16185         * icall.c: add new internal calls for the inotify file system watcher.
16187 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16189         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
16190         #78888.
16192 2006-07-20  Dick Porter  <dick@ximian.com>
16194         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
16195         warning.
16197 2006-07-20  Dick Porter  <dick@ximian.com>
16199         * threads.c (start_wrapper): Do the thread cleanup while we still
16200         hold a reference to its object.  Fixes bug 78123.
16202 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
16204         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
16205         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
16206           "managed-to-managed".
16207         * icall.c: Redirect string constructors that take sbyte* to
16208           ves_icall_System_String_ctor_RedirectToCreateString.
16209         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
16210           to CreateString () methods with matching signature.
16211         * reflection.c: Use original security informations for
16212           MONO_WRAPPER_MANAGED_TO_MANAGED.
16213         * security-manager.c: Use original security informations for
16214           MONO_WRAPPER_MANAGED_TO_MANAGED.
16215         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
16216           that is a placeholder and only its address should be used.
16217         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
16218           that is a placeholder and only its address should be used.
16220 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
16222         Begin implementing COM Interop.
16223         * appdomain.c: Increment corlib version.
16224         * class.c: Set ComImport classes' parent to __ComObject.
16225         * loader.c: Mark cominterop methods as such.
16226         * domain.c: Add __ComObject class to MonoDefaults structure.
16227         * image.c: Add 2 hashtables to the image for COM Interop related methods
16228         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
16229         using the mempool allocator
16230         
16231         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
16232         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
16233         declaration for mono_metadata_type_dup_mp.
16234         
16235         * debug-helpers.c: Added strings for two additional wrapper types
16236         * object.c: Create proxy objects for ComImport classes
16237         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
16238         and added __ComObject class to MonoDefaults structure.
16239         
16240         * object-internals.h: Finish MonoRealProxy definition, and add definition of
16241         MonoComInteropProxy and MonoComObject.
16242         
16243         * marshal.c: Added support for COM Interop
16244         (signature_cominterop): Converts managed signature to corresponding
16245         unmanaged COM signature.
16246         (cominterop_get_function_pointer): gets unmanaged function pointer via
16247         COM object vtable
16248         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
16249         (cominterop_get_method_interface): returns interface type that method is defined on
16250         (mono_mb_emit_cominterop_call): emits native call to function pointer
16251         gotten from vtable
16252         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
16253         that matches signature of unmanaged function.
16254         (cominterop_get_native_wrapper): wrapper around adjusted method call.
16255         (cominterop_get_invoke): forwards call from proxy to __ComObject
16256         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
16257         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
16258         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
16259         
16260         * marshal.h: Added Marshal icall declarations.
16261         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
16262         so we can access them in finalizer
16263         
16264 2006-07-14  Dick Porter  <dick@ximian.com>
16266         * object.c (mono_type_initialization_cleanup): Fix a race
16267         condition by temporarily commenting out the critical section
16268         deletion.
16270 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
16272         * reflection.c (create_custom_attr): Fix some warnings.
16273         (create_custom_attr_data): Ditto.
16274         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
16275         types. Fixes #78855.
16277 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
16279         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
16281         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
16283 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
16285         * reflection.c (resolve_object): Add support for DynamicMethod.
16287         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
16288         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
16290 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
16292         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
16293         don't leak GPtrArray's pdata has we have no use (nor free) for it.
16295 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
16297         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
16298         Fixes #77888.
16300 2006-06-30  Raja R Harinath  <rharinath@novell.com>
16302         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
16303         slightly: remove a shadow local variable.
16305 2006-06-29  Raja R Harinath  <rharinath@novell.com>
16307         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
16308         definition that introduces the virtual function slot.
16309         Also fix Coverity #105.
16311 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
16313         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
16314         for dynamic assemblies. Fixes #78724.
16316 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
16318         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
16319         Fixes #78722.
16321 2006-06-21  Martin Baulig  <martin@ximian.com>
16323         * reflection.c
16324         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
16325         fixes #76484.
16327 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
16329         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
16331 2006-06-20  Raja R Harinath  <rharinath@novell.com>
16333         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
16334         nor TYPEREFs.
16335         * class.c (mono_class_create_from_typespec): Add 'context' argument.
16336         Inflate result if necessary.
16337         (mono_class_get_full): Remove old version.  Rename from
16338         'mono_class_get' and add 'context' argument.  Pass it to
16339         ..._create_from_typespec.
16340         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
16341         (mono_ldtoken): Revert change below.
16343 2006-06-20  Martin Baulig  <martin@ximian.com>
16345         * class.c (mono_ldtoken): Don't pass the generic context to
16346         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
16348 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
16350         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
16351         and later freeing it. Fixes #78638.
16353 2006-06-15  Miguel de Icaza  <miguel@novell.com>
16355         * icall.c (mono_class_get_throw): Revert over-zealous error
16356         throwing, the caller for mono_class_get_throw will cope with
16357         errors when classes are not properly initialized already.
16359         The code still copes with loader exceptions though.
16361         Fixes the regression in reftype1 and reftype3 from the CAS tests.
16362         
16363 2006-06-14  Miguel de Icaza  <miguel@novell.com>
16365         Fixes the `make run1' version of RuntimeAbort (to be commited,
16366         source is in Bugzilla).
16367         
16368         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
16369         FALSE on class loading failure instead of returning true.
16371         * class.c (mono_class_create_from_typedef): It is possible for
16372         mono_metadata_interfaces_from_typedef_full to fail if a class is
16373         not found, cope with this.
16374         
16376 2006-06-14  Dick Porter  <dick@ximian.com>
16378         * socket-io.c: 
16379         * process.c: Fix a bunch of signed/unsigned warnings from gcc
16380         4.1.1
16382 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
16384         * culture-info-table.h : oops, forgot to make it nsync with r61548.
16386 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
16388         * icall.c: Another fix for building mono in Visual Studio.
16390 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
16392         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
16393         
16394 2006-06-09  Martin Baulig  <martin@ximian.com>
16396         * debug-mono-symfile.c: Put this back and really fix it this
16397         time. Sorry for all the trouble.
16399 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
16401         * icall.c (mono_class_get_throw): Fix a warning.
16402         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
16403         ReflectionTypeLoadException if needed. Fixes #78606.
16405         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
16406         (mono_class_init): Ditto.
16408         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
16409         ref_only exceptions.
16410         (mono_loader_clear_error): Make this work even if there is no error.
16412 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
16414         * object-internals.h marshal.c marshal.h icall.c: Implement method 
16415         Marshal.GetComSlotForMethodInfo using internal call.
16417 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
16419         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
16420         a function for signalling it.
16422         * class.c (mono_class_from_typeref): Use the new kind of loader error when
16423         a referenced assembly is not found.
16425         * loader.c (mono_loader_error_prepare_exception): Add support for 
16426         LOADER_ERROR_ASSEMBLY. Fix formatting.
16428 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
16430         * domain.c appdomain.c class-internals.h marshal.c: Add support 
16431         for VARIANT marshalling on windows and increment corlib version
16432         since Variant struct was added.
16434 2006-06-03  Miguel de Icaza  <miguel@novell.com>
16436         * debug-mono-symfile.c: Revert Martin's previous patch which broke
16437         stack trace line information:
16439         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
16440         (Martin) when looking up B which is between A and C, return A not C.
16442         Bug is #78573.
16444         Thanks to Alexander Olk for tracking this down.
16446 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
16448         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
16449         
16450         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
16451         avoid clobbering its value.
16452         (mono_string_to_lpstr): Fix a warning on windows.
16454 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
16456         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
16458         * reflection.c loader.c: Removed references to 'dummy' flag.
16460         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
16462         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
16463         it gets GC tracking.
16465         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
16466         GC tracking.
16467         
16468         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
16470         * marshal.c threadpool.c: Update callers of mono_async_result_new.
16472         * appdomain.c: Bump corlib version.
16474 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
16476         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
16477         CEE_STIND_REF when working with object references.
16479 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
16481         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
16482         Fixes #78539.
16484 2006-05-30  Miguel de Icaza  <miguel@novell.com>
16486         * loader.c (method_from_memberref): Fix argument value for
16487         mono_loader_set_error_method_load (I was passing the MonoClass
16488         instead of the class name char *).
16490 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
16492         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
16493         CEE_STIND_REF when working with object references.
16495 2006-05-30  Martin Baulig  <martin@ximian.com>
16497         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
16498         mono_method_full_name() change and replace the ':' with a '.'
16499         here.
16501 2006-05-30  Martin Baulig  <martin@ximian.com>
16503         * debug-mono-symfile.c
16504         (mono_debug_symfile_lookup_location): Fix the algorithm:
16505         when looking up B which is between A and C, return A not C.
16507 2006-05-29  Martin Baulig  <martin@ximian.com>
16509         * mono-debug.h
16510         (MonoDebugMethodInfo): Make the typedef public.
16511         (MonoDebugSourceLocation): New public struct.
16513         * mono-debug.c
16514         (mono_debug_source_location_from_address): Removed.
16515         (mono_debug_source_location_from_il_offset): Removed.
16516         (mono_debug_il_offset_from_address): Removed.
16517         (mono_debug_address_from_il_offset): Removed.
16518         (mono_debug_lookup_method): New public function.
16519         (mono_debug_lookup_source_location): New public function; replaces
16520         the old mono_debug_source_location_from_*() functions; see the
16521         inline documentation.
16522         (mono_debug_free_source_location): New public function.
16523         (mono_debug_print_stack_frame): New public function; see the
16524         inline documentation.
16526         * debug-mono-symfile.c
16527         (mono_debug_find_source_location): Renamed into
16528         mono_debug_symfile_lookup_location(); only take a
16529         `MonoDebugMethodInfo *' and an `offset' argument; added inline
16530         documentation.
16531         (mono_debug_find_method): Renamed into
16532         mono_debug_symfile_lookup_method().
16534 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
16536         * assembly.c (mono_assembly_open_full): Dont overwrite the status
16537         returned by mono_image_open_full ().
16539         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
16540         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
16541         #78517.
16543         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
16544         #78518.
16546 2006-05-27  Miguel de Icaza  <miguel@novell.com>
16548         * class.c (mono_class_from_typeref): handle missing images
16549         earlier, deals with bug #78418.   Refactor code; 
16551         Fix a warning introduced in my previous commit (some stale code
16552         from before I revisited my patch).
16554         * class.c (mono_class_create_from_typedef): On failure, remove the
16555         class from the MonoImage->class_cache as the class is not
16556         initialized;   Fixes the leak pointed out by Paolo.
16558 2006-05-25  Dick Porter  <dick@ximian.com>
16560         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
16561         DeleteCriticalSections until I figure out which one may still be
16562         sometimes locked when mono_thread_cleanup is called.
16564 2006-05-24  Dick Porter  <dick@ximian.com>
16566         * threads.c (mono_thread_cleanup): Move the threading cleanup out
16567         of mono_thread_manage and back into its own function, so it can be
16568         called after the finalizer thread has finished.
16570         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
16572 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
16574         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
16575         Fixes #78495.
16577         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
16578         with non-blittable elements.
16579         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
16581 2006-05-24  Martin Baulig  <martin@ximian.com>
16583         * mono-debug-debugger.h (MonoDebuggerEvent): Added
16584         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
16586         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
16587         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
16588         `mono_debugger_event_handler' to NULL.
16590 2006-05-24  Martin Baulig  <martin@ximian.com>
16592         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
16594 2006-05-24  Martin Baulig  <martin@ximian.com>
16596         * mono-debug-debugger.h
16597         (mono_debugger_create_notification_function): Added
16598         `MonoCodeManager *' argument.
16600 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
16602         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
16604 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
16606         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
16607         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
16608         implementation.
16610 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
16612         * icall.c: precise GC support: objects can't be stored in unmanaged
16613         memory anymore, even if they are kept alive by other references: since
16614         they can move the GC needs to be able to always find them.
16616 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
16618         * object.c: precise GC support for static fields. Support
16619         for moving GCs: write barriers and pinned allocation for interned
16620         strings.
16622 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
16624         * domain.c, domain-internals.h: precise GC support for the MonoDomain
16625         structure.
16627 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
16629         * class.c, gc.c: sgen and precise GC updates.
16631 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
16633         * marshal.h, marshal.c: added write barrier wrapper and precise type
16634         fixes.
16636 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
16638         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
16639         support.
16641 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
16643         * reflection.c: precise and sgen GC updates.
16645 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
16647         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
16649 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
16651         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
16653 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
16655         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
16656         MONO_TYPE_OBJECT. Fixes #78462.
16658 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
16660         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
16661         and blittable types.
16663 2006-05-17  Miguel de Icaza  <miguel@novell.com>
16665         * class.c (mono_class_get_exception_for_failure): Implement parts
16666         of a TODO: if the loader error is set (instead of the class
16667         error), we return a Loader exception that can be properly thrown
16668         elsewhere.
16670         This was exposed by some Winforms 2.0 code that I tried to run
16671         (Atsushi pointed me to it).
16673 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
16675         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
16676         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
16677         
16678         * marshal.c (emit_marshal_vtype): Add limited support for 
16679         UnmanagedType.LPStruct. Fixes #78427.
16681         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
16682         Applied a patch from kangaroo to fix #77523.
16684 2006-05-17  Martin Baulig  <martin@ximian.com>
16686         * threads.c
16687         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
16688         (debugger_thread_created): Removed.
16689         (debugger_thread_exited): Removed.
16691 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
16693         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
16695         * object-internals.h (MonoReflectionResource): Sync with managed version.
16697 2006-05-12  Wade Berrier <wberrier@novell.com>
16699         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
16701 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
16703         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
16704         functions try to allocate from the image mempool.
16706 2006-05-12  Dick Porter  <dick@ximian.com>
16708         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
16710 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
16712         * object.c: The FieldGetter and FieldSetter methods require the full
16713         name of the class, not only the name. Fixes bug #78277.
16715 2006-05-11  Miguel de Icaza  <miguel@novell.com>
16717         * loader.c (method_from_memberref): Do not pass the NULL klass to
16718         mono_loader_set_error_() methods.  Pass the non-NULL value
16719         (class). 
16721 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
16723         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
16724         (mono_assembly_close): Null out assembly->image->references after freeing it.
16726         * image.c (mono_image_close): Free image->references.
16727         
16728         * reflection.c (mono_image_basic_init): Fix a small memory leak.
16730 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
16732         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
16733         before checking if it's NULL (g_assert).
16735 2006-05-10  Martin Baulig  <martin@ximian.com>
16737         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
16738         I thought I already killed that two months ago, but now it somehow reappeared.
16740 2006-05-10  Martin Baulig  <martin@ximian.com>
16742         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
16744 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
16746         * reflection.c: Allocate memory for dynamically created methods in the image
16747         mempools.
16749 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
16751         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
16752         don't use the ad pointer before checking if it's NULL (g_assert).
16754 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
16756         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
16757         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
16759         * marshal.c: Allocate all signatures from mempools.
16761         * marshal.c: Allocate some more signatures from mempools.
16763 2006-05-09  Miguel de Icaza  <miguel@novell.com>
16765         * object.c (mono_load_remote_field): The code used to provide a
16766         temporary variable for returning results if the user did not
16767         provide a result pointer.  But our temporary variable was allocted
16768         on the satck.
16770         Fix calling code to always pass a result area.   Coverity ID 103.
16772 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
16774         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
16775         value, not the old. Fixes #78312.
16776         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
16778         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
16779         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
16780         per-image cache.
16782         * assembly.c (mono_assembly_close): Free image->references.
16784         * assembly.c (mono_assembly_names_equal): Fix a warning.
16785         (mono_assemblies_cleanup): Cleanup more global data.
16787         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
16789         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
16790         ptr_cache and image->modules.
16792         * image.c (mono_image_init): Allocate array_cache lazily.
16793         
16794 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16796         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
16797         behavior was changed recently and has bad side effects.
16799 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
16801         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
16802         
16803         * assembly.c (mono_assembly_close): Remove a debug printf.
16805         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
16807         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
16808         to also allow for temporary references between mono_image_open ()/close ().
16810         * domain.c (get_runtimes_from_exe): Add a FIXME.        
16812 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
16814         * marshal.c: Fix support for dynamic methods.
16816         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
16818         * marshal.c (mono_marshal_cleanup): New cleanup function.
16820         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
16821         image mempools.
16823         * class.c (mono_class_init): Fix leaking class->nested_classes.
16825         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
16827         * image.c (mono_image_init): Initialize the new cashes.
16829         * image.c (mono_image_close): Destroy the new cashes.
16831         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
16833         * mempool.c (mono_mempool_strdup): New helper function.
16835         * class-internals.h: Add prototype for mono_loader_unlock ().
16837         * domain.c (mono_jit_info_table_find): Fix a warning.
16838         (mono_debugger_check_runtime_version): Ditto.
16840         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
16841         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
16842         functions to these modules.
16844         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
16845         metadata modules.
16846         
16847         * marshal.c (mono_free_bstr): Fix a warning.
16849         * assembly.c (mono_assembly_open_full): Fix another small leak.
16851         * object.c: Fix some unload leaks in the remoting code.
16853         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
16854         function.
16856         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
16858         * reflection.c: Fix some unload leaks in dynamic assemblies.
16860 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
16862         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
16863         * marshal.h: Add BSTR support on Win32
16864         * icall.c: Add BSTR icalls
16865         * metadata.h: Add BSTR enums
16867 2006-04-28  Miguel de Icaza  <miguel@novell.com>
16869         Work to catch the crash from #76795 and turn it into an
16870         exception.   As I stubbed out pieces of the VisualBasic support,
16871         I found a number of places where the code was failing and I added
16872         checks to those places. 
16873         
16874         * metadata.c (do_mono_metadata_parse_generic_class): Make this
16875         function return a status code.  If we fail to parse the signature
16876         from mono_metadata_parse_generic_inst, return FALSE.
16878         * loader.c (mono_get_method_from_token): If we fail to load the
16879         method (mono_class_get) return NULL.   
16881         * (method_from_memberref): Return NULL if we are unable to parse
16882         the method signature
16884         (mono_loader_error_prepare_exception): Since we now use the
16885         loader_error flag internally to stop processing, and obtaining
16886         exceptions that might be thrown will walk this code path the
16887         proper way of going from a MonoLoaderError into a
16888         MonoException was convoluted.   This new routine encapsulates the
16889         process of turning the error into an exception and *clearing* the
16890         error afterwards.
16891         
16892 2006-04-27  Miguel de Icaza  <miguel@novell.com>
16894         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
16895         with missing assemblies), and to cope with:
16897                 * Missing fieldref from a non-existing assembly.
16898                 * Missing methodref from a non-existing assembly.
16900         The first batch of work to address *some* of the issues from 76661.
16901         
16902         * object.c (mono_class_create_runtime_vtable): If we fail to
16903         initialize the class raise the exception here. 
16905         * metadata.c (mono_class_get_overrides_full): If any methods fail
16906         to load return the failure to the caller.
16908         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
16909         flagging assemblies that failed to load.   
16911         Do not crash if we are unable to load the assembly.
16913         (mono_assembly_close): Do nothing with REFERENCE_MISSING
16914         assemblies. 
16916         * loader.c (mono_loader_set_error_type_load): Change the
16917         convention to always pass unallocated strings, so we make our own
16918         copies (I know our own code had duplicated strings before, but
16919         this keeps the normal conventions).
16920         (method_from_memberref): Call mono_loader_set_error_method_load
16921         for all possible failures of loading the class. 
16922         Remove assert, turn into a loader error.
16924         (mono_loader_error_to_exception): Move this routine from mini
16925         (mini_loader_error_to_exception) there was no need to have that in
16926         mini. 
16928         * class.c (mono_class_from_typeref): If we were not able to load
16929         the assembly with mono_assembly_load_reference, call the
16930         mono_loader_set_error_type_load to register the problem.
16932         (mono_class_setup_fields): If we fail to load the type from
16933         mono_metadata_parse_type_full, call mono_class_set_failure and
16934         break from the loop.
16936         If class->exception_type is set, we do not layout the fields as
16937         that might crash the runtime, and instead return (from breaking
16938         from the previous loop).
16940         (mono_class_setup_vtable): This now returns a boolean indicating
16941         whether the table was properly setup.   The decision is driven by
16942         mono_class_get_overrides_full which might run into non-existing
16943         methods. 
16944         
16945         (mono_class_init): Returns TRUE on success or FALSE if there was a
16946         problem in loading the type (incorrect assemblies, missing
16947         assemblies, methods, etc).
16949         When we call mono_class_setup_fields we also check for a potential
16950         error inside this call (either a class exception or a general
16951         loader exception).
16953         (mono_class_create_from_typedef): If the parent fails to load
16954         (calling mono_class_get_full) return NULL.
16955         
16956         ** Important **
16958         calls to mono_metadata_parse_type_full should be checked
16959         everywhere and set the mono_class_set_failure
16960         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
16962         The current patch checks the places where my manually constructed
16963         tests show the errors are showing up, but we should do it
16964         everywhere. 
16966         ** Important2 **
16968         mono_class_init return values should be tested everywhere, like
16969         the previous case this is something that we should audit
16970         everywhere and not only on the cases exposed by the tests I
16971         created. 
16973 2006-04-26  Miguel de Icaza  <miguel@novell.com>
16975         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
16976         boolean parameter and instead pass the information on `options'
16977         parameter (FileOptions).
16979         * icall.c: Register the new signature for MonoIO.Open.
16981         * debug-helpers.c (dis_one): Trying to understand how coverity
16982         works.  Fix Run 5, item 78.
16984 2006-04-26  Dick Porter  <dick@ximian.com>
16986         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
16987         dereference.
16989 2006-04-25  Martin Baulig  <martin@ximian.com>
16991         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
16993         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
16994         debugger_thread_created().
16995         (debugger_gc_push_all_stacks): Don't handle the main thread in any
16996         special way.
16997         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
16998         (mono_debugger_finalize_threads): New function; undo the effects
16999         of mono_debugger_init_threads().
17000         (mono_debugger_create_all_threads): Removed.
17002 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
17004         * image.c (mono_image_close): Tidy up trace messages.
17006         * assembly.c (mono_assembly_close): Ditto.
17008         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
17009         no longer references an already freed assembly. Fixes #78168.
17011 2006-04-21  Dick Porter  <dick@ximian.com>
17013         * threads.c (mono_thread_detach): Fix reference counting when
17014         detaching threads.
17016 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
17018         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
17019         #78155.
17021 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
17023         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
17024         (mono_type_to_stind): Ditto.
17026         * marshal.c: Use the new helper functions to simplify code.
17028         * image.c (mono_image_close): Add some code for help debug assembly unloading
17029         problems.
17031         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
17032         image mempool.
17034         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
17035         assembly was already loaded in another appdomain. Fixes #78083.
17037 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
17039         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
17040         referenced assemblies.
17041         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
17043         * domain.c (mono_domain_free): Add a trace message.
17045         * appdomain.c (add_assemblies_to_domain): Ditto.        
17047         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
17048         field.  
17050 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
17052         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
17054 2006-04-12  Martin Baulig  <martin@ximian.com>
17056         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
17057         `USE_INCLUDED_LIBGC'.   
17059 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
17061         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
17062         the patch contains ../ and a small directory name later. Hopefully fixes
17063         #78035.
17065 2006-04-10  Martin Baulig  <martin@ximian.com>
17067         Clean up the debugger's thread-handling code.
17069         The debugger's thread-handling code has been moved from
17070         ../mini/debug-debugger.c to threads.c.  We now iterate directly
17071         over the `threads' hash, keep track of exiting threads and also
17072         use proper locking.
17074         We can now debug XSP and XSP based applications with the debugger.
17076         * object-internals.h (MonoThread): Added `gpointer end_stack'.
17078         * threads.h
17079         (MonoThreadCallbacks): Removed; this was only used by the debugger.
17080         (mono_install_thread_callbacks): Likewise.      
17082         * threads.c (mono_thread_callbacks): Removed.
17083         (debugger_thread_created, debugger_thread_exited): New static functions.
17084         (start_wrapper): Call debugger_thread_created().
17085         (thread_cleanup): Call debugger_thread_exited().
17086         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
17087         (mono_debugger_init_threads): New public function.
17088         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
17089         iterate directly over the `threads' hash and also use proper locking.
17091         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
17093         * mono-debug-debugger.h
17094         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
17096 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
17098         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
17099         argument type=array. Fixes #78057.
17101 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
17103         * culture-info-table.h : regenerated. Fixed bug #69652.
17105 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
17107         * loader.c metadata.c: Reapply a variant r59116.
17108         
17109         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
17111         * class.c (mono_class_setup_interface_offsets): New internal function.
17113         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
17114         interfaces too. Fixes #77398.
17116         * reflection.c (encode_cattr_value): Add support for 
17117         parameter type=object, argument type=array.
17118         (load_cattr_value): Ditto. Fixes #77916.
17120         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
17121         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
17123         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
17124         a byval char array and CharSet is Ansi.
17126         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
17128 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
17130         * metadata.c: Add some locking comments.
17131         
17132         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
17133         mempool.
17134         (mono_metadata_free_method_signature): Don't free the signature itself.
17136         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
17138         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
17139         reference the same MonoImage.
17140         (mono_assembly_load_from_full): Add an assert.
17142 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
17144         * image.c (mono_image_close): Don't put the image we are about to free into the
17145         loaded_images_guid_hash.
17147         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
17148         to reduce code duplication.
17150         * marshal.c: Register the native functions called by this module as icalls, to
17151         somewhat centralize the creation of MonoMethodSignature's.
17153         * loader.c (mono_method_signature): Add a cache for method signatures.
17155         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
17156         the parameter attributes of a method.
17157         (mono_metadata_parse_method_signature_full): Refactored the computation of
17158         parameter attributes into a separate function. Also avoid one allocation in
17159         most cases.
17161         * assembly.c (mono_assembly_close): Ditto.
17163         * image.c (mono_image_close): Log trace messages with INFO level.
17165         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
17167         * image.c reflection.c: Correct reference counting of image modules.
17168         
17169         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
17170         of this function from the image mempool.
17171         
17172         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
17173         to allow more cached types to be used.
17175         * mono-debug.c (mono_debug_add_method): Appled patch from
17176         David S. Miller  <davem@sunset.davemloft.net>: Access 
17177         minfo->lexical_blocks[] entry elements using read32().
17179 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
17181         * loader.c (mono_free_method): No longer free the method header for non-dynamic
17182         methods as it is allocated from the mempool.
17184         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
17185         image mempool.
17187         * metadata-internals.h: Add comments describing the reference counting scheme
17188         used for MonoImage and MonoAssembly.
17190         * image.c assembly.c reflection.c: Rework reference counting of images and 
17191         assemblies so they are freed when the runtime is shut down. Free some 
17192         additional memory structures when an image is unloaded.
17193         
17194 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
17196         * class.c loader.c reflection.c: Allocate more data structures in
17197         the image mempool.
17199 2006-03-31  Miguel de Icaza  <miguel@novell.com>
17201         * icall.c
17202         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
17203         build on pre glib 2.4 systems.
17205 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
17207         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
17209         * icall.c: Fix some warnings.
17211 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
17213         * culture-info-table.h : regenerated.
17215 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
17217         * threads.c, object-internals.h, verify.c: changed the culture caching
17218         code to use a normal MonoArray for storage so the GC can keep track of
17219         them easily. Fixed bits of the cache logic, too and simplified the
17220         code.
17222 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
17224         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
17225         thread for non-Boehm GCs.
17227 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
17229         * domain.c, object.c, domain-internals.h: reduce the amount of memory
17230         needed to keep track of the data for static fields.
17232 2006-03-29  Raja R Harinath  <rharinath@novell.com>
17234         Fix #75172
17235         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
17236         for interface classes.  Use 'num_methods' instead.
17237         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
17238         before using '->vtable_size' field.
17240 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
17242         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
17243         doesn't contain managed pointers, so use a normal hashtable.
17245 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
17247         * reflection.c, class-internals.h, domain.c: fixed handling of types
17248         used as values for objects in custom attributes (bug #77915):
17250 2006-03-24  Martin Baulig  <martin@ximian.com>
17252         * class.c (mono_class_setup_fields): Added support for generic
17253         instances; fixes #77580.
17255 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17257         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
17259 2006-03-24  Dick Porter  <dick@ximian.com>
17261         * file-io.c (get_file_attributes): More stat macro breakage.
17262         Fixes bug 77759.
17264 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
17266         * profiler.c: added the file=filename option in the default profiler
17267         to output the profile data to filename.
17269 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17271         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
17272         bug #77877.
17274 2006-03-22  Martin Baulig  <martin@ximian.com>
17276         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
17277         allocated `MonoClassField *' in `fb->handle'.
17279 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
17281         * class.c, image.c, metadata-internals.h: implemented new mechanism to
17282         allocate interface ID to save memory and allow better ID reuse on
17283         appdomain unload. setup_generic_vtable () removal from Martin.
17285 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
17287         * object.h, appdomain.c, domain.c, exception.c, icall.c,
17288         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
17289         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
17290         write barriers for reference stores with managed objects accessed with
17291         C structures in the runtime and in embedding programs.
17293 2006-03-20  Raja R Harinath  <rharinath@novell.com>
17295         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
17296         'interface_id' and 'max_interface_id' fields of MonoClasses
17297         representing open generic types.
17299 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
17301         * object.h, object.c, icall.c: added functions to deal with
17302         storing valuetypes that contain references in managed objects.
17303         * reflection.c, string-icalls.c, threads.c, marshal.c: small
17304         fixes and comments around uses of mono_array_addr ().
17306 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
17308         * object.h, icall.c, monitor.c: object.GetHashCode ()
17309         implementation that supports the moving garbage collector.
17311 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
17313         * icall.c, threads-types.h, threads.c: implemented finalizer for
17314         LocalDataStoreSlot.
17316 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
17318         * metadata.c (mono_type_size): Add a fixme.
17319         (mono_type_stack_size): Ditto.
17321         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
17322         'type_forwarders' field.
17324         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
17325         attribute from net 2.0.
17327         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
17328         from class.c.
17330         * class.c (mono_class_setup_fields): Fix a warning.
17331         
17332         * class.c (mono_class_from_name): Add support for assemblyref entries
17333         in the EXPORTEDTYPE table.
17335         * reflection.c: Add support for handling type forwarders under net 2.0.
17337         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
17338         
17339 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
17341         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
17342         overwriting entries in ModuleBuild->types, also clean up the code
17343         a little. Fixes #77774.
17345 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
17347         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
17348         load friend assembly info when present.
17350 2006-03-14  Raja R Harinath  <rharinath@novell.com>
17352         Fix crasher on gtest-158.cs.
17353         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
17354         the return value if the MonoClass we want is yet in an
17355         inconsistent state.
17356         * class.c (mono_class_create_from_typedef): Add an comment
17357         explaining an order dependency between mono_class_setup_parent and
17358         mono_class_setup_mono_type.
17360 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
17362         * class.c: documentation updates and events bug fix.
17364 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
17366         * class.c: some cleanup, locking fixes.
17368 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
17370         * class.c: fix the generics code to setup nested
17371         type info to the instantiated type (bug #77770).
17373 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
17375         * marshal.c: fixed a few type correctness issues.
17377 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
17379         * loader.c: the Set/Get/Addrtess array methods should be public.
17381 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
17383         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
17384         
17385         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
17386         info->wrapper.
17388 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
17390         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
17392         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
17394         * mempool.c (mono_mempool_alloc): Speed this up a bit.
17395         (mono_mempool_alloc0): Ditto.
17397 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17399         * socket-io.c:
17400         (create_object_from_sockaddr): it was allocating 4 extra bytes
17401         for the AF_UNIX data. Fixes bug #77747.
17403 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
17405         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
17407 2006-03-09  Dick Porter  <dick@ximian.com>
17409         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
17410         Fixes bug 76966 again.
17412 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
17414         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
17415         names from r57532
17416         * appdomain.c: Bumped corlib version to 48 (due to r57532)
17418 2006-03-07  Martin Baulig  <martin@ximian.com>
17420         * object.c
17421         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
17423 2006-03-07  Martin Baulig  <martin@ximian.com>
17425         * class.c
17426         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
17427         regression introduced in r56970; see gtest-252.cs.
17429         * loader.c (mono_get_method_constrained): Correctly handle generic
17430         methods; see gtest-253.cs.
17432 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
17434         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
17436 2006-03-04  Martin Baulig  <martin@ximian.com>
17438         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
17439         compute the parent type at runtime, just like we're already doing
17440         it for interfaces.
17442         * reflection.c
17443         (mono_reflection_bind_generic_parameters): Don't compute the
17444         parent type anymore.
17446         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
17448 2006-03-04  Martin Baulig  <martin@ximian.com>
17450         * mono-debug-debugger.h
17451         (mono_debugger_create_notification_function): Allocate memory at
17452         runtime and return a pointer to it.
17454 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
17456         * assembly.c: Fix windows build.
17457         
17458         * assembly.c: Fix build.
17460         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
17462         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
17463         
17464 2006-03-03  Dick Porter  <dick@ximian.com>
17466         * process.c
17467         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
17468         Check parameters before dereferencing them.  Fixes Aaron's part of
17469         bug 77393.
17471 2006-03-03  Raja R Harinath  <rharinath@novell.com>
17473         Fix performance regression.
17474         * loader.c (find_method_in_class): Add 'from_class' argument.
17475         Rename 'klass' argument to 'in_class'.  The signature is compared
17476         against the method in 'in_class', and the corresponding method is
17477         returned from 'from_class'.
17478         (find_method): Walk both 'in_class' and 'from_class' in parallel.
17479         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
17480         type definition and generic instantiation in parallel.
17481         (mono_get_method_constrained): Update to changes.
17483 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
17485         * threads.c: make sure the domain is correct, too when doing
17486         mono_thread_attach ().
17488 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
17490         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
17491         windows. Fixes #77683.
17493 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
17495         * object.h, *: introduced specific way to set elements of an array
17496         of references to be used as write barrier. Still need to audit the
17497         uses of mono_array_addr.
17499 2006-03-01  Miguel de Icaza  <miguel@novell.com>
17501         * object-internals.h: New field to cache the assmebly name, patch
17502         from Tambet Ingo (tambet@ximian.com)
17504 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
17506         * decimal.h, class-internals.h, metadata-internals.h,
17507         file-io.h: mark a few function declarations as internal, to
17508         reduce the number of PLT entries.
17510 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17512         * file-io.c: fix typo in warning message.
17514 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
17516         * loader.c: on unix, lookup the "*A" version of a function
17517         if charset is auto as a second option before failing.
17519 2006-02-28  Raja R Harinath  <rharinath@novell.com>
17521         * class.h (mono_class_inflate_generic_method): Revert to two
17522         argument version.
17523         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
17524         (mono_class_inflate_generic_method_full): Add.
17525         * class.c (mono_class_inflate_generic_method_full): Rename from
17526         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
17527         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
17528         * loader.c, reflection.c: Update to changes.
17530 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
17532         * icall.c: const fixes and small improvements.
17534 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17536         * threadpool.c: for asynchronous connect(), enable the same workaround
17537         for BSD 6 as for the Mac. Fixes bug #77637.
17539 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
17541         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
17542         formatted classes. Fixes #77524.
17544 2006-02-24  Raja R Harinath  <rharinath@novell.com>
17546         * class.c (inflate_generic_type): Add a couple more
17547         micro-optimizations.
17548         (inflate_generic_context): Don't use the 'gmethod' from
17549         'inflate_with'.
17550         (mono_class_inflate_generic_method): If the method has generic
17551         parameters, but the passed-in context doesn't have a 'gmethod',
17552         create one.  Use the possibly simplified generic instantiation
17553         from the declaring class instead of the one passed in.
17555 2006-02-24  Raja R Harinath  <harinath@gmail.com>
17557         Make generic method signature and method header handling lazy.
17558         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
17559         (inflate_generic_header): Likewise.
17560         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
17561         parameter to avoid inflating types.
17562         (mono_get_inflated_method): Empty out.
17563         * class.h (mono_class_inflate_generic_method): Update to changes.
17564         * loader.c (mono_get_method_from_token): Don't parse signature for
17565         generic methods, nor methods of generic classes.
17566         (mono_method_signature): Rename from 'mono_method_signature'.
17567         Inflate signature on demand.
17568         (mono_method_get_header): Inflate method header on demand.
17569         * reflection.c: Update to changes.
17571 2006-02-23  Raja R Harinath  <rharinath@novell.com>
17573         * metadata.c (mono_metadata_inflate_generic_inst): If the
17574         instantiation is closed, don't bother expanding it in the new
17575         context.
17576         * class.c (inflate_generic_class): If the generic instantiation
17577         doesn't change after inflation, return the argument itself.
17578         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
17579         Add bounds checks.
17580         (inflate_generic_context): If neither the generic class nor the
17581         generic method instantiations change, return the original context.
17582         * reflection.c (mono_method_get_object): Do
17583         'mono_get_inflated_method' before accessing the ->klass field.
17584         (inflate_mono_method): Don't create a MonoGenericMethod unless
17585         necessary.
17586         (inflate_method): Don't pass a constructed type as the declaring
17587         type of a methodbuilder.
17589 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
17591         * object.c: fix memory overwrite.
17593 2006-02-22  Dick Porter  <dick@ximian.com>
17595         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
17596         it doesn't work any more.
17597         (mono_threads_request_thread_dump): Fix unused variable warnings.
17599 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
17601         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
17602         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
17603         the public header file.
17605 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
17607         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
17609 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
17611         * class-internals.h, object.c: reduce the size of MonoVTable
17612         and store the interface_offsets array at negative offsets.
17614 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
17616         * metadata.c: tweak table descriptors data structures to reduce
17617         size and runtime relocations.
17619 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
17621         * marshal.c: fix some types and opcodes to be type-safe
17622         in marshaling wrappers.
17624 2006-02-21  Ankit Jain  <jankit@novell.com>
17626         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
17628 2006-02-21  Raja R Harinath  <rharinath@novell.com>
17630         * metadata.c (get_constraints): Relax debugging checks for monodis.
17632 2006-02-21  Ankit Jain  <jankit@novell.com>
17634         * metadata.c (mono_metadata_load_generic_params): Move the code
17635         checking for ambiguous generic params from here to mono/dis/get.c
17636         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
17638 2006-02-21  Raja R Harinath  <harinath@gmail.com>
17640         Fix assertion triggered when compiling nemerle.
17641         * class.c (mono_get_shared_generic_inst): Rename from
17642         get_shared_inst and make non-static.
17643         * loader.c (mono_get_shared_generic_method): New.  Used to create
17644         the MonoGenericContext-equivalent of a MonoGenericContainer.
17645         (mono_get_method_from_token): Initialize the 'context' field of
17646         the created MonoGenericContainer.
17647         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
17648         * metadata.c (get_constraints): Add sanity check.
17649         * class-internals.h: Add new internal methods.
17651         * reflection.c (verify_safe_for_managed_space): New sanity check.
17652         Currently checks that owner-less generic parameters aren't allowed
17653         in managed space.
17654         (mono_type_get_object): Use it.
17655         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
17656         that are now in mono_type_get_object.
17657         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
17659 2006-02-19  Raja R Harinath  <harinath@gmail.com>
17661         * metadata.c (mono_type_create_from_typespec): Rename from
17662         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
17663         argument and caching of types in the generic container.
17664         (unwrap_arrays, find_generic_param): Remove.
17665         * metadata-internals.h: Update.
17666         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
17668 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
17670         * class.c (mono_class_get_exception_for_failure): Fix a warning.
17672         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
17673         return values. Fixes #77581.
17675         * class.c (mono_fnptr_class_get): Switch name and name_space.
17677         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
17678         classes and add support for [In, Out] attributes.
17679         (mono_marshal_free_asany): Ditto. Fixes #77524.
17681 2006-02-18  Raja R Harinath  <harinath@gmail.com>
17683         * class.c (mono_class_from_generic_parameter): Make more robust to
17684         incomplete MonoGenericContainers from monodis.
17686 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
17688         * class-internals.h: added some more exception types.
17689         * class.c, metadata.c: added a few checks to handle missing
17690         types.
17692 2006-02-17  Raja R Harinath  <rharinath@novell.com>
17694         Use owner-less generic-params some more.
17695         * class.c (my_mono_class_from_generic_parameter): Remove.
17696         (mono_class_from_generic_parameter): Handle null image,
17697         param->name and param->owner.
17698         (mono_class_from_mono_type): Update.
17699         (mono_class_create_from_typespec): Remove 'container' parameter.
17700         If that parameter is non-null, the result is always inflated by
17701         'mono_class_get_full' anyway.
17702         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
17703         parameter.
17704         (mono_class_get_full): Update.
17706         * class.c (inflate_generic_type) [GENERICINST]: If the generic
17707         instance is not open, don't bother inflating.
17708         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
17709         parse metadata for inflated classes.
17710         (_mono_class_get): Change GenericContext* parameter to
17711         GenericContainer*.
17712         (mono_class_create_from_typespec): Likewise.  Simplify, and
17713         implement trivially.  All the cases are handled in
17714         mono_class_from_mono_type.  Don't inflate returned class.
17715         (mono_class_get_full): Delegate GENERICINST optimization to
17716         inflate_generic_type.
17717         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
17719 2006-02-16  Dick Porter  <dick@ximian.com>
17721         * socket-io.c (create_object_from_sockaddr): Fix typo.
17722         (create_sockaddr_from_object): Check array lengths before
17723         potentially accessing items off the end.
17724         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
17725         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
17726         (ves_icall_System_Net_Sockets_Socket_Send_internal)
17727         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
17728         length checks to avoid wraparound overflows.
17729         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
17730         contents of the array of sockets
17731         (hostent_to_IPHostEntry2)
17732         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
17733         Check return value of inet_ntop ().
17734         (addrinfo_to_IPHostEntry): Fix typo
17736 2006-02-16  Raja R Harinath  <rharinath@novell.com>
17738         Type metadata parsing doesn't use generic-instantiation information.
17739         * metadata.c (mono_metadata_parse_array_full): Change
17740         MonoGenericContext* parameter to MonoGenericContainer*.
17741         (mono_metadata_parse_type_full): Likewise.
17742         (mono_type_create_from_typespec_full): Likewise.
17743         (mono_metadata_parse_mh_full): Likewise.
17744         (mono_metadata_parse_generic_inst): Likewise.
17745         (do_mono_metadata_parse_generic_class): Likewise.
17746         (do_mono_metadata_parse_type): Likewise.
17747         * metadata-internals.h: Update to changes.
17748         * class.c (mono_class_find_enum_basetype): Likewise.
17749         (mono_class_setup_fields): Likewise.
17750         (mono_class_create_from_typespec): Likewise.
17751         * loader.c (method_from_methodspec): Likewise.
17752         (mono_get_method_from_token): Likewise.
17753         (mono_method_get_header): Likewise.
17755 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
17757         * marshal.c: handle additional GENERICINST case (patch from
17758         Thong Nguyen <tum@veridicus.com>).
17759         Fix a few cases where LDIND_I/STIND_I was used for references.
17761 2006-02-16  Raja R Harinath  <rharinath@novell.com>
17763         * reflection.c (mono_reflection_get_token): Remove unused variable.
17765 2006-02-16  Martin Baulig  <martin@ximian.com>
17767         * reflection.c (mono_reflection_get_token): Add support for fields
17768         in instantiated generic types.
17770         * icall.c
17771         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
17773 2006-02-15  Martin Baulig  <martin@ximian.com>
17775         * icall.c
17776         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
17777         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
17778         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
17779         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
17781 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
17783         * class.c, metadata.c, metadata.h, object.c, icall.c,
17784         marshal.c: changed mono_type_get_underlying_type () to do
17785         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
17786         Fixed handling of instantiated generic valuetypes (bug #75479).
17788 2006-02-15  Raja R Harinath  <rharinath@novell.com>
17790         * metadata.c (mono_metadata_decode_signed_value): Simplify.
17791         Delegate to mono_metadata_decode_value, and work on the returned value.
17793         * icall.c (ves_icall_MonoType_GetGenericArguments):
17794         Add consistency check here too.
17795         
17796 2006-02-15  Ankit Jain  <jankit@novell.com>
17798         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
17799         char/short etc.
17801 2006-02-15  Ankit Jain  <jankit@novell.com>
17803         * metadata.c (mono_metadata_decode_signed_value): New function to decode
17804         signed values, used only for representing lower bounds of arrays.
17805         (mono_metadata_parse_array_full): Use new
17806         mono_metadata_decode_signed_value to decode lower bounds.
17808 2006-02-14  Martin Baulig  <martin@ximian.com>
17810         * reflection.c
17811         (mono_reflection_get_token): Support "MonoGenericMethod" and
17812         "MonoGenericCMethod" and allow generic instances / methods.
17814 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
17816         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
17817         to obtain the terminal size using an ioctl.
17819         * object.c (mono_nullable_init): Revert this as nullable reference
17820         types are not valid.
17821         (mono_nullable_box): Ditto.
17823 2006-02-09  Dick Porter  <dick@ximian.com>
17825         * threads.c (mono_thread_detach): Drop a reference to the thread
17826         we're detaching.
17828 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
17830         * object.c (mono_nullable_init): Handle nullable reference types.
17831         (mono_nullable_box): Ditto. Fixes #77446.
17833 2006-02-07  Martin Baulig  <martin@ximian.com>
17835         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
17837 2006-02-07  Ankit Jain  <jankit@novell.com>
17839         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
17840         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
17841         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
17842         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
17843         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
17844         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
17846 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
17848         * class.c (mono_class_create_generic): Set type_token as well.
17850         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
17851         compatible with MS.
17853 2006-02-02  Martin Baulig  <martin@ximian.com>
17855         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
17856         has never been used so far.
17858 2006-02-02  Martin Baulig  <martin@ximian.com>
17860         * mono-debug-debugger.h: Changed comment at the top of this file;
17861         the header is not installed, but it's safe to #include it from
17862         within the JIT.
17864         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
17865         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
17867 2006-02-02  Martin Baulig  <martin@ximian.com>
17869         * mono-debug.h
17870         (MonoSymbolTable): Removed the `metadata_info' field.
17872         * mono-debug.c
17873         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
17875         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
17876         (mono_debugger_add_builtin_types): Removed.
17877         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
17878         (mono_debugger_create_notification_function): We now operate on a
17879         pre-allocated area; take a `gpointer' and return `void'.
17881         * mono-debug-debugger.c
17882         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
17883         (mono_debugger_add_builtin_types): Removed.
17885 2006-02-02  Martin Baulig  <martin@ximian.com>
17887         * threads.c (mono_debugger_create_all_threads): New public method.
17889 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
17891         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
17892         breaks on several platforms.
17894 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
17896         * assembly.c: the VS.NET build doesn't supply default values for
17897         MONO_ASSEMBLIES and MONO_CFG_DIR.
17899 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
17901         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
17902         helper function.
17904         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
17906         * loader.c (method_from_memberref): Fix a warning.
17908         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
17910         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
17911         with explicit layout. Fixes #77433.
17913 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
17915         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
17916         max_interface_id is initialized before using it. Fixes #77398.
17917         (ves_icall_Type_GetInterfaces): Ditto.
17919 2006-01-30  Raja R Harinath  <rharinath@novell.com>
17921         * metadata.c (mono_metadata_parse_method_signature_full): Don't
17922         allocate memory for parameter attributes when parsing memberref
17923         signatures.
17924         * loader.c (mono_loader_set_error_method_load): Don't warn.
17925         (method_from_memberref): Ensure MissingMethodException gets thrown
17926         if method is not found.  Make warning more informative.
17928 2006-01-29  Raja R Harinath  <harinath@gmail.com>
17930         Fix #77397
17931         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
17932         return true if is byref.
17933         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
17934         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
17935         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
17937 2006-01-27  Raja R Harinath  <rharinath@novell.com>
17939         Fix tests/find-method.2.il
17940         * loader.c (find_method, find_method_in_class): Remove is_inflated
17941         argument.  Revert 2006-01-18 change.
17942         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
17943         is generic, search for method in its generic definition.
17944         * class.c (mono_class_setup_vtable_general): Print generic
17945         arguments of generic types in debugging printf.
17947 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
17949         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
17951         * threads.c (mono_threads_request_thread_dump): New helper function.
17953 2006-01-25  Raja R Harinath  <rharinath@novell.com>
17955         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
17957 2006-01-25  Ankit Jain  <jankit@novell.com>
17959         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
17960         move definition to ..
17961         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
17962         
17963 2006-01-25  Ankit Jain  <jankit@novell.com>
17964             Raja R Harinath  <rharinath@novell.com>
17966         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
17967         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
17968         as necessary.
17970 2006-01-25  Martin Baulig  <martin@ximian.com>
17972         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
17973         `MonoDebuggerThread' into debug-debugger.c.
17975 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
17977         * profiler.c: fix printing of data.
17979 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
17981         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
17982           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
17984 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
17986         * object.c: fix deadlock related to string interning.
17988 2006-01-23  Martin Baulig  <martin@ximian.com>
17990         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
17992         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
17994 2006-01-23  Martin Baulig  <martin@ximian.com>
17996         * mono-debug.h: Moved the prototypes of some functions which are
17997         used by the JIT here from mono-debug-debugger.h.
17999 2006-01-21  Martin Baulig  <martin@ximian.com>
18001         * Makefile.am: Don't install mono-debug-debugger.h.
18003 2006-01-21  Martin Baulig  <martin@ximian.com>
18005         * mono-debug-debugger.h: Enforce the private status of this header
18006         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
18007         Moved some stuff from mono-debugger-jit-wrapper.h here.
18009 2006-01-20  Raja R Harinath  <rharinath@novell.com>
18011         * class.c (mono_class_from_typeref): Add a sanity test to help
18012         catch lack of assembly load/search hooks.
18014 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
18016         * marshal.c (emit_struct_conv): Relax the fields with same offset
18017         check even more. Fixes #77230.
18019 2006-01-18  Martin Baulig  <martin@ximian.com>
18021         * loader.c (find_method_in_class): Added `gboolean is_inflated'
18022         argument; if false, we compare the uninstantiated signatures.
18023         (method_from_memberref): Compare the uninstantiated signatures;
18024         fixes #76417.
18026 2006-01-18  Robert Jordan  <robertj@gmx.net>
18028         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
18029         Clear the weak link. Fixes bug #77170.
18031         * gc.c (mono_gchandle_free):
18032         Reflect *-gc.c changes (tiny optimization).
18034 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
18036         * metadata.c (mono_metadata_signature_dup): Applied patch from
18037         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
18038         Fixes #77288.
18040 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
18042         * marshal.c (emit_struct_conv): Allow fields with the same offset when
18043         marshalling from native to managed code. Fixes #77230.
18045 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18047         * threadpool.c: fix problem (Mac only) when more than one asynchronous
18048         connect. Fixes bug #77020.
18050 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
18052         * class.c: fixed id assignement for nested interfaces (bug #77275).
18053         Added also better info for --print-vtable debugging.
18055 2006-01-12  Martin Baulig  <martin@ximian.com>
18057         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
18058         interfaces on-the-fly; fixes #76625.
18060         * class-internals.h
18061         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
18062         don't need that anymore.
18064 2006-01-12  Miguel de Icaza  <miguel@novell.com>
18066         * socket-io.c
18067         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
18068         To avoid initing the nested_classes when not needed I turned the
18069         PeerCredData as a toplevel internal class, as it has to be shared
18070         anyways. 
18072         Fixes the CASA issue.
18074 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
18076         * domain.c: Accessors for MonoJitInfo
18078         * profiler-private.h: Add jitinfo to the end jit hook
18080         * profiler.[ch]: Define new hooks, called after jitting which give
18081         the MonoJitInfo that was compiled
18083 2006-01-10  Martin Baulig  <martin@ximian.com>
18085         * class.c (mono_class_setup_events): Add support for generic
18086         classes; fixes #76440.
18088 2006-01-06  Raja R Harinath  <rharinath@novell.com>
18090         Fix #77160.
18091         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
18092         on passed-in method.
18094 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
18096         * object.c (mono_runtime_invoke_array): Add Nullable support.
18098         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
18100 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
18102         * file-io.c: Don't consider sockets as directory and avoid an endless
18103         loop. Fix bug #76966.
18105 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
18107         * object.c (mono_nullable_init): New helper function.
18108         (mono_nullable_box): Ditto.
18110         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
18112         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
18114         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
18115         
18116 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
18118         * class.c (mono_class_is_assignable_from): Make T assignable to 
18119         Nullable<T>.
18121 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
18123         * appdomain.c: Bump corlib version to 46.
18124         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
18125         serialization purpose) and changed ves_icall_System_Reflection_
18126         Assembly_get_code_base signature to accept a boolean (to escape, or 
18127         not, the assembly code base).
18129 2005-12-23  Dick Porter  <dick@ximian.com>
18131         * icall.c: 
18132         * threads-types.h: 
18133         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
18134         CreateEvent icall now returns "created" boolean parameter.
18136 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
18138         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
18139         #76967.
18141         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
18142         when attr_klass is an interface. Fixes #77045.
18144 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
18146         * marshal.c (emit_struct_conv): Fix previous patch.
18147         
18148         * marshal.c (emit_struct_conv): Add a check for fields with the same
18149         offset.
18151 2005-12-20  Raja R Harinath  <rharinath@novell.com>
18153         Fix regression in Mono.C5.
18154         * class.c (mono_class_create_generic): If 'klass' is an interface
18155         set up the interface offsets.
18156         (mono_class_is_assignable_from): Don't throw away generic arguments.
18158 2005-12-19  Raja R Harinath  <rharinath@novell.com>
18160         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
18161         type parameters.
18163 2005-12-15  Raja R Harinath  <rharinath@novell.com>
18165         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
18166         dead store.
18167         (do_mono_metadata_parse_generic_class): Don't pass the current
18168         generic context when parsing the type being instantiated: it
18169         cannot use it, anyway.
18171         * loader.c (method_from_memberref): Don't inflate a signature if
18172         it doesn't contain any type parameters.
18174 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
18176         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
18178 2005-12-14  Martin Baulig  <martin@ximian.com>
18180         * class.c
18181         (mono_type_get_name_recurse): Don't return null for type
18182         parameters and open generic classes.
18183         (mono_class_setup_methods): Don't exclude generic instances.
18184         (mono_get_unique_iid): Use different IDs for different
18185         instantiations of the same generic type.
18186         (mono_class_setup_vtable): Only use setup_generic_vtable() for
18187         open generic instances; create a normal vtable for closed generic
18188         instances.
18189         (mono_class_setup_vtable_general): We're now also called for
18190         closed generic instances.
18192         * reflection.c
18193         (mono_reflection_bind_generic_parameters): Correctly use
18194         mono_metadata_lookup_generic_inst() everywhere.
18196 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
18198         * object.c (mono_class_create_runtime_vtable): Call 
18199         mono_class_setup_vtable ().
18201         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
18202         function.
18203         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
18204         #76959.
18206         * loader.c (mono_loader_set_error_type_load): Print the type load
18207         warnings to the console so they are more visible to the user.
18208         (mono_loader_set_error_method_load): Ditto.
18210         * reflection.c (ensure_runtime_vtable): Revert the last change as it
18211         is still broken.
18212         
18213         * reflection.c (ensure_runtime_vtable): Fix build.
18215         * reflection.c (ensure_runtime_vtable): Disable an optimization which
18216         doesn't work in all cases.
18218 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
18220         * object.c (mono_array_new_full): Treat a single dimensional array
18221         with 0 lower bounds as an szarray. Fixes #76973.
18223         * reflection.c (custom_attr_visible): Really fix this.
18225 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
18227         * reflection.c (custom_attr_visible): Allow nested public attributes
18228         as well.
18230         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
18231         interface check.
18233 2005-12-12  Raja R Harinath  <harinath@gmail.com>
18235         * class.c (set_generic_param_owner): Delete.
18236         (mono_class_create_from_typedef): Don't set ->owner field of
18237         generic parameters to "param containers" of enclosing classes.
18238         * reflection.c (mono_reflection_initialize_generic_parameter):
18239         Likewise.
18241 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
18243         * reflection.c (custom_attr_visible): Fix build.
18245 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
18247         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
18248         private attributes.
18249         
18250         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
18251         handling of null parameter defaults.
18253 2005-12-09  Raja R Harinath  <rharinath@novell.com>
18255         * class.c (mono_class_from_generic_parameter): Don't set
18256         klass->generic_container.
18257         (my_mono_class_from_generic_parameter): Likewise.
18259 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
18261         * reflection.c (load_public_key): Fix a warning.
18262         (method_encode_code): Fix unaligned accesses.
18264 2005-12-07  Martin Baulig  <martin@ximian.com>
18266         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
18268         * reflection.c
18269         (write_generic_param_entry): Encode our custom attrs.
18271         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
18273 2005-12-07  Martin Baulig  <martin@ximian.com>
18275         * reflection.c (encode_new_constraint): Removed; we don't use the
18276         `NewConstraintAttribute' anymore.
18278 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
18280         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
18281         not fire a TypeResolve event when Assembly.GetType () is called.
18283 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
18285         Beginning of support for nullable types in the runtime. Parts of
18286         this patch are from Martin.
18288         * appdomain.c (MONO_CORLIB_VERSION): Bump
18290         * domain.c (mono_init_internal): get the nullable type
18292         * class.c (mono_class_is_nullable): New method
18293         (mono_class_get_nullable_param): New mehod
18294         (mono_class_create_generic): In types T? set cast_class to T
18296         * class-internals.h (MonoDefaults): new nullable default class
18297         (mono_class_get_nullable_param, mono_class_get_nullable_param):
18298         new methods.
18300 2005-12-05  Raja R Harinath  <rharinath@novell.com>
18302         * metadata.c (select_container): New.  Refactor code to select the
18303         appropriate GenericContainer given the type of generic parameter
18304         we are looking for.
18305         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
18306         not a MonoGenericContext.  Use select_container.  Update parameters.
18307         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
18308         and MONO_TYPE_MVAR.
18309         (unwrap_arrays): Remove duplicate tests.
18310         (find_generic_param): Rename from 'has_same_context'.  Now walks a
18311         generic instantiated class to find any arguments that are generic
18312         parameters.
18313         (mono_type_create_from_typespec_full): Use find_generic_param to
18314         avoid evicting some generic instantiations from the typespec
18315         cache.
18317 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
18319         * reflection.c: fixed writing of doubles on ARM FPA.
18321 2005-12-02  Robert Jordan  <robertj@gmx.net>
18323         * icall.c: Fixed EventInfo.ReflectedType (#76829).
18325 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18327         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
18328         least on SUSE 10 they are not the same (on debian, they are just the
18329         same thing).
18331 2005-12-01  Raja R Harinath  <rharinath@novell.com>
18333         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
18334         DeclaringType for VARs and MVARs.
18335         * class.c (set_generic_param_owner): Fix initialization of owner
18336         fields.
18338 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
18340         * icall.c: fixed Enum.ToObject() to correctly convert the values.
18342 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18344         * threadpool.c: workaround for a bug that shows up on the Mac:
18345         select()+connect() on a blocking socket is not like it should
18346         be, so we proceed to connect() in that case, wasting the I/O
18347         threadpool thread until connect succeedes. Fixes bug #75436.
18349 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18351         * threadpool.c: fix typo when setting file descriptor states.
18353 2005-11-28  Raja R Harinath  <rharinath@novell.com>
18355         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
18356         * metadata.c (mono_metadata_parse_method_signature_full): Don't
18357         create a temporary signature container.
18358         (mono_metadata_parse_generic_param): Update to changes.
18359         (mono_type_create_from_typespec_full): Update to changes.
18360         * loader.c (method_from_memberref): Don't use a
18361         MonoGenericContainer while parsing a memberref signature.
18362         (method_from_methodspec): Remove dead-store of the 'container'
18363         variable.  It's overwritten before use.
18365         * metadata.c (mono_type_create_from_typespec_full): Make debugging
18366         checks tighter.
18367         (mono_metadata_parse_generic_param): Likewise.
18368         * loader.c (find_method_in_class): Does not need a
18369         MonoGenericContainer.  Use 'mono_method_signature' rather than
18370         'mono_method_signature_full'.
18371         (find_method, mono_get_method_constrained, method_from_memberref):
18372         Update to changes.
18374         * metadata.c (mono_type_create_from_typespec_full): Ensure that
18375         owner-less generic-parameters are never evicted from the typespec
18376         cache.
18378         * loader.c (method_from_memberref): Don't use the current context
18379         when parsing signatures.
18380         (method_from_methodspec, mono_get_method_from_token): Update to changes.
18382         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
18383         side-effects in g_assert.
18384         * loader.c (mono_get_method_from_token): Resolve klass earlier so
18385         that we don't potentially lose information.
18387 2005-11-26  Dick Porter  <dick@ximian.com>
18389         * icall.c:
18390         * threads.c: icalls to implement basic (ie, not named)
18391         System.Threading.Semaphore.
18393 2005-11-24  Dick Porter  <dick@ximian.com>
18395         * process.c
18396         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
18397         Use GetProcessId() if it's available.
18399 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
18401         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
18403 2005-11-23  Raja R Harinath  <rharinath@novell.com>
18404             Ankit Jain  <jankit@novell.com>
18406         * loader.c (mono_get_method_from_token): Initialize 'method' field
18407         of all generic parameters before parsing the signature.  Remove
18408         code that "fixed"-up MVAR references.
18410 2005-11-23  Ankit Jain  <jankit@novell.com>
18412         * metadata.c (mono_metadata_has_generic_params):
18413         (mono_metadata_load_generic_param_constraints):
18414         (mono_metadata_load_generic_params): Move duplicate code ...
18415         (mono_metadata_get_generic_param_row): ... here. Returns the
18416         first row-id in GenericParam table for a given owner (token).
18417         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
18418         prototype.
18420 2005-11-23  Raja R Harinath  <rharinath@novell.com>
18421             Ankit Jain  <jankit@novell.com>
18423         * metadata.c (mono_metadata_class_equal): Pass signature_only when
18424         comparing VARs too.
18425         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
18426         type->data.generic_param only if the type is an MVAR.
18427         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
18428         leak owner-less VARs and MVARs into managed space.
18430 2005-11-21  Martin Baulig  <martin@ximian.com>
18432         * class-internals.h
18433         (MonoMethod): Moved the `generic_container' here from
18434         `MonoMethodNormal' since we now also need it for
18435         `MonoMethodPInvoke';
18436         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
18437         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
18438         an union containing both `MonoMethodNormal' and
18439         `MonoMethodPInvoke'.
18441         * loader.c
18442         (mono_get_method_from_token): Allow implementing generic methods
18443         as interncalls.
18445         * threads.c
18446         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
18447         icall.
18449 2005-11-17  Dick Porter  <dick@ximian.com>
18451         * icall.c: 
18452         * process.h: 
18453         * process.c: Split the Process Start_internal icall into
18454         ShellExecuteEx_internal and CreateProcess_internal, which are
18455         called depending on whether UseShellExecute is true.  Fixes bug
18456         76670.
18458         * appdomain.c (MONO_CORLIB_VERSION): Incremented
18460 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
18462         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
18463         'msize' parameters, use the information in 'mspec' instead.
18464         (emit_object_to_ptr_conv): Ditto.
18466         * marshal.c (emit_struct_conv): Handle explicit layout structs with
18467         fields out of order. Fixes #76733.
18469 2005-11-17  Ankit Jain  <jankit@novell.com>
18471         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
18473 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
18475         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
18476           bug #76575.
18478 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
18480         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
18481         for types with non-auto layout. Fixes #76717.
18483 2005-11-16  Ankit Jain  <jankit@novell.com>
18485         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
18486         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
18487         if generic_context is null.
18488           (mono_metadata_generic_param_equal): param->owner can be null.
18489           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
18490         null.
18492 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
18494         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
18495         the correct value.
18497 2005-11-15  Martin Baulig  <martin@ximian.com>
18499         * object.c (set_value): Use mono_class_from_mono_type() instead of
18500         the hack for generic instances; fixes #76136.
18502 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
18504         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
18505         fields.
18507         * image.c (load_metadata_ptrs): Initialize the new fields.
18509         * reflection.c (create_dynamic_mono_image): Ditto.
18511         * reflection.c (build_compressed_metadata): Use the new fields.
18513         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
18514         icall.
18516         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
18517         icall.
18518         
18519 2005-11-15  Ankit Jain  <jankit@novell.com>
18520             Raja R Harinath  <harinath@gmail.com>
18522         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
18523         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
18524         new per-generic_container cache if the cached MonoType's context matches
18525         the current context.
18526           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
18527         to the expected context.
18528           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
18530 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18532         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
18533         we changed the signature of an icall.
18534         * icall.c: Modify to mono_double_ParseImpl return true/false 
18535         depending on the success, instead of throwing the exception. This will
18536         help us in Double.TryParse methods.
18537         
18538 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
18540         * marshal.c (emit_marshal_object): Throw an exception when
18541         marshalling 'object' instead of crashing. Fixes #76696.
18543 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
18545         * class-internals.h: Add prototype for mono_type_get_full_name ().
18547 2005-11-11  Dick Porter  <dick@ximian.com>
18549         * threads.c (mono_thread_manage): Make sure the main thread has
18550         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
18552 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
18554         * loader.c (mono_loader_set_error_type_load): Log a warning to the
18555         console about the missing type.
18556         (mono_loader_set_error_method_load): Ditto.
18558 2005-11-09  Miguel de Icaza  <miguel@novell.com>
18560         * mono-config.c (mono_get_config_dir): Set the system defaults if
18561         none is specified.
18563         * assembly.c (mono_set_dirs): New API entry point to set the
18564         assembly and the config directory in one call
18566 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
18568         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
18569         the ftnptr was created from a delegate in a domain other than the
18570         current domain. Fixes #75377.
18572         * exception.h exception.c: Add mono_get_exception_not_supported ().
18574 2005-11-08  Martin Baulig  <martin@ximian.com>
18576         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
18578 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
18580         * security-manager.h: Added definitions to deal with strongname key 
18581         pairs bigger (and smaller) than 1024 bits.
18582         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
18583         adjust wrt the public key length being used.
18585 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
18587         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
18588           Windows build (r51396-51397).
18590 2005-11-03  Martin Baulig  <martin@ximian.com>
18592         * class.c (mono_class_setup_vtable_general): Also add generic
18593         methods to the vtable; fixes #76581.
18595 2005-11-01  Miguel de Icaza  <miguel@novell.com>
18597         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
18598         sure that we lookup GetString method from the System.Text.Encoding
18599         class, not the derived class or we get an empty method.
18601         Fixed class #76612.
18603 2005-10-25  Miguel de Icaza  <miguel@novell.com>
18605         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
18606         if it has been previously set (embedders). 
18608         Make mono_set_rootdir available also on Unix.
18610 005-10-24  Robert Jordan  <robertj@gmx.net>
18612         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
18614 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
18616         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
18617         only calls which are made to native code use this flag.
18619         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
18621 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
18623         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
18624         Add support for FieldBuilders.
18626 2005-10-29  Martin Baulig  <martin@ximian.com>
18628         * mono-debug.c
18629         (mono_debug_using_mono_debugger): New public method; returns
18630         whether we're running inside the debugger.
18632 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
18634         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
18635         for Method/Constructor/FieldBuilders.
18637 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
18639         * reflection.c (module_add_cattrs): Save custom attributes for global methods
18640         and fields as well.
18642 2005-10-26  Martin Baulig  <martin@ximian.com>
18644         * mono-debug-debugger.c
18645         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
18647 2005-10-24  Raja R Harinath  <harinath@gmail.com>
18649         * icall.c (base64_to_byte_array): Don't pass an out-of-range
18650         integer to isspace.
18652 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
18654         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
18655         when passing valuetypes byref. Fixes #76502.
18657 2005-10-19  Jackson Harper  <jackson@ximian.com>
18659         * profiler.c: Don't put a . in front of types that are not in a
18660         namespace.
18662 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
18664         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
18666 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
18668         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
18669         #76436.
18670         (mono_marshal_get_ldflda_wrapper): Fix a warning.
18672 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18674         * assembly.c metadata-internals.h icall.c: Define an additional
18675         parameter for mono_assembly_name_parse_full, so we can avoid creating
18676         S.R.AssemblyName.Version when no version info wasn't passed.
18677         
18678 2005-10-09  Miguel de Icaza  <miguel@novell.com>
18680         * class.c (mono_type_get_full_name): Reimplement method that was
18681         removed. 
18683         * image.c: Some docs
18685 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
18687         * profiler.c (output_newobj_profile): Fix printing of Total memory
18688         on x86.
18690 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
18692         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
18694 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
18696         * threads.c: remove debug output.
18698 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
18700         * threads.c (mono_thread_manage): Fix crashes if more than 64
18701         threads need to be aborted. Hopefully fixes #75899.
18703         * assembly.c (mono_stringify_assembly_name): New helper function.
18705         * class.c: Use mono_stringify_assembly_name instead of the similar
18706         static function.
18708         * assembly.h assembly.c: Add support for calling a postload search 
18709         hook if an assembly cannot be loaded.
18711         * appdomain.c: Register new search hooks which call the AssemblyResolve
18712         events in AppDomain. Fixes #75231
18714 2005-10-07  Martin Baulig  <martin@ximian.com>
18716         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
18717         methods without debug info.
18719 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
18721         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
18722         wrappers.
18724 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18726         * file-io.c: now that we return symlinks, use lstat and, when the file
18727         is a symbolic link, stat, to get the file attributes. Also avoid the
18728         conversion to/from utf16/external.
18730 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
18732         * class.c (mono_class_layout_fields): Compute klass->has_references
18733         correctly if an embedded valuetype is not yet initialized. Fixes
18734         #76331.
18736 2005-10-04  Martin Baulig  <martin@ximian.com>
18738         * metadata.c
18739         (mono_metadata_load_generic_param_constraints): New public
18740         function; splitted the constraints loading out from
18741         mono_metadata_load_generic_params().
18743         * class.c (mono_class_create_from_typedef): Call
18744         mono_metadata_load_generic_param_constraints() after setting up
18745         the type and creating our parent; fixes #75329.
18747 2005-10-04  Martin Baulig  <martin@ximian.com>
18749         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
18750         non-dynamic parent classes.
18752 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
18754         * file-io.c : win32 build fix (ETXTBSY seems not found).
18756 2005-10-04  Martin Baulig  <martin@ximian.com>
18758         * reflection.c
18759         (mono_image_get_methodspec_token): Make the cache actually work;
18760         fixes #75974.
18762 2005-10-04  Martin Baulig  <martin@ximian.com>
18764         * class.c (mono_class_name_from_token): Removed the unneccessary
18765         `MonoGenericContext *' argument.
18767 2005-10-04  Martin Baulig  <martin@ximian.com>
18769         * loader.c
18770         (method_from_methodspec): Make the caching work again; fixes the
18771         performance regression from #76262.
18773 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18775         * file-io.c:
18776         * file-io.h:
18777         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
18778         GetFileSystemEntries that performs the same work but without going
18779         into io-layer, locking, etc.
18781 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
18783         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
18784         ThreadState_Stopped as well. Fixes #76047.
18786 2005-09-29  Martin Baulig  <martin@ximian.com>
18788         * class.c
18789         (inflate_generic_context): If the new context has a `gmethod', set
18790         its `container' that that gmethod's `container'.
18792         * metadata.c
18793         (mono_metadata_parse_generic_param): Simplify things;
18794         `generic_container = generic_context->container;' is just fine.
18796         * loader.c (method_from_methodspec): Code cleanups.
18798 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
18800         * decimal.c: fix warning (and let gcc generate correct
18801         code on ARM with optimizations).
18803 2005-09-28  Martin Baulig  <martin@ximian.com>
18805         * loader.c
18806         (method_from_memberref): Added `MonoGenericContext *class_context'
18807         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
18808         (method_from_methodspec): If we're a memberref, use the enclosing
18809         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
18811 2005-09-28  Martin Baulig  <martin@ximian.com>
18813         * object.c (mono_runtime_invoke_array): Added support for
18814         MONO_TYPE_GENERICINST; fixes #75917.
18816 2005-09-27  Martin Baulig  <martin@ximian.com>
18818         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
18819         `k->byval_arg.type' to determine the actual type.
18821         * loader.c (method_from_methodspec): Removed some hacks.
18823 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
18825         * class-internals.h (mono_field_is_deleted): Do the test for
18826         rtspecialname before we check the actual name of the field. This
18827         prevents us from dereferencing a pointer into the string table,
18828         saving us from accessing a few pages
18830         * *.c: Replace the use of {Enter,Leave}CriticalSection with
18831         macros. This will allow a deadlock debugger to easily be plugged
18832         in.
18834 2005-09-27  Martin Baulig  <martin@ximian.com>
18836         * loader.c (method_from_methodspec): Create a "signature"
18837         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
18839 2005-09-27  Martin Baulig  <martin@ximian.com>
18841         * class.c
18842         (inflate_generic_class): Correctly set the new context's
18843         container.
18845         * loader.c
18846         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
18847         instead of a `MonoGenericContext *'.
18848         (mono_method_signature_full): Take a `MonoGenericContainer *'
18849         instead of a `MonoGenericContext *'.
18851         * metadata.c
18852         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
18853         instead of a `MonoGenericContext *'.
18854         (mono_metadata_parse_method_signature_full): Likewise.
18856 2005-09-26  Martin Baulig  <martin@ximian.com>
18858         * class.c
18859         (mono_class_from_generic_parameter): Set `klass->generic_container'
18860         (mono_class_from_generic_parameter): Likewise.
18861         (mono_bounded_array_class_get): We inherit the generic container
18862         from the element class.
18864         * loader.c
18865         (find_method, find_method_in_class): Take a `MonoGenericContext *'
18866         argument rather than computing it here.
18867         (method_from_memberref): Correctly set the generic context before
18868         parsing the signature.  Fixes #75681.
18870 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
18872         * object.c (mono_class_has_special_static_fields): Fix warnings.
18874 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18876         * assembly.c: Add parse_public_key function, to
18877         par the public keys. Also added mono_assembly_name_parse_full,
18878         to define it the parsed key should be freed or not.
18879         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
18880         to parse a long format assembly name.
18881         * metadata-internals.h: Keep mono_assembly_name_parse_full as
18882         private, since calling it to preserve the key requires
18883         freeing it manually.
18884         
18885 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
18887         * locales.c : removed HAVE_ICU part.
18889 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
18891         * object.c (mono_class_create_runtime_vtable): Avoid calling 
18892         field_is_special_static if the klass has no special static fields.
18894         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
18895         (MonoCachedClassInfo): Likewise.
18897         * object.c (mono_class_has_special_static_fields): New helper function.
18899 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18901         * class.c (mono_class_create_from_typedef): Don't call 
18902         interfaces_from_typedef_full for enums.
18903         (mono_class_create_from_typedef): Compute the base types of enums directly
18904         without calling mono_class_setup_fields ().
18905         (mono_class_find_enum_basetype): New helper function.
18907         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
18908         one place inside the string heap.
18909         
18910 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
18912         * class.c: locking fixes, code cleanups, some docs added.
18913         Allocate some data structures in the image mempool.
18915 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18917         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
18918         the example code.
18919         
18920 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
18922         * class-internals.h, class.c, reflection.c: reduce memory taken by
18923         MonoClass.
18925 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
18927         * metadata.c, metadata.h, loader.h: documentation updates, code and
18928         API cleanups.
18930 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18932         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
18933         the example code.
18935         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
18936         page faults caused by the runtime while reading metadata.
18938 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18940         * socket-io.c: the field names were changed 3 months ago and no one
18941         realized until bug #76077 got filed!
18943 2005-09-20  Martin Baulig  <martin@ximian.com>
18945         * icall.c (assembly_icalls): Removed some unused debugger icalls.
18947 2005-09-20  Martin Baulig  <martin@ximian.com>
18949         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
18950         write the rank into the class entry.
18952 2005-09-20  Martin Baulig  <martin@ximian.com>
18954         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
18956 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
18958         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18960         * icall.c (custom_attrs_defined_internal): New icall.
18962         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
18963         function.
18964         (mono_custom_attrs_construct_by_type): New helper function.
18966 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
18968         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
18969         terminate the resulting string. Fixes #76123.
18971 2005-09-16  Martin Baulig  <martin@ximian.com>
18973         * mono-debug.c
18974         (mono_debug_add_method): Ignore inflated methods for the moment.
18976 2005-09-14  Martin Baulig  <martin@ximian.com>
18978         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
18980 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
18982         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
18983         return a success/failure indication.
18984         (mono_metadata_interfaces_from_typedef_full): Ditto.
18985         (get_constraints): Ditto.
18987 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
18989         * marshal.c (emit_marshal_array): Fix handling of null arrays.
18990         
18991         * marshal.c (emit_marshal_array): Add support for returning string
18992         arrays from delegates. Fixes #76063.
18994         * marshal.c: Use the emit_ldloc/stloc macros where possible.
18996 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
18998         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
18999         icall.
19001 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
19003         * reflection.c icall.c: Fix after mono_get_exception_type_load
19004         signature change.
19006         * assembly.c (mono_assembly_get_assemblyref): New helper function.
19007         (mono_assembly_load_reference): Use the new helper.
19009         * class-internals.h (MonoLoaderError): New structure containing 
19010         information about type loading errors.
19012         * class-internals.h loader.c: Add APIs to store per-thread loader
19013         error information.
19015         * loader.c class.c: Set the loader error if needed.
19017         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
19019 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
19021         * decimal.c: fixed to handle the broken ARM fp format.
19023 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
19025         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
19026         broken.
19028 2005-09-06  Martin Baulig  <martin@ximian.com>
19030         * domain.c (supported_runtimes): Added v2.0.50727.
19032 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
19034         * culture-info.h: reduce the size of some structures.
19036 2005-09-05  Martin Baulig  <martin@ximian.com>
19038         Reflect latest API changes in the August CTP.
19040         * icall.c
19041         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
19042         ("MonoType.HasGenericArguments"): Removed.
19043         ("MonoMethod.BindGenericParameters"): Renamed to
19044         "MakeGenericMethod".
19045         ("MethodBuilder.BindGenericParameters"): Renamed to
19046         "MakeGenericMethod".    
19048 2005-09-05  Martin Baulig  <martin@ximian.com>
19050         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
19052 2005-09-05  Martin Baulig  <martin@ximian.com>
19054         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19056         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
19057         generic_container is non-NULL.
19059 2005-09-05  Martin Baulig  <martin@ximian.com>
19061         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19063         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
19065 2005-08-29  Michal Moskal  <malekith@nemerle.org>
19067         * reflection.c (encode_locals,
19068         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
19069         for large generic types.
19071 2005-09-05  Martin Baulig  <martin@ximian.com>
19073         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19075         * class.c (mono_dup_array_type): New public method.
19076         (mono_metadata_signature_deep_dup): New public method.
19077         (dup_type): Correctly duplicate array and function types.
19079 2005-09-05  Martin Baulig  <martin@ximian.com>
19081         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19083         * reflection.c (get_default_param_value_blobs): Handle generic types
19084         and generic methods.
19086 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
19088         * class.c: Fixed error reporting (method/class were inversed) for 
19089         inheritance demands.
19090         * security-manager.c|h: Added the AppDomain when calling the managed
19091         System.Security.SecurityManager.InheritanceDemand method.
19093 2005-09-01  Raja R Harinath  <rharinath@novell.com>
19095         * reflection.c (encode_marshal_blob): 'marshaltype' and
19096         'marshaltyperef' are alternate sources for the custom marshaler
19097         name.
19099 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
19101         * class.c: fix creation of array classes with rank == 1
19102         (patch by Ankit Jain <jankit@novell.com>).
19104 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
19106         * object.c: fix check for creating the bound data for arrays vs
19107         szarrays.
19109 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19111         * object.c: configuration file name is now based on the executable name,
19112         not the image name. Fixes bug #75931.
19114 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
19116         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
19117         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
19119 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
19121         * rand.c: Use wincrypt.h instead of WinCrypt.h.
19123 2005-08-24  Ankit Jain  <jankit@novell.com>
19124             Raja R Harinath  <rharinath@novell.com>
19126         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
19127           called by it recursively.
19128           (mono_class_init): Remove special case in pending_init handling, since it's
19129           superseded by the fix to mono_class_from_typeref.
19131 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
19133         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
19134         BROKEN_THREAD_START stuff.
19136 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
19138         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
19139         trampoline.
19141         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
19142         
19143         * object.c (mono_delegate_ctor): Replace the original function address with
19144         a delegate trampoline.
19146 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
19148         * icall.c: add boolean argument to base64_to_byte_array and 
19149         InternalFromBase64String to control whether a whitespace-only string
19150         is allowed (or should casue a FormatException to be thrown). We need
19151         this as the behavior has changed between MS.NET 1.x and 2.0, and we
19152         to match the MS behaviour in both profiles.
19153         * appdomain.c: Bump corlib version.
19155 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19157         This patch implements a big portion of publisher policy
19158         support, used to bind assembly versions and redirect
19159         one assembly from version A to version B.
19161         * assembly.c:
19162         New GSList loaded_assembly_bindings, for storing the cached
19163         assembly bindings.
19164         (assembly_binding_maps_name): New static function for checking if a 
19165         assembly binding information maps an assembly name.
19166         (mono_assembly_binding_info_free): New function for freeing
19167         assembly binding information resources.
19168         (get_publisher_policy_info): New static function for retrieving 
19169         assembly binding information from a MonoImage.
19170         (compare_versions): New static function for comparing an assembly
19171         binding information data and the version of an assembly name.
19172         (check_policy_versions): New static function for checking if an
19173         assembly binding info mapping an assembly name is valid for it.
19174         (mono_assembly_load_publisher_policy): New static function for
19175         loading the 'policy.major.minor.MyAssembly' image for an assembly
19176         with an assembly name 'aname'.
19177         (mono_assembly_bind_version): New static function for updating
19178         assembly redirection.
19179         (mono_assembly_apply_binding): New static function for applying
19180         assembly binding.
19181         (search_binding_loaded): New static function for searching 
19182         loaded assembly binding infos in the cache domain.
19183         (mono_assembly_load_full): Don't apply assembly binding for
19184         reflection only assemblies.
19186         * metadata-internals.h: Add MonoAssemblyBindingInfo,
19187         which contains information about assembly binding. Also
19188         declare signature for mono_config_parse_publisher_policy ()
19189         function, used to retrieve pub policy info.
19190         
19191         * mono-config.c:
19192         (publisher_policy_start): New static function used to parse publisher 
19193         policy config files.
19194         (publisher_policy_parser): New static MonoParseHandler containing 
19195         the functions used when parsing config files.
19196         (mono_config_parse_publisher_policy): New function for parsing
19197         publisher policy files.
19198         
19199 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
19201         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
19203         * marshal.c (mono_delegate_free_ftnptr): Ditto.
19205         * object.c (mono_get_addr_from_ftnptr): New helper function.
19207         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
19209         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
19211 2005-08-19  Dick Porter  <dick@ximian.com>
19213         * threads.c, threads.h, appdomain.c, appdomain.h,
19214         profiler-private.h, monitor.c, object.c, object-internals.h,
19215         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
19216         store the thread ID, so it can hold a 64 bit value if needed.
19218 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
19220         * reflection.c (mono_reflection_create_dynamic_method): Store the
19221         handle class into the method references as well so ldtoken works in
19222         dynamic methods.
19224         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
19225         types.
19227 2005-08-19  Ankit Jain <jankit@novell.com>
19229         Fix #75847.
19230         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
19231           here rather than using the method signature of a arbitrary function
19232           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
19233           two arguments.
19234           Hack done with Harinath.
19236 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19238         * threadpool.c: disable printing stack traces when we get a exception
19239         in a threadpool thread. I need to do more testing to figure out which
19240         cases actually print this. Fixes bug #75828.
19242 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19244         * icall.c: there might be ignored whitespace after the last '='. This
19245         fixes length computation and bug #75840.
19247 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
19249         * assembly.c (mono_assembly_load_full): Consider .exe extension as
19250         well. Fixes #75809.
19252         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
19253         #75784.
19254         
19255         * reflection.c (create_custom_attr_data): Ditto.
19257 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
19259         * locales.c, culture-info.h : removed RegionLCIDMap.
19260         * culture-info-tables.h : regenerated.
19262 2005-08-16  Martin Baulig  <martin@ximian.com>
19264         * class.c (mono_type_get_name_recurse): Small fix.
19266 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
19268         * locales.c : indentation fixie.
19270 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
19272         * object-internals.h,
19273           locales.h,
19274           locales.c,
19275           culture-info.h,
19276           icall.c : added RegionInfo table support.
19277         * culture-info-table.h : regenerated for region support.
19279 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
19281         * reflection.c (resolve_object): handle all kinds of MonoMethod
19282         including generic ones
19284 2005-08-12  Ankit Jain <jankit@novell.com>
19286         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
19287           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
19289 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
19291         * process.c: Don't close a thread handle when it's NULL. This is a
19292         workaround for bug #75733.
19294 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
19296         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
19298 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
19300         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
19302 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19304         * threadpool.c: if a work item in the thread pool has a callback that
19305         catches a exception, don't propagate it after invoking the callback.
19306         Fixes bug #75336.
19308 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
19310         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
19312         * class-internals.h (MonoCachedClassInfo): Add some new fields.
19314         * class.c (mono_class_init): Load field info lazily in the AOT case.    
19316         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
19318 2005-08-03  Ankit Jain  <jankit@novell.com>
19320         Fix #75683.
19321         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
19322           PInvoke calling convention is 0.
19324 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
19326         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
19327         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
19329 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
19331         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
19332         to handle threads not started by the GC (patch by Michael Meeks
19333         <michael.meeks@novell.com>).
19335 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
19337         * reflection.c: Make buffer used in emitting types larger for some
19338         big generic types (patch by Michal Moskal).
19340 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
19342         * mono-debug.c: Fix some (not all) alignment problems.
19344 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19346         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
19347         Invoke mono_image_load_from_data_full passing the refonly
19348         parameter.
19350         * assembly.c
19351         (mono_assembly_open_from_bundle): Add the refonly argument, 
19352         in order to pass it to other methods it calls to.
19353         (do_mono_assembly_open): Add the refonly argument, in order 
19354         to pass it to other methods it calls to.
19355         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
19356         the refonly parameter to it.
19358         * image.c: Add loaded_images_refonly_hash and
19359         loaded_images_refonly_guid_hash to cache the reflection
19360         only loaded images.
19361         (mono_images_init): Initialize the hash tables used for
19362         caching the reflection only images.
19363         (load_modules): Invoke mono_image_open_full passing the refonly
19364         parameter to load the modules the correct way.
19365         (build_guid_table): Add the refonly argument, to re-build the 
19366         correct hash table.
19367         (do_mono_image_open): Added the refonly argument, in order to
19368         define it for the loaded image.
19369         (mono_image_loaded_full): New function, which receives an
19370         additional parameter to look for the image in the refonly or
19371         non-refonly section.
19372         (mono_image_loaded): Updated, using mono_image_loaded_full.
19373         (mono_image_loaded_by_guid_full): The same case that happens
19374         with mono_image_loaded_full.
19375         (mono_image_loaded_by_guid): Likewise.
19376         (register_image): Use the ref_only variable inside MonoImage
19377         to decide in which hash table store the current image.
19378         (mono_image_open_from_data_full): Rename
19379         mono_image_open_from_data to mono_image_open_from_data_full,
19380         adding the refonly argument, to define the ref_only variable 
19381         inside MonoImage.
19382         (mono_image_open_from_data): Return 
19383         mono_image_open_from_data_full.
19384         (mono_image_open_full): Rename mono_image_open to
19385         mono_image_open_full, receiving the new refonly argument,
19386         to pass it to inner methods.
19387         (mono_pe_file_open): Update this function, to open
19388         a MonoImage as a non-refonly image.
19389         (mono_image_close): Use the refonly variable inside
19390         MonoImage to remove the image from the correct caches.
19392         * image.h: Add the signatures of mono_image_open_full,
19393         mono_image_open_from_data_full, mono_image_loaded_full,
19394         mono_image_loaded_by_guid_full.
19396         * metadata-internals.h: Add the ref_only field to 
19397         MonoImage.
19398         
19399 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19401         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
19402         Fix the last behavior, which used to load the assemblies and
19403         extract MonoReflectionAssemblyName information, instead of
19404         extract it from the metadata tables. Needed for Reflection
19405         Only assemblies.
19406         
19407 2005-07-29  Martin Baulig  <martin@ximian.com>
19409         * mono-debug-debugger.c
19410         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
19411         not initialized.
19413         * mono-debug.c
19414         (mono_debug_address_from_il_offset): Check whether we have
19415         debugging support before attempting to take the lock.
19416         (mono_debug_source_location_from_address): Likewise.
19417         (mono_debug_source_location_from_il_offset): Likewise.
19418         (mono_debug_il_offset_from_address): Likewise.
19419         (mono_debug_address_from_il_offset): Likewise.
19421 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
19423         * class.c (mono_class_from_name_case): Add support for dynamic images.
19424         Fixes #75650.
19426         * object.c (mono_class_compute_gc_descriptor): Add a workaround
19427         for #75479.
19429 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
19430         
19431         * reflection.c (mono_method_get_object): Fix warning.
19433 2005-07-28  Martin Baulig  <martin@ximian.com>
19435         * mono-debug.c
19436         (mono_debug_add_wrapper): Also write the wrapper type.
19438 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
19440         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
19441         
19442         * class.c (mono_class_init): Avoid reading nested classes if the AOT
19443         data indicates the class has none.
19445 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
19447         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
19448         loader lock with the debugger lock. Prevents deadlocks for beagle.
19450         Beagle can now run on an smp box for a weekend without any
19451         issues. Woohoo!
19453 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
19455         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
19456         in a module. Fixes #75629.
19458 2005-07-26  Martin Baulig  <martin@ximian.com>
19460         * mono-debug.c (mono_debug_add_wrapper): New static method.
19461         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
19462         interncall or a wrapper.
19464         * mono-debug.h (MonoDebugWrapperData): New public typedef.
19465         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
19466         (MONO_DEBUGGER_VERSION): Bump to 51.
19468         * mono-debug-debugger.c
19469         (mono_debugger_add_type): Removed this empty function.
19470         (mono_debugger_add_method): Likewise.
19472 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
19474         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
19475         before accessing method->slot.
19477 2005-07-21  Jb Evain  <jbevain@gmail.com>
19479         * reflection.c (method_encode_clauses/class): Handle filters clauses.
19480         Fixes #75010.
19482 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
19484         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
19485         #75587.
19487 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
19489         * image.h image.c: Add mono_image_get_guid () API function.
19491 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
19493         There were issues when multiple threads tried to load
19494         assemblies. A deadlock was created between assemblies_mutex and
19495         mono_domain_assemblies_lock. This fixes the issue by making the
19496         assembly ref counting be lock free. See bug 75586.
19497         
19498         * image.c (mono_image_close): The add ref function here was using
19499         Interlocked operations while the unref was using a mutex and a
19500         --. I don't think this was ever a bug that would be exposed in a
19501         non-pendantic way (ie, by an embedder doing a ref on one thread
19502         and an unref on another), but for the sake of correctness, this is
19503         now Interlocked.
19505         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
19506         (mono_assembly_load_reference): Call mono_assembly_addref rather
19507         than touching the refcount ourselves.
19508         (mono_assembly_close): Use InterlockedDecrement to unref the
19509         assembly. Don't acquire the lock unless it is actually needed.
19511 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
19513         * class.c (mono_class_layout_fields): Fix calculation of has_references
19514         for generic types.
19516 2005-07-12  Martin Baulig  <martin@ximian.com>
19518         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19520         * metadata.c
19521         (mono_type_hash): Provide better hashing for generic instances.
19522         (mono_generic_inst_hash): Improve hashing.
19523         (mono_generic_class_hash): Likewise.
19525         * reflection.c (mymono_metadata_type_hash): Improve hashing for
19526         generic instances.
19528 2005-07-12  Martin Baulig  <martin@ximian.com>
19530         * reflection.c (mono_reflection_create_runtime_class): Remove the
19531         hack for generic type definitions and non-`Run' assemblies.
19532         (mono_reflection_bind_generic_parameters): Also use
19533         `klass->wastypebuilder' to check for TypeBuilders.
19535 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
19537         * class.c (mono_class_layout_fields): Fix calculation of has_references
19538         for generic types.
19540         * class.c (inflate_generic_class): Fix a leak.
19541         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
19542         for generic types.
19544 2005-07-11  Martin Baulig  <martin@ximian.com>
19546         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
19547         on error.
19549 2005-07-11  Martin Baulig  <martin@ximian.com>
19551         * loader.c (find_method): Also lookup in
19552         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
19554 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19556         * appdomain.c (mono_domain_unload): Don't free the error message
19557         before passing it to mono_get_exception_...
19559         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
19560         
19561 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
19563         * threads.c: try to better guess an available RT signal (bug #75387).
19565 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19567         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
19568         and CACHE_OBJECT.
19570 2005-07-07  Martin Baulig  <martin@ximian.com>
19572         * class.c (mono_type_get_name_full): Return NULL for
19573         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
19574         fixes #75408.
19576 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19578         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
19579         exit the appdomain as well being aborted.
19581         * threadpool.c: Create all threadpool threads inside the root appdomain, and
19582         change back to the root domain after calling managed code. This enables
19583         appdomains using threadpools to be unloaded.
19585 2005-07-07  Martin Baulig  <martin@ximian.com>
19587         * class-internals.h
19588         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
19589         into `MonoDynamicGenericClass' since we only need it for dynamic
19590         types.
19592         * reflection.c (mono_class_bind_generic_parameters): We don't need
19593         to compute the `parent' here.
19595 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
19597         * culture-info-table.h : regenerated.
19599 2005-07-06  Martin Baulig  <martin@ximian.com>
19601         * icall.c
19602         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
19604         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
19606 2005-07-06  Martin Baulig  <martin@ximian.com>
19608         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
19609         we're doing a signature-only comparision; fixes #74945.
19611 2005-07-06  Martin Baulig  <martin@ximian.com>
19613         * class-internals.h (MonoGenericClass): Moved some things out into
19614         a new `MonoInflatedGenericClass' type.  
19615         (MonoInflatedGenericClass): New type; the `klass' of a
19616         `MonoGenericClass' is now computed lazyly in
19617         mono_get_inflated_generic_class().      
19619         * class.c (mono_get_inflated_generic_class): New public function.
19620         (mono_class_inflate_generic_method): Removed the unused
19621         `MonoClass *' argument.
19622         (setup_generic_vtable): Don't call mono_get_inflated_method() on
19623         all the methods.
19624         (mono_class_create_generic): Make this static and merge it with
19625         mono_class_create_generic_2(); we're now called automatically from
19626         mono_get_inflated_generic_class().
19628         * loader.c (mono_method_signature): Call
19629         mono_get_inflated_method() here.
19631 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
19633         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
19634         type of fields with RVA.
19636         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
19637         for this pseudo class.
19638         (my_mono_class_from_generic_parameter): Likewise.
19639         (mono_class_init): Allow interfaces to have cctors.
19641 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
19643         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
19644         lazily for AOT methods.
19646 2005-07-05  Martin Baulig  <martin@ximian.com>
19648         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
19649         returns FALSE for a successful match, not TRUE.
19651 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
19653         * loader.c (mono_method_get_index): Optimize this a bit.
19655 2005-07-04  Martin Baulig  <martin@ximian.com>
19657         * class.c
19658         (class_compute_field_layout): Move the check for generic type
19659         definitions into mono_class_layout_fields().  Fixes #74684.
19660         (mono_class_from_generic_parameter): Correctly compute
19661         `klass->parent'; fixes #75457.
19663         * reflection.c (register_assembly, register_module): Make sure
19664         `domain->rejobject_hash' is already created.
19666 2005-07-02  Martin Baulig  <martin@ximian.com>
19668         * class-internals.h
19669         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
19670         `MonoDynamicGenericClass'.      
19672 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
19674         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
19675         returned by a field getter is null, since null is a valid value.
19677 2005-07-01  Martin Baulig  <martin@ximian.com>
19679         * reflection.c (mono_reflection_generic_class_initialize): Update
19680         the `dgclass->fields [i].parent' to the correct class.
19681         (mono_image_get_fieldref_token): Use the declaring type, not the
19682         reflected type.
19684 2005-07-01  Martin Baulig  <martin@ximian.com>
19686         * loader.c (find_method): Also look in the interfaces; fixes #75429.
19688 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
19690         * threads.c (thread_cleanup): assert that thread != NULL
19691         (wait_for_tids_or_state_change): We were using the wrong variable
19692         when accessing wait->threads. `i' was always out of the bounds of
19693         the array.
19695 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19697         * loader.c: map user32 and kernel32 to libMonoSupportW
19699 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
19701         * appdomain.c (unload_thread_main): Mark this as WINAPI.
19703 2005-06-28  Martin Baulig  <martin@ximian.com>
19705         * loader.c (method_from_methodspec): Fix #75334.
19707 2005-06-28  Martin Baulig  <martin@ximian.com>
19709         Fix #74953 - Arrays now implement the generic IList<T> interface
19710         on the 2.0 platform.
19712         * class-internals.h (MonoDefaults): Added `generic_array_class'.
19714         * reflection.c (mono_class_bind_generic_parameters): New public
19715         function; similar to mono_reflection_bind_generic_parameters(),
19716         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
19718         * domain.c (mono_init_internal): Try to initialize.
19719         `mono_defaults.generic_array_class' here; this'll only succeed if
19720         we're using the 2.0 corlib.
19722         * icall.c
19723         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
19724         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
19725         (mono_lookup_internal_call): Added support for nested classes.
19727         * loader.c
19728         (mono_get_method_from_token): Set `result->signature->pinvoke' if
19729         we're an interncall and have generic arguments.
19731         * class.c
19732         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
19733         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
19734         instance of System.Array.InternalArray<T> for arrays, so they
19735         implement the generic IList<T> interface.
19737 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
19739         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
19740         (chastamar@yahoo.com). Fixes #75374.    
19742 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
19744         * culture-info-table.h: regenerated.
19746 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19748         * icall.c: handle spaces correctly for base64 strings.
19750 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
19752         * *.c: Kill some warnings.
19754 2005-06-23  Duncan Mak  <duncan@novell.com>
19756         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
19757         that this builds on Solaris 10 (x86).
19759 2005-06-23  Martin Baulig  <martin@ximian.com>
19761         * class.c
19762         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
19763         generic type definitions.
19765 2005-06-23  Martin Baulig  <martin@ximian.com>
19767         Fix #75331.
19769         * metadata.c (mono_class_get_overrides): Renamed to
19770         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
19771         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
19772         pass it to mono_get_method_full().
19774 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
19776         * reflection.c (mono_reflection_create_runtime_class): take the
19777         mono_domain_lock in this method. Prevents deadlocks
19779 2005-06-22  Martin Baulig  <martin@ximian.com>
19781         * loader.c (method_from_methodspec): Fix #75330.
19783 2005-06-22  Martin Baulig  <martin@ximian.com>
19785         * reflection.c (type_get_qualified_name): Use
19786         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
19787         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
19788         argument; use it if we don't have an assembly name.
19790 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
19792         * object.c: In mono_message_init, set "copy out" flag for in
19793         parameters with the [Out] flag.
19795 2005-06-21  Martin Baulig  <martin@ximian.com>
19797         * class.c
19798         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
19799         and MONO_TYPE_PTR.
19801 2005-06-21  Martin Baulig  <martin@ximian.com>
19803         * class.c (mono_class_init): Don't initialize `class->fields' for
19804         generic instances since they're initialized again in
19805         compute_field_layout(). 
19806         (compute_field_layout): Set the field's `generic_info' here; fix
19807         #75320. 
19809 2005-06-21  Martin Baulig  <martin@ximian.com>
19811         * class-internals.h
19812         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
19814         * metadata.c (mono_metadata_generic_method_equal): Also
19815         distinguish the `generic_class'; fixes #75334.
19817 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19819         * domain.c:
19820         * appdomain.c:
19821         * domain-internals.h:
19822         * reflection.c: 'domain_assemblies' field is now protected by its own
19823         lock. Don't call into managed code to run the AssemblyLoad event if we
19824         now there are no registered delegates for it.
19826 2005-06-20  Martin Baulig  <martin@ximian.com>
19828         * class.c (mono_class_is_assignable_from): Use a custom version of
19829         mono_class_has_parent() to make things work for generic instances;
19830         fix #75300.
19832 2005-06-20  Martin Baulig  <martin@ximian.com>
19834         * loader.c (method_from_methodspec): Apply a patch from
19835         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
19837 2005-06-20  Martin Baulig  <martin@ximian.com>
19839         * class.c (mono_class_init): Reverted Zoltan's last change; it
19840         breaks generics.
19842 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
19844         * threads.c (wait_for_tids_or_state_change): Add missing locking.
19846 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19848         * socket-io.c: fix the index in the socket array for writable/error
19849         sockets. Fixes bug #75306.
19851 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
19853         * class.c (mono_class_init): Allow interfaces to have static ctors.
19855 2005-06-17  Martin Baulig  <martin@ximian.com>
19857         * loader.c (method_from_methodspec): Use `context->container' when
19858         parsing the `gmethod->inst'.
19860 2005-06-17  Martin Baulig  <martin@ximian.com>
19862         * class.c (mono_type_get_name_recurse): Don't add the assembly
19863         name for type arguments.
19865 2005-06-15  Martin Baulig  <martin@ximian.com>
19867         * reflection.c (mono_image_get_inflated_method_token): Encode
19868         correct klass; fixes #75260.
19870 2005-06-13 Michal Moskal <malekith@nemerle.org>
19872         * icall.c: Make GetCorrespondingMethod/Constructor take
19873         MonoReflectionMethod method not MonoMethod. Removed
19874         MonoType.GetCorrespondingField, and make
19875         MonoGenericType.GetCorrespondingField take name not
19876         MonoClassField.
19878 2005-06-13  Michal Moskal <malekith@nemerle.org>
19880         * reflection.c (field_encode_signature, encode_locals):
19881          Make sizes of buffers for types larger (for big generic types).
19882          (create_generic_typespec,
19883          mono_reflection_sighelper_get_signature_local,
19884          mono_reflection_sighelper_get_signature_field):
19885          Add asserts for too small buffers.
19887 2005-06-15  Martin Baulig  <martin@ximian.com>
19889         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
19890         if our parent is not a dynamic type.
19892 2005-06-15  Martin Baulig  <martin@ximian.com>
19894         * class-internals.h (MonoTypeNameFormat): New enum.
19896         * class.c
19897         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
19898         (mono_type_get_full_name): Removed.
19899         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
19900         argument instead of the boolean's.
19902         * icall.c (ves_icall_System_MonoType_getFullName):
19903         Added `gboolean assembly_qualified'.    
19905         * reflection.h
19906         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
19908         * reflection.c (mono_reflection_parse_type): Parse the new type
19909         name format.
19911 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19913         * icall.c: no need to convert from utf16 to utf8 and then back again
19914         after the call to GetLogicalDrives.
19916 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19918         * icall.c: frombase64. Fix problems exposed by new tests.
19920 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19922         * icall.c: added internal calls for converting char [] and strings in
19923         base64 into byte [].
19925 2005-06-10  Martin Baulig  <martin@ximian.com>
19927         * class.c (mono_class_create_generic_2): Read the nested classes
19928         from the metadata rather than from `gklass->nested_classes' since
19929         `gklass' might not be initialized yet.
19931 2005-06-09  Duncan Mak  <duncan@novell.com>
19933         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
19934         all public headers. Fixes #74919.
19936 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
19938         * domain.c: The key for proxy_vtable_hash is now a pointer
19939         array. Added new GHashFunc and GCompareFunc functions for this.
19941         * class.h: The list of interfaces in MonoRemoteClass is known in
19942         advance and can't grow (we create a new MonoRemoteClass if needed),
19943         so now the interface array can be allocated together with
19944         MonoRemoteClass.
19945         
19946         * object.c: Added a new method create_remote_class_key.
19947         Fixed mono_remote_class so it does not depend on
19948         mono_upgrade_remote_class.
19949         Removed extend_interface_array.
19950         Added new method clone_remote_class(), which makes a copy of a remote
19951         class and adds a new interface or class to it.
19952         mono_upgrade_remote_class() now creates a new remote class (or gets
19953         it from the cache) if an vtable upgrade is needed. In this way
19954         we make sure that other objects sharing the same remote class
19955         don't get the new vtable with unwanted interfaces.
19956         
19957         * object-internals.h:
19958         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
19959         
19960         * marshal.c: Track changes in mono_upgrade_remote_class().
19962 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
19963         * icall.c: Add runtime methods for obtaining members of inflated
19964         class, which were created from supplied non-inflated members. It
19965         is used in internal Get{Method,Constructor,Field} methods in
19966         System.Type
19968 2005-06-09  Martin Baulig  <martin@ximian.com>
19970         * reflection.c
19971         (mono_reflection_bind_generic_method_parameters): Fix #75169.
19973 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19974         * reflection.c (mono_image_basic_init): Define
19975         Version in MonoDynamicAssembly. 
19976         
19977 2005-06-08  Martin Baulig  <martin@ximian.com>
19979         Fix #75136.
19981         * loader.c
19982         (mono_method_signature_full): New public method; takes a
19983         `MonoGenericContext *'.
19984         (find_method): Use mono_method_signature_full() and pass the
19985         klass'es context to it.
19987         * class.c (mono_class_is_inflated_method): Use
19988         mono_method_signature_full() and pass the context to it.
19990 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
19992         * object.c: add proper locking in mono_remote_class_vtable(),
19993         fixes possible memory corruption.
19995 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
19997         * marshal.c (mono_remoting_marshal_init): set
19998         initialized after initialization.
20000 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
20002         * locales.c : hush.
20004 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
20006         * object.c (extend_interface_array): fix really silly
20007         memory corrupting / comparison bug.
20009 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20011         * reflection.c: Functions added to support the creation
20012         of CustomAttributeData, which includes Attribute data
20013         used by ReflectionOnly methods.
20015         * reflection.h:  mono_reflection_get_custom_attrs_data and
20016          mono_custom_attrs_data_construct added (functions exposed).
20018          * icall.c: Added mono_reflection_get_custom_attrs_data
20019          as icall.
20020         
20021 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
20023         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
20024         lupus's request.
20026 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
20028         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
20030         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
20031         dynamic DllImportAttribute.
20033         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
20034         dynamic DllImportAttribute.
20036         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
20037         Fixes #75162.
20039 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20041         * threads.c: avoid segfault when an unstarted thread is aborted.
20043 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
20045         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
20046         Returns the name and version of the runtime for reporting.
20048 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20050         * appdomain.c: bump corlib version.
20051         * object-internals.h: new field in MonoReflectionAssembly.
20053 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20055         * object-internals.h: Carlos forgot to add this field.
20057 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20059         * icall.c: Added create_version to create instances
20060         of Version of MonoReflectionAssemblyName. This change helps
20061         the AssemblyName tests to keep running fine.
20062         
20063 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
20064   
20065         * object.c (mono_method_return_message_restore): A somehow less
20066         intrusive fix for #75138.
20068 2005-06-03  Raja R Harinath  <rharinath@novell.com>
20070         * object.c (mono_method_return_message_restore): Fix computation
20071         of expected number of out args.
20073 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
20075         * reflection.c (mono_image_get_method_info): Fix the case when the
20076         charset is empty.
20078 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
20080         * object.c: Added missing null check in
20081           mono_method_return_message_restore.
20083 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
20085         * reflection.c (mono_image_get_method_info): Handle the case when
20086         dllentry is empty.
20088 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
20090         * object.c: When creating the vtable for a proxy, take into account
20091         all inherited interfaces, not only the ones registered in
20092         iclass->interfaces. This fixs bug #74996.
20093         Also, in mono_method_return_message_restore, verify that the array
20094         of out args has the expected lengh.
20096 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20098         * socket-io.c: update the timeout in Poll when the call is interrupte.
20100 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20102         * socket-io.c: support abort/suspend in Select_internal after last
20103         change.
20105 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20107         * threadpool.c: remove warning.
20109 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20111         * icall.c:
20112         * socket-io.[ch]: Select_internal uses poll() now when available, thus
20113         removing the 1024 limit from select(). Runtime part of the fix for
20114         bug #71203.
20116 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20118         * socket-io.c: when resolving the addresses for the same
20119         host returned by gethostname(), get the local IPs from the interface
20120         list. Loopback addresses are discarded if the are interfaces up with
20121         non-loopback ones. Fixes bug #63265.
20123 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
20125         * appdomain.c, verify.c, object-internals.h, reflection.c:
20126         bumped corlib number to 36, and added new extra_flags field
20127         to ReflectionMethodBuilder and friends.  Fixes #75060.
20129 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
20131         * gc.c: register a new weak link only if the object is non-null
20132         (fixes bug#75047).
20134 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
20136         * culture-info.h : short time pattern too.
20138 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
20140         * culture-info.h : expand long time pattern string length.
20142 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
20144         * culture-info-table.h : update (more French date format; #72788).
20146 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
20148         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
20149         the method is static. Fixes #75029.
20151 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
20153         * reflection.c: Update the table_idx field of method builders after
20154         saving the module, since it can change. This is a workaround for
20155         bug #74914. 
20157 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
20159         * culture-info-table.h : update (additional French date format).
20161 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
20163         * icall.c (ves_icall_type_Equals): Revert last change.
20164         
20165         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
20167         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
20169 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
20171         * class-internals.h: Added executioncontext_class field to 
20172         MonoDefaults structure.
20173         * domain.c: Cache System.Threading.ExecutionContext class in 
20174         mono_defaults.
20175         * object.c: Capture the ExecutionContext for asynchroneous calls in
20176          mono_async_result_new.
20177         * object-internals.h: Added execution_context and original_context 
20178         fields to MonoAsyncResult. Added execution_context to MonoThread.
20179         * security-manager.c|.h: Added mono_get_context_capture_method to 
20180         return the capture method (if required by the security manager or by
20181         the framework version used).
20182         * threadpool.c: Apply capture (if present) ExecutionContext in 
20183         mono_async_invoke and revert to original context after it completes.
20185 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
20187         * culture-info-table.h : updated (real hacky solution for zh-CHT).
20189 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
20191         * culture-info-table.h : zh-CHT related workaround.
20193 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
20195         * marshal.c (emit_marshal_custom): Add some error checking and call the
20196         methods in the ICustomMarshaler interface. Fixes #74875.
20197         
20198         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
20199         native->managed wrappers.
20201 2005-05-12  Martin Baulig  <martin@ximian.com>
20203         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
20204         here and use the loader lock.
20206         * mono-debug.c: Properly lock when the debugger is not attached.
20207         (mono_debug_init): Release the initial lock if we're not running
20208         in the debugger.
20210 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
20212         * marshal.c (emit_marshal_custom): Pass through NULL values without
20213         calling the custom marshalling routines.
20215         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
20216         conversion in structures. Fixes #74882.
20218 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
20220         * culture-info-table.h : zh-* cultures were missing.
20222 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
20224         * threads.c: Added a new event background_change_event which is signaled
20225         when a thread changes its background mode.
20226         Moved here several checks previously done in managed code. The checks
20227         require the thread lock, and using the thread lock in managed code
20228         can result in deadlocks.
20229         Merged Start_internal and Thread_internal into a single method. Now 
20230         Thread_internal does all work of creating and starting a thread.
20231         Added icalls for setting and getting the state of the object. Moved from
20232         managed code to avoid locking there.
20233         Added wait_for_tids_or_state_change() which is called instad of
20234         wait_for_tids when waiting for non-backround threads to end. This method
20235         will return if one of the threads ends or the background_change_event
20236         is signaled.
20237         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
20238         the background mode. This method signals the background_change_event
20239         event.
20240         * icall.c:
20241         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
20242         removed Start_internal.
20243         
20244 2005-05-11  Martin Baulig  <martin@ximian.com>
20246         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
20247         to order of some fields to get proper alignment on 64-bit machines.
20249 2005-05-11  Martin Baulig  <martin@ximian.com>
20251         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
20252         changes as they're broken and completely fuck up the debugger.
20254         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
20256 2005-05-10  Martin Baulig  <martin@ximian.com>
20258         * reflection.c (mono_reflection_generic_class_initialize): Don't
20259         call mono_class_setup_parent() here.
20261 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20263         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
20264         send/receive timeout use an integer in milliseconds. We were using a
20265         struct timeval.
20267 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20269         * locales.c:
20270         (internal_get_cultures): reserve the first slot of the array for the
20271         InvariantCulture, which will be filled in managed code.
20273 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
20275         * reflection.c (mono_image_fill_module_table): Initialize the
20276         GENERATION field as well.
20278 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20280         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
20281         Monitor.Enter on the object.
20283 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
20285         * threads.c: Enable the wait for running threads when exiting.
20286         * icall.c: Suspend all threads before exiting.
20288 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
20290         * assembly.c (mono_assembly_load_reference): Fix warning.
20292 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20294         * threadpool.c: changed the default number of threads per cpu. From now
20295         on, the default will be 20 + (5 * number of cpus) instead of 50.
20297 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
20299         * loader.c (mono_method_get_signature_full): Add locking here.
20301 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
20303         * appdomain.c: Moved methods for parsing and freeing assembly
20304         names to assembly.c.
20305         * assembly.c, domain-internals.h: Created public methods for parsing
20306         assembly names. Fixed mono_assembly_load_with_partial_name:
20307         it now finds the best match, taking into account the version,
20308         token and culture specified in the partial name. Also return
20309         the latest version if no version information is specified.
20311 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
20313         * threadpool.c: replace check for SocketAsyncCall class.
20315 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20317         * threadpool-internals.h:
20318         * Makefile.am: added threadpool-internals.h
20320         * threadpool.c: call mono_unhandled_exception on exceptions not handled
20321         that happen in threadpool threads (tested on MS).
20322         (mono_thread_pool_remove_socket): new function that dispatch any pending
20323         AIO call on a socket that is closing. By now only epoll really needs it,
20324         as select/poll wake up when the socket closes.
20327         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
20329 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
20331         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
20333 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
20335         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
20337 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
20339         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
20340         has an abort request, convert it into a suspend request.
20342 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
20344         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
20345         warning for the usage of `UnmanagedFunctionPointerAttribute' which
20346         is not supported yet.
20348 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20350         * image.c: register assemblies loaded from data (bundles) in the loaded
20351         assemblies hash. Fixes bug #74772.
20353 2005-04-29  Martin Baulig  <martin@ximian.com>
20355         * class.c (mono_type_get_name_recurse): Update to the new naming
20356         schema from the latest .NET 2.x beta2.
20357         (mono_class_setup_vtable_general): If we're a generic instance,
20358         copy the vtable from our generic type definition and inflate all
20359         the methods in it.
20361         * loader.c (find_method): Update to the new naming schema from the
20362         latest .NET 2.x beta2.
20364 2005-04-29  Raja R Harinath  <harinath@gmail.com>
20366         * class.c (mono_class_init): Add a mono_loader_unlock to the
20367         #74734 fix.
20369 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
20371         * icall.c (ves_icall_System_Environment_Exit): Remove the 
20372         suspend_all_other_threads () call for the time being, since it can hang.
20374         * threads.c (mono_thread_manage): Similarly, disable the waiting for
20375         the background threads to exit, since it can also hang.
20377         * class.c (mono_class_init): Applied patch from Ankit Jain 
20378         (radical@gmail.com). Avoid pending init errors when a field refers
20379         to a nested class using a typeref. Fixes #74734.
20381         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
20382         this for dynamic modules.
20384 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20386         * threads.c: don't wait for threads that are in the process of aborting
20387         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
20388         and waiting for background threads to finish. This makes xsp and
20389         mod-mono-server exit without random length delays and/or hangs.
20391 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20393         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
20395 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
20397         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
20398         dynamic types to prevent infinite loops. Fixes #74727.
20400         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
20401         ..._is_assignable_to.
20403 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
20405         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
20407 2005-04-25  Martin Baulig  <martin@ximian.com>
20409         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
20411         * domain.c
20412         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
20414         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
20416         * reflection.c (build_compressed_metadata): Set metadata header
20417         version to 2.0.
20419 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
20421         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
20422         number into an integral and a decimal part. Fixes #70473.
20424         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
20426 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
20428         * culture-info-table.h : reflected the latest locale-builder output.
20430 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20432         * threadpool.c: check for SuspendRequested too when deciding if
20433         mono_thread_interruption_checkpoint should be called.
20435 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20437         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
20438         * threads.c: remove interruption_mutex and use Interlocked instead. When
20439         suspending all the threads, wait for all the suspended events at once.
20440         If we're shutting down and get an APC that is going to be queued,
20441         call mono_thread_execute_interruption immediately, as the thread might
20442         be sleeping on a pthread condition or mutex.
20444         * icall.c: call mono_runtime_set_shutting_down before suspending the
20445         threads.
20447         Fixes bug #74693. And now xsp is happier when exiting.
20449 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
20451         * loader.c (mono_stack_walk): Fix #74690.
20453 2005-04-22  Martin Baulig  <martin@ximian.com>
20455         * mono-debug.h (MonoDebugMethodJitInfo): Added
20456         `MonoDebugMethodJitInfo *jit'.
20458         * mono-debug.c (mono_debug_read_method): Cache the
20459         MonoDebugMethodJitInfo in `address->jit'.
20460         (mono_debug_free_method_jit_info): New public method.
20462 2005-04-22  Martin Baulig  <martin@ximian.com>
20464         * class.c (mono_class_is_assignable_from): Disallow
20465         type parameter -> interface.
20467 2005-04-21  Dick Porter  <dick@ximian.com>
20469         * threads.c (mono_thread_create): Turn an assertion into an error.
20471 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
20473         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
20474         
20475         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
20476         Fix some gcc 4.0 warnings.
20478 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
20480         * file-io.c: fix alt dir separator char on unix systems
20481         and cleanup (fixes bug #71214).
20483 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
20485         * marshal.c: Use CALLVIRT instead of CALL when dispatching
20486         a call to a remote domain, since the method may be an
20487         interface method in the client domain. This fixes bug #74192.
20489 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20491         * threadpool.c: recv/send are now performed before going back to managed
20492         code to save one transition.
20494 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20496         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
20498         * metadata/threadpool.c: removed hack to workaround the bug above.
20500         Fixes bug #74618.
20502 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
20504         * reflection.c reflection.h: Fix handling of parameter defaults in
20505         dynamic methods. Also fixes handling of parameter attributes.
20506         Fixes #74609.
20508         * mono-debug.c (mono_debug_close_image): Fix warning.
20510 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20512         * socket-io.h: replaced old unused field with new 'blocking'.
20513         * threadpool.c: restore socket blocking state on windows(tm).
20515 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
20517         * icall.c: don't return the codebase in the AssemblyName[] returned by
20518         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
20519         * object-internals.h: Removed FIXME (fields were presents) and fixed
20520         versioncompat declaration.
20522 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20524         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
20525         not closed, so don't cleanup when it happens.
20527 2005-04-13  Chris Toshok  <toshok@ximian.com>
20529         * mono-debug-debugger.h: change prototype for
20530         mono_debugger_lookup_type.
20532         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
20533         this function, although it should probably be named
20534         mono_debugger_init_type.
20536 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20538         * threadpool.c: fix non-AIO case.
20540 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
20542         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
20543         the built-in profiler to measure just JIT compilation times.
20545 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20547         * threadpool.c: the epollfd might be closed by another thread at
20548         any time, so ignore EBADF at treat it as a "we're closing" sign.
20550 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20552         * threadpool.c: release the semaphores with a count equals to the number
20553         of working threads in both IO and regular pools. Fixed typo that messed
20554         up the count of IO pool threads. Don't initialize the pipe handles if
20555         we're using epoll.
20557 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20559         * threadpool.c: some systems don't like a NULL when deleting the socket
20560         from epoll.
20562 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20564         * threadpool.c: fix semaphore allocation.
20566 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20568         * threadpool.c: added epoll() based implementation for asynchronous IO
20569         that is used instead of the default poll() when available.
20570         It can be disabled by setting MONO_DISABLE_AIO.
20572 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20574         * threadpool.c: windows needs 'closesocket' and instead of returning
20575         0 when the stream is closed while in select, it returns -1. Fixes bug
20576         #74573.
20578 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
20580         * class.c (class_compute_field_layout): Fix the regression caused by
20581         the previous try.
20583 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20585         * threadpool.c: separate pool for socket async. IO.
20586         * threadpool.h: mono_max_worker_threads is not a global any more.
20588 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
20590         * class.c (class_compute_field_layout): Fix #74549.
20592 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20594         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
20595         use 2 connected sockets instead.
20597 2005-04-08  Miguel de Icaza  <miguel@novell.com>
20599         * mono-config.c: Add new entry point for mkbundle
20600         mono_config_parse_memory. 
20602 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20604         * threadpool.c: removed another unused function.
20606 2005-04-08  Ankit Jain  <radical@corewars.org>
20608         * reflection.c (get_default_param_value_blobs): Add 'types'
20609         parameter to get the types encoded in the constant table.
20610         (mono_param_get_objects): Use the type from the constant table,
20611         not the type of the parameter, when creating default values.
20612         Handle null default values correctly.
20614 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20616         * file-io.c:
20617         * file-io.h:
20618         * threadpool.c:
20619         * threadpool.h:
20620         * icall.c:
20621         * socket-io.c: removed dead code for async IO.
20623 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20625         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
20627         * threadpool.c: intercept socket async. calls and pass them to a thread
20628         that is polling and dispatching the job items to the threadpool as
20629         socket become ready. Fixes bugs #71217, #71933.
20631         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
20632         between char and short/ushort arrays.
20634         * socket-io.c: remove dead code.
20636 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
20638         * locales.c,
20639           icall.c : removed InternalToUpper_Comp() and
20640           InternalToLower_Comp().
20642 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
20644         * char-conversions.h : The tables were incorrectly generated. Should
20645           be generated against invariant culture.
20647 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
20649         * object.c (mono_runtime_invoke_array): Fix return value when 
20650         passing pre-created valuetype objects to ctors.
20652         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
20653         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
20654         Fixes #74338.
20656 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
20658         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
20659         only used with --security and hides the wrong corlib version error.
20661 2005-03-30  Joshua Tauberer  <tauberer@for.net>
20663         * class.c: Changed mono_class_name_from_token so that types
20664         outside of a namespace don't have an initial period.  Improved
20665         the g_warning message used in _mono_class_get when loading
20666         fails.
20667         * assembly.c: In mono_assembly_load_reference, when an assembly
20668         can't be found, "No such file or directory" is misleading and
20669         unhelpful because a few paths were checked for the presence of
20670         the assembly.  When that happens (ENOENT), display a nicer
20671         message indicating the directories that were searched.  In all
20672         cases, the warning is made easier to read for non-hackers.
20674 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
20676         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
20677         project/solution.
20678         * appdomain.h|domain.c: Removed inline from functions.
20679         * appdomain.c: Reduced warnings when compiling on windows.
20680         * icall.c: Fixed output_debug declaration to gunichar2*.
20681         * mono-config.c: Reduced warnings when compiling on windows.
20682         * rand.c: Added missing "windows.h". Added missing return value.
20683         * rawbuffer.c: Added missing winsock2.h for windows.
20684         * sysmath.h: Added mono-compiler.h header to allow/ease 
20685         compilation with non-GCC compilers.
20686         * threads.c: Fixed declarations to compile with VS.NET C compiler.
20687         Removed cast warnings.
20689         Adapted from the work of J Lothian (for VC6).
20691 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
20693         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
20694         from default_path.
20696 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
20698         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
20699         the 2.0 profile.
20701 2005-03-27  Raja R Harinath  <harinath@gmail.com>
20703         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
20704         has to be in $(exec_prefix).  $(prefix) is for arch-independent
20705         stuff, and it would probably use $(prefix)/share rather than
20706         $(prefix)/lib.
20708 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20710         * console-io.c: added 2 includes that might be missing.
20712 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
20714         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
20715         profile.
20717         * reflection.c (create_custom_attr): Allocate the params array using
20718         alloca so it gets GC tracking.
20720 2005-03-23  Chris Toshok  <toshok@ximian.com>
20722         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
20723         out some spew.
20725 2005-03-24  Raja R Harinath  <rharinath@novell.com>
20727         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
20728         changes to pick up any changes in prefix, etc.
20730 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
20732         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
20733         
20734         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
20735         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
20737 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
20739         * class-internals.h object-internals.h class.c reflection.c: Extend the
20740         mono_lookup_dynamic_token () function to return the class of the
20741         token as well. 
20743         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
20744         well. Fixes #73848.
20746 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
20748         * security-manager.c: Skip inheritance checks for intra-corlib
20749         class inheritance and method overrides. This skips a lot of checks
20750         and (anyway) permissions cannot work until corlib is loaded.
20752 2005-03-23  Martin Baulig  <martin@ximian.com>
20754         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
20755         MONO_TYPE_GENERICINST.  
20757 2005-03-23  Martin Baulig  <martin@ximian.com>
20759         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
20761 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
20763         * class.c: added locking comments to some functions.
20764         Cache the interface offsets arrays (saves about 20 KB
20765         of runtime memory in a typical app).
20766         Reduce the time overhead in mono_class_setup_supertypes ().
20768 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
20770         * icall.c: speedup and fix leaks in GetMethodsByName and
20771         GetPropertiesByName.
20773 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20775         * reflection.c: some locking fixes.
20777 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
20779         * metadata.c: added missing break in case statement.
20781 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
20783         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
20784         typedbyref return values. Fixes #73941.
20786 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
20788         * security-manager.c|h: Added demandunmanaged method and 
20789         suppressunmanagedcodesecurity class to MonoSecurityManager.
20790         Renamed aptc class to allowpartiallytrustedcallers.
20792 2005-03-17  Martin Baulig  <martin@ximian.com>
20794         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
20796 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20798         * file-io.c: disabled file async. IO using aio_*. It uses the
20799         threadpool now. Workaround for bug #73718.
20801 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20803         * assembly.h, mono-config.c: added code to deal with bundled configs
20804         for bundled assemblies.
20806 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
20808         * *.c, private.h: cleanup, removing old private.h header file.
20810 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
20812         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
20813         and throw_on_unmappable_char attributes.
20815 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
20817         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
20818         _ProcessName_internal.
20820 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
20822         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
20823         #73631.
20825         * icall.c threads.c threads-types.h: Remove slothash icalls as they
20826         are no longer used.
20828 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
20830         * object.c (compute_class_bitmap): Add support for generics. Fixes
20831         #73527.
20833 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
20835         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
20837 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20839         * filewatcher.c: commented out the code for windows watcher, as we don't
20840         use it (we use the managed implementation instead).
20842 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
20844         * object-internals.h (MonoThread): Remove 'unused1' field.
20846         * appdomain.c: Bump corlib version.
20848         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
20850         * reflection.c (mono_reflection_create_runtime_class): Remove the
20851         AssemblyBuilder.Save optimization since it causes too many problems.
20853 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
20855         * exception.c|h: Added mono_get_exception_reflection_type_load to
20856         create a ReflectionTypeLoadException object.
20857         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
20858         to return NULL is a InheritanceDemand fails during reflection. Updated
20859         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
20860         ReflectionTypeLoadException if an InheritanceDemand fails during 
20861         reflection. Added icall mapping for GetLinkDemandSecurity.
20862         * security-manager.c|h: Added ves_icall_System_Security_
20863         SecurityManager_GetLinkDemandSecurity internal call to return the
20864         class and methods permissions set for a LinkDemand. Removed unused
20865         fields in MonoSecurityManager.
20867 2005-03-10  Martin Baulig  <martin@ximian.com>
20869         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
20870         it's a generic instance.
20872 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
20874         * reflection.c (mono_get_object_from_blob): Applied patch from
20875         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
20877         * class.c (mono_class_is_assignable_from): Another try at fixing 
20878         #73469 without breaking anything.
20880 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
20882         * class.c: (mono_class_is_assignable_from): Revert the last changes
20883         since they don't work with generics.
20884         
20885         * class.c (mono_class_is_assignable_from): Fix build bustage.
20887         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
20888         the managed IsAssignableFrom method. Fixes #73469.
20890         * reflection.c (mono_reflection_call_is_assignable_from): New helper
20891         function.
20893 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
20895         * object.c (mono_load_remote_field_new): Fix returning uninitialized
20896         memory when the remoting callback does not sets the out arguments.
20897         Fixes #73007.
20899         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
20900         by mistake.
20902         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
20904         * object-internals.h (MonoStackFrame): Sync with managed object layout.
20906         * appdomain.c: Bump corlib version.
20908 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
20910         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
20911         function.
20913         * threads.c (mono_thread_attach): Detect threads which are not started
20914         by the GC pthread wrappers.
20916 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
20918         * icall.c: Added new icall for RNG.
20919         * rand.c|h: Added new icall to open the RNG. This allows to share a 
20920         single handle on Linux to access /dev/urandom and fix #73183.
20922 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
20924         * object.c: setting the new vtable in a transparent proxy object must
20925         not change the GC descriptor.
20927 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20929         * object.c: fixed compilation without GCJ support.
20930         * reflection.c: for runtime-created types ensure klass->has_references
20931         is correct (bug #73215).
20933 2005-03-02  Martin Baulig  <martin@ximian.com>
20935         * class.c (mono_class_is_assignable_from): Make this work if
20936         `oklass' is a generic instance; fixes #72831.
20938 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
20940         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
20941         with hasthis set.
20942         
20943         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
20945         * marshal.c: Reorganize native->managed marshalling code to also use
20946         the emit_marshal_... functions.
20948 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
20950         * object.c: typed allocs have issues with bitmap sizes > 30,
20951         so check for max_set >= 30.
20953 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
20955         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
20956         managed code. Fixes #73012.
20958         * metadata.h (MonoMarshalSpec): Add elem_mult field.
20960         * metadata.c reflection.c: Load/Emit elem_mult as well.
20961         
20962         * metadata.h (MonoMarshalSpec): Add comment.
20964         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
20966         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
20967         num_elem to -1 if not given.
20969         * object-internals.h (MonoReflectionMarshal): Add has_size field.
20971         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
20972         given values.
20974 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
20976         * null-gc.c (mono_gc_free_fixed): Was not compilable.
20978 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
20980         * reflection.c (encode_marshal_blob): Encode param_num field as well.
20982         * object-internals.h (MonoReflectionMarshal): Add param_num field.
20984 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
20986         * object.c: generalized the reference bitmap creation
20987         and added hooks for the new GC.
20988         * class-internals.c: removed the gc_bitmap field from MonoClass.
20990 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
20992         * domain.c: help the compiler to produce better code
20993         in mono_jit_info_table_find ().
20995 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
20997         * object.c: make all allocations look typed.
20999 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21001         * socket-io.c: load Mono.Posix if it's not loaded already
21002         (fixes bug#73033).
21004 2005-02-24  Martin Baulig  <martin@ximian.com>
21006         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
21007         * reflection.c (dup_type): Likewise.
21009 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
21011         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
21012         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
21014 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21016         * domain.c, threads.c, object-internals.h: make the critical thread
21017         local vars use the fast access mode (even when we're compiled in
21018         a lib). Provide accessors to be used by the jit during codegen.
21020 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21022         * appdomain.c: Changed hook functios behavior to include
21023         support for the reflection only assemblies. Some icalls were changed
21024         to support the mentioned assemblies too. Signatures of static methods
21025         try_assembly_resolve and real_load now have an additional parameter:
21026         refonly.
21028         * assembly.c: General changes to mono_assembly_ methods to support
21029         reflection only api. Functions mono_assembly_open, mono_assembly_load,
21030         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
21031         suffix, to support an additional gbool parameter to specify whether
21032         the assembli is reflection only or not. Created some new hook functions 
21033         to add support for reflection only assemblies. Signatures of static 
21034         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
21035         have now an additional parameter: refonly.
21037         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
21038         indicating whether the assembly is reflection only or not.
21040         * exception.c: Add mono_get_exception_invalid_operation.
21042         * icall.c: Throw an InvalidOperationException when trying to invoke
21043         a property/method/event, or trying to set/get the value of a field.
21044         Also add an icall to retrieve the ref_only flag to the
21045         MonoReflectionAssembly.
21047 2005-02-23  Chris Toshok  <toshok@ximian.com>
21049         Part of fix for #72827.
21050         * mono-debug.c (mono_debug_add_method): add lexical block data to
21051         the info we write.  Kind of a hack at the moment - we copy the
21052         lexical block info from the MonoDebugMethodInfo to the
21053         MonoDebugMethodJitInfo here, before writing it.
21054         (mono_debug_read_method): read the lexical block info.
21056         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
21058         * debug-mono-symfile.h: add lexical block support.
21060         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
21061         support.
21063 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
21065         * loader.c (mono_lookup_pinvoke_call): Fix warning.
21067         * object.c (mono_runtime_free_method): Call mono_free_method () and
21068         put the TODOs there.
21070         * loader.c (mono_free_method): Free up most memory allocated for 
21071         dynamic methods.
21073 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
21075         * reflection.c: properly flag a Type argument to a
21076         named custom attr value (bug #72248).
21078 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21080         * reflection.c: reduce code duplication in named custom
21081         attribute encoding.
21083 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
21085         * reflection.c: properly encode custom attrs of type object
21086         (bug #72649).
21088 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
21090         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
21092 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
21094         * socket-io.c: load System.dll if it's not loaded already
21095         (bug #72850 and #70477).
21097 2005-02-21  Martin Baulig  <martin@ximian.com>
21099         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
21100         generic instances.
21102 2005-02-21  Martin Baulig  <martin@ximian.com>
21104         * reflection.c (mono_image_build_metadata): We also need to
21105         "fixup" the MethodImpl table after we computed the final method
21106         indices.  Call fixup_methodimpl() to do that.
21107         (fixup_methodimpl): New private method.
21109 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
21111         * assembly.c: special case mscorlib.dll (bug#72536),
21112         patch from Carlos Alberto Cortez.
21114 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
21116         * threads-types.h threads.c: Fix build bustage.
21118         * threads.c: Use a union for long<->double conversions.
21120         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
21121         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
21123         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
21124         containing the checkpoint call with NOT_TAKEN.
21125         
21126         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
21127         checkpoint before pushing the arguments, so they won't have to be
21128         spilled to stack.
21130 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21132         * domain.c, assembly.c, domain-internals.h: make some data
21133         const and relocation-free.
21135 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
21137         * object.c, appdomain.c, class-internals.h: introduce the
21138         MonoClassRuntimeInfo structure to hold the info needed to
21139         use a class at runtime. Made mono_class_vtable() lock-free
21140         for all the appdomains.
21142 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
21144         * metadata-internals.h, image.c: introduce a per-image mempool to
21145         be used for memory that has the same lifetime as the image.
21147 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
21149         * domain.c: In mono_init_internal(), instead of selecting the first
21150         runtime version supported by an executable, get a list of all
21151         supported versions and select the one for which an mscorlib exists
21152         (since even if the runtime supports a given version, it doesn't mean
21153         that the framework for that version is installed).
21154         Modified get_runtimes_from_exe to support this behavior.
21155         In supported_runtimes, added information about additional system
21156         assembly versions.
21157         
21158         * assembly.c: Added support for more than one system assembly version
21159         per runtime version. Updated the assembly list.
21160         In mono_assembly_remap_version, removed the initial version check,
21161         since we don't know to which version we need to compare until we
21162         get the version set on which the assembly is based.
21163         Moved the code for loading corlib into the new method
21164         mono_assembly_load_corlib(), so it can be used by the initialization
21165         code.
21166         
21167         * domain-internals.h: Updated data structures and added declaration
21168         for mono_assembly_load_corlib.
21170 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
21172         * reflection.c (resolve_object): Fix the creation of the signature in 
21173         the SignatureHelper case.
21175         * assembly.c (mono_assembly_remap_version): Fix binary search.
21176         
21177 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
21179         * class.c: Added inheritance check when a method is overloaded (from a
21180         virtual method or when implementing an interface) and when a class is
21181         inherited. Added functions to set a failure for a class and to 
21182         retreive the exception from a failure.
21183         * class-internals.h: Added fields to MonoClass to keep the exception
21184         information status for inheritance (or other exceptions) to be thrown
21185         later (i.e. not at load time).
21186         * object.c: Throw the inheritance SecurityException when a type is to 
21187         be created with either class or method inheritance violations.
21188         * reflection.c|h: Fix when getting declsec from a class. Removed 
21189         unrequired code for class. Improved sanity in parameter naming.
21190         * security-manager.c|h: Added functions to check for class and method
21191         inheritance.
21193 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
21195         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
21196         and has_finalize in dynamic types as well.
21198 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
21200         * culture-info-table.h : fixed currency format for en-GB (and so on).
21202 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
21204         * gc.c: ensure the GC handles never have 0 as a value.
21206 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
21208         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
21209         a pointer to a struct to unmanaged code. Fixes #72625.
21211 2005-02-16  Martin Baulig  <martin@ximian.com>
21213         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
21215 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
21217         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
21219 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
21221         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
21223         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
21224         UnmanagedFunctionPointerAttribute, use it for determining calling convention
21225         etc. Fixes #71471.
21227         * reflection.c (mono_custom_attrs_get_attr): New helper function.
21229         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
21231 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
21233         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
21234         changes to make the current context a field in MonoThread.
21236 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
21238         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
21239         the last change.
21240         
21241         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
21242         extracted from mono_marshal_get_native_wrapper.
21244         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
21245         to create wrappers around native functions.
21247         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
21248         delegates for arbitrary function pointers. Fixes #71472.
21250 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
21252         * threads.c: cleaned up the code a little.
21254 2005-02-15  Martin Baulig  <martin@ximian.com>
21256         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
21257         the data table.
21259         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
21260         allocate larger chunks if needed.
21262 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
21264         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
21265         in by mistake.
21267 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
21269         * domain.c: keep the domains in an array and ensure the domain ids
21270         are kept small, so they can be used as indexes to domain-specific data
21271         with a small memory overhead.
21273 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
21275         * icall.c: Handle byref types in Type icalls. Fixes #72544.
21277 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
21279         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
21281 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
21283         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
21285         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
21286         values.
21288         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
21289         
21290 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
21292         * domain-internals.h: add the hashtable here.
21294         * class-internals.h: Remove `info' from MonoMethod
21296         * domain.c: Add a new hashtable, jit_trampoline_hash
21298 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
21300         * object.c: don't set the value of static fields
21301         (fixes bug#72494).
21303 2005-02-11  Martin Baulig  <martin@ximian.com>
21305         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
21306         (mono_debug_add_method): Silently ignore the method if it's too big.
21307         (mono_debug_add_type): Likewise.
21309 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
21311         * threads.c, appdomain.c: remove #ifdefs from the code.
21313 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
21315         * metadata-internals.h: Added flags to MonoAssembly to cache the most
21316         common security informations. This allows us to stay in unmanaged code
21317         when doing LinkDemand and it's special cases (except for the first 
21318         time for initialization). The flags a very much used with --security.
21319         * reflection.c|h: Added code to get declarative security attributes 
21320         for LinkDemand and InheritanceDemand. This required to refactor the
21321         existing code for Demand.
21322         * security-manager.c|h: Added new method fields for the special cases
21323         of LinkDemand.
21325 2005-02-10  Martin Baulig  <martin@ximian.com>
21327         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
21328         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
21330 2005-02-10  Martin Baulig  <martin@ximian.com>
21332         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
21333         debugging code; this is almost a complete rewrite.
21335         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
21337 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21339         * domain.c, object.h: expose mono_string_equal () and 
21340         mono_string_hash ().
21341         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
21342         it's implemented in managed code.
21344 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21346         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
21347         lo leak objects between appdomains.
21349 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21351         * assembly.c: old compilers compilation fix from 
21352         robertj@gmx.net (Robert Jordan).
21354 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
21356         * class-internals.h: Little reminder for the future.
21358         * debug-helpers.c: Fix up wrapper_type_names
21360 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21362         * image.c, metadata-internals.h: when loading an image from a file,
21363         mmap all of it and use the same codepaths as when using a
21364         in-memory image: the code is simpler and we use less memory
21365         (both writable and readonly).
21367 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
21369         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
21370         API to alloc runtime data structures that need to be tracked by the
21371         GC and contain pointers.
21372         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
21373         make the code more readable and eventually use a different GC.
21375 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
21377         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
21378         for out arguments.
21379         
21380 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
21382         * object.c: In release_type_locks(), don't release the cctor lock
21383         if it has already been released. This fixes a crash in the
21384         thread5 test.
21386 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21388         * gc.c, marshal.c, icall.c: register a delegate for finalization
21389         only when the native function pointer has been allocated for it.
21391 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
21393         * object.c: cleaned up some code, allocate objects that are
21394         pointer free with the atomic malloc variant. Allocate memory
21395         for static data from the mempool if it's pointer-free.
21396         Allocate the bounds array at the end of the array data, when needed.
21397         * object-internals.h, object.h: move a private function in a private
21398         header.
21399         * class.c: handle missing case in tracking references in fields.
21401 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
21403         * class.c, class-internals.h: keep track if a type has
21404         reference fields in either the instance or static fields.
21406 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
21408         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
21409         and renamed to MonoRuntimeInfo. Added fields to store the expected
21410         framework assembly version. Changed mono_get_framework_version and
21411         mono_get_runtime_version for a single mono_get_runtime_info method.
21412         
21413         * assembly.c: Added method to remap system assembly versions to the
21414         current executing runtime version. Removed old mapping code.
21415         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
21416         
21417         * icall.c, reflection.c: Track api changes.
21419 2005-02-06  Miguel de Icaza  <miguel@novell.com>
21421         * loader.c (method_from_memberref): Improve error reporting,
21422         produce the class name instead of the typeref/typedef index. 
21424 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
21426         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
21428 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21430         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
21431         stdcall and charset name mangling.  Reorganize the code and add
21432         some tracing stuff.
21434 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
21436         * monodiet.c: More iters!
21438         * marshal.c: Iter usage.
21440         * icall.c: Iter usage.
21442         * object.c: Use iters.
21444         * debug-helpers.c: More iters
21446 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21448         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
21449         under win32.
21451 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
21453         * mono-debug-debugger.c: use iters
21455         * class.c, class-internals.h: mono_class_setup_events is static
21456         now
21458         * All callers: use iters
21460 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21462         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
21463         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
21465 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
21467         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
21469         * marshal.h: Add prototypes for ldfld/stfld_remote.
21471         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
21472         this is called during startup.
21473         
21474 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
21476         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
21477         MonoThreadsSync struct private in monitor.c. Changed the way
21478         MonoThreadsSync is allocated so it's faster and there is no
21479         need to keep track of it with a finalizer and it uses less memory.
21480         This also finally allows us to allocate mono objects as ptrfree when
21481         there are no reference fields.
21483 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
21485         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
21486         disappearing link to the GC interface and use them to simplify
21487         the gchandles code.
21489 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
21491         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
21492         stfld_remote which call mono_load/store_field_new. This allows methods
21493         calling ldfld/stfld wrappers to be AOTed.
21495         * console-io.c: Include sys/filio.h under solaris.
21496         
21497         * console-io.c: Include curses.h if needed correctly.
21499 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
21500         
21501         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
21502         method->klass as well.
21504         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
21506         * class.c (mono_class_init): Switch on lazy initialization of 
21507         methods.
21509         * class.c (mono_class_get_finalizer): Handle the case when the 
21510         finalizer is inherited.
21512 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21514         * console-io.c: <curses.h> is needed by term.h on solaris.
21516 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
21518         * icall.c, class-internals.h, monodiet.c, class.c: Remove
21519         mono_class_setup_properties where possible. Remove this ftn from
21520         the header file, and make it static.
21522 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
21524         * loader.c: Add missing setup_... call.
21526         * class.c: Add missing setup_... calls.
21528         * class.c (mono_class_init): Switch on lazy initialization of 
21529         the generic vtable.
21530         
21531         * class.c (mono_class_init): Fix generics broken by the recent changes.
21533         * monodiet.c (handle_type): Add missing setup_... calls.
21535         * class.c: Back out garbage in previous patch.
21536         
21537         * class.c: Add missing setup_... calls.
21539         * class.c (mono_class_get_method_from_name_flags): Avoid calling
21540         mono_class_setup_methods () if possible.
21542         * class-internals.h (MonoClass): Add 'has_cctor' flag.
21544         * class-internals.h (MonoCachedClassInfo): New structure.
21546         * class.c: Initialize properties and events fields of MonoClass lazily.
21548         * class.c: Add infrastructure for lazily initializing the methods and
21549         vtable fields of MonoClass. Not yet used.
21551         * class.c (mono_class_get_finalizer): New helper function.
21553         * class.c: Add infrastructure for loading some class related data from
21554         an AOT file.
21556         * object.c: Add infrastructure for initializing the vtable from data
21557         in the AOT file.
21559         * gc.c (run_finalize): Use mono_class_get_finalizer ().
21561         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
21562         appropriate initialization function before accessing parts of the
21563         MonoClass structure.
21565         * marshal.c: Fix warnings.
21566         
21567         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
21569         * mono-debug-debugger.c (get_exception_message): Use 
21570         mono_class_get_method_from_name_flags ().
21572 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
21574         * reflection.c, appdomain.c: Replace a few manual searches that
21575         Zoltan missed. (Paolo approved this part of my initial patch).
21577 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
21579         * profiler.c: disable recording statistical events at report time.
21581 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21583         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
21584         to byteswap arrays of enum values, too (bug #72080).
21586 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
21588         * appdomain.c (set_domain_search_path): Allow this to be called if
21589         domain->setup is not yet set.
21591         * loader.c (mono_method_get_index): New helper function.
21593         * loader.c reflection.c: Use mono_method_get_index ().
21595         * class.c (mono_class_get_method_from_name_flags): New helper method.
21597         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
21598         this.
21600         * class.c (mono_class_get_cctor): New helper method.
21602         * string-icalls.c object.c class.c marshal.c reflection.c: Use
21603         mono_class_get_method () to look up methods.
21605 2005-02-01  Miguel de Icaza  <miguel@novell.com>
21607         * console-io.c: Fix the build, this should work on Windows.
21609 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
21611         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
21612         be set to null to keep things valid
21614 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21616         * icall.c: added Console 2.0 icalls.
21617         * Makefile.am: added console-io.[ch]
21618         * console-io.[ch]: internal calls for Console 2.0 API.
21620 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21622         * class.c: make sure we consider all the interfaces
21623         when calculating max_interface_id (bug found by
21624         Jeroen Frijters running ikvm).
21626 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
21628         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
21629         valuetype fields to null.
21631         * object.c (set_value): Ditto. Fixes #71669.    
21633 2005-01-31  Martin Baulig  <martin@ximian.com>
21635         * metadata.c (mono_metadata_has_generic_params): New public
21636         function; checks whether something is a generic method.
21638 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
21640         * appdomain.c: fix infinite recursion when adding assemblies.
21642 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
21644         * object.c: Fix small typo to return all items for Environment.
21645         GetCommandLineArgs.
21647 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21649         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
21650         reflection.c: more domain and assembly-unload related fixes
21651         and memory leaks plugs.
21653 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
21655         * 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.
21657 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
21659         * loader.c (mono_method_signature): Make this method lazy
21660         (mono_get_method_from_token): Don't computate the signature here.
21662         Doing this saves quite a bit of memory. I got 90 kb on starting up
21663         monodoc. It should also save some disk reads on startup.
21665         * *: MonoMethod->signature might be NULL now. You *MUST* use
21666         mono_method_signature.
21668 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
21670         * object.c (mono_runtime_get_main_args): Return an array from the
21671         current domain here. Fixes #71938.
21673 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
21675         * monitor.c: formatting changes to comply with the
21676         mono coding style and remove #ifdefs from the code.
21678 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
21680         * metadata.c, private.h: remove some unneeded data
21681         and use a more compact representation for table schemas.
21683 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
21685         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
21686         to get a better distribution in hash tables.
21687         * *.c: use mono_aligned_addr_hash() where appropriate.
21688         * assembly.c: make var static.
21690 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
21692         * domain-internals.h: Put MonoJitInfo on a diet.
21694         * domain.c: Fix a warning.
21696 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21698         * gc.c: rework the gc handles code to reuse handles
21699         when freed.
21701 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
21703         * domain.c: fixed long standing bug in mono_string_equal() which
21704         was brought to light with the ldstr changes.
21706 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
21708         * reflection.c: Remove warning by adding missing include for marshal.h
21710 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21712         * domain.c, object.c: change the ldstr_table to hold
21713         MonoString* as keys: makes the runtime isinterned lookup
21714         faster and simplifies memory management.
21716 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
21718         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
21719         possible to add imperative security checks before calling the icall.
21720         * reflection.c: Return security attributes on the original MonoMethod
21721         (and not the wrapped one). This fix permissions on icalls.
21723 2005-01-25  Dick Porter  <dick@ximian.com>
21725         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
21726         the check for mktime() support actually test the mktime() return
21727         value.  "Fixes" bug 71682, though the output is still different to
21728         MS.
21730 2005-01-25  Martin Baulig  <martin@ximian.com>
21732         * class.c (mono_class_is_assignable_from): Make this work for
21733         generic instances.
21735 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
21737         * marshal.c (mono_string_utf8_to_builder)
21738         (mono_string_builder_to_utf16): We might not have ownership of the
21739         string. In thise case, we need to create a new buffer.
21741         * object-internals.h (mono_stringbuilder_capacity): sb->str might
21742         be null, in which case, use the default capacity.
21744 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21746         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
21747         GC events to the profiler.
21749 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
21751         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
21752         if you don't want the GC to run.
21754 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
21756         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
21757         start providing a GC API and keeping different implementations in
21758         their own file.
21759         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
21761 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
21763         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
21764         mmap rather than allocating a huge buffer.
21765         (mono_debug_close_mono_symbol_file): Free the buffer allocated
21766         above.
21768 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
21770         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
21771         and CheckExecutionRights.
21772         * reflection.c|h: Keep the index of the declarative security to be 
21773         used, instead of the pointer, when AOT compiler is used. Also add 
21774         class initialization when requesting demands.
21775         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
21776         CheckExecutionRights. Both properties are now FALSE by default, and
21777         unmodifiable, unless the --security option is used.
21779 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
21781         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
21782         reflection.c: properly refcount images and assemblies, many leaks fixed.
21784 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21786         * threadpool.c: increase the timeout for threads in the thread pool to
21787         10s.  Fixes bug #67159.
21789 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
21791         * class-internals.h: Sun's compiler insists on explicit
21792         signed on bit fields to handle then correctly.
21794 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
21796         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
21797         Make the size of the array fit only the number of invalid path
21798         chars that we have.
21800         * class.c (_mono_class_get): Improve the error reporting when a
21801         class referenced is not found, to assist debugging. 
21803 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
21805         * threads.c: fix off-by-one error.
21806         * domain.c: free data allocated in the domain.
21808 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
21810         * reflection.c (mono_method_body_get_object): Fill out exception info
21811         as well.
21813         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
21814         structure.
21815         
21816 2005-01-19  Martin Baulig  <martin@ximian.com>
21818         * loader.c (mono_get_method_constrained): Make this work again.
21820 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
21822         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
21823         guint16 to match the managed side.
21825         * reflection.c (mono_reflection_body_get_object): Fill out local
21826         variables array.
21828         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
21829         as well.
21831         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
21832         'local_var_sig_token'.
21834 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
21836         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
21837         System.Drawing.
21839         * reflection.c (mono_method_body_get_object): Handle abstract and
21840         runtime methods.
21842 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
21844         * marshal.c, loader.c, class-internals.h, reflection.c:
21845         store the emthod data for a wrapper in an array instead of a list.
21847 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
21849         * marshal.c: change the code to allocate memory more
21850         conservatively for method wrappers.
21852 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
21854         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
21855         fields from MonoClass to the marshal info structure where they belong.
21857 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21859         * class.c, object.c, class-internals.h, marshal.c: rearrange
21860         some fields and tweak some types to lower memory usage.
21862 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
21864         * threads.c (signal_thread_state_change): Handle the case when the
21865         target thread is the current thread.
21867         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
21869         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
21870         emit_ptr_to_object_conv. 
21872         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
21873         marshalling. Fixes #71352.
21875 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
21877         * metadata.h, blob.h: move table enum to blob.h so it can be included
21878         in any header.
21879         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
21880         cut the size of MonoImage/MonoDynamicImage.
21882 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
21884         * profiler.c (mono_profiler_install_simple): Fix default arguments.
21886 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
21888         * reflection.c, reflection.h, icall.c: add a function to check
21889         if an attribute type is defined for a metadata object.
21891 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
21893         * object-internals.h: Added some needed fields from StringBuilder class.
21894         * marshal.c: Set the maxCapacity when creating a StringBuilder.
21896 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
21898         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
21899         threads before shutting down the runtime.
21901         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
21903 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21905         * object-internal.h, threads.c: implement stacksize and 
21906         parameterized thread start functionality (requires
21907         matching corlib). Marked broken code for later removal.
21909 2005-01-12  Martin Baulig  <martin@ximian.com>
21911         * class-internals.h (MonoGenericClass): Moved the `initialized'
21912         flag to MonoDynamicGenericClass, removed `init_pending'.
21913         (MonoGenericInst): Added `is_reference' flag.
21915 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
21917         * reflection.c (mono_image_create_pefile): Only set the pe_offset
21918         inside the MSDOS header. Fixes #71201.
21920         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
21921         gc thread.
21922         (mono_domain_finalize): Ditto.
21924 2005-01-12  Martin Baulig  <martin@ximian.com>
21926         * class.c (mono_get_shared_generic_class): Use the cache for
21927         non-dynamic generic classes.
21929         * class-internals.h (mono_class_create_generic_2): Removed
21930         function prototype, this function is now static inside class.c.
21932         * class.c (mono_class_create_generic_2): Made this static, only
21933         call it from mono_class_init() and mono_class_setup_parent().
21934         (collect_implemented_interfaces_aux): Call mono_class_init() on
21935         the interfaces we collect.
21936         (mono_class_setup_vtable): Call mono_class_init (class->parent).
21938 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
21940         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
21941         it a real thread handle.
21943         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
21944         MonoJitExceptionInfo, since each catch clause needs its own variable.
21945         
21946 2005-01-11  Dick Porter  <dick@ximian.com>
21948         * image.c (mono_pe_file_open): New variant on mono_image_open()
21949         that does not set up the CLI metadata; used for FileVersionInfo so
21950         it can get the data for windows binaries too.
21951         
21952         * process.c (process_read_string_block): Don't read off the end of
21953         the StringTable block.
21955         These both fix bug 70766.
21957 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
21959         * gc.c: set some fields to NULL at GC cleanup time.
21960         * threads.c: if we quit the main thread, call exit ().
21962 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
21964         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
21966 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
21968         * threads.h, threads.c, object.c: added accessor and settor for
21969         main_thread. Handle it specially when exiting from it: wait
21970         for other foreground threads to exit.
21972 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
21974         * process.c, verify.c: remove some bloat.
21976 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
21978         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
21979         the calling convention to cdecl under win32.
21981 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
21983         * object.c (mono_object_get_size): New function to get the size of
21984         an object instance.
21986         * profiler.c (simple_allocation): Use above.
21988 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
21990         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
21991         ves_icall_System_AppDomain_getRootDomain (as it's not required to
21992         get an appdomain by it's id and we can't assume the root's id is 0).
21993         * domain-internals.h: Change the function prototype to match.
21994         * icall.c: Change the icall table for AppDomain.
21996 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
21998         * locales.c (string_invariant_compare_char): Only compute
21999         GUnicodeTypes in the case where we need them.  Test for ordinality
22000         first and return if so.
22002         From the commit:
22004                 /*
22005                  * FIXME: here we must use the information from c1type and c2type
22006                  * to find out the proper collation, even on the InvariantCulture, the
22007                  * sorting is not done by computing the unicode values, but their
22008                  * actual sort order.
22009                  */
22011 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
22013         * loader.c: for P/Invoke methods, allow the "Internal" shared
22014         library name to refer to the calling process symbol namespace.
22016 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
22018         * Makefile.am: Add the security manager to the build.
22019         * security-manager.c|h: New. Initialization of the security manager.
22021 2005-01-07  Dick Porter  <dick@ximian.com>
22023         * threads.c: 
22024         * monitor.c: Update thread state during Monitor and WaitHandle
22025         waits.  Fixes bug 71031.
22027 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
22029         * reflection.c (property_encode_signature): Correctly handle when the
22030         property has no methods.
22032 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
22034         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
22035         
22036         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
22037         fields from mb, not rmb. Fixes #71017.
22039         * marshal.c (emit_ptr_to_str_conv): Add support for 
22040         ByValTStr -> string conversion. Fixes #71015.
22042         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
22044         * mempool.c (mono_mempool_contains_addr): New helper function.
22046 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
22048         * metadata.c (mono_metadata_compute_size): Fix size calculation of
22049         HasSematics encoded fields.
22050         
22051         * metadata.c (mono_type_to_unmanaged): Improve error message for 
22052         invalid string marshalling.
22054         * metadata.c: Fix warnings.
22055         
22056 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22058         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
22059         profiler support.
22061 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
22063         * domain.c object.c domain-internals.h: Revert part of r38077 since the
22064         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
22065         tests.
22067 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
22069         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
22070         so methods containing these can be AOTed.
22072 2005-01-03  Martin Baulig  <martin@ximian.com>
22074         * loader.c (find_method): Removed the hack for generic instances.
22075         (method_from_memberref): If our parent is a generic instance, pass
22076         its generic type definition to find_method() and then inflate the
22077         method.
22078         (mono_get_method_constrained): Pass the generic type definition to
22079         find_method() and inflate the method later.
22081         * class-internals.h (MonoStats): Added `generic_class_count'.
22083         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
22084         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
22086         * reflection.c (mono_custom_attrs_from_params): Don't ignore
22087         generic type definitions.
22089 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
22091         * loader.c icall.c: Fix warnings.
22093 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
22095         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
22096         blittable types. Fixes #70864.
22098 2004-12-29  Martin Baulig  <martin@ximian.com>
22100         * icall.c
22101         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
22103         * reflection.c (mono_method_get_object): Create a
22104         "System.Reflection.MonoGenericMethod" for inflated methods; don't
22105         call mono_get_inflated_method().
22107         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
22109 2004-12-27  Martin Baulig  <martin@ximian.com>
22111         * class-internals.h (MonoMethod): Added `is_inflated' flag.
22112         (MonoMethodInflated): Added `inflated' field.
22114         * class.c (mono_class_inflate_generic_method): Don't really
22115         inflate the method here; just set the `is_inflated' flag in the
22116         MonoMethod.
22117         (mono_class_get_inflated_method): Actually inflate the method here
22118         if it's not already inflated; we use the MonoMethodInflated's new
22119         `inflated' field as a cache.
22121 2004-12-26  Martin Baulig  <martin@ximian.com>
22123         * class.c
22124         (inflate_generic_class): Moved some code out of inflate_generic_type().
22125         (mono_class_inflate_generic_method): If we're already inflated,
22126         inflate the context and use the declaring method; ie. make sure
22127         the declaring method of an inflated method is always the generic
22128         method definition.
22129         (mono_class_create_from_typedef): Create
22130         `class->generic_container->context->gclass'.
22132 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
22134         * metadata-internals.h, marshal.c, reflection.c: More
22135         MonoGHashTable->GHashTable.
22137         * domain-internals.h, class.c: Change MonoGHashTable's into
22138         GHashTables for some cases where no gc stuff is used
22140         All users: update apis
22142 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
22144         * metadata.c (builtin_types): Make this `const'. Makes this get
22145         put into the shareable section.
22146         (mono_metadata_init): Casts to make gcc happy.
22148 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
22150         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
22152 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
22154         * icall.c: Added an internal call to retrieve the position and length
22155         of assembly-level declarative security attributes (RequestMinimum, 
22156         RequestOptional and RequestRefuse). This is used by the Assembly class
22157         to re-create the corresponding permission sets.
22159 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
22161         * marshal.c: fix the stelemref wrapper to be type correct
22162         (and faster).
22164 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
22166         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
22167         to do key & 0x7fffffff. Hashtable already does this. It just
22168         results in longer code.
22170 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
22172         * appdomain.c: Bump corlib version.
22173         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
22174         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
22175         * reflection.c|h: Add functions to get declarative security infos
22176         (blob position and length) for assemblies, classes and methods.
22178 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
22180         * reflection.c: sort the constant table (bug #70693).
22182 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
22184         * object-internals.h, threads.c, domain.c: add accessors for
22185         the MonoThread and MonoDomain tls keys.
22187 2004-12-18  Martin Baulig  <martin@ximian.com>
22189         * class.c (inflate_generic_type): If we're inflating a generic
22190         instance, set `ngclass->context->container = context->container';
22191         ie. the container we inflated into.
22193         * metadata.c (mono_metadata_parse_generic_param): Reflect above
22194         inflate_generic_type() changes.
22196 2004-12-17  Martin Baulig  <martin@ximian.com>
22198         * class-internals.h
22199         (MonoGenericClass): Replaced `MonoType *generic_type' with
22200         `MonoClass *generic_class'.  Removed `dynamic_info'; if
22201         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
22202         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
22204 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
22206         * exception.c (mono_exception_from_token): New helper function.
22208 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
22210         * assembly.c (mono_assembly_load_with_partial_name): Call 
22211         mono_assembly_loaded before invoking the preload hooks. Fixes
22212         #70564.
22214         * object-internals.h (MonoThread): Change culture_info and 
22215         ui_culture_info into an array.
22217         * threads.c: Cache culture info objects from more than one appdomain.
22219         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
22220         current UI culture.
22222 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
22224         * threads.h threads.c appdomain.c: Clear the culture_info field of
22225         all threads during unloading if they point to an object in the dying
22226         appdomain.
22228 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
22230         * culture-info.h (TextInfoEntry): New struct
22231         * object-internals.h: sync with managed
22232         * locales.c: fill the `text_info_data' field
22233         * culture-info-tables.h: update
22235 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
22237         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
22238         collector.
22240 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
22242         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
22243         (ves_icall_ModuleBuilder_getMethodToken): Ditto
22245 2004-12-12  Martin Baulig  <martin@ximian.com>
22247         * mono-debug-debugger.c (write_type): If we're an enum and the
22248         builtin types have already been initialized, call mono_class_init().
22250 2004-12-11  Martin Baulig  <martin@ximian.com>
22252         * metadata.c (mono_metadata_load_generic_params): Added
22253         `MonoGenericContainer *parent_container' argument; automatically
22254         compute `container->is_method'; pass the correct owner to
22255         get_constraints().      
22257         * reflection.c (compare_genericparam): Sort the GenericParam table
22258         according to increasing owners. 
22260 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
22262         * profiler.c: allow disabling the default profiler.
22264 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
22266         * decimal.c, icall.c: allow disabling System.Decimal support.
22268 2004-12-09  Marek Safar <marek.safar@seznam.cz>
22270         * reflection.c: Add support for null attribute arguments.
22272 2004-12-09  Martin Baulig  <martin@ximian.com>
22274         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
22275         names to get rid of compiler warnings.
22277 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
22279         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
22280         mono_marshal_load_type_info (). Fixes #69625.
22281         (mono_marshal_get_ptr_to_struct): Likewise.
22283 2004-12-08  Martin Baulig  <martin@ximian.com>
22285         * mono-debug.h: Bumped version number to 47.
22287         * mono-debug-debugger.c
22288         (mono_debugger_event_handler, mono_debugger_event): Take two
22289         guint64 arguments insteed of a gpointer and a guint32.  
22291 2004-12-08  Martin Baulig  <martin@ximian.com>
22293         * debug-mono-symfile.h
22294         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
22295         `address' to `native_offset'.
22297 2004-12-08  Martin Baulig  <martin@ximian.com>
22299         * class.c (mono_class_create_from_typespec): Only inflate if we
22300         either have `context->gclass' or `context->gmethod'.
22302 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
22304         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
22306         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
22308         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
22310         * reflection.c (mono_assembly_get_object): Remove the workaround put
22311         in for the release.
22312         
22313         * appdomain.c: Use the corlib_internal field from MonoAssembly.
22315         * appdomain.c: Bump corlib version.
22317         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
22318         be visible in other appdomains.
22320 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
22322         * threads.c: Interlocked inc and dec for longs were messed up,
22323         use a KISS based impl for this. Fixes 70234
22325 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
22327         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
22329 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
22331         * icall.c: fix to follow policy not to allow struct
22332         arguments in icalls.
22334 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22336         * process.c: make the patch that handles spaces in file paths work
22337         on mono/windows too.
22339 2004-12-06  Martin Baulig  <martin@ximian.com>
22341         * class.c (mono_class_create_generic): Call
22342         mono_class_setup_supertypes() if we're dynamic.
22343         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
22345 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
22347         * object-internals.h: Add new fields to MonoThread.
22349         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
22351         * icall.c threads-types.h threads.c: Add new icalls.
22353         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
22355         * object-internals.h (MonoReflectionAssembly): Sync object layout with
22356         managed side.
22358         * appdomain.c: Bump corlib version.
22360         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
22361         internal assemblies. Fixes #69181.
22363 2004-12-05  Martin Baulig  <martin@ximian.com>
22365         * class.c (mono_class_inflate_generic_signature): Make this a
22366         no-op if `context' is NULL or we don't have any type parameters;
22367         also copy `sentinelpos'.        
22369 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
22371         * image.c: Add unbox_wrapper_cache.
22373         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
22375         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
22376         function generator.
22377         
22378         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
22379         Fixes #70173.
22381         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
22382         
22383 2004-12-04  Martin Baulig  <martin@ximian.com>
22385         * loader.c (mono_method_get_signature_full): New public function;
22386         like mono_method_get_signature(), but with an additional
22387         `MonoGenericContext *' argument.
22389         * class.c (mono_class_inflate_generic_signature): Formerly known
22390         as inflate_generic_signature(); make this public.
22392 2004-12-04  Martin Baulig  <martin@ximian.com>
22394         * metadata.c
22395         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
22396         instead of a `MonoGenericContainer *'.  
22397         (mono_metadata_parse_array_full): Likewise.
22398         (mono_metadata_parse_signature_full): Likewise.
22399         (mono_metadata_parse_method_signature_full): Likewise.
22400         (mono_metadata_parse_generic_inst): Likewise.
22401         (mono_metadata_parse_generic_param): Likewise.
22402         (mono_metadata_parse_mh_full): Likewise.
22403         (mono_type_create_from_typespec_full): Likewise.
22405 2004-12-03  Martin Baulig  <martin@ximian.com>
22407         * class-internals.h (MonoGenericContainer): Replaced the
22408         `MonoGenericContext * pointer with a `MonoGenericContext'
22409         structure and made it the first element.
22411 2004-12-03  Martin Baulig  <martin@ximian.com>
22413         * class.c
22414         (inflate_generic_type): Set the `context->container' when creating
22415         a new MonoGenericContext.
22416         (mono_class_inflate_generic_method): Likewise.
22417         (mono_class_create_from_typespec): Just use `context->container'
22418         to get the container.
22420         * loader.c (method_from_methodspec): Set `context->parent' from
22421         `context->container' - and if that's a method container, use its
22422         parent.  Also set the `context->container' when creating a new
22423         MonoGenericContext.
22424         (mono_get_method_from_token): Use just `context->container' to get
22425         the container.
22427         * metadata.c (do_mono_metadata_parse_generic_class): Also set
22428         `gclass->context->container'.
22430         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
22431         the `context->container' when creating a new MonoGenericContext.
22433 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
22435         * reflection.c (compare_genericparam): Sort params with identical
22436         owner by their number. Fixes gen-111 on sparc.
22438 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
22440         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
22441         around the domain changes.
22443         * appdomain.c (mono_domain_unload): Handle the case when the thread
22444         calling Unload is itself being aborted during unloading. Fixes #70022.
22446         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
22448         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
22449         checkpoint_func as an icall so it gets a wrapper.
22450         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
22451         in the cross-appdomain wrappers too.
22453         * threads.c (mono_thread_has_appdomain_ref): Make this public.
22455         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
22457         * reflection.c: Fix some memory leaks.
22458         
22459 2004-12-02  Martin Baulig  <martin@ximian.com>
22461         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
22463         * metadata.c (generic_class_cache): New static hashtable.
22464         (mono_metadata_lookup_generic_class): New public method.
22466 2004-12-02  Martin Baulig  <martin@ximian.com>
22468         * class.c (mono_class_create_from_typedef): Call
22469         mono_class_setup_parent() and mono_class_create_mono_type() before
22470         parsing the interfaces.
22472 2004-12-02  Martin Baulig  <martin@ximian.com>
22474         * metadata.c (generic_inst_cache): New static hashtable.
22475         (mono_metadata_lookup_generic_inst): New public function.
22476         (mono_metadata_inflate_generic_inst): New public function.
22477         (mono_metadata_parse_generic_inst): New public function.
22478         (do_mono_metadata_parse_generic_class): Use the new
22479         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
22480         since this'll also use the cache.
22482         * reflection.c (mono_reflection_bind_generic_method_parameters):
22483         Use mono_metadata_lookup_generic_inst() to use the new cache.
22485         * class.c (inflate_mono_type): Use
22486         mono_metadata_inflate_generic_inst() to inflate a generic
22487         instance; this'll also use the new cache.
22489         * loader.c (method_from_methodspec): Use
22490         mono_metadata_parse_generic_inst() and
22491         mono_metadata_inflate_generic_inst() rather than parsing it
22492         manually, so we can use the new cache.
22494 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
22496         * threads.c (wait_for_tids): Do not incorrectly free threads when 
22497         the wait times out.
22499 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
22501         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
22502         iter->args based on whether parameters are passed in registers (i.e.
22503         MONO_ARCH_REGPARMS is defined)
22505 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
22507         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
22508         the exception message. Fixes #70070.
22509         (method_from_methodspec): Fix warnings.
22511 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22513         * process.c: (complete_path) return the path quoted
22515 2004-12-01  Martin Baulig  <martin@ximian.com>
22517         * class-internals.h (MonoGenericInst): New structure.
22518         (MonoGenericClass): Replaced `type_argc', `type_argv' and
22519         `is_open' with `MonoGenericInst *inst'.
22520         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
22521         `is_open' with `MonoGenericInst *inst'.
22523 2004-11-30  Martin Baulig  <martin@ximian.com>
22525         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
22527         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
22528         to `generic_class_cache'.
22530         * metadata.c
22531         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
22532         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
22533         (mono_generic_inst_is_valuetype): Renamed to
22534         mono_generic_class_is_valuetype().
22536         * class-internals.h
22537         (MonoGenericInst): Renamed to MonoGenericClass.
22538         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
22539         (MonoClass): Renamed `generic_inst' to `generic_class'.
22540         (MonoGenericContext): Renamed `ginst' to `gclass'.
22542         * object-internals.h
22543         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
22545         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
22546         mono_reflection_generic_class_initialize().
22548         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
22549         now known as "System.Reflection.MonoGenericClass".
22550         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
22552 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
22554         * class-internals.h: Added a flag field to MonoClass to cache the
22555         declarative security attributes actions associated with the class.
22556         * domain-internals.h: Added booleans to MonoJitInfo to cache the
22557         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
22558         applicable to the JITted method.
22559         * reflection.c|h: Added functions to extract (as flags) which security
22560         actions are available (declaratively) for a method, class or assembly.
22561         * metadata.c|h: Added functions to search the declarative security
22562         table in the metadata.
22563         
22564 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
22566         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
22567         EXPORTEDTYPES are already in the class name cache, so there is no
22568         need to add extra code here to look at them. Just removes a bit of
22569         cruft.
22571         (ves_icall_System_Environment_get_TickCount): No need for #if
22572         WINDOWS. We already have the code in io-layer.
22574 2004-11-28  Martin Baulig  <martin@ximian.com>
22576         * loader.c
22577         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
22578         Fixes gen-112.cs.
22580 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
22582         * assembly.c (do_mono_assembly_open): Instead of having a
22583         conditional WITH_BUNDLE, incorporate support for bundles here, by
22584         having a global `bundles' variable holding a pointer to the actual
22585         bundles. 
22587         (mono_register_bundled_assemblies): New API call used by the
22588         bundle code. 
22590         See mkbundle.1 for details.
22591         
22592 2004-11-27  Martin Baulig  <martin@ximian.com>
22594         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
22595         the vtable for generic methods.
22597 2004-11-26  Martin Baulig  <martin@ximian.com>
22599         * metadata.c
22600         (mono_metadata_generic_method_hash): New public function.
22601         (mono_metadata_generic_method_equal): Likewise.
22603         * class-internals.h
22604         (MonoGenericContainer): Added `GHashTable *method_hash'.
22606         * reflection.c (ReflectionMethodBuilder): Added
22607         `MonoGenericContainer *generic_container'.
22608         (reflection_methodbuilder_to_mono_method): Don't create a new
22609         MonoGenericContainer each time we're called.
22610         (mono_reflection_bind_generic_method_parameters): Use
22611         `container->method_hash' to cache the results so we don't create a
22612         different method if we're called several times with the same
22613         arguments.
22615         * loader.c (method_from_methodspec): Use the new
22616         `container->method_hash' here, too.
22618 2004-11-26  Martin Baulig  <martin@ximian.com>
22620         * class.c (inflate_generic_signature): Correctly compute
22621         `res->has_type_parameters'.
22622         (mono_class_vtable): Use the `has_type_parameters' flag to
22623         determine whether we're a generic method.
22625         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
22627 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
22629         * object.c (mono_runtime_run_main): Fix a small memory leak.
22631 2004-11-25  Martin Baulig  <martin@ximian.com>
22633         * class.c (set_generic_param_owner): Fixed the loop.
22635 2004-11-25  Martin Baulig  <martin@ximian.com>
22637         * object.c (mono_class_vtable): Don't create any JIT wrappers for
22638         generic methods.
22640 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
22642         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
22643         names. Fixes #69787.
22645 2004-11-24  Martin Baulig  <martin@ximian.com>
22647         * class.c (mono_class_create_generic_2): If we don't have a
22648         `ginst->parent', inflate `gklass->parent' to get our parent.
22650 2004-11-24  Martin Baulig  <martin@ximian.com>
22652         * reflection.c (compare_genericparam): Correctly sort the
22653         GenericParam table; fixes #69779.
22655 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
22657         * reflection.c: When writing a PE file, don't create a huge
22658         buffer in memory. Just write the arrays we have to the file.
22659         This reduces memory usage.
22661         * metadata-internals.h: MonoDynamicStream pefile is no longer used
22662         globally.
22664 2004-11-17  Martin Baulig  <martin@ximian.com>
22666         * class.c (mono_class_init): Don't setup `class->parent' for
22667         dynamic instances; moved this to mono_class_generic_2().
22668         (mono_class_create_generic): Also set `klass->inited' for dynamic
22669         generic instances.
22670         (mono_class_create_generic_2): Don't do anything for dynamic
22671         generic instances.  Set `klass->parent' here and also call
22672         mono_class_setup_parent() here. 
22674         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
22675         `MonoType *parent' argument; set `ginst->parent' before calling
22676         mono_class_create_generic_2(), so we set the correct parent.
22678 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
22680         * reflection.c: allow getting attributes from ModuleBuilder
22681         (used by ikvm).
22683 2004-11-17  Martin Baulig  <martin@ximian.com>
22685         * class.c (mono_class_create_from_typedef): If a type parameter is
22686         inherited from an outer class, set its owner to that class.
22688 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
22690         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
22691           for (int*) written size. This fixes bug #69592.
22693 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
22695         * icall.c: Added IsAuthenticodePresnet internal call.
22696         * image.c|h: New function that check a MonoImage for an Authenticode
22697         signature in the certificate PE data directory.
22698         * security.c|h: New internal call to ask the runtime if an 
22699         Authenticode signature seems referenced in the PE header.
22701 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
22703         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
22705         * reflection.c (mono_image_create_pefile): Free the assembly streams
22706         after writing out the assembly file.
22708         * object.c (mono_runtime_run_main): Fix small memory leak.
22710         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
22711         property access modifiers. Fixes #69389.
22713 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
22715         * domain.c, object.c, object-internals.h, domain-internals.h,
22716         object.h, marshal.c: keep dynamic code info per domain.
22718 2004-11-15  Martin Baulig  <martin@ximian.com>
22720         * class.c (mono_type_get_name_recurse): Put type arguments in
22721         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
22722         see bug #68387.
22724 2004-11-15  Martin Baulig  <martin@ximian.com>
22726         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
22727         (mono_class_setup_vtable): When computing `the_cname' for a
22728         generic instance, don't include the namespace since we'd otherwise
22729         add it twice.
22731 2004-11-15  Martin Baulig  <martin@ximian.com>
22733         * class.c (mono_class_create_generic): Changed return type to void.
22734         (mono_class_create_generic_2): New public function; setup
22735         `class->method', `class->field' and `class->interfaces' here
22736         instead of in mono_class_init().
22738         * class.h (mono_class_create_generic): Moved to class-internals.h.
22740 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
22742         * reflection.c (mono_image_create_pefile): take a file HANDLE.
22743         rather than writing to memory, write to this file. Right now,
22744         we are just writting into a buffer, and copying that. However
22745         we can avoid the buffer later.
22747         (mono_dynamic_stream_reset): new function
22749         * icall.c, object-internals.h: update for the above.
22751 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
22753         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
22754         have been using gc'd memory. First it is slower, unlikely
22755         the comment in the source code said, secondly, it increases
22756         our footprint to do it in the gc.
22758         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
22759         the method so that it does not have to copy to managed code.
22761 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
22763         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
22765 2004-11-12  Martin Baulig  <martin@localhost>
22767         * reflection.c (mono_image_create_token): Allow generic method
22768         definitions here, since they may appear in an `.override'; see
22769         gen-98/gen-99 for an example.
22771 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
22773         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
22774         #69365.
22776         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
22777         descriptive.
22779 2004-11-11  Martin Baulig  <martin@ximian.com>
22781         * class.c (mono_class_setup_vtable): In an explicit interface
22782         implementation, the method name now includes the arity.
22784 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
22786         * object.c (mono_array_full_copy): Fix warning.
22788 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
22790         * appdomain.c: Removed look_for_method_by_name(). Use the new method
22791         mono_class_get_method_from_name() instead.
22792         
22793         * class-internals.h: Added two new types of wrappers. 
22794         Added MonoRemotingTarget enum. Added new trampoline function type, which
22795         takes an additional MonoRemotingTarget value as parameter, so it is
22796         possible to request a trampoline for a specific target.
22797         
22798         * class.c: Added new mono_class_get_method_from_name() method.
22799         
22800         * class.h: In MonoRemoteClass, we can have now to vtables, one for
22801         general remoting sinks and one specific for cross domain calls.
22802         
22803         * debug-helpers.c: Added new wrapper names.
22804         
22805         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
22806         of a remote class.
22807         
22808         * image.c: Porperly delete value objects form the remoting invoke hashtable.
22809         
22810         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
22811         with several other methods (mono_marshal_get_xappdomain_dispatch,
22812         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
22813         and others) can generate a fast remoting wrapper for cross domain calls.
22814         More information can be found in docs/remoting.
22815         Other changes: Removed mono_find_method_by_name, and used
22816         mono_class_get_method_from_name instead.
22817         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
22818         is stored in the remoting invoke hashtable.
22819         
22820         * marshal.h: published the new method for getting the xdomain wrapper,
22821         and also added a method for getting the adequate wrapper for a given
22822         method and target.
22823         
22824         * object-internals.h, object.c: Added a couple of methods for capying and
22825         cloning arrays.
22826         Modified mono_install_remoting_trampoline, which takes the new remoting
22827         trampoline that has a remoting target as parameter.
22828         mono_class_proxy_vtable now also takes a remoting target as parameter, and
22829         will return the most suitable vtable for the target.
22830         Added mono_remote_class_vtable, which returns the vtable of a remote class
22831         (which can be the normal remoting vtable or the xdomain vtable).
22832         
22833         * threads.c: the xdomain invoke and dispatch wrappers must also be
22834         protected against interruptions.
22836 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22838         * icall.c: use memmove in BlockCopyInternal when the source and
22839         destination arrays are the same.
22841 2004-11-09  Martin Baulig  <martin@ximian.com>
22843         * class-internals.h (MonoGenericContainer): Removed `method' and
22844         `signature', replaced them with `is_method' and `is_signature'
22845         flags.  Added `context'.
22847         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
22848         instead of a `MonoGenericContainer *'.
22850         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
22851         for dynamic type parameters.
22852         (mono_metadata_load_generic_params): Setup `container->context'.
22854         * reflection.c (mono_reflection_setup_generic_class): Setup
22855         `tb->generic_container->context'.
22856         (do_mono_reflection_bind_generic_parameters): Use
22857         mono_class_inflate_generic_type() to correctly inflate types,
22858         rather than using our own hack just for MONO_TYPE_VAR.
22860 2004-11-09  Martin Baulig  <martin@ximian.com>
22862         * class.c (mono_class_inflate_generic_method): Small fix; don't
22863         crash here.
22865         * icall.c
22866         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
22867         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
22868         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
22869         (ves_icall_Type_BindGenericParameters): Likewise.
22870         (ves_icall_Type_get_IsGenericInstance): Likewise.
22871         (ves_icall_Type_GetGenericParameterPosition): Likewise.
22872         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
22873         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
22874         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
22876 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
22878         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
22879         assembly versions and public key tokens. Fixes #69113.
22881 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
22883         * metadata.c: fix bug introduced with the type cache changes
22884         on 2004-11-06.
22886 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
22888         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
22889         the MonoClass pointer instead of the token in exception clauses.
22890         * reflection.c: updates for the above and make the code not depend
22891         on the structure of MonoExceptionClause.
22893 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
22895         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22896         Add support for dynamic assemblies. Fixes #69114.
22898         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
22900 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
22902         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
22903         since most only those methods use it. the code member of
22904         MonoMethodPInvoke was dead, so that can be removed too. Also,
22905         remove inline_count (again, not used), and move slot so that it
22906         can share bits with some other flags. This saves 8 bytes in the
22907         structure and gives us about 50 kb back for mcs helloworld.cs
22909         * *.[ch]: Do naming changes for the above.
22911         * loader.c (mono_method_get_header): Lazily init the header
22912         on first access.
22913         (mono_get_method_from_token): don't init the header here
22914         (mono_free_method): the header may never be allocated
22916         Overall, this saves 150 kb of unmanaged allocations
22917         for mcs helloworld.cs. That accounts for 10% of the unmanaged
22918         memory at runtime.
22919         
22920         * loader.c, loader.h (mono_method_get_header): new accessor.
22922         * *.[ch]: use the above method. Prepares us to lazily load
22923         the header.
22925         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
22926         three warnings, which are actual bugs (see 69206).
22928         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
22929         unused. Saves a cool 4 bytes / method.
22931 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
22933         * metadata.c (builtin_types): Add types for System.Object here.
22934         (mono_metadata_parse_type_full): Cache MonoType*'s that are
22935         for a class or valuetype from klass->this_arg or klass->byval_arg.
22937         On mcs for a hello world, this gets us down from 21836 MonoType's
22938         to 14560.
22940         (mono_metadata_free_type): Account for the above change.
22942 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
22944         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
22945         exception instead of asserting if name is null.
22946         (ves_icall_System_AppDomain_GetData): Ditto.
22948 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
22950         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
22951         EnumBuilder.
22953         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
22954         Return NULL when the domain does not have entry_assembly set.
22956         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
22957         Add a 'resource_modules' argument.
22958         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
22960         * reflection.c (mono_reflection_create_runtime_class): Move setting
22961         of wastypebuilder here, so mono_get_type_object () returns a MonoType
22962         for enums too.
22964         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
22965         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
22966         Throw an ArgumentNullException if 'ptr' is null.
22968         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
22969         assemblies here. Fixes #69020.
22971 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
22973         * reflection.c (build_compressed_metadata): Fix the previous patch for
22974         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
22975         the stack.
22977 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
22979         * assembly.c (mono_assembly_names_equal): Allow a match if one of
22980         the cultures is false. Fixes #69090.
22982         * reflection.c (build_compressed_metadata): Fix invalid memory read 
22983         detected by valgrind.
22984         
22985         * reflection.c (mono_reflection_get_type): Avoid triggering a 
22986         TypeResolve multiple times for the same type. Fixes #65577.
22988 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
22990         * marshal.c: Avoid using ldftn to call managed functions. It is
22991         much slower than just a call.
22993         * reflection.c (mono_module_get_object): free the basename we
22994         allocate here from glib.
22995         
22996         * reflection.c (ensure_runtime_vtable): make sure to free
22997         overrides.  Also, we were allocating an array of MonoMethod not an
22998         array of MonoMethod*.
23000         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
23002         * image.c (mono_image_close): free image->guid here.
23004 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
23006         * reflection.c: Fix some spec conformance issues with the PE file
23007         structures so mcs compiled apps run on the Net 2.0 beta.
23009 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
23011         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
23012         Implement this. Fixes #67264.
23014         * debug-helpers.h debug-helpers.c marshal.c: Move 
23015         mono_find_method_by_name to debug-helpers.c.
23017 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
23019         * object.c (mono_release_type_locks): type_initialization_hash is
23020         a GHashTable.
23022         * reflection.c object.c object-internals.h: Fix warnings.
23024         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
23025         without accessors. Fixes #61561.
23027         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
23028         application base from the root domain if not set. Fixes #65641.
23029         (mono_runtime_init): Fix warning.
23031 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23033         * appdomain.c: call mono_thread_pool_init.
23034         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
23035         of worker threads based on the number of CPUs and the environment
23036         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
23037         for non-windows (windows) systems.
23039 2004-10-27  Chris Toshok  <toshok@ximian.com>
23041         * mono-debug-debugger.c (write_class): don't call mono_class_init
23042         here, as even with the check for (!klass->init_pending), we get
23043         into a situation where we're hitting cycles in class
23044         initialization.  Fixes #68816.
23046 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
23048         * image.c: Avoid overwriting values in the loaded_images_hash when an
23049         assembly is loaded multiple times. Fixes #61152.
23051         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
23052         so multiple satellite assemblies for the same name can be loaded.
23053         Fixes #68259.
23055         * mono_domain_assembly_preload: Actually return the loaded assembly, 
23056         not NULL.
23058         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
23059         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
23061         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
23062         pending finalizers are not invoked after the appdomain has been 
23063         unloaded. Fixes #67862.
23065 2004-10-22  Martin Baulig  <martin@ximian.com>
23067         * mono-debug-debugger.c
23068         (mono_debugger_runtime_invoke): Don't box valuetypes.
23070 2004-10-22  Chris Toshok  <toshok@ximian.com>
23072         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
23073         don't hide private methods.
23075 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
23077         * icall.c: Allows the runtime to "share" (when known) the public key
23078         token of an assembly. This avoid the need to recalculate the token 
23079         (from the public key) in managed code.
23081 2004-10-21  Chris Toshok  <toshok@ximian.com>
23083         * debug-helpers.c (append_class_name): argh, revert last patch.
23084         
23085 2004-10-21  Chris Toshok  <toshok@ximian.com>
23087         * debug-helpers.c (append_class_name): use '+' as the delimiter,
23088         not '/', so that it matches what the debugger uses to look up
23089         methods.
23091 2004-10-21  Martin Baulig  <martin@ximian.com>
23093         * mono-debug-debugger.c (mono_debugger_throw_exception): New
23094         public method; this is called each time an exception is thrown and
23095         allows the debugger to use exception catch points.
23097 2004-10-21  Martin Baulig  <martin@ximian.com>
23099         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
23100         the stack pointer and the exception object in some struct and pass
23101         that to the debugger.
23103 2004-10-21  Chris Toshok  <toshok@ximian.com>
23105         * mono-debug-debugger.c (do_write_class): add instance/static
23106         event support.  We don't expose "raise" or "other" yet.
23107         (event_is_static): new method.
23109 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
23111         * mono-debug-debugger.c
23112         (mono_debugger_handle_exception): Remove
23113         bogus return value for fussy compilers.
23115 2004-10-20  Martin Baulig  <martin@ximian.com>
23117         * mono-debug-debugger.c
23118         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
23119         (mono_debugger_handled_exception): Likewise.
23121 2004-10-20  Martin Baulig  <martin@ximian.com>
23123         * mono-debug-debugger.h (MonoDebuggerEvent): Added
23124         MONO_DEBUGGER_EVENT_EXCEPTION.
23126         * mono-debug-debugger.c (mono_debugger_handle_exception): New
23127         public function to send the debugger a notification for an
23128         exception and inform it about a catch/finally clause.
23130 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
23132         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
23133         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
23134         fix 2.95 build. 
23136         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
23138 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
23140         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
23141         marshalled as [In,Out]. Fixes #58325.
23143 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
23145         * reflection.c (mono_method_body_get_object): Implement some fields.
23147 2004-10-12  Martin Baulig  <martin@ximian.com>
23149         * reflection.c (mono_reflection_bind_generic_parameters): Small
23150         fix, correctly retrieve our parent from a generic instance.
23152 2004-10-12  Martin Baulig  <martin@ximian.com>
23154         * metadata.c (mono_metadata_generic_param_equal): We always have
23155         an owner.
23157         * class.c
23158         (mono_class_from_generic_parameter): We need to have an owner.
23159         (my_mono_class_from_generic_parameter): Likewise.
23161         * reflection.c (mono_reflection_setup_generic_class): Renamed to
23162         mono_reflection_create_generic_class() and added a new
23163         mono_reflection_setup_generic_class().  
23164         (mono_reflection_initialize_generic_param): If we're a nested
23165         generic type and inherited from the containing class, set our
23166         owner to the outer class.
23168 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
23170         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
23172         * reflection.c (mono_method_body_get_object): New function to create
23173         a MethodBody object.
23175         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
23177 2004-10-11  Martin Baulig  <martin@ximian.com>
23179         * metadata.c (_mono_metadata_type_equal): Renamed to
23180         do_mono_metadata_type_equal() and made static.
23182 2004-10-11  Martin Baulig  <martin@ximian.com>
23184         * appdomain.c: Bump corlib version number to 28.
23186 2004-10-10  Martin Baulig  <martin@ximian.com>
23188         * class-internals.h
23189         (MonoGenericInst): Added `MonoGenericContainer *container'.
23190         (MonoGenericMethod): Likewise.
23191         (MonoGenericContext): Likewise.
23192         (MonoGenericParam): Added `MonoGenericContainer *owner'.
23194         * metadata.c
23195         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
23196         (do_mono_metadata_parse_generic_inst): Likewise.
23197         (mono_metadata_parse_type_full): New public method.  This is the actual
23198         mono_metadata_parse_type() implementation - with an additional
23199         `MonoGenericContainer *' argument.
23200         (mono_metadata_parse_array_full): Likewise.
23201         (mono_metadata_parse_signature_full): Likewise.
23202         (mono_metadata_parse_method_signature_full): Likewise.
23203         (mono_metadata_parse_mh_full): Likewise.
23204         (mono_type_create_from_typespec): Likewise.
23205         (mono_metadata_interfaces_from_typedef_full): New public method;
23206         this is similar to the other _full() methods, but we take a
23207         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
23208         (mono_metadata_parse_generic_param): Take an additional
23209         `MonoGenericContainer *' argument and lookup the MonoGenericParam
23210         from that container.
23211         (mono_metadata_generic_param_equal): New static method to compare
23212         two type parameters.
23213         (_mono_metadata_type_equal): New static method; takes an
23214         additional `gboolean signature_only' argument - if true, we don't
23215         compare the owners of generic parameters.
23216         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
23217         with a TRUE argument - do a signature-only comparision.
23219         * loader.c: Use the new _full() methods and pass the
23220         MonoGenericContainer to them.
23222         * object-internals.h (MonoReflectionTypeBuilder): Added
23223         `MonoGenericContainer *generic_container' field.
23224         (MonoReflectionMethodBuilder): Likewise.
23226 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
23228         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
23229         case initial images of dynamic assemblies.
23231         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
23233         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
23235         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
23236         length of event->other array.
23237         (typebuilder_setup_events): Ditto.
23239         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
23240         'assembly_by_name' and add an 'assemblies' list.
23242         * assembly.h assembly.c: Add a new search hook for determining whenever
23243         an assembly is already loaded. Use this instead of searching in the
23244         loaded_assemblies list.
23246         * domain.c appdomain.c: Implement the new search hook so loaded 
23247         assemblies are now scoped by appdomain. Fixes #67727.
23249 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
23251         * threads.c (mono_thread_attach): Initialize synch_lock field so
23252         mono_thread_detach works again.
23254         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
23255         'lib' too. Fixes #63130.
23257 2004-10-06  Jackson Harper  <jackson@ximian.com>
23259         * culture-info-tables.h: regenerated.
23261 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
23263         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
23264         implemented by other interfaces in the result. Fixes #65764.
23265         
23266         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23267         Handle unloadable modules without crashing.
23269         * image.c (load_modules): Revert the previous patch since modules must
23270         have a fixed index inside the array.
23271         
23272         * image.c (load_modules): Don't include native modules in the modules
23273         array.
23275 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
23277         * reflection.h: Add param_defaults field.
23279         * reflection.c: Add support for parameter defaults in dynamic methods.
23280         Fixes #64595.
23282         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
23283         an empty string when a type has no namespace. Fixes #64230.
23285 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
23287         * tabledefs.h: Added "internal" security actions to support non-CAS
23288         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
23289         Note: they do not seems to be used anymore in 2.0 (new metadata format)
23291 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
23293         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
23294         constructor of abstract class. Fixes #61689.
23296 2004-10-04  Martin Baulig  <martin@ximian.com>
23298         * class-internals.h (MonoGenericContainer): New type.
23299         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
23300         `MonoGenericContainer *generic_container'.
23301         (MonoClass): Replaced `gen_params' and `num_gen_params' with
23302         `MonoGenericContainer *generic_container'.
23304         * metadata.c (mono_metadata_load_generic_params): Return a
23305         `MonoGenericContainer *' instead of a `MonoGenericParam *';
23306         removed the `num' argument.
23308 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
23310         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
23311         for dynamic images.
23313         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
23314         machine fields.
23316         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
23318         * reflection.c: Save pe_kind and machine values into the generated
23319         image file.
23321         * appdomain.c: Bump corlib version number.
23323         * object-internals.h: Reorganize layout of LocalBuilder.
23325         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
23326         New helper function.
23328         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
23329         created MonoType for dynamic types. Fixes #66180.
23331 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
23333         * threadpool.c: the ares hashtable needs a critical section around it.
23334         this prevents some nasty segfaults
23336 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
23338         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
23339         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
23340         bug 67324).
23341         
23342 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
23344         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
23345         
23346 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
23348         * image.c: Always canonicalize image file names, to avoid loading
23349         the same assembly twice when referenced using a relative path.
23351 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
23353         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
23355         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
23357         * marshal.c: Fix warnings.
23359 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
23361         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
23362         attempting to marshal the delegate_trampoline as the method_addr.
23363         This patch has a static hashtable of marshalled delegates so that 
23364         we can map delegate_trampoline addresses back to delegates.  This
23365         allows a delegate passed to managed code to be passed back into native
23366         code.  Fixes #67039
23368 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
23370         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
23372         * reflection.c (method_encode_code): Align method headers properly.
23373         Fixes #66025.
23375 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
23377         * marshal.c: In the runtime invoke wrapper, reset the abort
23378         exception if it is cached. This avoids the automatic rethrowal of 
23379         the exception after the catch of the wrapper. Also check for pending
23380         interruptions before calling the managed method. This is done using
23381         the new method emit_thread_force_interrupt_checkpoint, since the
23382         normal checkpoint method is ignored when running the invoke wrapper.
23383         * object.c: If the abort exception is rethrown, set the abort_exc
23384         field of the thread, so it will be rethrown aftere every catch.
23385         * threadpool.c: Only run an interruption checkpoint if what has been
23386         requested is a stop of the thread (aborts will be ignored).
23387         * threads.c: By default, a thread will now never be interrumped while
23388         running the runtime invoke wrapper (this ensures that runtime_invoke
23389         will always return to the caller if an exception pointer is provided).
23390         There is a new special method mono_thread_force_interruption_checkpoint()
23391         to force an interruption checkpoint even if running a protected
23392         wrapper, which is used by the same runtime invoke wrapper to do a check
23393         at a safe point.
23395 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
23397         * object.c, object-internals.h: Implemented mono_release_type_locks,
23398         which releases the cctor locks held by a thread.
23399         * threads.c, threads.h: In thread_cleanup, release cctor locks held
23400         by a thread. Added mono_thread_exit() method to be used to safely stop
23401         a thread.
23403 2004-09-28  Raja R Harinath  <rharinath@novell.com>
23405         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23406         Move null check before dereference.  Avoid indexing beyond the end
23407         of the 'modules' array.
23409 2004-09-28  Raja R Harinath  <rharinath@novell.com>
23411         * metadata-internals.h (MonoImage): Add module_count field.
23412         * image.c (load_modules): Set image->module_count.
23413         (mono_image_load_file_for_image): Use image->module_count.
23414         * reflection.c (mono_image_load_module): Append to image->modules array 
23415         of dynamic assembly.
23416         (mono_module_get_object): Fix loop to actually increment index.
23417         Use image->module_count.
23418         * assembly.c (mono_assembly_load_references): Use image->module_count.
23419         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
23420         Likewise.
23422 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
23424         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
23425         Avoid assert on generic types.
23427 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
23429         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
23431         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
23433         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
23434         function to convert a MarshalSpec structure to its managed counterpart.
23436         * reflection.c: Fix warnings.
23437         
23438         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
23439         field.
23441         * icall.c (mono_create_icall_signature): Fix build.
23443 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
23445         * icall.c: Add MakePointType icall.
23447         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
23448         warnings.
23450 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23452         * threadpool.c: reuse allocated slots in the queue.
23454 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
23456         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
23458         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
23460         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
23461         previous change.
23463         * tabledefs.h: Add constants for pinvoke attributes BestFit and
23464         ThrowOnUnmappableChar.
23466         * icall.c (ves_icall_Type_GetPacking): New icall.
23468 2004-09-24  Martin Baulig  <martin@ximian.com>
23470         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
23472 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23474         * appdomain.c:
23475         (mono_domain_set): allow setting a domain that is being unloaded.
23476         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
23477         being unloaded.
23479 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
23481         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
23482         the GetCustomAttributes icall.
23484 2004-09-23  Martin Baulig  <martin@ximian.com>
23486         * object-internals.h (MonoReflectionGenericParam): Replaced
23487         'has_ctor_constraint', `has_reference_type' and `has_value_type'
23488         with `guint32 attrs'.
23490 2004-09-23  Martin Baulig  <martin@ximian.com>
23492         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
23494 2004-09-23  Martin Baulig  <martin@ximian.com>
23496         * object-internals.h (GenericParameterAttributes): New enum.
23498 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
23500         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
23501         
23502         * class.c (init_events): Fill out event->other field.
23504         * class.c: Fix warnings.
23506         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
23508 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
23510         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
23511         walk which doesn't supply the IL offset.
23513 2004-09-22  Martin Baulig  <martin@ximian.com>
23515         * reflection.c (mono_reflection_setup_internal_class): If we're
23516         System.ValueType, System.Object or System.Enum, set
23517         `klass->instance_size' and create the vtable.
23518         (mono_reflection_create_internal_class): If we're an enum type,
23519         get the base class from our current corlib.
23521 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
23523         * reflection.h (MonoResolveTokenError): New type.
23525         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
23526         icall.
23528         * icall.c: Add an 'error' argument to the ResolveToken icalls.
23530 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
23532         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
23533         Support also calling constructors, but only for already allocated objects.
23535 2004-09-17  Geoff Norton <gnorton@customerdna.com>
23537         * reflection.c (type_get_qualified_name): If the klass is null
23538         return the typename to avoid a NullRefEx.
23539         (encode_cattr_value): Get the qualified name of the boxed type,
23540         not the underlying enumtype.  Fixes #62984.
23542 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
23544         * marshal.c: Fix problems with previous checkin.
23546 2004-09-21    <vargaz@freemail.hu>
23548         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
23549         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
23551         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
23553 2004-09-21  Geoff Norton <gnorton@customerdna.com>
23555         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
23556         should only return a type for pointers, arrays, and passbyref types.
23557         Fixes bug #63841.
23559 2004-09-21  Martin Baulig  <martin@ximian.com>
23561         * domain.c (mono_debugger_check_runtime_version): New public
23562         function.
23564         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
23566 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
23568         * reflection.c: Added missing sort to the declarative security 
23569         attributes table. MS implementation stops seeing the attributes if the
23570         token number regress in the table (as shown by ildasm and permview).
23572 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
23574         * object-internals.h (MonoReflectionModule): Add 'token' field.
23575         
23576         * reflection.c (mono_reflection_get_token): Add support for Module
23577         and Assembly.
23578         (mono_module_get_object): Set 'token' field.
23579         (mono_module_file_get_object): Set 'token' field.
23581         * icall.c: Add new Assembly and Module icalls.
23583         * appdomain.c: Bump corlib version.
23585 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
23587         * loader.h loader.c class.h class.c: Add helper functions for obtaining
23588         tokens of metadata objects.
23590         * reflection.h reflection.c (mono_reflection_get_token): New function
23591         to obtain the token of a metadata object.
23593         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
23595 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
23597         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
23598         
23599         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
23601 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
23603         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
23604         * object-internals.h: Added 3 MonoArray* members to MonoReflection
23605         AssemblyBuilder to access the permissions set in the class lib.
23606         * reflection.c: Added security attributes encoding step in 
23607         mono_image_build_metadata.
23608         * tabledefs.h: Added new security actions defined in 2.0:
23609         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
23611 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
23613         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
23614         macro parameter.
23616 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
23618         * locales.c: nullify the ICU_collator member of CompareInfo when it is
23619           finalized. There where random SIGSEVs at program termination, when
23620           an object being finalized was trying to do a string comparison and
23621           the current culture was already finalized.
23623 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23625         * threads.c: call thread_cleanup before finishing the thread if we get
23626         there.
23628 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
23630         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
23631         assemblies from the parent. Fixes #65665.
23633 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
23635         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
23636         modifiers.
23638 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
23640         * reflection.h: add prototype for mono_get_dbnull_object
23641         * reflection.c: add prototypes for get_default_param_value_blobs 
23642         and mono_get_object_from_blob for fussier compilers
23644 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
23646         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
23647         false deadlock checks in class initialization.
23649 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
23651         * image.c (mono_image_addref): Fix comment.
23653         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
23654         possible.
23656 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
23658         * reflection.c (mono_param_get_objects): Modified to return
23659         ParameterInfo.DefaultValue object.
23661         (get_default_param_value_blobs):
23662         (mono_get_object_from_blob):
23663         (mono_get_dbnull_object): New helper routines. 
23665         * object.c (mono_get_constant_value_from_blob): New helper routine
23666         carved out from get_default_field_value ()
23668         * object-internals.h (mono_get_constant_value_from_blob): Added
23669         function declaration.
23671 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
23673         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
23674         referenced assemblies. Fixes #62135.
23676         * exception.h exception.c (mono_get_exception_file_not_found2): New
23677         helper function.
23679 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
23681         * class.h class.c: Add mono_type_get_underlying_type ().
23683 2004-09-09  Geoff Norton <gnorton@customerndna.com>
23685         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
23686         Fix GetTypes() to support dynamically created assemblies.
23688 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
23690         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
23691         
23692         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
23693         previous patch.
23695         * reflection.h reflection.c loader.c: Allow dynamic construction of
23696         pinvoke methods. Fixes #65571.
23697         
23698         * reflection.c (mono_reflection_get_type): Revert previous change since
23699         it causes regressions.
23701 2004-09-08  Martin Baulig  <martin@ximian.com>
23703         * class.c (class_compute_field_layout): Don't call
23704         mono_class_layout_fields() for open generic instances.
23706 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
23707         * threads.c appdomain.c: fix typo in GC macro
23709 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23711         * threads.c: don't call mono_thread_detach() in start_wrapper(),
23712         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
23714 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
23716         * image.c (mono_image_close): Applied patch from 
23717         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
23718         assembly is loaded multiple times from data.
23719         
23720         * image.c (mono_image_open): Fix warning.
23722 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
23724         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
23725         once. Fixes #58334.
23726         
23727         * reflection.c (mono_reflection_create_runtime_class): Initialize
23728         klass->nested_classes. Fixes #61224.
23730 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
23732         * threads.c: sched_yield() on exit, to allow threads to quit.
23734 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
23736         * object.c (mono_unhandled_exception): Remove leftover debug code.
23738 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
23740         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
23742 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
23744         * marshal.c (emit_marshal_array): Really null terminate string arrays.
23745         
23746         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
23748 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
23750         * marshal.c (emit_marshal_array): Null terminate string arrays.
23751         
23752         * marshal.c (raise_auto_layout_exception): Fix warning.
23754         * reflection.c (mono_param_get_objects): Initialize the default value
23755         with DBNull.Value, not null. Fixes #62123.
23757 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
23759         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
23760         throw an exception with a cute explanation.
23762 2004-09-06  Dick Porter  <dick@ximian.com>
23764         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
23765         Close the new process's thread handle, as we don't use it.  The
23766         handle stays around forever otherwise.
23768 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
23770         * object.c (arith_overflow): Fix warning.
23772         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
23773         calling conventions in method refs. Fixes #65352.
23775         * reflection.c: Fix warnings.
23777 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
23779         * icall.c: Add a new icall for Array.Clear
23781 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
23783         * object.c: When allocating an array, we have to throw
23784         an overflow exception if any of the lengths are < 0.
23786 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
23788         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
23789         properly. Also move implementation of string array marshalling to 
23790         managed code. Fixes #42316.
23792 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23794         * assembly.c: provide more information when loading an assembly fails.
23796 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23798         * filewatcher.c: don't expect the development fam package to be
23799         installed.
23801 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
23803         * marshal.c: Make a copy of the signature cookie since it will be
23804         freed by the caller.
23805         
23806         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
23808         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
23810         * metadata.c (mono_metadata_free_marshal_spec): New function to free
23811         marshal specs.
23813         * marshal.c: More refactoring.
23814         
23815         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
23816         smaller functions.
23818 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
23820         * object.c: In mono_message_invoke, fill the output parameter array after
23821           calling the managed method (it was done before the call). This fixes
23822           bug #59299.
23824 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
23826         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
23827         as well.
23829 2004-09-02  Martin Baulig  <martin@ximian.com>
23831         * class.c (mono_class_instance_size): Don't allow generic type
23832         definitions or open generic instances.
23833         (mono_class_array_element_size): If we're a value type, call
23834         mono_class_instance_size() on the original class.
23836         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
23837         handle generic instances.
23839         * mono-debug-debugger.c (write_type): Handle generic instances
23840         like classes.
23842 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
23844         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
23845         the allocation request fails. Fixes #65089.
23847         * object.c (mono_runtime_free_method): Do not call mono_free_method.
23848         
23849         * object.c (mono_runtime_free_method): New function to free a dynamic
23850         method.
23852         * marshal.c (mono_delegate_free_ftnptr): New function to free the
23853         delegate trampoline.
23855         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
23856         with hasthis as dynamic,
23858         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
23860         * domain.c (mono_jit_info_table_remove): New function to remove an
23861         entry from the jit info table.
23863         * class-internals.h (MonoMethod): Add 'dynamic' field.
23865         * loader.c: Fix warnings.
23867 2004-09-01  Martin Baulig  <martin@ximian.com>
23869         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
23870         instead of mono_debugger_lock() because the latter one is a no-op
23871         unless running in the debugger.
23873 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
23875         * class.c (class_compute_field_layout): Classes with auto-layout or
23876         reference fields are not blittable.
23877         
23878 2004-09-01  Dick Porter  <dick@ximian.com>
23880         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
23881         mono_image_get_filename() to get the assembly location.
23883         * icall.c:
23884         * metadata.h: Fix compile warnings
23886 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
23888         * class.c (class_compute_field_layout): System.Object is blittable.
23890         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
23891         as in/out. Fixes #59909.
23893 2004-09-01  Martin Baulig  <martin@ximian.com>
23895         * metadata.h (MONO_TYPE_ISREFERENCE): Call
23896         mono_metadata_generic_inst_is_valuetype() if we're a generic
23897         instance to check whether our underlying type is a reference type.
23899 2004-09-01  Martin Baulig  <martin@ximian.com>
23901         * metadata.c (mono_type_size): If we're a generic instance, call
23902         mono_class_value_size() for value types.
23904 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
23906         * marshal.c: Implement more custom marshalling functionality. Fixes
23907         #64915.
23909 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
23911         * mono-debug.c, debug-mono-symfile.c: add some locking love.
23913 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
23915         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
23917         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
23919         * icall.c: Fix some warnings.
23921         * threads.c (abort_appdomain_thread): Fix unref errors.
23922         (mono_thread_current): Fix THREAD_DEBUG define.
23924 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
23926         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
23928         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
23930 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
23932         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
23933         string arrays.
23935 2004-08-28  Martin Baulig  <martin@ximian.com>
23937         * metadata.c
23938         (mono_metadata_generic_inst_is_valuetype): New public function.
23940         * metadata.h (MONO_TYPE_ISSTRUCT): Call
23941         mono_metadata_generic_inst_is_valuetype() if we're a generic
23942         instance to check whether our underlying type is a valuetype.
23944 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
23946         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
23947         #63768.
23949 2004-08-25  Martin Baulig  <martin@ximian.com>
23951         * loader.c (mono_get_method_from_token): Abstract methods can also
23952         be generic and thus have type parameters.
23954         * metadata-internals.h
23955         (MonoDynamicImage): Added `GPtrArray *gen_params'.
23957         * reflection.c (mono_image_get_generic_param_info): Don't create a
23958         metadata row, just add an entry to the `gen_params' array.
23959         (build_compressed_metadata): Sort the `gen_params' array and then
23960         actually create the metadata.
23962 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23964         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
23966 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
23968         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
23970 2004-08-24  Martin Baulig  <martin@ximian.com>
23972         * class.cs (mono_class_is_subclass_of): Like an interface, a
23973         generic instance also derives from System.Object.
23975 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
23977         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
23978         custom modifiers to be in any order. Fixes #61990.
23980 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
23982         * object.c: Register mono_object_new_fast icall.
23983         
23984         * object.c (mono_class_get_allocation_ftn): Return to calling
23985         mono_object_new_fast, since it seems faster to compute the object 
23986         size in unmanaged code than passing it as a parameter.
23988         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
23990         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
23991         this function with Boehm as the oom handler, so we don't have to check
23992         the result of GC_malloc.
23994         * object.c: Remove checks for oom.
23996         * object.h object.c (mono_class_get_allocation_ftn): New function to
23997         return the icall which can be used to allocate an instance of a given
23998         class. 
24000         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
24002         * class-internals.h: Add 'enabled' field.
24004 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
24006         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
24008 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
24009         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
24010         value 0x0010.
24012 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
24014         * appdomain.c: use the Tls function for appdomain too,
24015         at Zoltan's request. Actually return in mono_context_get
24017         * appdomain.c, profiler.c, threads.c: use __thread
24019 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
24021         * appdomain.c threads.c: Call GC_CreateThread on windows.
24023         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
24024         multiple libraries since this don't work on windows.
24026 2004-08-18  Martin Baulig  <martin@ximian.com>
24028         * class-internals.h
24029         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
24030         MonoMethodHeader.
24032         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
24033         MonoMethodNormal since we also need it for abstract and interface
24034         methods.
24036         * reflection.c
24037         (build_compressed_metadata): Sort the GenericParam table.
24038         (mono_image_create_token): Added `gboolean create_methodspec'
24039         argument; this is false when generating a MethodImpl token.
24040         (reflection_methodbuilder_to_mono_method): Abstract and interface
24041         methods may also have generic parameters.
24043 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
24045         * appdomain.c: thread local alloc
24047 2004-08-17  Martin Baulig  <martin@ximian.com>
24049         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
24051         * icall.c
24052         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
24053         argument.
24055         * class.c (mono_type_get_full_name): New public function.
24056         (mono_type_get_name): Don't include the type arguments.
24058 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
24060         * Makefile.am: Build static versions of libmetadata and libmonoruntime
24061         for inclusion into the mono executable.
24063 2004-08-16  Martin Baulig  <martin@ximian.com>
24065         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
24066         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
24068 2004-08-14  Martin Baulig  <martin@ximian.com>
24070         * class.c (dup_type): Also copy the `byref' field.
24072 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
24074         * reflection.c (create_dynamic_mono_image): Revert the last change 
24075         since it breaks bootstrap.
24077 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
24079         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
24081         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
24082         not free them with g_free.
24084 2004-08-11  Martin Baulig  <martin@ximian.com>
24086         * reflection.c (mono_reflection_setup_internal_class): Also call
24087         mono_class_setup_mono_type() if we already have a `tb->type.type'.
24089 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
24091         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
24092         called during default (first) AppDomain creation. Keep track of
24093         Evidence when loading assemblies.
24095 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
24097         * opcodes.c, opcodes.h: reduce runtime relocations.
24099 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
24101         * culture-info.h, locales.c: fixes and chages to sue the new
24102         optimized format of the locale data.
24103         * culture-info-tables.h: regenerated.
24105 2004-08-06  Geoff Norton <gnorton@customerdna.com>
24106         
24107         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
24109 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
24111         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
24112         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
24113         * domain-internals.h: icall declaration.
24114         * icall.c: icall registration.
24115         * object-internals.h: New fields in MonoAssembly for CAS.
24117 2004-08-05  Duncan Mak  <duncan@ximian.com>
24119         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
24120         CEE_LDELEM_ANY.
24122 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
24124         * reflection.c: fix to deal with object[] arrays in custom ctors
24125         (bug #62550).
24127 2004-08-05  Martin Baulig  <martin@ximian.com>
24129         * class.c (mono_class_array_element_size): Added support for
24130         generic instances and correctly handle "recursive" types.
24132 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
24134         * assembly.c: Fix warnings.
24136 2004-08-04  Martin Baulig  <martin@ximian.com>
24138         * class.c
24139         (mono_type_get_name_recurse): Added `gboolean include_arity'
24140         argument specifying whether or not we should include the generic
24141         arity in the type name.
24142         (_mono_type_get_name): New static function.
24143         (mono_class_setup_vtable): If we're a generic instance, don't
24144         include the generic arity in the names of explicit method
24145         implementations.        
24147 2004-08-03  Martin Baulig  <martin@ximian.com>
24149         * class.c (mono_type_get_name_recurse): Enclose the generic type
24150         arguments in `<', '>'.
24152 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24154         * gc.c: make GC warning messages use the trace API, they are just
24155         noise to most of the users.
24157 2004-08-03  Martin Baulig  <martin@ximian.com>
24159         * debug-mono-symfile.c (read_string): Correctly read the string.
24161 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
24163         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
24164         
24165         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
24166         icalls.
24167         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
24169 2004-07-30  Martin Baulig  <martin@ximian.com>
24171         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
24172         Reflect latest symbol writer changes.   
24174 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
24176         * object.c: always create an object if null is passed
24177         to Invoke() where a valuetype is expected.
24179 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
24181         * marshal.c (mono_marshal_init): make managed
24182         signatures match native ones better for 64bits.
24184 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24186         * appdomain.c: hack to build correctly the private bin path on windows.
24187         Fixes bug #61991.
24189 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
24191         * assembly.c: Load mscorlib from the correct framework directory
24192           (mono/<version>/mscorlib.dll).
24193         * appdomain.h: Added prototypes for new functions.
24194         * internals.h: Added some prototypes.
24195         * domain.c: When initializing the runtime, get from the executable and
24196           the configuration files the runtime version that the app supports.
24197           Added support methods for reading app.exe.config. Added list of versions
24198           supported by the JIT. Added two new methods: mono_init_from_assembly,
24199           which initializes the runtime and determines the required version from
24200           the provided exe file, and mono_init_version, which initializes
24201           the runtime using the provided version.
24202         * icall.c: Get machine.config from version-specific directory.
24203         * reflection.c: When generating an image, embed the version number
24204           of the current runtime.
24206 2004-07-28  Dick Porter  <dick@ximian.com>
24208         * socket-io.c
24209         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
24210         returned sockaddr size before creating the remote address object.
24211         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
24212         61608.
24214 2004-07-28  Dick Porter  <dick@ximian.com>
24216         * locales.c (string_invariant_compare_char): Fix invariant char
24217         compares between upper and lower cases.  Fixes bug 61458.
24219 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
24220         
24221         * marshal.c: actually cache stelem.ref wrappers.
24222         
24223 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
24225         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
24226         sections and remove the mono_cli_rva_map () function.
24228 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
24230         * debug-mono-symfile.c: fix one more endianess issue, from a patch
24231         by Geoff Norton (<gnorton@customerdna.com>).
24233 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24235         * class.c: fix class loads for pointer types (typeof(int) !=
24236         typeof(int*)).
24238 2004-07-27  Martin Baulig  <martin@ximian.com>
24240         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
24241         reading the debugging information from an external ".mdb" file.
24243 2004-07-24  Martin Baulig  <martin@ximian.com>
24245         * reflection.c (mono_image_get_type_info): Only write a class
24246         layout entry if we actually have a size or a packing size.
24248 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
24250         * reflection.c (type_get_fully_qualified_name): 
24251         insert cast to get type checking of ?: with non-gcc compilers
24253 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
24255         * rand.c: use g_getenv for both lookups of
24256         MONO_EGD_SOCKET
24258 2004-07-17  Martin Baulig  <martin@ximian.com>
24260         * reflection.c (mono_reflection_bind_generic_method_parameters):
24261         Set `gmethod->reflection_info'.
24263 2004-07-17  Martin Baulig  <martin@ximian.com>
24265         * class.c (mono_class_create_from_typedef): Insert the newly
24266         created class into the hash table before computing the interfaces
24267         since we could be called recursively.
24269 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
24271         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
24272         function to implement stelem.ref in managed code
24273         * class-internals.h, debug-helpers.c: a new wrapper type
24274         for the above.
24276 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
24278         * gc.c: allow GC handles to work even when no GC is compiled in.
24279         Fix part of bug #61134 (GetAddrOfPinnedObject).
24281 2004-07-13  Peter Williams  <peter@newton.cx>
24283         * process.c (complete_path): Make sure we don't attempt to execute
24284         directories.
24286 2004-07-12  Geoff Norton <gnorton@customerdna.com>
24288         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
24289           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
24290           and will add/subtract the hour if needed
24292 2004-07-12  Martin Baulig  <martin@ximian.com>
24294         * reflection.c (mono_field_get_object): If we have
24295         `field->generic_info', take the attributes from
24296         `field->generic_info->generic_type'.    
24298 2004-07-12  Martin Baulig  <martin@ximian.com>
24300         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
24301         This function must be called before initializing the runtime.
24302         (mono_debug_init_1): New function; call this after initializing
24303         the runtime, but before loading the assembly.  It tells the
24304         debugger to load corlib and the builtin types.
24306         * mono-debug-debugger.c: Did some larger changes in the debugging
24307         code; support recursive class declarations, make sure we actually
24308         add all classes.
24310 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24312         * debug-helpers.c: undo my previous patch and fixed the real issue in
24313         ../mini/exceptions-x86.c
24315 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24317         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
24318         when no HOME env. variable was set and a NullRef was thrown in a .cctor
24319         called from other .cctors.
24321 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
24323         * loader.c: Removed the mono_loader_wine_init hack now that we are
24324         doing a managed version of Windows.Forms.
24326 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
24328         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
24329         threadpool.c, threads.c: remove static data from rootset.
24331 2004-07-09  Dick Porter  <dick@ximian.com>
24333         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
24334         Don't do any more processing if the matched length was 0.  It was
24335         increasing the size of the string before.  Fixes bug 61167.
24337 2004-07-09  Dick Porter  <dick@ximian.com>
24339         * socket-io.h:
24340         * socket-io.c
24341         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
24342         Add support for SO_PEERCRED if its available.
24344 2004-07-09  Peter Bartok <pbartok@novell.com>
24345         * loader.c: winelib.exe.so error message is now only displayed if
24346         MONO_DEBUG is set. To help us avoid questions when people are trying
24347         out the new Managed.Windows.Forms.
24349 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
24351         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
24352         for isinst and castclass wrappers.
24354         * class-internals.h icall.c: Move registration and lookup of JIT icalls
24355         to libmetadata from the JIT, so they could be used by the marshalling
24356         code and the interpreter.
24358         * marshal.c: Register marshalling related JIT icalls here instead of
24359         in mini.c. Use CEE_MONO_ICALL instead of the family of 
24360         CEE_MONO_PROC<x> opcodes to call marshalling functions.
24362         * metadata.h: Remove unneeded marshalling conversions.
24364         * opcodes.c: Update for new opcodes.
24365         
24366 2004-07-08  Martin Baulig  <martin@ximian.com>
24368         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
24369         (mono_debug_get_domain_data): Make this function static.
24371 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
24373         * gc.c, object.h: add nice GC handle API for embedders.
24375 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
24377         * reflection.c: more changes for the new api
24379         * object.c: When we reflect on a field w/ a constant value, it
24380         will not have a memory location, so we must access metadata. Also,
24381         allow easier reading of strings so that we can read them from
24382         the constant data.
24384         * class.c (mono_class_layout_fields): no need for literal fields here.
24386         * class-internals.h: api changes for const fields
24388         * icall.c (ves_icall_get_enum_info): use new apis for const fields
24390 2004-07-06  Martin Baulig  <martin@ximian.com>
24392         * mono-debug.h: Increment version number to 44.
24394         * mono-debug.c (mono_debug_add_wrapper): The second argument is
24395         now a gpointer, rewrote this whole method.
24397         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
24398         function.  Add information about the wrapper in a new "misc table".
24400         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
24401         for the new misc table.
24403 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
24405         * metadata-internals.h image.c: Add a cache for helper signatures.
24407         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
24409 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
24411         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
24412         delegates from a delegate. Fixes #61033.
24413         
24414         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
24415         marshalling of stringbuilder arrays. Fixes #59900.
24417 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
24419         * icall.c: Add EnumBuilder:setup_enum_type icall.
24421 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
24423         * icall.c: Added a new icall for the property version of
24424         OffsetOfStringData.
24426 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
24428         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
24429         it has a constant size across platforms.
24431         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
24432         stack trace.
24434 2004-06-29  Martin Baulig  <martin@ximian.com>
24436         * mono-debug.c (mono_debug_add_method): Protect the whole function
24437         in mono_debugger_lock(), not just parts of it.
24439 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
24441         * reflection.c: make sure padding bytes in heaps are zeroed.
24443 2004-06-24  David Waite  <mass@akuma.org>
24445         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
24446         image.c, loader.c, locales.c, marshal.c, metadata.c,
24447         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
24448         string-icalls.c, threads.c: change to C90-style comments from C99 /
24449         C++ -style
24451 2004-06-24  Dick Porter  <dick@ximian.com>
24453         * threads.c
24454         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
24455         return createdNew.  Fixes bug 60412.
24457         * threads-types.h: 
24458         * icall.c: Add createdNew parameter to CreateMutex icall
24460 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
24462         * reflection.c, object-internals.h: save default value in params.
24464 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24466         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
24467         no need to build a new path combining that with the application base.
24468         Fixes bug #60442.
24470 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
24472         * reflection.c: fixed minor standard compliance issues.
24474 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
24476         * reflection.c: fixed issue with encoding some custom attributes
24477         (arrays in properties and fields, bug #60411).
24479 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24481         * reflection.c: fix start address when copying the public key token.
24483 2004-06-23  Martin Baulig  <martin@ximian.com>
24485         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
24486         the `exc' object in a static object to put it into the GC's root set.
24488 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
24490         * reflection.c: make mono_reflection_setup_internal_class ()
24491         callable a second time to setup a new parent class.
24493 2004-06-23  Dick Porter  <dick@ximian.com>
24495         * threads.c: Check for WAIT_IO_COMPLETION return values.
24497 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
24499         * appdomain.c: Removed the g_free on the public key token. Now copy 
24500         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
24501         * assembly.c: Added public key token string value when loading 
24502         assemblies. Fix bug #60439.
24503         * icall.c: Added missing informations (like public key) in 
24504         GetReferencedAssemblies. Fix #60519.
24505         * image.h: Changed definition for public key token from const char*
24506         public_tok_value to guchar public_key_token [17];
24507         * reflection.c: Updated for changes to public key token.
24509 2004-06-22  Lluis Sanchez Gual
24511         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
24512         for the field in base classes.
24514 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
24516         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
24517         mark headers as not supported, they are installed only for use by the
24518         debugger.
24520 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
24522         * *.c, *.h: avoid namespace pollution in public headers.
24524 2004-06-21  Martin Baulig  <martin@ximian.com>
24526         * exception.c (mono_get_exception_security): It's in
24527         "System.Security", not in "System".
24529         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
24530         the exception classes.
24532 2004-06-21  Martin Baulig  <martin@ximian.com>
24534         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
24535         Protect the exception object from being finalized.
24537 2004-06-21  Martin Baulig  <martin@ximian.com>
24539         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
24540         public function.
24542 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
24544         * reflection.c: Load the assembly in mono_reflection_type_from_name,
24545         if it was not loaded before. Fix parts of #60439.
24547 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
24549         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
24550         code that was broken since Ben's change: wrappers are now
24551         dependent on the method signature only again.
24553 2004-06-21  Martin Baulig  <martin@ximian.com>
24555         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
24556         added interface support.
24558 2004-06-21  Martin Baulig  <martin@ximian.com>
24560         * class.c (mono_vtable_get_static_field_data): New public method.
24562 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
24564         * filewatcher.c : Windows build fix to be compliant with API changes.
24566 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
24568         * class.h, class.c: more accessors.
24569         * metadata.h, metadata.c: prepare for hiding MonoType and
24570         MonoMethodSignature: people should use the accessors from now on
24571         outside of the tree.
24573 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
24575         * *.c, *.h: more API cleanups.
24577 2004-06-18  Jackson Harper  <jackson@ximian.com>
24579         * assembly.c: Trace loading assemblies.
24580         * loader.c: Trace loading native libraries.
24581         * mono-config.c: Trace loading config files.
24582         
24583 2004-06-18  Dick Porter  <dick@ximian.com>
24585         * locales.c: Tell ICU the lengths of strings, it can cope with
24586         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
24588 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
24590         * image.c: swapped name/filename;
24592 2004-06-18  Martin Baulig  <martin@ximian.com>
24594         * mono-debug-debugger.c (write_class): Write the parent class at
24595         the end of the header.
24597 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
24599         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
24601 2004-06-17  Raja R Harinath  <rharinath@novell.com>
24603         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
24604         (bundle_obj): New conditional define.
24605         (BUILT_SOURCES): Remove.
24606         ($(bundle_srcs)): Make parallel-make safe.
24607         (libmonoruntime_la_LIBADD): Make unconditional.
24608         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
24609         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
24611 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
24613         * culture-info-tables.h: It was inconsistent with the latest
24614           supp info files.
24616 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
24618         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
24619         be loaded.
24621         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
24622         with gcc 2.95.
24624 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
24626         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
24627         cleaned up public header threads.h.
24629 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
24631         * Makefile.am, *.c, *.h: more API cleanups.
24633 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
24635         * Makefile.am: removed monosn from compilation.
24636         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
24637         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
24638         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
24639         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
24640         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
24641         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
24643 2004-06-15  Jackson Harper  <jackson@ximian.com>
24645         * assembly.c: Make locales lower case when searching the GAC for
24646         assemblies. gacutil will always make locales lowercase when
24647         installing so this effectively makes them case insensitive.
24648         
24649 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
24651         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
24652         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
24653           parameter which allows to choose whether the wait can be interrupted or 
24654           not. Also added the method mono_monitor_enter(), which locks the monitor
24655           using an infinite wait and without allowing interruption.
24656           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
24657           interrupted.
24658         * object.h: Added new fields in MonoThread. suspend_event holds the event
24659           used to susped/resume the thread. synch_lock is the lock object to use for
24660           modifying the thread state.
24661         * threads.c: Use the new synch_lock object for locking, instead of "this",
24662           which can generate deadlocks.
24663           Moved thread state change in Thread.Sleep and Thread.Join from managed
24664           to unmanaged code. This avoids a deadlock when the thread was suspended
24665           just after acquiring the thread lock.
24666           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
24667           Implemented Thread.Suspend using an event instead of ThreadSuspend,
24668           which is not fully implemented in the io-layer.
24669         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
24671 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
24673         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
24674         threads-types.h: more API cleanups.
24676 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
24678         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
24679         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
24680         threadpool.c, threads.c: first pass at the exported API cleanup.
24682 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
24684         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
24686 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24688         * icall.c: added internalGetHome.
24690 2004-06-14  Dick Porter  <dick@ximian.com>
24692         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
24693         possible to return successfully when '.' or '..' were the only
24694         entries in a directory, but were skipped.  The MonoIOStat was not
24695         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
24696         Fixes bug 59574.
24698 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
24700         * reflection.c: make binaries run on .Net 1.1 by default.
24702 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
24704         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
24706 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
24708         * marshal.c: keep track of struct size with explicit layout
24709         (bug #59979).
24711 2004-06-12  Martin Baulig  <martin@ximian.com>
24713         * mono-debug-debugger.c: Comment out a debugging g_message().
24715 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
24717         * reflection.c, reflection.h: do not free custom attrs that are cached.
24718         * icall.c: use braces to make code clearer.
24720 2004-06-11  Martin Baulig  <martin@ximian.com>
24722         * class.h (MonoInflatedField): New type.
24723         (MonoClassField): Replaced `MonoType *generic_type' with
24724         `MonoInflatedField *generic_info'.
24726         * icall.c
24727         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
24729 2004-06-11  Martin Baulig  <martin@ximian.com>
24731         * reflection.c (mono_image_create_method_token): Correctly encode
24732         varargs methods.
24734 2004-06-11  Martin Baulig  <martin@ximian.com>
24736         * metadata.c (mono_metadata_parse_method_signature): When parsing
24737         a MethodDef which has VarArgs, also set sentinelpos if we don't
24738         have any parameters.
24740 2004-06-11  Martin Baulig  <martin@ximian.com>
24742         * verify.c (mono_method_verify): In CEE_CALL, use
24743         mono_method_get_signature() to get the method's signature, unless
24744         we're a PInvoke method.
24746 2004-06-10  Jackson Harper  <jackson@ximian.com>
24748         * assembly.c: Use <path>/lib/mono/gac for the extra paths
24749         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
24750         logical name as the supplied path is just a prefix to the gac not
24751         the direct path to it.
24752         
24753 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
24755         * reflection.c: make the token for a created method match
24756         the token of the MethodBuilder it was created from
24757         (IKVM requires this behaviour now).
24759 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
24761         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
24762         reflection.c, socket-io.c: leak fixes.
24764 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
24766         * icall.c: handle sentinel pos in vararg methods in position different
24767         from 0.
24769 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24771         * culture-info-tables.h: freshly generated.
24773 2004-06-09  Martin Baulig  <martin@ximian.com>
24775         * loader.c (mono_get_method_constrained): Call `mono_class_init
24776         (constrained_class)'.   
24778 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
24780         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
24781         any methods. Fixes #59629.
24783 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24785         * culture-info-tables.h: reflecting locale-builder updates.
24787 2004-06-08  Dick Porter  <dick@ximian.com>
24789         * object.h:
24790         * locales.c: Fixed compile warnings, including a real bug in
24791         CompareInfo_internal_compare.
24792         
24793 2004-06-08  Dick Porter  <dick@ximian.com>
24795         * locales.c
24796         (ves_icall_System_Globalization_CompareInfo_internal_index):
24797         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
24798         Double-check the resuls of usearches, because ICU currently
24799         ignores most of the collator settings here.  Fixes bug 59720.
24800         
24801 2004-06-08  Dick Porter  <dick@ximian.com>
24803         * locales.c
24804         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
24805         Fix memory leak and segfault-causing typo.  No idea how this one
24806         lasted so long without being noticed.
24808 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
24810         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
24811         any methods. Fixes #59629.
24813 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24815         * assembly.c:
24816         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
24817         own the critical section before). Removed dead code (that's done
24818         in the preload hook).
24820         (mono_assembly_load_with_partial_name): call the preload hook.
24822 2004-06-08  Martin Baulig  <martin@ximian.com>
24824         * metadata.c (mono_metadata_signature_alloc): Default
24825         `sentinelpos' to -1.
24827         * reflection.c (mono_image_get_array_token): Likewise.
24829 2004-06-08  Martin Baulig  <martin@ximian.com>
24831         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
24833         * metadata.c (mono_metadata_parse_method_signature): When parsing
24834         a MethodDef which has VarArgs, set sentinelpos.
24836         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
24837         `gint16' since we're using -1 for non-varargs methods.
24839         * reflection.c
24840         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
24841         (method_encode_signature): Added varargs support.
24842         (method_builder_encode_signature): Likewise.
24843         (mono_image_get_varargs_method_token): New static method.
24844         (mono_image_create_method_token): New public method; this is
24845         called via an icall instead of mono_image_create_token() when
24846         calling a varargs method.       
24848 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
24850         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
24852 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24854         * culture-info-tables.h : Reflecting the latest locale-builder that
24855           fixed empty array representation ({} to {0}).
24857 2004-06-07  Jackson Harper  <jackson@ximian.com>
24859         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
24860         looking up extra gac paths. This allows MONO_GAC_PATH to act
24861         exactly like a prefix.
24862         
24863 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
24865         * reflection.c (mono_reflection_type_from_name): Make a copy of the
24866         type name before modifying it. Fixes #59405.
24868 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24870         * culture-info.h: added fields for "all datetime patterns".
24871         * locales.c: (  ves_icall_System_Globalization_CultureInfo
24872           _construct_datetime_format ()): fill xxx_patterns fields.
24873         * object.h: added fields for "all datetime patterns" to
24874           MonoDateTimeFormatInfo.
24875         * culture-info-tables.h: reflecting locale-builder updates.
24877 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
24879         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
24880         the event has no add and remove methods. Fixes #59629.
24882 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
24884         * object.c: Fixed possible integer overflow when allocating large
24885         strings.
24887 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
24889         * culture-info-tables.h: reflecting locale-builder updates.
24891 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
24893         * culture-info-tables.h: reflecting locale-builder updates.
24895 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
24897         * culture-info-tables.h: reflecting locale-builder updates.
24899 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
24901         * threads.c: Made Thread.Sleep abortable.
24903 2004-06-02  Martin Baulig  <martin@ximian.com>
24905         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
24907         * debug-mono-symfile.h: Bumped symbol file version number to 37.
24909 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
24911         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
24913 2004-05-30  Jackson Harper  <jackson@ximian.com>
24915         * reflection.c: Do not hardcode assembly versions or public key
24916         tokens anymore. All of this except the corlib section was dead
24917         code anyways.
24918         
24919 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
24921         * object.c (mono_runtime_invoke_array): Automatically create boxed
24922         objects for byref valuetypes if needed. Fixes #59300.
24923         
24924         * object.c (mono_method_return_message_restore): Handle 
24925         MONO_TYPE_OBJECT as well.
24927 2004-05-28  Jackson Harper  <jackson@ximian.com>
24929         * reflection.c: The modified type encoding was causing build
24930         problems. Reverted for now.
24931         
24932 2004-05-28  Jackson Harper  <jackson@ximian.com>
24934         * reflection.c/h: Take an assembly ref so that we dont create
24935         fully qualified names when encoding types in the same assembly as
24936         the custom attribute being emitted.
24937         * appdomain.c: Increment version number.
24938         
24939 2004-05-26  Duncan Mak  <duncan@ximian.com>
24941         * icall.c
24942         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
24943         Set the full version number (major, minor, build, revision).
24945 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
24947         * marshal.c (emit_struct_conv): increment src/dst after blit
24948         (mono_marshal_get_managed_wrapper,
24949         mono_marshal_get_native_wrapper): make sure we have marshalling
24950         info before marshalling params (info computation affects
24951         blittable)
24953         * class.c (class_compute_field_layout): correctly deal with
24954         blittable
24955         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
24956         value types (as per what windows dows by default)
24957         (mono_class_setup_mono_type): System.ValueType is blittable
24958         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
24959         blittable
24961         * marshal.c (mono_marshal_load_type_info): flag types  as
24962         non-blittable if the native layout doesn't match the managed
24963         layout
24965 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24967         * appdomain.c: don't add stuff in the private search path that is
24968         above the application base. If application base is not set, there's
24969         no private search path.
24971 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
24973         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
24974         byref struct arguments in native->managed marshalling.
24976 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
24978         * marshal.c (mono_marshal_get_runtime_invoke): correctly
24979         cache methods using signature (special case for methods
24980         that are value type or string class)
24981         
24982         * image.c (mono_image_close): clean up allocated GSList's
24983         in runtime_invoke_cache.
24985 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24987         * mono-config.c: set the correct path for mono_cfg_dir on windows when
24988         there's no MONO_CFG_DIR environment variable defined.
24990 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24992         * threads.c: windows version must be >= 0x0500 to include OpenThread.
24994 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
24996         * threadpool.c: Really wait for 500ms after the async call, even if the wait
24997           is interrumped.
24998         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
24999           before waiting for it, and call CloseHandle after the wait to unref it.
25000           This will make sure that handles are not disposed too early.
25002 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25004         * appdomain.c:
25005         * appdomain.h:
25006         * icall.c: removed
25007         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
25008         needed now.
25010         * object.c: se the application_base only for the domain that runs
25011         Main. Fixes bug #59216,
25013 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25015         * appdomain.c:
25016         * object.c: only the domain in which Main is run have
25017         SetupInformation.ConfigurationFile set, so moved a few lines from
25018         appdomain.c to object.c.
25020 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25022         * appdomain.c: we tried to load [name].(dll|exe), but according
25023         to bug #57710, we must also try [culture]/[name].(dll|exe) and
25024         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
25025         There's a test case attached to bug #58922.
25027 2004-05-27  Dick Porter  <dick@ximian.com>
25029         * icall.c:
25030         * file-io.c: Implemented icalls for locking and unlocking regions
25031         in a file.
25032         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
25033         FALSE on error (fixes both compiler warning and real bug.)
25035 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
25037         * culture-info-tables.h: reflecting locale-builder updates.
25039           (Added missing ChangeLog entry for 05/26)
25041 2004-05-27  Jackson Harper  <jackson@ximian.com>
25043         * locales.c: Fix some cut and paste errors.
25044         
25045 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25047         * mono-config.c: set the correct path for config. directory on windows.
25049 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
25051         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
25052           on win32.
25054 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
25056         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
25057         from pinvoke functions.
25058         
25059         * marshal.c (mono_ftnptr_to_delegate): Implement this.
25061 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
25063         * culture-info-tables.h: reflecting locale-builder updates.
25065 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
25067         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
25068         #59086.
25070 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
25072         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
25073         * icall.c: Modified icalls for RNG.
25074         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
25075         Windows (CryptoAPI).
25077 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
25079         * locales.c: Fix build.
25081 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
25083         * culture-info-tables.h: reflecting locale-builder updates.
25085 2004-05-25  Jackson Harper  <jackson@ximian.com>
25087         * locales.c: When creating the current culture use the $LANGs
25088         specific culture. So DateTimeFormat and NumberFormat entries are created.
25089         
25090 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
25092         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
25093         a char array as parameter.
25095 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
25097         * image.c: In mono_image_open(), always use an absolute path name to
25098           look for already loaded images.
25100 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
25102         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
25103         missing in the windows build (like older cygwin include files).
25105 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
25107         * icall.c: Fixed check for possible integer overflow in Buffer_
25108         BlockCopy icall. Replaced comments style // by /* */.
25110 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
25112         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
25113         
25114         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
25115         check after MONO_VTADDR. Fixes pinvoke2.exe.
25117         * marshal.h marshal.c metadata.h: Add beginnings of support for
25118         ftnptr -> delegate marshalling.
25120 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
25122         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
25123         * threads.c: Fix warnings.
25125 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
25127         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
25128         * icall.c: Registered icalls for Suspend and Resume.
25129         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
25130           Thread.Abort.
25131         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
25132         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
25133         * process.c: Use WaitForSingleObjectEx.
25134         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
25135           checkpoints.
25136         * threads.c, threads.h: Make use of new Ex wait methods. Improved
25137           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
25138           for Suspend and Resume. Added new mono_thread_stop, used for stoping
25139           background threads. Added basic support for Abort in Windows.
25140           Start new threads using a managed delegate invoke wrapper. This wrapper
25141           has an interruption checkpoint that is needed since an interruption
25142           can be requested before the thread leaves the unmanaged code that starts 
25143           the thread.
25144         * marshal.c: Added interruption checkpoint after every native call, and
25145           also before managed calls for wrappers called from unmanaged code to
25146           go into managed code.
25147         * object.h: Added new field in MonoThread to keep track of interruption
25148           requests.
25150 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
25152         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
25153         calls.
25155 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25157         * appdomain.c:
25158         * assembly.c:
25159         * gc.c:
25160         * locales.c:
25161         * mono-config.c:
25162         * rand.c: getenv -> g_getenv (windows!)
25164         * process.c: complete_path is also used on non-windows platforms.
25166 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25168         * icall.c: new signature for Process_Start.
25170         * process.[ch]: new signature for Process_Start. If we're on windows
25171         and UseShellExecute is false, we have to search for the program by
25172         ourselves if we don't get a full path.
25174 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
25176         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
25177         marshalling and call CleanUpNativeData if needed. Fixes #58646.
25179 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25181         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
25182         Fixes bug #58373.
25184 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25186         * process.c: use double quotes to quote program name and arguments on
25187         windows. Fixes bug #58575.
25189 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25191         * file-io.c: don't return "." and ".." when using windows Find*File.
25193 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
25195         * marshal.c: Don't pass wrappers to message init because method 
25196         addressed used to lookup metadata. part of remoting[2|3] fix.
25198 2004-05-15  Jackson Harper  <jackson@ximian.com>
25200         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
25201         path is essentially the same as MONO_PATH except that it points to
25202         GACs instead of lib directories.
25203         * loader.h: The user gac is gone so we dont need function to
25204         enable/disable it.
25205         * mono-config.c: user gac option is now gone.
25206         
25207 2004-05-15  Jackson Harper  <jackson@ximian.com>
25209         * culture-info.h: Make defines more consistent, add calendar data
25210         to the culture info table.
25211         * culture-info-tables.h: Add basic calendar data. Basically
25212         everyone gets default gregorian until all the data is
25213         updated.
25214         * locales.c: Use the new consistent defines. Set calendar data for
25215         culture info objects.
25216         * object.h: add a field for calendar data to CultureInfo
25217         
25218 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
25220         * image.c: image->runtime_invoke_cache is keyed on signatures now.
25221         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
25222         a signature.
25223         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
25224         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
25225         an extra param that is the pointer of the method to invoke. The IL for
25226         the invoke method is no longer specific to the method, but to the
25227         signature of the method. Thus, we can share the same code for multiple
25228         methods. This reduces the number of methods that have to be compiled.
25230 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
25232         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
25234         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
25236         * icall.c: Optimize Buffer.BlockCopy.
25238 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25240         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
25241         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
25242         quote). Changed them to "MMMM yyyy".
25244 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
25246         * rand.c
25247         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
25249 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
25251         * reflection.h: Updated after changes to managed structures.
25253         * appdomain.c: Bump corlib version.
25255 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25257         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
25258         windows.
25260 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25262         * Makefile.am: link to ../os/libmonoos.la on windows.
25264         * assembly.c:
25265                 -If MONO_DEBUG, warn about non-existing directories in
25266                 MONO_PATH.
25267                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
25268                 compile time variable.
25269                 -Removed init_default_path and call mono_set_rootdir from
25270                 libmonoos.a instead (windows only).
25272         * assembly.h: declare mono_assembly_getrootdir().
25274         * domain.c:
25275         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
25277         * loader.c: s/getenv/g_getenv/
25279 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
25281         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
25283         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
25285         * metadata.h: Add new marshalling conversions.
25287         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
25288         function.
25290         * reflection.c (mono_reflection_get_type): Lookup the type in all
25291         modules of a multi-module assembly. Fixes #58291.
25293 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
25295         * threads.c: Before aborting a background, set the StopRequested
25296         state.  This avoids throwing the Abort exception.
25297         In mono_thread_manage, don't continue with the shutdown until all
25298         aborted threads have actually stopped.
25300 2004-05-10  Jackson Harper  <jackson@ximian.com>
25302         * locales.c: Remove the modifier from culture names.
25303         
25304 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25306         * Makefile.am: monosn is not installed any more. It has been deprecated
25307         in favor of sn.
25309 2004-05-07  Jackson Harper  <jackson@ximian.com>
25311         * locales.c
25312         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
25313         Fix array construction, add bailout if the length is 0.
25315 2004-05-07  Dick Porter  <dick@ximian.com>
25317         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
25318         machine doesn't have a DNS entry.  Patch by Urs Muff
25319         (umuff@quark.com), fixes bug 57928.
25321 2004-05-06  Jackson Harper  <jackson@ximian.com>
25323         * reflection.c: Handle null PublicTokens properly. alloc mem for
25324         assembly names culture so we dont crash when freeing it.
25325         
25326 2004-05-06  Jackson Harper  <jackson@ximian.com>
25328         * assembly.c: Check the usergac when loading with partial names.
25329         
25330 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
25332         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
25333         does nothing for now (not required for Linux/Windows) but the class
25334         library can call it (and a newer or modified runtime could need it).
25335         * icall.c: Registred icall.
25337 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25339         * loader.c: prints a message on module loading error we set MONO_DEBUG
25340         environment variable.
25342 2004-05-05  Jackson Harper  <jackson@ximian.com>
25344         * appdomain.c: Handle PublicKeyToken=null properly.
25345         
25346 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
25348         * environment.c|h: Added icall ves_icall_System_Environment_
25349         GetOSVersionString to get the current OS version as a string.
25350         * icall.c: Registred icall.
25352 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
25354         * object.c: in mono_object_get_virtual_method(), take into account that
25355         non-virtual methods don't have a slot in the vtable. Check needed when
25356         the object is a proxy.
25358 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
25360         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
25361         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
25363         * object.c (mono_class_compute_gc_descriptor): Fix warning.
25365         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
25366         passed when a valuetype is expected.
25368         * object.c (mono_unhandled_exception): Only set the exit code if the
25369         exception happens in the main thread. Fixes thread5.exe.
25371         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
25372         invalid names. Fixes #58047.
25374 2004-05-03  Jackson Harper  <jackson@ximian.com>
25376         * assembly.c: This line was committed accidently and is unneeded.
25377         
25378 2004-05-03  Jackson Harper  <jackson@ximian.com>
25380         * icall.c: Add new icall for Assembly::LoadWithPartialName
25381         * assembly.c/.h: new function that probes the GAC to load partial
25382         assembly names by Paolo Molaro.
25383         
25384 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25386         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
25387         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
25388         (type_get_fully_qualified_name): Added PublicKeyToken when building a
25389         full type name.
25391 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25393         * appdomain.c: fixed check for 'neutral' culture and removed warning.
25394         * reflection.c: fix bug when parsing a full type name and Version is not
25395         the last thing in the string.
25397 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
25399         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
25400         crashes when it is freed.
25402 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25404         * assembly.c: print the compat warning to stderr.
25406 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
25408         * assembly.c (mono_assembly_load_references): Add a compatibility
25409         hack to run old applications that might be still referencing the
25410         3300-based assemblies, only do this for System.xxx.
25412 2004-05-01  Jackson Harper  <jackson@ximian.com>
25414         * appdomain.c: If the culture is neutral we set it to "".
25415         
25416 2004-04-29  Jackson Harper  <jackson@ximian.com>
25418         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
25420 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
25422         * string-icalls.c: added low overhead function for copying chars
25423         * icall.c: added needed icall for the above function
25425 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25427         * icall.c: fix return value of get_global_assembly_cache.  Implemented
25428         Environment.GetLogicalDrives.
25430 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
25432         * rand.c: try and talk to egd or prngd
25433         for random bytes if opening devices fail.
25435 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
25437         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
25438         alignment for the type using the native alignment of its members 
25439         instead of using klass->min_align.
25441         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
25443 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25445         * file-io.c:
25446         * socket-io.c: added check for sys/aio.h.
25448 2004-04-28  Dick Porter  <dick@ximian.com>
25450         * threads.c: Don't abort a thread thats already aborting, when
25451         terminating everything.
25453 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25455         * icall.c: added 2 new async calls for Socket.
25457         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
25458         IO on *nix systems.
25460         * threadpool.c: removed unused variable.
25462 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
25464         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
25466 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25468         * locales.c: put back string_invariant_tolower () and
25469         string_invariant_toupper ().
25471 2004-04-26 David Waite <mass@akuma.org>
25473         * file-io.h:
25474         * socket-io.h:
25475         * threads.h:
25476         * unicode.h: remove comma from end of enumeration declarations
25478 2004-04-26 David Waite <mass@akuma.org>
25480         * debug-mono-symfile.h:
25481         * decimal.c:
25482         * mono_debug.h:
25483         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
25486 2004-04-26  Jackson Harper  <jackson@ximian.com>
25488         * appdomain.c: Increment version number.
25489         
25490 2004-04-26  Jackson Harper  <jackson@ximian.com>
25492         * appdomain.c: Set assembly references public token value when
25493         PublicKeyToken is specified, not the hash_value. Free public token
25494         values when free assembly name data. Previously the public key
25495         token was hex decoded, however we are using hex encoded public key
25496         tokens, so this is not neccasary.
25497         * assembly.c: Lookup assemblies in the gac if their public token
25498         value is set. Add function to allow enabling user gac
25499         lookups. Specify whether or not the assembly was loaded from the
25500         GAC. Compare full assembly names when checking the cache for
25501         assemblies (Temporarily disabled see comment in code). Remove
25502         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
25503         specifies trace-loader they get extra info to stdout on the
25504         loading of assemblies.
25505         * image.h: Add a field for an assembly references public token
25506         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
25507         whether an assembly has been loaded from the GAC.
25508         * image.c: Remove a corlib -> mscorlib name mapping.
25509         * loader.h: Add function to enable/disable the user gac.
25510         * mono-config.c: Check if the usergac is enabled in the config
25511         file.
25512         * icall.c: New icall to determine whether or not an assembly has
25513         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
25514         * tabldefs.h: Add constant for assemblyref flag that specifies a
25515         full public key is used instead of a public token.
25516         * reflection.c: Remove mscorlib -> corlib mappings. Set
25517         PublicTokenValue instead of hash value. This value is a hex
25518         string so it does not need to be expanded.
25520 2004-04-26  Martin Baulig  <martin@ximian.com>
25522         * mono-debug-debugger.c (mono_debugger_initialize): Set
25523         `mono_debugger_initialized' before calling mono_debug_lock().
25525 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
25527         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
25528           InternalToUpper/InternalToLower.
25529         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
25530           removed invariant culture shortcut.  This is now done in managed code.
25531         * locales.c: (string_invariant_toupper/tolower) removed.
25533 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25535         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
25536         Added Poll internal call.
25538         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
25539         call for Poll. Select was too heavy for polling a single socket.
25541         * threadpool.[ch]: added mono_threadpool_cleanup.
25542         * threads.c: use it. Don't use Thread_Abort on windows.
25544 2004-04-23  Martin Baulig  <martin@ximian.com>
25546         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
25548 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
25550         * icall.c: Registred new icalls for key pair protection and added an
25551         icall for Environment.GetFolderPath on Windows.
25552         * security.c|h: Added new icalls for key pair protection.
25554 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25556         * socket-io.c: don't display the non-supported family warning for known
25557         families. Now this is not displayed on windows when checking support
25558         for IPv4/IPv6.
25560 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25562         * class.c: don't display the layout warning for static fields.
25564 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
25566         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
25567         * locales.c, locales.h: Added new icalls for culture-specific
25568         Char.ToLower and Char.ToUpper.
25570 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25572         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
25573         by David Waite.
25575 2004-04-20  Martin Baulig  <martin@ximian.com>
25577         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
25578         of the type name before passing it to mono_reflection_type_from_name().
25580 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
25582         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
25583         encodings here. Fixes #56965.
25585 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
25587         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
25588         fix test on strstr result not that I can see anything that
25589         relies on the result.
25591 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
25593         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
25594         Fixes #57081.
25596         * marshal.c (mono_marshal_get_string_encoding): New helper function.
25598         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
25599         function to determine which marshalling to use for strings. Fixes
25600         #56965.
25602         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
25604         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
25606 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
25608         * icall.c: #include mono-config.h
25610 2004-04-15  Jackson Harper  <jackson@ximian.com>
25612         * culture-info-tables.h: Fix date formats for en-US culture.
25613         
25614 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
25616         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
25617         ThreadPool.SetMinThreads.
25618         * threadpool.c: Implemented ThreadPool.GetMinThreads and
25619         ThreadPool.SetMinThreads.
25621 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
25623         * mono-config.c: also load the .config file in the directory
25624         where the assembly was found.
25626 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
25628         * assembly.c: load per-assembly config files.
25629         * icall.c: decrapified code to get the config dir and moved to
25630         mono-config.c.
25631         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
25632         per-assembly config files. When doing a dll map lookup give precedence
25633         to the per-assembly data.
25635 2004-04-14  Martin Baulig  <martin@ximian.com>
25637         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
25638         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
25639         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
25641         * mono-debugger-debugger.c: While the debugger is locked, remember
25642         whether the symbol tables have changes and send one single
25643         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
25645 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
25647         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
25649         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
25650         function.
25652         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
25653         account when marshalling string arrays. Fixes #56965.
25655 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
25657         * icall.c: Add new icalls mapping for security.
25658         * security.c|h: Add internal calls for WindowsIdentity,
25659         WindowsImpersonationContext and WindowsPrincipal.
25661 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
25663         * class.c: Added comment to ensure the System.MonoDummy class
25664         is removed when no longer necessary
25666 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
25668         * appdomain.c: Pass arguments to the bootstraping exceptions to
25669         minimize JITed methods at boot
25671         * metadata.c (mono_exception_from_name_two_strings): Allow for the
25672         second string to be null.
25674         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
25675         Change the protocol to minimize the JIT methods at startup.  Now
25676         it Returns the internal codepage, if the value of "int_code_page"
25677         is 1 at entry, and we can not compute a suitable code page
25678         number, returns the code page as a string.
25680 2004-04-13  Jackson Harper  <jackson@ximian.com>
25682         * culture-info-tables.h: Fix number of decimal digits for all
25683         english locales.
25685 2004-04-13  Jackson Harper  <jackson@ximian.com>
25687         * icall.c: Clairfy out of sync error message. It is not always
25688         your corlib that is out of sync.
25690 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
25692         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
25693         properties when only the set accessor is overriden. Fixes #55874.
25695 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
25697         * assembly.c (mono_assembly_load_references): Make this thread safe.
25698         Fixes #56327.
25700 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
25702         * monosn.c: Add missing initialization calls.
25704 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
25706         * locales.c:
25707         ves_icall_System_Globalization_CultureInfo_construct_number_format
25708         Fix g_assert so it compiles on fussier compilers re int/ptr
25709         mismatch
25711 2004-04-08  Dick Porter  <dick@ximian.com>
25713         * socket-io.h:
25714         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
25715         53992.  Also rearrange the code so that the internal calls return
25716         an error value and exceptions are thrown from managed code.
25718         * icall.c: Add type info to the socket icalls.
25720 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25722         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
25723         owes me a beer.
25725 2004-04-07  Martin Baulig  <martin@ximian.com>
25727         * class.c (mono_class_from_generic_parameter): Don't default
25728         `klass->parent' to `mono_defaults.object_type'.
25730 2004-04-07  Martin Baulig  <martin@ximian.com>
25732         * reflection.c (mono_reflection_initialize_generic_parameter): Set
25733         `param->pklass->reflection_info'.       
25735 2004-04-07  Jackson Harper  <jackson@ximian.com>
25737         * culture-info-tables.h: Fix date separator symbol.
25738         
25739 2004-04-07  Martin Baulig  <martin@ximian.com>
25741         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
25742         from System.Type to System.MonoType.
25744 2004-04-07  Martin Baulig  <martin@ximian.com>
25746         * reflection.h
25747         (MonoReflectionGenericParam): Added `has_reference_type' and
25748         `has_value_type' fields.
25750         * reflection.c (mono_image_get_generic_param_info): Encode the
25751         correct flags if we have the `class' or `struct' constraint.
25753 2004-04-07  Martin Baulig  <martin@ximian.com>
25755         * reflection.h
25756         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
25758 2004-04-07  Jackson Harper  <jackson@ximian.com>
25760         * appdomain.c: Revert extra patches, just wanted to bump the
25761         version number.
25762         
25763 2004-04-07  Jackson Harper  <jackson@ximian.com>
25765         * Makefile.am: Add culture-info private headers.
25766         * icall.c: Add new icalls for contructing locales.
25767         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
25768         * locales.h: Declare new culture info construction methods.
25769         * object.h: Add new fields used to avoid the CultureMap to
25770         MonoCultureInfo.
25771         * culture-info.h: Definition of structs used in the culture info
25772         tables.
25773         * culture-info-tables.h: Autogenerated tables that contain culture
25774         info data. This file was generated with the locale-builder tool.
25775         * appdomain.c: Incement corlib version number.
25776         
25777 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
25779         * appdomain.c: (mono_runtime_init) move mono_thread_init
25780         to before mono_object_new calls so critical sections
25781         are initialized before use.
25783 2004-04-07  Martin Baulig  <martin@ximian.com>
25785         * icall.c
25786         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
25787         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
25788         (ves_icall_MonoGenericParam_initialize): Removed.
25789         (monogenericparam_icalls): Removed.
25790         (generictypeparambuilder_icalls): Added new table for
25791         System.Reflection.Emit.GenericTypeParameterBuilder.
25793         * reflection.c
25794         (mono_reflection_define_generic_parameter): Removed.
25795         (mono_reflection_initialize_generic_parameter): This is now called
25796         from GenericTypeParameterBuilder's .ctor.
25798 2004-04-06  Martin Baulig  <martin@ximian.com>
25800         * class.c (mono_class_init): Don't inflate nested classes in a
25801         generic instance.
25802         (mono_type_get_name_recurse): Include the generic arguments for
25803         generic instances and generic type declarations.
25804         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
25805         (_mono_class_get_instantiation_name): Removed.
25806         (mono_class_create_generic): Always use `gklass->name' as our name.
25808         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
25810         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
25811         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
25812         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
25813         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
25814         closed generic methods here.
25816         * reflection.c
25817         (mono_reflection_generic_inst_get_nested_types): Removed.
25818         (inflate_mono_method): Copy the generic parameters from the
25819         MonoMethodHeader into out MonoGenericMethod.
25821 2004-04-06  Martin Baulig  <martin@ximian.com>
25823         * row-indexes.h
25824         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
25826         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
25828         * reflection.c (build_compressed_metadata): If we have any entries
25829         in the GenericParam, MethodSpec or GenericParamConstraint tables,
25830         set the header version to 1.1.
25832 2004-04-06  Martin Baulig  <martin@ximian.com>
25834         * class.c (mono_class_init): If we're a generic instance,
25835         initialize our nested classes, too.
25836         (_mono_class_get_instantiation_name): Deal with the new `!%d'
25837         suffix. 
25839 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25841         * process.c: quote the argument passed to the shell on windows.
25843 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
25845         * threads.c (mono_alloc_special_static_data): Allow this to be
25846         called during startup.
25848 2004-04-02  Martin Baulig  <martin@ximian.com>
25850         * icall.c
25851         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
25853 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
25855         * icall.c: Fix build.
25857 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
25859         * Makefile.am: Added security.c|h.
25860         * icall.c: Added icall for get_UserName;
25861         * security.c: New file for security related icalls. Added function
25862         get_UserName for System.Environment (fix #56144).
25863         * security.h: New. Header file for security.c
25865 2004-04-02  Dick Porter  <dick@ximian.com>
25867         * icall.c: Deleted the icalls that were obsoleted some time ago
25868         by the ICU string code, and which were mixed into the icall
25869         rearranging.  Fixes bug 55969.
25871         * string-icalls.h: 
25872         * string-icalls.c: Deleted the code that those icalls reference.
25874 2004-04-01  Martin Baulig  <martin@ximian.com>
25876         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
25878         * class.c (mono_class_from_generic_parameter): Don't set 
25879         TYPE_ATTRIBUTE_INTERFACE.
25880         (my_mono_class_from_generic_parameter): Likewise.
25882 2004-04-01  Martin Baulig  <martin@ximian.com>
25884         * loader.c (find_method): Added an optional `MonoClass *ic'
25885         argument to search in a specific interface.
25886         (mono_get_method_constrained): New public function.
25888 2004-04-01  Martin Baulig  <martin@ximian.com>
25890         * reflection.c (mono_image_get_generic_field_token): Use the
25891         `handleref' cache here.
25893 2004-04-01  Martin Baulig  <martin@ximian.com>
25895         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
25897         * reflection.c (create_generic_typespec): Use the `typespec' hash
25898         here, not the `typeref' one.    
25900 2004-04-01  Martin Baulig  <martin@ximian.com>
25902         * class.c (mono_class_inflate_generic_type): Moved the
25903         functionality into a new static inflate_generic_type() which
25904         returns NULL if it didn't do anything.  Only increment the
25905         `mono_stats.inflated_type_count' if we actually inflated
25906         something.
25907         (mono_class_get_full): Check the classes type to see whether we
25908         need to inflate it; also inflate MONO_TYPE_(M)VAR.
25910 2004-04-01  Jackson Harper  <jackson@ximian.com>
25912         * reflection.c: Set culture for assembly references.
25913         
25914 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
25916         * reflection.[ch], icall.[ch], Fix support for pinning variables.
25918 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25920         * assembly.c:
25921         (do_mono_assembly_open): the critical section also covers
25922         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
25924 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25926         * threads.c:
25927         (mono_manage_threads): abort the background threads when finishing.
25928         Fixes bug #47232.
25930 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25932         * gc.c: only close the done_event handle if there was no timeout.
25933         C-ified comments.
25935 2004-03-30  Martin Baulig  <martin@ximian.com>
25937         * icall.c (icall_entries): It's called "System.Activator", not
25938         "System.Activation".    
25940 2004-03-30  Martin Baulig  <martin@ximian.com>
25942         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
25943         (mono_class_create_from_typespec): Likewise.
25945 2004-03-30  Martin Baulig  <martin@ximian.com>
25947         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
25948         `has_ctor_constraint' and `initialized'.
25950 2004-03-30  Martin Baulig  <martin@ximian.com>
25952         * reflection.c (encode_new_constraint): New static function to add
25953         the constructor constraint attribute to a type parameter.
25954         (encode_constraints): Call encode_new_constraint() if necessary.
25956         * reflection.h
25957         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
25959         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
25960         
25961 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
25963         * reflection.c, icall.c: add support for pinning variables. 
25965 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
25967         * marshal.c (mono_marshal_get_managed_wrapper):
25968         init bool local with zero rather than null.
25970 2004-03-29  Martin Baulig  <martin@ximian.com>
25972         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
25973         the "official" behavior here.
25974         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
25976 2004-03-29  Martin Baulig  <martin@ximian.com>
25978         * icall.c: Reflect latest API changes.
25980 2004-03-29  Martin Baulig  <martin@ximian.com>
25982         * loader.c (mono_get_method_from_token): Also call
25983         mono_metadata_load_generic_params () for abstract and interface
25984         methods; replace the type arguments in the method signature with
25985         the ones which are loaded from the metadata.
25987 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
25989         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
25990         of the lock is not the current thread. MS.NET don't do it, in spite of
25991         what the documentation says. See bug #56157.
25993 2004-03-28  Martin Baulig  <martin@ximian.com>
25995         * class.c (mono_class_init): Don't call init_properties() and
25996         init_events() for generic instances; set `prop->parent' when
25997         inflating properties.
25999         * reflection.c (mono_generic_inst_get_object): Call
26000         `mono_class_init (ginst->klass)'.
26001         (mono_type_get_object): Only create a MonoGenericInst if your
26002         generic type is a TypeBuilder.
26003         (do_mono_reflection_bind_generic_parameters): Only set
26004         `ginst->is_dynamic' if our generic type is a TypeBuilder.
26006 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
26008         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
26009         Fixes #56091.
26011 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26013         * icall.c: added Kill_internal icall.
26014         * process.[ch]: added Kill_internal icall.
26016 2004-03-25  Martin Baulig  <martin@ximian.com>
26018         * class.h (MonoStats): Added `generic_instance_count',
26019         `inflated_method_count', `inflated_type_count' and
26020         `generics_metadata_size'.       
26022 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26024         * reflection.c: no warnings now.
26026 2004-03-25  Martin Baulig  <martin@ximian.com>
26028         * class.c (mono_class_get_full): New public function; does a
26029         mono_class_get(), but also takes a `MonoGenericContext *'.
26031         * loader.c (mono_field_from_memberref): Renamed to
26032         `field_from_memberref', made static and added `MonoGenericContext *'
26033         argument.
26034         (mono_field_from_token): Added `MonoGenericInst *' argument.
26035         (method_from_memberef): Likewise.
26036         (mono_get_method_from_token): Likewise.
26037         (mono_get_method_full): New public function; does a
26038         mono_get_method(), but also takes a `MonoGenericContext *'.
26040         * verify.c (mono_method_verify): Get the method's generic context
26041         and pass it to mono_field_from_token(), mono_get_method_full() and
26042         mono_class_get_full().
26044 2004-03-25  Martin Baulig  <martin@ximian.com>
26046         * class.c (mono_class_inflate_generic_type): Take a
26047         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
26048         `MonoGenericMethod *'.
26050 2004-03-25  Martin Baulig  <martin@ximian.com>
26052         * loader.h (MonoMethodInflated): Store the MonoGenericContext
26053         instead of the MonoGenericMethod here.
26055 2004-03-25  Martin Baulig  <martin@ximian.com>
26057         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
26058         each time we create a new MonoGenericInst, we also create a new
26059         context which points back to us.
26061         * class.c (inflate_method): Use `ginst->context' instead of
26062         creating a new context.
26064         * loader.c (method_from_memberref): Use
26065         `klass->generic_inst->context' instead of creating a new context.
26067 2004-03-25  Martin Baulig  <martin@ximian.com>
26069         * class.h (MonoGenericContext): New struct.
26070         (MonoGenericMethod): Removed `generic_inst'.
26072         * class.c (mono_class_inflate_generic_method): Take a
26073         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
26075 2004-03-25  Martin Baulig  <martin@ximian.com>
26077         * loader.h (MonoMethodInflated): New typedef.
26079         * metadata.h (MonoMethodSignature): Removed `gen_method', make
26080         `generic_param_count' consume just 30 bits, added `is_inflated'
26081         and `has_type_parameters' flags (one bit each).
26083         * class.c (mono_class_inflate_generic_method): Create a
26084         MonoMethodInflated instead of a MonoMethodNormal and set
26085         `is_inflated' in the method signature.
26087         * class.h (MonoGenericMethod): Removed `generic_method'.
26089 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
26091         * image.c: Make sure the name of a MonoImage is always an absolute path.
26092           This fixes bug #54415.
26094 2004-03-24  Martin Baulig  <martin@ximian.com>
26096         * class.c (mono_class_setup_vtable): If we're a generic instance,
26097         use our generic type's vtable size.
26099 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
26101         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
26102         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
26103         problems.
26105 2004-03-23  Martin Baulig  <martin@ximian.com>
26107         * class.h (MonoDynamicGenericInst): Added `int count_events' and
26108         `MonoEvent *events'.
26110         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
26111         (typebuilder_icalls): Added "get_event_info"; calls
26112         mono_reflection_event_builder_get_event_info(). 
26114         * reflection.c (mono_reflection_generic_inst_initialize): Added
26115         `MonoArray *events'.
26116         (mono_reflection_event_builder_get_event_info): New function.
26118 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
26120         * object.h: add mono_type_initialization_init
26122         * object.c (mono_runtime_class_init): 
26123         implement class constructor synchronization rules
26124         to cope with threading issues.  
26125         add mono_type_initialization_init
26127         * appdomain.c (mono_runtime_init): call 
26128         mono_type_initialization_init
26130         * class.h: removing initializing field from MonoVTable
26132 2004-03-23  Martin Baulig  <martin@ximian.com>
26134         * class.c (my_mono_class_from_generic_parameter): Use
26135         `param->name' if it's not NULL. 
26137 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
26139         * class.c: do not insert non-virtual methods in the vtable.
26140         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
26141         that means the method is non-virtual. This never would have
26142         happened before.
26144 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
26146         * profiler.c: Added lock for accessing coverage_hash.
26148 2004-03-22  Martin Baulig  <martin@ximian.com>
26150         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
26151         `method->method->signature->generic_param_count != 0' to make it
26152         work for interface methods.
26154 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26156         * process.c: quote the string passed to the shell using g_shell_quote.
26158 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26160         * threads.c:
26161         (mono_threads_manage): don't remove the finalizer thread and self
26162         from the threads hash table so that mono_thread_manage can be called
26163         more than once.
26165 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26167         * process.c: quote the arguments when UseShellExecute is true. Fixes
26168         bug #55790.
26170 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26172         * threads.c: set mono_thread_detach as a cleanup routine for every
26173         thread. This way it's always executed upon thread termination, either
26174         aborted or finished normally. No more xsp hangs!
26176 2004-03-17  Martin Baulig  <martin@ximian.com>
26178         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
26179         `int count_nested' and a `MonoType **nested'.
26181         * reflection.c (mono_reflection_bind_generic_parameters): Moved
26182         most of the functionality into a new static
26183         do_mono_reflection_bind_generic_parameters() and don't take a
26184         `MonoType *nested_in' argument any more.  Don't compute nested
26185         types here.
26186         (mono_reflection_generic_inst_get_nested_types): New public method
26187         to get nested types.
26189         * class.c (mono_class_create_generic): Set `klass->nested_in' if
26190         we're a nested class.
26192         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
26193         mono_reflection_generic_inst_get_nested_types() to compute the
26194         nested types.
26196 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
26198         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
26199         descriptive error message under windows.
26200         
26201 2004-03-17  Martin Baulig  <martin@ximian.com>
26203         * class.c (dup_type): Added `const MonoType *original' argument;
26204         copy the attrs from the original type.
26206 2004-03-17  Martin Baulig  <martin@ximian.com>
26208         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
26209         `m->generic_inst_cache' here.
26211 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
26213         * exception.h exception.c: Add stack_overflow_exception.
26215 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26217         * threadpool.c:
26218         (overlapped_callback): call SetEvent *after* invoking the callback.
26219         No need to call CloseHandle.
26221 2004-03-16  Martin Baulig  <martin@ximian.com>
26223         * reflection.c (mono_image_get_fieldref_token): Take a
26224         `MonoReflectionField *' instead of a `MonoClassField *' and a
26225         `MonoClass *'; store the `MonoReflectionField *' in the hash.
26227 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26229         * appdomain.c: don't add the culture to the filename we're looking for
26230         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
26232 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26234         * locales.c: don't ignore symbols when doing case insensitive compares.
26235         Thanks Dick! Fixes bug #54046.
26237         * threads.c: surround 'threads' usage with enter/leave in
26238         mono_thread_manage.
26240 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
26242         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
26243         implicitly marshalled as [Out]. Fixes #55450.
26245         (mono_marshal_get_runtime_invoke): Zero out the result if there is
26246         an exception.
26248 2004-03-16  Martin Baulig  <martin@ximian.com>
26250         * class.c (mono_class_from_generic_parameter): Use the actual
26251         parameter name. 
26253 2004-03-16  Martin Baulig  <martin@ximian.com>
26255         * reflection.c (type_get_signature_size): New static function.
26256         Compues the size of the type in a method signature.
26257         (method_get_signature_size): New static function; calls
26258         type_get_signature_size() to compute the actual size of the
26259         method's signature.
26260         (method_encode_signature): Use method_get_signature_size() to get
26261         the signature's size rather than using `nparams * 10'.
26263 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26265         * file-io.h: define here WapiOverlapped on windows. I don't want the
26266         regular OVERLAPPED one.
26268         * file-io.c:
26269         * threadpool.c: somehow, BindIoCompletionCallback is not found.
26270         Disabling AIO on windows.
26272 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26274         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
26275         bug #55385.
26277 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26279         * appdomain.c: upgraded corlib version.
26281         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
26282         and BeginWrite. Allow opening files for asynchrnous operations.
26284         * file-io.h: new struct that maps FileStreamAsyncResult.
26285         * icall.c: added new icalls.
26286         * process.[ch]: support setting child process environment variables
26287         and use the SHELL or COMSPEC when UseShellExecute is true.
26289         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
26290         callback for async. IO is here and also BindHandle.
26292         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
26293         from here.
26295 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
26297         * reflection.c (create_custom_attr): Allow len == 0.
26299         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
26300         computation on big-endian machines.
26302 2004-03-13  Martin Baulig  <martin@ximian.com>
26304         * class.h (MonoGenericInst): Added `int count_ifaces'.
26306         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
26307         `ginst->count_ifaces' instead `klass->interface_count' since we
26308         may get called before the vtable is created.
26310         * loader.c (mono_method_get_param_names): If we're a generic
26311         instance, return and don't initialize the class.
26313         * reflection.c (mono_reflection_setup_generic_class): Don't call
26314         ensure_runtime_vtable().
26315         (mono_reflection_bind_generic_parameters): Set
26316         `ginst->count_ifaces'.
26318 2004-03-11  Jackson Harper <jackson@ximian.com>
26320         * icall.c:
26321         * unicode.c:
26322         * unicode.h: Remove unused System.Char icalls.
26323         
26324 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
26326         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
26327         code when we P/Invoke the first library in Windows.Forms, instead
26328         of when we first open the assembly.
26330         * assembly.c: Drop the lookup from here.
26332 2004-03-10  Martin Baulig  <martin@ximian.com>
26334         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
26335         class for properties, fields and events.  Finally fixes #54945.
26337 2004-03-10  Martin Baulig  <martin@ximian.com>
26339         * metadata.c (mono_metadata_class_equal): New static function;
26340         checks whether two generic instances or two generic parameters are
26341         equal.
26342         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
26343         compare classes.        
26345 2004-03-10  Martin Baulig  <martin@ximian.com>
26347         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
26349         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
26350         argument and write it into the `reflection_info' field.
26352         * icall.c
26353         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
26354         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
26356 2004-03-09  Jackson Harper  <jackson@ximian.com>
26358         * char-conversions.h: use 8 bits for numeric data its all we need
26359         * icall.c: numeric data is only 8 bits now.
26361 2004-03-09  Martin Baulig  <martin@ximian.com>
26363         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
26365         * class.c (init_properties, init_events): Initialize the new
26366         `parent' field.
26368         * reflection.c (typebuilder_setup_properties): Likewise.
26369         (typebuilder_setup_events): Likewise.
26371         * reflection.h (MonoEventInfo): Replaced `parent with
26372         `declaring_type' and `reflected_type'.
26374         * icall.c (ves_icall_get_property_info): Distinguish between
26375         declaring and reflected type.
26376         (ves_icall_get_event_info): Likewise.
26378 2004-03-09  Martin Baulig  <martin@ximian.com>
26380         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
26381         (ves_icall_Type_GetField): Correctly set field->klass.
26383 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
26385         * loader.h: Fix warning.
26387 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
26389         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
26390         library routine if present.  Notice that it will still continue
26391         executing even if its missing, for those working on the Gtk#
26392         edition of Windows.Forms.
26394         * assembly.c (do_mono_assembly_open): If loading the
26395         System.Windows.Forms call mono_loader_wini_init.
26397 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
26399         * class.h: Added MonoRemoteClass struct.
26400         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
26401         function for MonoStrings.
26402         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
26403         Added internal call for getting the proxy type.
26404         * marshal.c: Get the type of transparent proxies from its remote_class.
26405         Added methods that generate the IL for type checks and casts:
26406         mono_marshal_get_isinst, mono_marshal_get_castclass, 
26407         mono_marshal_get_proxy_cancast.
26408         * marshal.h: Declaration of the previous new methods.
26409         * object.c: Added new moethods for creating and updating MonoRemoteClass
26410         instances: mono_remote_class, mono_upgrade_remote_class, 
26411         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
26412         * verify.c: FIx transparent_proxy_fields layout.
26413         * appdomain.c: Bump corlib version.
26415 2004-03-04  Jackson Harper  <jackson@ximian.com>
26417         * icall.c: Add icall to access char conversion tables.
26418         * char-conversions.h: Character conversion tables.
26419         * Makefile.am: Add char-conversions.h private header file.
26420         
26421 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
26423         * appdomain.c (unload_thread_main): Increase unloading timeout to
26424         10 sec as a temporary workaround for Nant problems.
26426 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
26428         * gc.c: Add checks for GC_enable and GC_disable.
26430         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
26431         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
26432         (bug #54988).
26433         
26434 2004-02-27  Martin Baulig  <martin@ximian.com>
26436         * reflection.c (mono_reflection_bind_generic_parameters): Take a
26437         `MonoReflectionType *' instead of a `MonoType *'.
26439 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
26441         * gc.c (run_finalize): Avoid finalizing the object representing the
26442         finalizer thread.
26443         (finalizer_thread): Fix warning.
26445 2004-02-25  Martin Baulig  <martin@ximian.com>
26447         * class.c (_mono_class_get_instantiation_name): Added `int offset'
26448         argument for nested types.
26449         (mono_class_create_generic): Added support for nested generictypes.
26451         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
26452         `GList *nested'.
26454         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
26456         * reflection.c (method_encode_signature): Increase the minimum
26457         value of `size' from 10 to 11.
26458         (mono_reflection_bind_generic_parameters): Take `int type_argc'
26459         and `MonoType **types' arguments instead of the `MonoArray
26460         *types'; added `MonoType *nested_in'.  Recursively instantiate
26461         nested classes. 
26463 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
26465         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
26466         stack_overflow_ex members which are used by exception handling.
26468         * appdomain.c (mono_runtime_init): Initialize the new members.
26470         * gc.c (mono_gc_enable): New helper function.
26471         * gc.c (mono_gc_disable): New helper function.
26473 2004-02-23  Martin Baulig  <martin@ximian.com>
26475         * icall.c: I must have been really stupid - make it actually work
26476         this time ;-)
26478 2004-02-23  Martin Baulig  <martin@ximian.com>
26480         * loader.c (method_from_memberref): Only inflate the method if
26481         it's in another klass.
26483 2004-02-23  Martin Baulig  <martin@ximian.com>
26485         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
26486         (mono_class_init): If we're a generic instance and an interface,
26487         compute `class->interface_id'; also create `class->interfaces'
26488         here and inflate them.
26490         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
26491         `ginst->is_open'.
26492         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
26494         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
26496 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
26498         * reflection.c (method_encode_code): Improved the error message
26499         generated by the exception.
26501 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26503         * icall.c: Martin did not do what he said in the ChangeLog for
26504         2004-02-18, but put back the changes for properties and events.
26505         Commenting those changes out again and adding comment to bug #54518.
26506         
26507         * process.c: removed warning.
26509 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
26511         * marshal.c (emit_struct_conv): Print an error message instead of
26512         asserting when a type does not have the StructLayout attribute.
26514 2004-02-20  Martin Baulig  <martin@ximian.com>
26516         * reflection.c (mono_type_get_object): Also use the cache for
26517         generic instances.
26518         (mono_reflection_bind_generic_parameters): Always compute
26519         `ginst->ifaces'.        
26521 2004-02-20  Martin Baulig  <martin@ximian.com>
26523         * class.h (MonoGenericMethod): Removed `klass'.
26525         * class.c (mono_class_inflate_generic_method): Added `MonoClass
26526         *klass' argument.
26528 2004-02-20  Martin Baulig  <martin@ximian.com>
26530         * reflection.c (method_encode_methodspec): Actually use the
26531         uninflated signature for the memberref.
26533 2004-02-20  Martin Baulig  <martin@ximian.com>
26535         * class.h (MonoGenericMethod): Removed `declaring'.
26537         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
26538         is NULL, compute it here.
26540 2004-02-20  Martin Baulig  <martin@ximian.com>
26542         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
26544         * metadata.c (mono_metadata_generic_inst_hash): New method.
26545         (mono_metadata_generic_inst_equal): New method.
26547         * reflection.c (mono_reflection_bind_generic_parameters): Use the
26548         `klass->image->generic_inst_cache' cache to avoid creating
26549         duplicate MonoGenericInst's.
26551         * class.c (mono_class_inflate_generic_type): Use the cache.
26553 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
26555         * object.c: fixed gc descriptor calculation for embedded valuetypes.
26557 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26559         * icall.c: added Socket.WSAIoctl icall.
26561         * socket-io.[ch]: implemented
26562         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
26564 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
26566         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
26568 2004-02-18  Urs C Muff  <umuff@quark.com>
26570         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
26571         this work on PPC and other big-endian architectures.
26573         * debug-mono-symfile.h: Prepended the names of all the `guint32'
26574         fields with an underscore to make sure they're only accessed by
26575         the read32() macro.
26577 2004-02-18  Martin Baulig  <martin@ximian.com>
26579         * icall.c: Put the klass->refclass changes back for methods and
26580         fields, but not for properties and events.  We're currently not
26581         distinguishing between DeclaringType and ReflectedType for
26582         properties and events, that's what caused the regressions.
26584 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26586         * object.c:
26587         (mono_async_result_new): the handle can be NULL.
26589         * threadpool.c: Use an event instead of a semaphore, don't initialize
26590         it until needed. This saves quite a few semaphores from being created
26591         when using the threadpool.
26593 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
26595         * object.c (mono_string_is_interned_lookup): Fix interning of long
26596         strings. Fixes #54473.
26598         * domain.c (ldstr_equal): Optimize if the two strings are equal.
26600         * icall.c: Revert the klass->refclass changes since they introduce
26601         regressions (bug #54518).
26603 2004-02-18  Martin Baulig  <martin@ximian.com>
26605         * class.c (mono_class_init): If we're a generic instance and don't
26606         come from a TypeBuilder, inflate our members here.
26607         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
26608         (mono_class_create_generic): New public method.
26609         (mono_class_initialize_generic): Removed.
26610         (get_instantiation_name): Renamed to
26611         _mono_class_get_instantiation_name() and made it public.
26613 2004-02-18  Martin Baulig  <martin@ximian.com>
26615         * class.c (mono_class_inflate_generic_type): Clear the new
26616         instance's `nginst->klass' when inflating a generic instance.
26617         (mono_class_is_subclass_of): Added (basic) support for generic
26618         instances.
26620 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
26622         * appdomain.h, domain.c: use a MonoCodeManager instead of a
26623         MonoMempool to hold compiled native code.
26625 2004-02-17  Martin Baulig  <martin@ximian.com>
26627         * class.h (MonoDynamicGenericInst): Added `count_properties' and
26628         `properties'.
26630         * reflection.c (mono_reflection_generic_inst_initialize): Added
26631         `MonoArray *properties' argument.
26633         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
26635 2004-02-17  Martin Baulig  <martin@ximian.com>
26637         * icall.c (ves_icall_Type_GetFields): Renamed to
26638         ves_icall_Type_GetFields_internal() and added a
26639         `MonoReflectionType *rtype' argument; pass it to
26640         mono_field_get_object() to set the field's "reflected" type.
26641         (ves_icall_Type_GetConstructors): Likewise.
26642         (ves_icall_Type_GetEvents): Likewise.
26643         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
26644         argument; pass it to mono_method_get_object() to set the method's
26645         "reflected" type.       
26647 2004-02-17  Martin Baulig  <martin@ximian.com>
26649         * class.h (MonoDynamicGenericInst): New type.
26650         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
26652         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
26653         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
26654         (ves_icall_MonoGenericInst_GetFields): New interncall.
26656         * class.c (mono_class_from_generic): Don't call
26657         mono_class_initialize_generic() if this is a dynamic instance;
26658         ie. it's being created from a TypeBuilder.
26659         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
26660         `class->byval_arg.type'.
26662         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
26663         to `inflate_method' and made static.
26664         (mono_reflection_inflate_field): Removed.
26665         (mono_reflection_generic_inst_initialize): New public method.
26667         * reflection.h (MonoReflectionGenericInst): Removed `methods',
26668         `ctors' and `fields'; added `initialized'.
26670 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
26672         * debug-helpers.c (mono_method_full_name): Fix output for empty
26673         namespaces.
26675 2004-02-12  Martin Baulig  <martin@ximian.com>
26677         * class.h (MonoClassField): Added `MonoType *generic_type'.
26679         * reflection.c (mono_image_get_fieldref_token): Added support for
26680         instantiated generic types.
26681         (field_encode_inflated_field): Removed.
26682         (mono_image_get_inflated_field_token): Removed.
26683         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
26685         * reflection.h (MonoReflectionInflatedField): Removed.
26687 2004-02-12  Martin Baulig  <martin@ximian.com>
26689         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
26690         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
26692         * reflection.c (mono_image_get_methodspec_token): Take a
26693         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
26694         (mono_image_create_token): Check whether we have a
26695         `method->signature->gen_method' and call
26696         mono_image_get_methodspec_token() if appropriate.
26697         (inflated_method_get_object): Removed.
26698         (mono_reflection_bind_generic_method_parameters): Return a
26699         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
26700         (mono_reflection_inflate_method_or_ctor): Likewise.
26702         * reflection.h (MonoReflectionInflatedMethod): Removed.
26704 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
26706         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
26707         for custom valuetype marshalling.
26709         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
26711 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26713         * icall.c: fixed WSAGetLastError_internal name.
26715 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
26717         * threads.c (mono_thread_attach): Allow this to be called multiple
26718         times for a thread.
26719         
26720         * threads.c (build_wait_tids): Do not wait for ourselves.
26722         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
26723         appdomain list is empty.
26725         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
26726         memory returned by mono_string_builder_to_utf16, since it points into
26727         managed memory. Thanks to Bernie Solomon for noticing this.
26729         * icall.c: Add AppDomainSetup icalls.
26731         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
26733         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
26734         types.
26736         * reflection.c (reflection_methodbuilder_to_mono_method): Save
26737         custom attributes to the method_aux struct. Also fix array indexes etc.
26739         * loader.c (mono_method_get_param_names): Make dynamic case work again.
26740         
26741 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
26743         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
26744         (both static and runtime) and reduce startup time.
26746 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
26748         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
26749         AsAny marshalling conversion instead of crashing.
26751         * marshal.c: Fix warnings.
26753 2004-02-09  Martin Baulig  <martin@ximian.com>
26755         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
26757         * reflection.h (MonoReflectionInflatedMethod): Removed the
26758         `declaring' field, it's now in the unmanaged MonoGenericMethod.
26760         * reflection.c (method_encode_methodspec): Removed the `method'
26761         argument; we get it from `gmethod->declaring'.
26762         (inflated_method_get_object): Removed the `declaring' argument.
26764 2004-02-09  Martin Baulig  <martin@ximian.com>
26766         * class.h (MonoGenericMethod): New type.
26767         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
26768         `generic_method'.
26770         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
26771         a `MonoGenericMethod *gen_method' one.
26773         * class.c (mono_class_inflate_generic_type): Take an additional
26774         `MonoGenericMethod * argument.  This is only non-NULL if we're
26775         inflating types for a generic method.   
26776         (mono_class_inflate_generic_signature): Renamed to
26777         inflate_generic_signature() and made static; take a
26778         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
26779         (inflate_generic_header): Take a `MonoGenericMethod *' argument
26780         instead of a `MonoGenericInst *' one.
26781         (mono_class_inflate_generic_method): Likewise.
26783         * reflection.c (encode_generic_method_sig): Take a
26784         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
26785         (method_encode_methodspec): Likewise.
26786         (inflated_method_get_object): Likewise. 
26788         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
26789         field with a `MonoGenericMethod *gmethod' one.  
26791 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
26793         * class.h (mono_class_has_parent): add parens to expansion
26794         so you can ! this.
26796 2004-02-08  Martin Baulig  <martin@ximian.com>
26798         * image.h (MonoImage): Removed `generics_cache'.
26800         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
26801         instead of a `MonoType *' argument; removed the `inflate_methods'
26802         argument.  Don't inflate methods here.
26804         * loader.c (find_method): If it's a generic instance, call
26805         mono_class_init() on the `sclass->generic_inst->generic_type'.
26807         * metadata.c (mono_type_size): Make this work on uninitialized
26808         generic instances; call it on the `ginst->generic_type's class.
26810         * reflection.c (mono_reflection_bind_generic_parameters): Call
26811         mono_class_from_generic() to create the `ginst->klass'.
26813 2004-02-08  Martin Baulig  <martin@ximian.com>
26815         * class.h (MonoClass): Changed type of `generic_inst' from
26816         `MonoType *' to `MonoGenericInst *'.
26818 2004-02-08  Martin Baulig  <martin@ximian.com>
26820         * icall.c (ves_icall_Type_BindGenericParameters): Just call
26821         mono_type_get_object(), this is now creating a `MonoGenericInst'
26822         for MONO_TYPE_GENERICINST.
26823         (ves_icall_MonoGenericInst_GetParentType): Likewise.
26824         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
26826         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
26827         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
26828         (inflated_method_get_object): Added `MonoClass *refclass' argument.
26829         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
26830         and reflected type.
26832         * reflection.h (MonoReflectionInflatedMethod): Removed
26833         `declaring_type' and `reflected_type'.
26835 2004-02-08  Martin Baulig  <martin@ximian.com>
26837         * class.h (MonoGenericInst): Added `MonoType *parent' and
26838         `MonoType **ifaces'.
26840         * reflection.h (MonoReflectionGenericInst): Removed `klass',
26841         `parent' and `interfaces'.
26843         * reflection.c (mono_reflection_bind_generic_parameters): Take a
26844         `MonoType *' argument and return a `MonoType *'.
26846         * icall.c
26847         (ves_icall_MonoGenericInst_GetParentType): New interncall.
26848         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
26850 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
26852         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
26853         valuetype marshalling.
26855 2004-02-06  Martin Baulig  <martin@ximian.com>
26857         * class.c
26858         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
26859         (my_mono_class_from_generic_parameter): Likewise.
26861 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
26863         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
26864         contents of the symbol files lazily.
26866         * object.h (MonoThread): Add 'name' and 'name_len' fields.
26868         * threads.h threads.c icall.c: New icalls for getting and setting the
26869         threads name.
26871 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
26873         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
26874         Raise an exception when the domain is not found.
26876 2004-02-03  Martin Baulig  <martin@ximian.com>
26878         * reflection.c (mono_image_get_methodspec_token): Use the
26879         uninflated signature; fixes gen-33.
26881 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
26883         * gc.c threads.c: Make the finalizer thread a normal managed thread so
26884         the finalizer code can use thread functionality.
26886         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
26887         the finalizer thread.
26889         * threads.c: Make some functions more robust.
26891         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
26893         * metadata.h: Add new marshalling conventions.
26895         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
26896         stringbuilder marshalling. Fixes #53700.
26898         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
26900         * reflection.c (mono_image_get_type_info): Save declarative security
26901         info.
26903         * reflection.c (mono_image_get_field_info): Handle uninitialized 
26904         unmanaged fields as well.
26906         * appdomain.c: Bump corlib version.
26908 2004-02-01  Martin Baulig  <martin@ximian.com>
26910         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
26911         method type arguments.  
26913 2004-01-30  Duncan Mak  <duncan@ximian.com>
26915         * marshal.h: Add prototype for
26916         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
26917         and
26918         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
26919         fix the build.
26921 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
26923         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
26924         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
26926 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
26928         * marshal.c (mono_marshal_get_native_wrapper): Add support for
26929         custom marshalling of valuetypes.
26931         * marshal.c: Fix some warnings.
26933 2004-01-29  Martin Baulig  <martin@ximian.com>
26935         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
26936         for generic method parameters.
26938         * reflection.c (method_encode_methodspec): Write the uninflated
26939         signature into the methodspec table.
26940         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
26941         is always the uninflated method.
26942         (reflection_methodbuilder_to_mono_method): Copy the generic
26943         parameters from the MethodBuilder into `header->gen_params'.
26945 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
26947         * class.c (mono_class_from_generic_parameter): Fix warning.
26949 2004-01-27  Martin Baulig  <martin@ximian.com>
26951         * class.c (mono_class_from_generic_parameter): Don't create
26952         `klass->methods' here.  
26954 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
26956         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
26957         extension since it does not work with libraries named lib<FOO>.dll.so.
26959 2004-01-25  Martin Baulig  <martin@ximian.com>
26961         * class.c (mono_class_inflate_generic_type): Added support for
26962         MONO_TYPE_GENERICINST.
26964         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
26965         inflate methods on open constructed types.      
26967 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26969         * object.c: fire ProcessExit event in the root AppDomain after running
26970         Main. Fixes bug #53299.
26972 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
26974         * socket-io.c: include the new socket-wrappers.h header.
26975         Use the wrappers instead of the unix socket functions to make the code
26976         more clear.
26978 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
26980         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
26982         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
26983         Fixes #22532.
26985 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
26987         * reflection.c (mono_image_create_pefile): Handle the case when the
26988         entry point is not a MethodBuilder.
26990         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
26991         field to ReflectionMethod since it is not allways a builder.
26993         * reflection.c (type_get_fully_qualified_name): New helper function to
26994         return the fully qualified name of a type.
26996         * reflection.c (encode_marshal_blob): Always emit the fully qualified
26997         type name for custom marshallers.
26999         * reflection.c (mono_marshal_spec_from_builder): Ditto.
27001         * class.c (mono_class_setup_vtable): If a parent class already 
27002         implements an interface, use the implementing methods from that class.
27003         Fixes #53148.
27005 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27007         * threadpool.c: just return instead of ExitThread to allow for thread
27008         clean up earlier.
27010 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
27012         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
27013         when closing resource modules.
27015         * reflection.c (mono_image_create_pefile): Handle the case when the
27016         entry point is not a MethodBuilder.
27018         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
27019         field to ReflectionMethod since it is not allways a builder.
27021 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
27023         * marshal.c (mono_marshal_get_managed_wrapper): 
27024         mono_marshal_alloc takes native int so CONV_I
27025         the arg for 64bits.
27027 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
27029         * reflection.c (fixup_cattrs): New function to fixup the methoddef
27030         tokens in the cattr table. Fixes #53108.
27032 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27034         * loader.c: don't trim ".dll" before looking up in the config file.
27035         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
27037 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
27039         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
27040         Return the module which contains the resource as well.
27041         (ves_icall_System_Reflection_Module_Close): New icall.
27043         * appdomain.c: Bump corlib version number.
27045         * image.c (mono_image_addref): New public function.
27047         * assembly.c: Call mono_image_addref.
27049         * reflection.c (mono_module_get_object): Increase reference count of 
27050         the image.
27052         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
27053         Fixes #22532.
27055         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
27056         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
27057         proper exceptions on DllImport problems.
27059 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
27061         * class.c, metadata.c: eliminate CSIZE macro.
27063 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
27065         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
27066         * object.h: Added async_callback field in MonoAsyncResult.
27067         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
27068         * verify.c: Added async_callback in MonoAsyncResult layout.
27070 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
27072         * reflection.c (mono_reflection_get_custom_attrs): Add support
27073         for Modules.
27075 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
27077         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
27078         marshalling.
27079         (mono_marshal_method_from_wrapper): Add null pointer check.
27081 2004-01-16  Martin Baulig  <martin@ximian.com>
27083         * debug-mono-symfile.h: Set version number to 36 and reflect
27084         latest symbol writer changes.
27086 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
27088         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
27089         multi-dimensional arrays.
27090         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
27091         (mono_class_from_mono_type): Use bounded_array_class_get.
27092         
27093         * class.c (mono_bounded_array_class_get): New function which takes
27094         a 'bounded' bool argument to distinguish vectors from one dimensional
27095         arrays.
27097         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
27098         bounded_array_class_get if the array has bounds.
27100         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27101         Search modules loaded using AssemblyBuilder:AddModule as well.
27103 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27105         * appdomain.c: increased corlib version.
27106         * filewatcher.c: removed g_print.
27107         * icall.c:
27108         (get_property_info): only allocate what is actually requested.
27109         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
27111 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27113         * Makefile.am: added filewatcher.[ch]
27114         * filewatcher.[ch]: FileSystemWatcher runtime support.
27115         * icall.c: added new FSW icalls.
27117 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
27119         * string-icalls.c: fix stringbuilder regression as suggested by
27120         Iain McCoy <iain@mccoy.id.au>.
27122 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
27124         * process.c (process_read_stringtable_block): Recognize '007f' as
27125         a language neutral stringtable block.
27127 2004-01-12  Patrik Torstensson
27129         * object.h (MonoStringBuilder) : Changed layout to support our
27130         new stringbuilder class.
27131         * marshal.c: Change marshalling to support the new layout of 
27132         string builder.
27133         * appdomain.c: increased version number because new layout of
27134         string builder.
27136 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
27138         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
27139         assembly name as an string instead of an AssemblyName, since it is
27140         easier to extract info from it.
27142         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
27143         the culture subdirectories too. Fixes #52231.
27145 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27147         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
27148         It takes 2 new parameters with an optional name for the method to look
27149         for and case ignoring info.
27151         * threadpool.c: removed unused variable.
27153 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27155         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
27156         It takes 2 new parameters with an optional name for the property to look
27157         for and case ignoring info.
27158         Fixes bug #52753.
27160 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
27162         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
27163         Fix #52451.
27165 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27167         * appdomain.c:
27168         * assembly.c: escape the uri before passing it to g_filename_from_uri.
27169         Fixes bug #52630.
27171 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
27173         * reflection.c: Add support for more than one unmanaged resource.
27175         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
27176         in field->def_value, as done in all other cases.
27178         * reflection.c (mono_reflection_get_custom_attrs): Add support for
27179         TypeBuilders.
27181         * reflection.c (mono_reflection_create_runtime_class): Remove 
27182         errorneous assignment to klass->element_class, since it is already
27183         done in mono_reflection_setup_internal_class.
27185 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27187         * gc.c: added missing LeaveCriticalSection.
27188         * icall.c: indented a couple of lines.
27189         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
27190         if we call EndInvoke inside a callback. Fixes bug #52601.
27192 2004-01-07  Martin Baulig  <martin@ximian.com>
27194         * mono-debug-debugger.h
27195         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
27197 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
27199         * appdomain.c: Use messages in NotImplementedException.
27201         * exception.c (mono_get_exception_not_implemented): Now this takes
27202         a message argument.
27204         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
27205         exception instead of g_asserting an aborting when something is not
27206         implemented.
27208         Add some inline docs.
27210 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
27212         * reflection.h: Update after changes to object layout.
27214         * reflection.c: Implement saving of unmanaged aka win32 resources.
27216         * appdomain.c: Bump version number.
27218         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
27219         Handle missing domains gracefully.
27221 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
27223         * file-io.c : On Windows, there are much more invalid_path_chars.
27225 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
27227         * class.h, object.c: prepare for GetType () speedup.
27229 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
27231         * profiler.c: workaround for --profile null reference exception on
27232           cygwin. Patch by Patrik Torstensson.
27234 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
27236         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
27237         make work for unaligned access.
27239 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
27241         * class.c: small cleanup (class->fields [i] -> field).
27242         * image.c: check address of metadata is valid.
27244 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
27246         * assembly.h assembly.c (mono_assembly_loaded): New public function to
27247         search the list of loaded assemblies.
27249         * reflection.c (mono_reflection_type_from_name): Use 
27250         mono_assembly_loaded instead of mono_image_loaded.
27252         * reflection.c: Fix warnings.
27254 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
27256         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
27257         is dynamic. This is needed since an assembly can contain both dynamic and
27258         non-dynamic images.
27260         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
27261         assembly->dynamic.
27263         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
27265         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
27266         to store modules loaded using AddModule.
27268         * reflection.c (mono_image_fill_file_table): Generalize this so it works
27269         on Modules.
27271         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
27273         * reflection.c (mono_image_fill_export_table_from_module): New function to
27274         fill out the EXPORTEDTYPES table from a module.
27276         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
27277         into a separate function. Also handle loaded non-dynamic modules.
27279         * reflection.c (mono_image_basic_init): Fix memory allocation.
27281         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
27283         * assembly.c (mono_assembly_load_references): Make this public.
27285 2003-12-19  Martin Baulig  <martin@ximian.com>
27287         * class.c (mono_class_initialize_generic): Made this static, take
27288         a `MonoGenericInst *' instead of a `MonoClass *'.
27289         (mono_class_from_generic): Call mono_class_initialize_generic()
27290         unless we're already initialized or being called from
27291         do_mono_metadata_parse_generic_inst().
27293         * class.h (MonoGenericInst): Added `initialized' and
27294         `init_pending' flags.
27296         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
27297         `mono_class_init (gklass)' or mono_class_initialize_generic()
27298         here; set `generic_inst->init_pending' while parsing the
27299         `type_argv'.
27301 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
27303         * locales.c: include string.h for memxxx prototypes
27305 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
27307         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
27308         constructor when accessing literal fields.
27310 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
27312         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
27314         * reflection.c (assembly_add_resource_manifest): New function to fill
27315         the MANIFESTRESOURCE table.
27317         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
27319         * reflection.h: Update to changes in class layout.
27321         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
27322         Reenable call to mono_runtime_is_shutting_down ().
27324         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
27325         determine if the runtime is shutting down.
27327 2003-12-16  Jackson Harper <jackson@ximian.com>
27329         * icall.c: comment out call to mono_runtime_is_shutting_down to
27330         fix build.
27331         
27332 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
27334         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
27335         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
27337 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
27339         * reflection.c: move definition of swap_with_size
27340         to before its first call
27342 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
27344         * appdomain.c (mono_runtime_is_shutting_down): New public function.
27346         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
27347         icall.
27349         * object.c: Fix warnings.
27351         * icall.c (ves_icall_Type_Get...): Only consider inherited static
27352         members if FlattenHierarchy is set.
27354         * reflection.c (mono_image_add_decl_security): New function to emit
27355         declarative security.
27357         * reflection.h reflection.c: Add support for declarative security.
27359         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
27360         
27361 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
27363         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
27364         
27365         * appdomain.c verify.c: Moved corlib version checking into its own
27366         function in appdomain.c since it needs to create vtables etc.
27368 2003-12-13  Patrik Torstensson <p@rxc.se>
27370         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
27371         instead of unwrapped server.
27373 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
27375         * verify.c (check_corlib): Fix field index.
27377 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
27379         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
27380         GetGacPath icall.
27382 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
27384         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
27385         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
27386         cope with sizeof(size_t) != sizeof(guint32).
27388 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27390         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
27391         in case of failure.
27393 2003-12-10  Mark Crichton <crichton@gimp.org>
27395         * icall.c: removed the GetNonZeroBytes.  We now handle this case
27396         in managed code.
27398         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
27400 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
27402         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
27403         marked as deleted.
27405 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
27407         * verify.c (check_corlib): Handle the case when the version field is 
27408         initialized by a static constructor.
27410 2003-12-08  Patrik Torstensson  <p@rxc.se>
27412     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
27414 2003-12-08  Martin Baulig  <martin@ximian.com>
27416         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
27417         a MonoReflectionGenericParameter, also take the parameter index
27418         and name as arguments.
27419         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
27420         (ves_icall_MonoGenericParam_initialize): New interncall.
27421         (ves_icall_Type_make_byref_type): New interncall.
27423         * reflection.h (MonoReflectionGenericParam): Derive from
27424         MonoReflectionType, not just from MonoObject.  Added `refobj' and
27425         `index' fields.
27427         * reflection.c (mono_reflection_define_generic_parameter): Create
27428         and return a new MonoReflectionGenericParam; don't initialize the
27429         constraints here.
27430         (mono_reflection_initialize_generic_parameter): New public method;
27431         initializes the constraints and creates the `param->pklass'.
27433 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
27435         * reflection.h reflection.c: Use the new fields 'num_types', 
27436         'num_fields' and 'num_methods' to track the number of types etc.
27438         * verify.c (check_corlib): Check corlib version number.
27440 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
27442         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
27443         function works on all methods.
27445 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
27447         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
27448         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
27449         the custom_type_info flag of the transparent proxy.
27450         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
27451         objects that supports IRemotingTypeInfo.
27452         * object.h: Added custom_type_info field in transparent proxy.
27454 2003-12-06  Martin Baulig  <martin@ximian.com>
27456         * class.c (mono_class_create_from_generic): Removed.
27457         (mono_class_from_generic): Check `ginst->klass' before doing
27458         anything else.  This is important to fully support "recursive"
27459         generic types.
27461         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
27462         empty `generic_inst->klass' before doing anything else.
27464 2003-12-06  Dick Porter  <dick@ximian.com>
27466         * verify.c: 
27467         * object.h:
27468         * icall.c:
27469         * locales.c: Use C structs to access class fields.  Don't do a
27470         conversion between MonoString and UChar because both are
27471         platform-endian UTF-16.  Compare now takes startindex and count
27472         parameters.  Add a char overload for IndexOf.  Speed up the
27473         invariant string IndexOf.
27475 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
27477         * Makefile.am (monosn_LDADD): Fix parallel build.
27479 2003-12-04  Martin Baulig  <martin@ximian.com>
27481         * icall.c
27482         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27483         (ves_icall_Type_make_array_type): New interncall.       
27485 2003-12-04  Martin Baulig  <martin@ximian.com>
27487         * locales.c: also change it in the !HAVE_ICU case.
27489 2003-12-04  Dick Porter  <dick@ximian.com>
27491         * icall.c:
27492         * locales.c: construct_compareinfo is now in CompareInfo, not
27493         CultureInfo.
27495 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
27497         * image.c (mono_image_load_file_for_image): Cache loaded images in the
27498         image->files array.
27500         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
27501         table as well.
27503         * assembly.c (mono_assembly_load_references): Only load references
27504         once.
27506         * class.c (mono_class_from_name): Avoid linear search of the 
27507         EXPORTEDTYPE table.
27509         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
27511 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
27513         * image.h (MonoImage): Add 'field_cache' field.
27515         * loader.c (mono_field_from_token): Cache field lookups.
27516         
27517         * reflection.c (mono_module_get_object): Fix name property.
27519         * icall.c (ves_icall_get_enum_info): Update after changes to 
27520         mono_metadata_get_constant_index ().
27522         * icall.c: Get rid of get_type_info icall, use a separate icall for
27523         each type property to avoid needless memory allocations. Fixes #51514.
27525         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
27526         to avoid needless binary searches.
27528         * class.c (class_compute_field_layout): Move the initialization of
27529         field->def_value to mono_class_vtable ().
27531         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
27532         non-corlib types.
27534         * object.c (mono_object_allocate): Make it inline.
27536         * object.c (mono_object_allocate_spec): Make it inline.
27537         
27538 2003-12-02  Dick Porter  <dick@ximian.com>
27540         * locales.c (create_NumberFormat): NumberFormatInfo construction.
27541         Patch by Mohammad DAMT (mdamt@cdl2000.com).
27543 2003-12-01  Dick Porter  <dick@ximian.com>
27545         * threads.c: Fix signature and call in CreateMutex and
27546         CreateEvent.
27548 2003-12-01  Dick Porter  <dick@ximian.com>
27550         * icall.c: 
27551         * locales.c: Implement string compares and searching
27553         * object.h: Add extra Thread field
27555 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
27557         * reflection.c (fixup_method): Add support for MonoCMethod.
27559 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
27561         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
27563         * reflection.c (assembly_name_to_aname): Allow extra characters in
27564         assembly names. Fixes #51468.
27566 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
27568         * exception.c (mono_exception_from_name_domain): New helper function.
27570         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
27571         exception object in the correct domain.
27573         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
27574         formatting + make a copy a the input data.
27576         * loader.c (mono_get_method_from_token): Methods which contain
27577         native code do not have entries in the ImplMap.
27579         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
27580         Thanks to Gonzalo for spotting this.
27581         
27582         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
27583         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
27585         * assembly.h (mono_assembly_load_from): Split the second part of 
27586         assembly loading into a new public function.
27588         * exception.h (mono_get_exception_bad_image_format): New function.
27590 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
27592         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27593         Enumerate all modules inside a dynamic assembly. Fixes #51293.
27594         
27595         * icall.c: Add new icall for creating dynamic methods.
27597         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
27599         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
27601         * reflection.c (mono_reflection_create_dynamic_method): New icall to
27602         create a dynamic method.
27604         * reflection.c (resolve_object): New helper function.
27606         * reflection.c: Generalize ReflectionMethodBuilder and the functions
27607         which manipulate it so they can also work on dynamic methods.
27609         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
27610         creating the MonoReflectionMethodAux structure if it is not needed.
27611         
27612         * reflection.h verify.c: Update after changes to object layout.
27614         * reflection.c (method_builder_encode_signature): Fix compilation on
27615         gcc 2.95.x.
27617 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
27619         * appdomain.h: Added support for context static fields. Added static_data
27620           field to MonoAppContext and renamed thread_static_fields to a more
27621           generic special_static_fields in MonoAppDomain, since it can now contain
27622           context static fields.
27623         * domain.c: Updated hashtable name.
27624         * object.c: Replaced field_is_thread_static() for a more generic
27625           field_is_special_static() which also checks for context static attribute.
27626           In mono_class_vtable(), added support for static context fields.
27627         * threads.c: Changed methods that manage thread static fields to more
27628           generic methods so they can be reused both for thread and context static
27629           data.
27630         * threads.h: Declared some new methods.
27632 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
27634         * reflection.h: Update after changes to the managed types.
27636         * reflection.c (encode_custom_modifiers): New helper function.
27638         * reflection.c (method_encode_signature): Emit custom modifiers.
27640         * reflection.c (field_encode_signature): Emit custom modifiers.
27642 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
27644         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
27646         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
27647         implementation.
27649         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
27650         icall.
27652         * object.c (mono_field_get_value_object): New function.
27654         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
27655         specific.
27657 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
27659         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
27660         return a preallocated out-of-memory exception instance.
27662         * object.c (out_of_memory): Use the new function.
27664         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
27665         flag is before the custom modifiers. Fixes #49802.
27667 2003-11-16  Martin Baulig  <martin@ximian.com>
27669         * class.c (mono_class_is_open_constructed_type): Implemented the
27670         MONO_TYPE_GENERICINST case.
27672 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
27674         * assembly.c (mono_assembly_fill_assembly_name): New function to
27675         fill out the MonoAssemblyName structure.
27676         (mono_assembly_open): Use the new function.
27678         * icall.c (fill_reflection_assembly_name): New helper function.
27680         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
27681         new function.
27683         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
27685 2003-11-15  Martin Baulig  <martin@ximian.com>
27687         * class.c (mono_class_is_open_constructed_type): New public
27688         function; checks whether a type is an open constructed type,
27689         ie. whether it still contains type parameters.
27690         (mono_class_inflate_generic_type): If we're a type parameter and
27691         the inflated type is also a MONO_TYPE_(M)VAR, return the original
27692         type.
27694         * class.h (MonoGenericInst): Added `guint32 is_open'.
27696         * loader.c (method_from_methodspec): Check whether we're an open
27697         or closed constructed type and set `ginst->is_open'.
27699         * reflection.c (mono_reflection_bind_generic_parameters): Check
27700         whether we're an open or closed constructed type and set
27701         `ginst->is_open'.
27702         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
27703         from open constructed types.
27705 2003-11-15  Martin Baulig  <martin@ximian.com>
27707         * reflection.c (mono_reflection_bind_generic_parameters): If we're
27708         a generic instance (instead of a generic type declaration) with
27709         unbound generic parameters, bind them to our actual types.
27711 2003-11-14  Martin Baulig  <martin@ximian.com>
27713         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
27715         * reflection.c (mono_reflection_bind_generic_parameters): If we're
27716         an interface type, populate `res->interfaces' with instantiated
27717         versions of all the interfaces we inherit.
27719 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
27721         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
27722         when MONO_PATH is set but doesn't contain the install dir.
27724 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27726         * icall.c:
27727         (ves_icall_Type_GetInterfaces): don't return an interface twice when
27728         it's also implemented in base classes. Fixes bug #50927.
27730 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
27732         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
27733         if this method is called from a finalizer. Fixes #50913.
27735 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
27737         * threads.c: Implement VolatileRead/VolatileWrite
27739         * icall.c: Add new icalls for VolatileRead/VolatileWrite
27741 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
27743         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
27744         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
27745         2.95.3.
27747         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
27748         from Peter Ross (pro@missioncriticalit.com).
27749         
27750 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
27752         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
27754 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
27756         * assembly.c (mono_assembly_load_references): Disable check because it
27757         triggers on older corlibs which lots of people have.
27759 2003-11-12  Jackson Harper  <jackson@ximian.com>
27761         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
27762         load corlib.dll if mscorlib.dll is not found.
27763         * assembly.h: Remove corlib name define.
27764         * class.c:
27765         * domain.c:
27766         * image.c: Change corlib name to mscorlib.
27767         
27768 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
27770         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
27772 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
27774         * appdomain.h: Added loader_optimization here to sync with the C#
27775         code, and add disallow_binding_redirects field.
27777 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
27779         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
27781         * reflection.c (mono_image_build_metadata): Fix crash on modules
27782         with no types.
27784         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
27786         * icall.c (ves_icall_get_method_info): Return callingConvention as
27787         well.
27789         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
27790         namespaces from the EXPORTEDTYPE table as well.
27792         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
27793         from all modules inside the assembly.
27794         
27795 2003-11-11  Martin Baulig  <martin@ximian.com>
27797         * reflection.c (mono_reflection_bind_generic_parameters): Make
27798         this work for interfaces.
27800 2003-11-11  Martin Baulig  <martin@ximian.com>
27802         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
27804 2003-11-11  Martin Baulig  <martin@ximian.com>
27806         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
27807         "MonoInflatedMethod" and "MonoInflatedCtor".
27809 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
27811         * reflection.c (resolution_scope_from_image): Use the assembly table
27812         from the manifest module, since other modules don't have it.
27814         * debug-helpers.c (mono_type_full_name): New helper function.
27816         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
27818         * image.c (mono_image_load_file_for_image): New public function which
27819         is a replacement for the load_file_for_image in class.c.
27821         * assembly.c (mono_assembly_load_module): A wrapper for the function
27822         above which does assembly association and reference loading too.
27824         * class.c (mono_class_from_name): Call mono_assembly_load_module.
27826 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27828         * appdomain.c: not all of the attributes for the full assembly name
27829         are required and the order doesn't matter. Fixes bug #50787.
27831 2003-11-10  Dick Porter  <dick@ximian.com>
27833         * locales.c: Use platform-endian UTF16
27835 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
27837         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
27838         
27839 2003-11-10  Martin Baulig  <martin@ximian.com>
27841         * metadata.c
27842         (mono_metadata_load_generic_params): Make this actually work.
27844         * reflection.c (mono_reflection_bind_generic_parameters): If our
27845         parent is a generic instance, pass all the `types' to it, no
27846         matter whether it has the same number of type parameters or not.
27848 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
27850         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
27852         * assembly.c (mono_assembly_load_references): Move the image<->assembly
27853         assignment code to this function so it gets called recursively for all
27854         modules.
27856         * image.c (load_modules): Remove the assembly assignment since it is
27857         now done by mono_assembly_load_references.
27858         
27859         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27860         Add 'module' argument.
27861         (mono_module_get_types): New helper function.
27862         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
27864 2003-11-08  Martin Baulig  <martin@ximian.com>
27866         * class.c (mono_class_inflate_generic_method): Interface method
27867         don't have a header.
27869         * reflection.c (mono_image_get_methodspec_token): Take an
27870         additional `MonoGenericInst *' argument instead of reading it from
27871         the header; this is necessary to support interfaces.
27872         (mono_image_create_token): Pass the `MonoGenericInst *' from the
27873         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
27874         (inflated_method_get_object): Take an additional `MonoGenericInst *'
27875         argument.
27877         * reflection.h (MonoReflectionInflatedMethod): Added
27878         `MonoGenericInst *ginst'.
27880 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
27882         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
27884 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
27886         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
27888 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
27890         * reflection.c 
27891         (reflection_methodbuilder_from_method_builder):
27892         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
27893         initialize a ReflectionMethodBuilder structure.
27894         (mono_image_get_methodbuilder_token):
27895         (mono_image_get_ctorbuilder_token): New functions to emit memberref
27896         tokens which point to types in another module inside the same assembly.
27898         * reflection.c: Use the new helper functions.
27899         
27900         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
27902         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
27903         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
27905         * reflection.c (resolution_scope_from_image): Emit a moduleref if
27906         neccesary.
27908         * reflection.c (mono_image_build_metadata): Emit metadata only for the
27909         current module. Emit the manifest only for the main module.
27911         * reflection.c (mono_image_create_token): Add assertion when a 
27912         memberref needs to be created.
27914         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
27916         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
27917         larger buffer for the custom attribute blob. Fixes #50637.
27918         
27919 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27921         * threadpool.c: notify listener on async processing handles after
27922         invoking the async callback. Thanks to Zoltan.
27924 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27926         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
27927         avoid code duplication.
27929         * reflection.h (MonoDynamicImage): New type which is currently unused,
27930         but will be used through the ref.emit code in place of 
27931         MonoDynamicAssembly.
27933         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
27934         object layout.
27936         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
27937         a MonoDynamicImage instead of just a MonoImage.
27938         
27939         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
27940         icalls to ModuleBuilder but keep their semantics, so they will work
27941         with moduleb->assemblyb. This will change later.
27942         
27943 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27945         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
27946         object layout.
27948         * reflection.c (mono_image_build_metadata): Avoid creation of a default
27949         main module, since it is now done by the managed code.
27951 2003-11-03  Martin Baulig  <martin@ximian.com>
27953         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
27954         `ginst->klass' here.
27955         (method_encode_methodspec): Don't use the `ginst->generic_method's
27956         klass if it's a generic instance, use `ginst->klass' in this case.
27958 2003-11-03  Martin Baulig  <martin@ximian.com>
27960         * reflection.c (mono_image_get_generic_method_param_info):
27961         Removed, use mono_image_get_generic_param_info() instead.
27962         (mono_image_get_type_info): Write the GenericParam table before
27963         the Method table.  This is neccessary because in the GenericParam
27964         table, type parameters of the class (ie. '!0' etc.) must come
27965         before the ones from its generic methods (ie. '!!0' etc).
27967 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27969         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
27971 2003-11-02  Martin Baulig  <martin@ximian.com>
27973         * reflection.c (create_generic_typespec): Take a
27974         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
27975         the generic parameters from it.
27977 2003-11-02  Martin Baulig  <martin@ximian.com>
27979         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
27980         instead of a `MonoClassField *' since we just need the type.
27981         (create_generic_typespec): New static function.  Creates a
27982         TypeSpec token for a generic type declaration.
27983         (mono_image_get_generic_field_token): New static function.
27984         (mono_image_create_token): If we're a FieldBuilder in a generic
27985         type declaration, call mono_image_get_generic_field_token() to get
27986         the token.
27988 2003-11-02  Martin Baulig  <martin@ximian.com>
27990         * reflection.h
27991         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
27992         `MonoReflectionGenericInst *declaring_type' and
27993         `MonoReflectionGenericInst *reflected_type' fields.
27995         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
27996         `MonoReflectionGenericInst *declaring_type' and a
27997         `MonoReflectionGenericInst *reflected_type' argument instead of a
27998         single `MonoReflectionGenericInst *type' one.  Set
27999         `res->declaring_type' and `res->reflected_type' from them.
28000         (mono_reflection_inflate_field): Likewise.      
28002 2003-11-02  Martin Baulig  <martin@ximian.com>
28004         * class.c (mono_class_setup_vtable): Don't store generic methods
28005         in the vtable.  
28007 2003-11-02  Martin Baulig  <martin@ximian.com>
28009         * reflection.h (MonoReflectionGenericInst): Added
28010         `MonoReflectionType *declaring_type'.
28012         * reflection.c (mono_reflection_bind_generic_parameters): Use
28013         `if (tb->parent)' instead of `klass->parent'.
28015 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
28017         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
28018         with an empty ASSEMBLY table.
28020         * reflection.c (mono_image_build_metadata): Avoid using the same loop
28021         variable in the inner and outer loops.
28023 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
28025         * metadata.h (mono_metadata_make_token): Put parentheses around macro
28026         argument.
28028         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
28029         
28030         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
28031         icalls. Instead, do everything in managed code. This is needed since
28032         it is hard to restore the original domain etc. in unmanaged code in the
28033         presence of undeniable exceptions.
28035         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
28036         New icalls to push and pop appdomain refs.
28038 2003-10-31  Martin Baulig  <martin@ximian.com>
28040         * class.c (inflate_generic_type): Renamed to
28041         mono_class_inflate_generic_type() and made it public.
28043         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
28044         New interncall.
28046         * loader.c (mono_field_from_memberref): Also set the retklass for
28047         typespecs.
28049         * fielder.c (mono_image_get_inflated_field_token): New static
28050         method; creates a metadata token for an inflated field.
28051         (mono_image_create_token, fixup_method): Added support for
28052         "MonoInflatedField".
28053         (fieldbuilder_to_mono_class_field): New static function.
28054         (mono_reflection_inflate_field): New public function.
28056         * reflection.h
28057         (MonoReflectionGenericInst): Added `MonoArray *fields'.
28058         (MonoReflectionInflatedField): New typedef.     
28060 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
28062         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
28063         for Solaris and other platforms without s6_addr16
28065 2003-10-30  Martin Baulig  <martin@ximian.com>
28067         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
28068         argument instead of two.
28069         (mono_class_inflate_generic_signature): Likewise.
28070         (inflate_generic_header): Likewise.
28071         (mono_class_inflate_generic_method): Likewise.  In addition, if
28072         `ginst->klass' is set, it becomes the new `method->klass'.
28074         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
28075         field.
28077         * reflection.c (encode_generic_method_sig): Write a 0xa as the
28078         first byte. [FIXME]
28079         (method_encode_methodspec): If we have generic parameters, create
28080         a MethodSpec instead of a MethodRef.
28081         (fixup_method): Added support for "MonoInflatedMethod" and
28082         "MonoInflatedCtor".
28083         (mono_image_create_token): Added support for "MonoInflatedMethod"
28084         and "MonoInflatedCtor".
28085         (inflated_method_get_object): New static function; returns a
28086         managed "System.Reflection.MonoInflatedMethod" object.
28087         (mono_reflection_bind_generic_method_parameters): Return a
28088         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
28089         (mono_reflection_inflate_method_or_ctor): Likewise.
28090         (mono_image_get_generic_method_param_info): Initialize unused
28091         fields to zero.
28092         (mono_image_get_generic_param_info): Likewise.
28094         * reflection.h (MonoReflectionInflatedMethod): New public
28095         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
28096         "S.R.MonoInflatedCtor" classes.
28098         * loader.c (method_from_memberref): If we're a TypeSpec and it
28099         resolves to a generic instance, inflate the method.
28101 2003-10-28  Dick Porter  <dick@ximian.com>
28103         * object.c (mono_runtime_run_main): Convert command-line arguments
28104         into utf8, falling back to the user's locale encoding to do so.
28106 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
28108         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
28109         at this time.
28111         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
28113         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
28114         up icalls at method definition time. Partially fixes #33569.
28116 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
28118         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
28119         marshalling of arrays. Fixes #50116.
28121         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
28123         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
28124         points to a vtable in the dying appdomain.
28126         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
28127         listeners into unmanaged code inside the lock.
28129         * object.c (mono_class_vtable): Turn off typed allocation in non-root
28130         domains and add some comments.
28132 2003-10-25  Martin Baulig  <martin@ximian.com>
28134         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
28136         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
28138         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
28139         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
28140         currently parsing.  Create the generic class and store it in
28141         `generic_inst->klass' before parsing the type arguments.  This is
28142         required to support "recursive" definitions; see mcs/tests/gen-23.cs
28143         for an example.
28144         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
28145         to support recursive typespec entries.
28147         * class.c (mono_class_setup_parent): If our parent is a generic
28148         instance, we may get called before it has its name set.
28149         (mono_class_from_generic): Splitted into
28150         mono_class_create_from_generic() and mono_class_initialize_generic().
28152 2003-10-25  Martin Baulig  <martin@ximian.com>
28154         * icall.c (ves_icall_Type_BindGenericParameters): Return a
28155         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
28156         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
28157         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
28159         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
28160         (create_typespec): Likewise.
28161         (mono_reflection_bind_generic_parameters): Return a
28162         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
28163         (mono_reflection_inflate_method_or_ctor): New public function.
28165         * reflection.h (MonoReflectionGenericInst): New typedef.        
28167 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
28169         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
28170         inside the domain lock. Fixes #49993.
28171         
28172         * object.c (mono_class_vtable): When typed allocation is used, 
28173         allocate vtables in the GC heap instead of in the mempool, since the
28174         vtables contain GC descriptors which are used by the collector even
28175         after the domain owning the mempool is unloaded.
28177         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
28179         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
28180         reflect what it does. Also invalidate mempools instead of freeing
28181         them if a define is set.
28183         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
28184         of the appdomain.
28185         
28186         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
28187         hold the finalizable objects in this domain.
28189         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
28190         appdomain.
28192         * appdomain.c (mono_domain_set): New function to set the current
28193         appdomain, but only if it is not being unloaded.
28195         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
28196         appdomain which is being unloaded.
28197         
28198         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
28199         unloading of the root appdomain.
28201         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
28202         icall to execute a method in another appdomain. Intended as a 
28203         replacement for InternalSetDomain, which can confuse the code 
28204         generation in the JIT.
28206         * appdomain.c (mono_domain_is_unloading): New function to determine
28207         whenever an appdomain is unloading.
28209         * appdomain.c (mono_domain_unload): New function to correctly unload
28210         an appdomain.
28212         * assembly.c (mono_assembly_load_references): Check that an assembly
28213         does not references itself.
28215         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
28216         domain manually, it asks the finalizer thread to do it, then waits for
28217         the result. Also added a timeout.
28219         * icall.c: Register the new icalls.
28221         * threads.h threads.c: Export the mono_gc_stop_world and 
28222         mono_gc_start_world functions.
28223         
28224         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
28225         function to fill out the mempool with 0x2a.
28227 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
28229         * reflection.h (MonoReflectionMethodAux): New structure to store
28230         information which is rarely used, thus is not in the MonoMethod
28231         structure.
28233         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
28234         store the aux info.
28236         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
28237         and marshalling info into the aux structure.
28239         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
28240         from the aux structure.
28242         * loader.c (mono_method_get_param_names): Retrieve the param names from
28243         the aux structure.
28244         
28245 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
28247         * exception.h exception.c: Add AppDomainUnloadedException && fix 
28248         warning.
28250 2003-10-21  Dick Porter  <dick@ximian.com>
28252         * socket-io.c
28253         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
28254         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
28256 2003-10-21  Martin Baulig  <martin@ximian.com>
28258         * reflection.c (mono_reflection_bind_generic_parameters):
28259         `klass->parent' is NULL for interfaces.
28261 2003-10-21  Martin Baulig  <martin@ximian.com>
28263         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28265 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
28267         * exception.c (mono_exception_from_name_msg): New helper function for
28268         creating exceptions and initializing their message field.
28270         * exception.c: Simplify functions using the new helper.
28272         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
28273         New function.
28275         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
28276         mono_raise_exception, since otherwise gcc doesn't generate the function
28277         epilog for raise_exception, confusing the stack unwinding in the JIT.
28278         Fixes #45043.
28280         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
28281         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
28282         Fixes #49499.
28284 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28286         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
28287         utf8.
28289 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
28291         * icall.c: Removed GetUninitializedObject method because
28292           AllocateUninitializedClassInstance does the same.
28294 2003-10-18  Martin Baulig  <martin@ximian.com>
28296         * class.c (inflate_generic_signature): Renamed to
28297         mono_class_inflate_generic_signature() and made it public.
28298         (my_mono_class_from_generic_parameter): New static function; if we
28299         don't already have the generic parameter's MonoClass, create a
28300         very simple one which is just used internally in the runtime and
28301         not passed back to managed code.
28303         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
28305         * metadata.h (MonoMethodSignature): Moved the
28306         `MonoGenericParam *gen_params' to the MonoMethodHeader.
28307         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
28309         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
28310         ves_icall_MonoMethod_GetGenericArguments(); this is now an
28311         interncall on the MonoMethod class, not on MethodInfo.
28312         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
28313         calling mono_reflection_bind_generic_method_parameters() directly.
28315         * loader.c (mono_method_get_signature): If this is a MethodSpec;
28316         return the already computed `method->signature'.
28317         (method_from_methodspec): New static function to load a method
28318         from a MethodSpec entry.
28319         (mono_get_method_from_token): Call the new method_from_methodspec()
28320         for MethodSpec tokens.  
28321         (mono_get_method_from_token): If we're a generic method, load the
28322         type parameters.
28324         * reflection.c (mono_image_get_memberref_token): Allow
28325         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
28326         table.
28327         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
28328         (mono_image_create_token): First check whether it's a generic
28329         method (so we'd need to create a MethodSpec), then do the other
28330         two alternatives.
28331         (mono_reflection_bind_generic_method_parameters): Return a
28332         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
28333         called directly from the interncall.
28335 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
28337         * reflection.c (load_public_key): Move loading of the public key
28338         into managed code.
28340         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
28342         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
28343         fields.
28345         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
28346         culture, hash_alg and public_key. Fixes #49555.
28348 2003-10-17  Martin Baulig  <martin@ximian.com>
28350         * class.h (MonoGenericInst): Moved this declaration here and added
28351         `MonoMethod *generic_method'.
28353         * icall.c
28354         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
28355         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
28357         * metadata.c (mono_metadata_type_equal): Two types of
28358         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
28359         index; ie. don't compare the address of the `MonoGenericParam'
28360         structure.
28361         (mono_metadata_load_generic_params): Removed the `MonoMethod
28362         *method' argument.
28364         * metadata.h (MonoGenericInst): Moved declaration to class.h.
28365         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
28367         * reflection.c (method_encode_signature): Encode the number of
28368         generic parameters.
28369         (encode_generic_method_sig): New static function.
28370         (method_encode_methodspec): New static function; creates an entry
28371         in the MethodSpec table for a generic method.
28372         (mono_image_get_methodspec_token): New static function.
28373         (mono_image_create_token): Call mono_image_get_methodspec_token()
28374         for generic methods.
28375         (mono_reflection_bind_generic_method_parameters): New public
28376         function.  Instantiates a generic method.
28378 2003-10-16  Martin Baulig  <martin@ximian.com>
28380         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
28381         *gen_params' here from MonoMethodHeader.
28383         * metadata.c (mono_metadata_parse_method_signature): If we have
28384         generic parameters, initialize `method->gen_params' and then set
28385         the correct `type->data.generic_param' in all the parameters.
28387 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
28389         * threads.c (mono_threads_get_default_stacksize): New function to 
28390         return the default stacksize.
28392         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
28393         termination of the finalizer thread, since the previous method had
28394         race conditions. Fixes #49628.
28396         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
28397         as for the other managed threads.
28399 2003-10-16  Martin Baulig  <martin@ximian.com>
28401         * class.c (inflate_generic_signature): Copy `generic_param_count'
28402         and `gen_params'.
28404         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
28405         New interncall.
28407         * metadata.c (mono_metadata_parse_method_signature): Actually set
28408         the `method->generic_param_count' here.
28409         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
28411 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
28413         * object.h: Add a new field to TypedRef to simplify the implementation
28414         of the REFANY opcodes in the JIT.
28416         * icall.c: Make use of the new field.
28418         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
28419         dynamically.
28421 2003-10-15  Martin Baulig  <martin@ximian.com>
28423         * class.c (mono_class_from_gen_param): Renamed to
28424         mono_class_from_generic_parameter() and moved most of the
28425         functionality from mono_reflection_define_generic_parameter()
28426         here; ie. we create a "real" class here.
28427         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
28428         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
28429         previously been called.
28431         * class.h (MonoGenericParam): Moved the declaration of this struct
28432         here from metadata.h and added `MonoMethod *method'.
28434         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
28435         interncall.
28437         * loader.c (mono_get_method_from_token): If we have any generic
28438         parameters, call mono_metadata_load_generic_params() to read them
28439         from the MONO_TABLE_GENERICPAR.
28441         * metadata.c (mono_metadata_load_generic_params): Added
28442         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
28444         * metadata.h (MonoMethodSignature): Replaced
28445         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
28446         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
28448         * reflection.c (mono_reflection_define_generic_parameter): Moved
28449         most of the functionality into the new
28450         mono_class_from_generic_parameter(); set the `method' field if
28451         we're a method parameter.       
28453 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
28455         * marshal.c (emit_struct_conv): if native size is 0
28456         emit no code.
28458 2003-10-14  Martin Baulig  <martin@ximian.com>
28460         * icall.c: The generics API has changed in the spec since it was
28461         added to System.Type; these modifications make it match the spec
28462         again.
28463         (ves_icall_Type_GetGenericParameters): Renamed to
28464         `ves_icall_Type_GetGenericArguments'.
28465         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
28466         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
28467         `ves_icall_MonoType_get_HasGenericArguments'.
28468         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
28469         `ves_icall_MonoType_get_IsGenericParameter'.
28470         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
28471         this is no interncall anymore.
28472         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
28473         `ves_icall_TypeBuilder_get_IsGenericParameter'.
28475 2003-10-14  Martin Baulig  <martin@ximian.com>
28477         * reflection.c (mono_reflection_bind_generic_parameters): Also
28478         inflate generic methods if we're reading the class from IL.
28480 2003-10-13  Martin Baulig  <martin@ximian.com>
28482         * reflection.c (mono_reflection_define_generic_parameter): This
28483         method isn't called directly from the icall anymore; take a
28484         `MonoReflectionAssemblyBuilder *' so we can use this for type and
28485         method generic parameters.
28486         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
28487         (method_builder_encode_signature): Encode generic parameters.
28488         (mono_image_get_method_info): Write generic params to the
28489         MONO_TABLE_GENERICPARAM table.
28491         * reflection.h (MonoReflectionMethodBuilder): Added
28492         `MonoArray *generic_params'.
28494         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
28496         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
28497         wrapper for mono_reflection_define_generic_parameter().
28498         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
28500 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
28502         * marshal.h: Add missing function to fix build.
28504         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
28505         the SetLastError pinvoke attribute.
28507         * marshal.c (mono_marshal_set_last_error): New helper function called
28508         by the generated code.
28509         
28510         * marshal.c (mono_mb_emit_branch): New helper function.
28512         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
28514         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
28515         classes as parameters and return values of delegates. Fixes #29256. 
28517 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
28519         * locales.c: use gint32 in non HAVE_ICU case
28521 2003-10-11  Martin Baulig  <martin@ximian.com>
28523         * mono-debug.c (mono_debug_add_method): Added a workaround for
28524         bug #48591.
28526 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
28528         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
28529         delegates passed to native code must use the STDCALL calling 
28530         convention. Fixes #35987.
28532 2003-10-10  Martin Baulig  <martin@ximian.com>
28534         * class.c (inflate_generic_type): If we're inflating for a generic
28535         type instance (and not for a generic method), return
28536         MONO_TYPE_MVAR unchanged.
28538 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28540         * string-icalls.c: Join ignores null strings in the source array.
28541         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
28542         * threads.c: GetAvailableTheads is slightly more accurate.
28544 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
28546         * threads.h threads.c : add mono_threads_set_default_stacksize
28547         and pass default to CreateThread calls.
28549 2003-10-09  Dick Porter  <dick@ximian.com>
28551         * icall.c:
28552         * locales.h:
28553         * locales.c: Internal calls for constructing CultureInfo and
28554         related objects from libicu (if its available.)
28556 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
28558         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
28560 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28562         * threadpool.c: added an argument to async_invoke_thread that is the
28563         item to process, pass the MonoAsyncResult to the thread start function
28564         when creating a new thread. This way we don't need to acquire any lock
28565         when we're creating a new thread. Readded a semaphore for faster
28566         response times (instead of that Sleep i added).
28568 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
28570         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
28571         get daylight change dates better on Windows, fix handling
28572         of platforms without tm_gmtoff.
28574 2003-10-06  Martin Baulig  <martin@ximian.com>
28576         * class.c (inflate_generic_method): Renamed to
28577         mono_class_inflate_generic_method() and made public.
28578         (mono_class_init): Don't inflate the generic methods here.
28579         (mono_class_from_generic): Added `gboolean inflate_methods'
28580         argument.  Inflate the methods here.
28582         * loader.c (mono_method_get_param_names): Ignore instances of
28583         generic types for the moment.
28585         * reflection.c (fixup_method): Added support for inflated methods.
28586         (mono_image_create_token): Use mono_image_get_methodref_token()
28587         for inflated methods.
28588         (mono_custom_attrs_from_param): Ignore instances of generic types
28589         for the moment.
28590         (mono_reflection_bind_generic_parameters): New public function.
28591         Moved all the functionality from
28592         ves_icall_Type_BindGenericParameters() here and added support for
28593         dynamic types.
28594         (mono_reflection_define_generic_parameter): Initialize
28595         `klass->methods' here.
28597         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
28598         functionality into mono_reflection_define_generic_parameter().
28599         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
28600         TypeBuilder, return that TypeBuilder.
28602 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28604         * appdomain.c: removed mono_delegate_semaphore.
28606         * threadpool.c:
28607         (mono_thread_pool_add): moved hash table creation inside and the thread 
28608         creation outside of the critical region.
28609         (mono_thread_pool_finish): removed obsolete code.
28610         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
28611         continue or exit the thread depending on the queue.
28613 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
28615         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
28616         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
28617         handle more bool marshalling options
28619 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
28621         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
28622         arrays of structs. Also add a more descriptive error message when
28623         a structure member is marshalled as LPArray.
28625 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
28627         * marshal.c (mono_marshal_get_native_wrapper): Add support for
28628         marshalling arrays of complex types. Fixes #29098. Also remove an
28629         usused and incomplete function.
28631 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
28633         * gc.c: report heap_size - free_bytes as total memory allocated
28634         (bug#49362).
28636 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
28638         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
28639         fix timezone handling problems on Windows.
28640         
28641         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
28642         asserts when the year is outside the range handled by ms the functions.
28644         * class.c (setup_interface_offsets): If the class is an interface,
28645         fill out its interface_offsets slot.
28647 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28649         * threadpool.c: mark threadpool threads as background.
28651 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
28653         * decimal.c - define DECINLINE to nothing if not using GCC
28655 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
28657         * assembly.c: More refcount fixes.
28659 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28661         * string-icalls.c: if we're not trimming, return the same string.
28662         When not splitting, don't create a new string.
28664 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28666         * image.c:
28667         (mono_image_open): increment the ref_count inside the critical section.
28669 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
28671         * image.c (mono_image_open): Fix reference counting bug.
28673 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
28675         * marshal.c (mono_marshal_type_size) struct alignment changed for 
28676         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
28677         64bits. Avoid leak in mono_marshal_get_native_wrapper when
28678         mono_lookup_pinvoke_call throws.        
28680 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
28682         * reflection.c (mono_reflection_parse_type): Fix #49114.
28684         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
28685         temporary workaround for cygwin header problem.
28687         * object.c (mono_object_isinst): Synchronize this with the code
28688         generated by the JIT for casts.
28690 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
28692         * reflection.c (encode_type): Fix #38332.
28694 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
28696         * marshal.c (mono_marshal_method_from_wrapper): New function to return
28697         the original method from the wrapper method.
28699 2003-09-25  Martin Baulig  <martin@ximian.com>
28701         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
28702         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
28703         (ves_icall_Type_get_IsGenericInstance): New interncall.
28705 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
28707         * object.c: fix cast warning in big endian code.
28709 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
28711         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
28712         
28713 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28715         * assembly.c: don't call check_env from mono_assembly_load. It's
28716         already done once in mono_assemblies_init and may cause headaches when
28717         multiple threads are loading assemblies.
28719 2003-09-19  Martin Baulig  <martin@ximian.com>
28721         * reflection.c (mono_reflection_define_generic_parameter): Don't
28722         allocate `klass->methods', set `klass->flags' to
28723         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
28725 2003-09-18  Martin Baulig  <martin@ximian.com>
28727         * class.c (mono_class_init): Don't create `class->methods' if it's
28728         already initialized.
28730         * metadata.c (mono_metadata_load_generic_params): Make this
28731         actually work.
28733         * reflection.c (mono_reflection_define_generic_parameter): Set
28734         parent class and interfaces from the constraints.
28736         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
28737         to keep this struct in sync with the declaration in TypeBuilder.cs.
28739 2003-09-17  Martin Baulig  <martin@ximian.com>
28741         * metadata.h (MonoType): Replaced the data's `int type_param'
28742         field with `MonoGenericParam *generic_param'.
28743         (MonoGenericParam): Added `MonoClass *klass'.
28745         * class.c (mono_class_from_gen_param): Removed the
28746         `MonoImage *image' and `int type_num' arguments.
28748         * metadata.c (mono_metadata_parse_generic_param): New static
28749         method; creates a MonoGenericParam which just contains the index.
28750         (do_mono_metadata_parse_type): Call
28751         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
28752         MONO_TYPE_MVAR.
28754         * reflection.c (mono_image_typedef_or_ref): Generic type
28755         parameters may be in the same assembly, but never use a typedef
28756         for them.
28757         (mono_reflection_define_generic_parameter): We're now creating a
28758         "real" class for the type parameter; it's now safe to call
28759         mono_class_from_mono_type() on the class'es type, it'll do the
28760         right thing.
28762 2003-09-16  Martin Baulig  <martin@ximian.com>
28764         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
28765         `symfile->range_entry_size' and `symfile->class_entry_size' here;
28766         the `symfile' data structure must be fully initialized before it
28767         gets added to the table.
28769 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
28771         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
28773         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
28774         class init trampolines.
28776 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
28778         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
28779         to the built-in profiler to turn off time and allocation profiling
28780         respectively.
28782 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
28784         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
28785         g_direct_equal.
28787         * debug-helpers.c (mono_method_full_name): Print the wrapper type
28788         in human readable form.
28790 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
28792         * reflection.c icall.c: Fixed warnings.
28794         * image.c (load_class_names): Use a temporary hash table to hold the
28795         namespaces in order to avoid doing many string comparisons.
28797         * image.h: Fix typo.
28799         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
28800         Pass NULL instead of g_direct_equal to the GHashTable constructor 
28801         since the NULL case is short-circuited inside g_hash_table_lookup, 
28802         leading to better performance.  
28804         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
28805         obtain the first custom attribute for a given index. Depends on the
28806         CustomAttribute table being sorted by the parent field.
28808         * reflection.c (mono_custom_attrs_from_index): Use the new function 
28809         for better performance.
28811 2003-09-07  Martin Baulig  <martin@ximian.com>
28813         * class.c (mono_class_init): If we're a generic instance, inflate
28814         all our methods instead of loading them from the image.
28815         (mono_class_from_generic): Set `class->methods = gklass->methods'.
28817 2003-09-07  Martin Baulig  <martin@ximian.com>
28819         * mono-debug-debugger.c: Added support for constructors.
28821 2003-09-06  Martin Baulig  <martin@ximian.com>
28823         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
28824         New interncall.
28826         * reflection.c (mono_reflection_setup_generic_class): Call
28827         ensure_runtime_vtable() to create the vtable.
28829 2003-09-05  Martin Baulig  <martin@ximian.com>
28831         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
28832         MONO_TYPE_MVAR.
28834 2003-09-04  Martin Baulig  <martin@ximian.com>
28836         * reflection.c (mono_reflection_define_generic_parameter): Generic
28837         parameters start with zero.
28839 2003-09-04  Martin Baulig  <martin@ximian.com>
28841         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28843         * reflection.h (MonoReflectionGenericParam): New typedef.
28844         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
28845         the generic parameters from the managed TypeBuilder.
28847         * reflection.c (mono_reflection_define_generic_parameter): New function.
28848         (mono_reflection_create_runtime_class): Encode generic parameters.
28849         (mono_reflection_setup_generic_class): New function; this is
28850         called after adding adding all generic params to the TypeBuilder.
28851         (encode_type): Added MONO_TYPE_VAR.
28853 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
28855         * class.h class.c (mono_class_needs_cctor_run): Moved this method
28856         here from the JIT.
28858         * assembly.h assembly.c: Moved the AOT loading code into an assembly
28859         load hook.
28861 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
28863         * reflection.h reflection.c class.h class.c: Delete duplicate 
28864         definition of mono_type_get_name () from reflection.c and export the
28865         one in class.c.
28867         * class.c: Class loading fixes from Bernie Solomon 
28868         (bernard@ugsolutions.com).
28870         * reflection.c: Endianness fixes from Bernie Solomon 
28871         (bernard@ugsolutions.com).
28872         
28873 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
28875         * assembly.h assembly.c: Define a file format version for AOT
28876         libraries.
28877         
28878         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
28880         * appdomain.h (MonoJitInfo): New field to determine whenever the
28881         code is domain neutral.
28882         
28883 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
28885         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
28887 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
28889         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
28890         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
28891         Avoid caching the result since strings must be domain specific. Fixes
28892         #48050.
28894 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
28896         * marshal.c (mono_marshal_init): Make this callable multiple times
28897         since it is hard to find a correct place to call it.
28899         * object.c (mono_runtime_class_init): Execute static constructors in
28900         the correct appdomain.
28902         * image.c (build_guid_table): Handle the case when multiple images have
28903         the same GUID.
28905 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28907         * icall.c: added a couple of icalls for System.Web.
28909 2003-08-28  Martin Baulig  <martin@ximian.com>
28911         * icall.c (ves_icall_Type_BindGenericParameters): Use
28912         `klass->generic_inst' instead of `&klass->byval_arg' in the
28913         mono_type_get_object() call.  The returned type must be
28914         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
28916 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
28918         * NOTES: New file.
28920         * object.c (mono_class_proxy_vtable): Make it thread safe.
28922         * pedump.c: Fix warning.
28924         * object.c appdomain.h: Get rid of metadata_section. 
28925         It is no longer needed and it was causing deadlocks with domain->lock.
28927         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
28929 2003-08-26  Martin Baulig  <martin@ximian.com>
28931         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
28933 2003-08-26  Martin Baulig  <martin@ximian.com>
28935         * pedump.c (main): Call mono_metadata_init(),
28936         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
28937         and mono_loader_init().
28939 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
28941         * loader.h: Add missing include to fix build.
28943         * image.h: mono_image_load_references is no more.
28945         * assembly.c: Reworked assembly loading to make it really thread safe.
28946         After these changes, the assembly returned by mono_assembly_open is
28947         fully initialized, i.e. all its references assemblies are loaded.
28949         * assembly.c (mono_image_load_references): Renamed to 
28950         mono_assembly_load_references, and made private, since clients no
28951         longer need to call it.
28953         * class.c: Removed calls to mono_assembly_load_references, since it was
28954         a source of deadlocks.
28956         * loader.h loader.c class.h class.c: Protect data structures using a 
28957         new lock, the loader lock.
28959         * class.c (mono_class_setup_vtable): Create temporary hash tables and
28960         GPtrArrays only when needed.
28962         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
28963         into empty structures by mcs. Fixes pinvoke7.cs.
28964         
28965         * domain.c (mono_init): Call a new initialization function.
28967         * appdomain.c (mono_runtime_init): Call the new initializer function
28968         of the marshal module.
28970         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
28971         inserted into empty structures by mcs. Fixes pinvoke7.cs.
28973         * marshal.h marshal.c: Added locks around the wrapper caches to make
28974         this module thread safe.
28976         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
28977         this argument. Fixes pinvoke1.exe.
28979 2003-08-25  Lluis Sanchez <lluis@ximian.com>
28981         * object.h: Added call_type field to MonoMethodMessage and the corresponding
28982         enumeration of values. Removed fields to store remote call output values in
28983         MonoAsyncResult. Not needed any more.
28984         * object.c: Initialize call_type and async_result fields in mono_message_init.
28985         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
28986         dispatching the message.
28987         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
28988         async call to finish. To do it use a message with EndInvoke call type.
28990 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
28992         * loader.h loader.c (mono_method_hash_marhal_info): New function which
28993         determines whenever a method has marshalling info.
28995 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28997         * assembly.c: fix the build on windows.
28999 2003-08-22 Lluis Sanchez <lluis@ximian.com>
29001         * object.cs: Fixed bug #47785.
29003 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
29005         * string-icalls.c (StringReplace): If their are no occurances of
29006         the old string found return a reference to the supplied
29007         string. This saves some memory and matches MS behavoir.
29008         
29009 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29011         * socket-io.c: fixed compilation for systems that define AF_INET6
29012         and don't define SOL_IP/SOL_IPV6.
29014 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
29016         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
29017         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
29019         * rawbuffer.c rawbuffer.h: Make this module thread safe.
29021         * domain.c: Make this module thread safe.
29023         * domain.c (mono_init): Call new initialization function.
29025         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
29026         reference types too. Fixes #38812.
29028         * image.c (mono_image_init): Fixed warnings.
29030         * class.c (mono_class_from_typeref): Handle assembly load failure
29031         correctly.
29033         * appdomain.c (add_assemblies_to_domain): Handle the case when
29034         the references of an assembly are not yet loaded.
29036         * metadata.c image.c assembly.c: Moved initialization of global
29037         variables to a separate function called at startup since lazy 
29038         initialization of these variables is not thread safe.
29039         
29040         * image.c assembly.c: Made this module thread safe by adding locks in 
29041         the appropriate places.
29043         * domain.c (mono_init): Call the new initialization functions of the
29044         three modules.
29046 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
29048         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
29049           make a direct call. It is proxy's work to make the call asynchronous.
29050           mono_delegate_end_invoke(): If the targe is a proxy, just collect
29051           the return values.
29052         * object.cs: mono_method_call_message_new(): read AsyncResult and
29053           state object from parameters list, if this info is requested.
29054         * object.h: Added fields to store remote call output values in
29055           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
29057 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29059         * object.h: add needed fields to MonoThread.
29060         * threads.c, threads.h: allow registering a function to cleanup data
29061         allocated per thread by the JIT.
29063 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29065         * loader.h: portability fix by Bernie Solomon
29066         * <bernard@ugsolutions.com>.
29068 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
29070         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
29071         return a MonoArray. This simplifies the code and also ensures that
29072         the cache allways contains an object reference as a value.
29074         * icall.c (ves_icall_get_parameter_info): Simplified using the new
29075         function.
29077 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29079         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
29080         fixes a problem with byte ordering when getting the address family for
29081         a socket.
29083 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
29085         * .cvsignore: Added monosn.
29087         * reflection.h reflection.c loader.c: Added support for parameter
29088         marshalling to dynamically created types. Fixes #47295.
29090 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
29092         * rand.c: remove useless warnings.
29094 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
29096         * class.c: implemented ldtoken for methods and fieldrefs.
29098 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29100         * threadpool.c: when mono_async_invoke was called, no one took care of
29101         monitoring the queue. So if the method invoked took some time and we
29102         got new async invoke requests after 500 ms (the thread created waited
29103         that long in WaitForSingleObject), the new async invoke was not called
29104         until the previous one finished.
29106         This is fixed now. Thanks to Totte for helping with it.
29108 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29110         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
29112 2003-08-11  Martin Baulig  <martin@ximian.com>
29114         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
29116 2003-08-06  Martin Baulig  <martin@ximian.com>
29118         * mono-debug-debugger.c: Added support for static fields,
29119         properties and methods.
29121 2003-08-06  Martin Baulig  <martin@ximian.com>
29123         * mono-debug-debugger.c: Don't store the MonoString's vtable to
29124         make this work for applications with multiple application domains.
29126 2003-08-04  Martin Baulig  <martin@ximian.com>
29128         * mono-debug-debugger.c: Completely reworked the type support; the
29129         most important thing is that we're now just using one single
29130         `MonoType' instance per type.
29132 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
29134         * mono-endian.h, mono-endian.c, icall.c: Added icall
29135         ves_icall_System_Double_AssertEndianity to assert double word endianity
29136         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
29138 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29140         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
29141         support, icalls and fixes.
29143 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
29145         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
29146         classes that are a punctuation character in .NET is not the same a
29147         g_unichar_ispunct.
29149 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29151         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
29153 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
29155         * icall.c: Add new MemCopy internalcall.
29156         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
29157         Simplified code; It is not necessary to handle all the cases here,
29158         as the C# code takes care of it.  Only handle the case of the name
29159         resource embedded into the assembly.
29161         Changed signature to return the data pointer and the size of the
29162         data. 
29164 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
29166         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
29167         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
29169 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
29171         * socket-io.c: ignore EINTR error in select.
29173 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
29175         * class.h, class.c: removed unused subclasses field in MonoClass.
29177 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
29179         * icall.c: improve fix of get_base_definition(). If the parent class
29180           doesn't have the mehod, look at the parent of the parent.
29181         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
29182           to check if a parameter is an in or out parameter
29183           (PARAM_ATTRIBUTE_IN is not set by default).
29184           mono_method_return_message_restore(): Use mono_class_value_size to
29185           get the size of a value type. mono_type_stack_size (parameterType)
29186           does not return the correct value if parameterType is byRef.
29187           mono_load_remote_field(), mono_load_remote_field_new(),
29188           mono_store_remote_field(), mono_store_remote_field_new():
29189           raise exception if the remote call returns an exception.
29191 2003-07-28  Martin Baulig  <martin@ximian.com>
29193         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
29194         method.  This is a wrapper around mono_runtime_invoke() which
29195         boxes the instance object if neccessary.
29197 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29199         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
29200         metadata.h, row-indexes.h, verify.c: first cut of generics support.
29202 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29204         * icall.c: disable mcs bug workaround.
29206 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
29208         * object.c (mono_runtime_class_init): Take the metadata_section
29209         mutex before obtaining the domain mutex.
29211         * appdomain.h: Added definition of metadata_section mutex here. 
29213         * object.c: define metadata_mutex here.
29215 2003-07-24  Ravi Pratap  <ravi@ximian.com>
29217         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
29218         fixed.
29220 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
29222         * reflection.c: Fix bug #46669
29224 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29226         * exception.c:
29227         * exception.h:
29228         * icall.c:
29229         * object.h: fill in the type name for TypeLoadException.
29231 2003-07-23  Ravi Pratap  <ravi@ximian.com>
29233         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
29234         relationship between TypeBuilders while compiling corlib) and bug
29235         45993 (Array types returned from the runtime while compiling
29236         corlib were from the loaded corlib).
29238 2003-07-22  Martin Baulig  <martin@ximian.com>
29240         * mono-debug-debugger.c: Reworked the type support a bit more;
29241         distinguish between types and classes.
29243 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
29245         * icall.c: add IsArrayImpl icall.
29247 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
29249         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
29250         initializing real_size only once. Also fix bug #46602.
29252 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
29254         * object.c: Renamed mono_metadata_section to metadata_section.
29256 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
29258         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
29259           empty array if the type is an array. Fixed.
29260           ves_icall_MonoMethod_get_base_definition: if the base method
29261           is abstract, get the MethodInfo from the list of methods of
29262           the class.
29263         * reflection.c: ParameterInfo.PositionImpl should be zero-based
29264           and it was 1-based. Fixed in mono_param_get_objects.
29266 2003-07-20  Martin Baulig  <martin@ximian.com>
29268         * mono-debug.h: Set version number to 31.
29269         (mono_debug_init): Added `MonoDomain *' argument.
29271         * mono-debug-debugger.c: Reworked the type support; explicitly
29272         tell the debugger about builtin types; pass the `klass' address to
29273         the debugger.
29275 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
29277         * image.c: Allow new metadata tables to be loaded without a
29278         warning. Also update the warning message to give the new constant value.
29279                 
29280 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
29282         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
29283         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
29284         array type representation changes.
29286 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
29288         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
29289         on Environment.Exit () call.
29291 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
29293         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
29294         requires a matching corlib.
29296 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
29298         * Changelog: My editor decided to add a CR to each line. Sorry about that.
29299           Committed again without the CRs.
29300         
29301 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
29303         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
29304           getting it from the "this" socket instance. Did not work
29305           if the socket is a subclass of Socket.
29306           Also fixed bug #35371.
29308 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
29310         * metadata.c: fixed size for TypedByRef.
29311         * loader.c: when searching for a method, consider the vararg amrker.
29312         * unicode.c, decimal.c: constify some arrays.
29314 2003-07-15  Dick Porter  <dick@ximian.com>
29316         * socket-io.c: Fixed compilation for gcc < 3.2.
29318         Fixed compilation for machines that don't have AF_INET6 (thanks to
29319         Bernie Solomon <bernard@ugsolutions.com> for that part.)
29321         Fixed compile warnings.
29322         
29323         Fixed formatting and line endings.
29325 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
29327         * socket-io.h:
29328         * socket-io.c: Added IPv6 support.
29330 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
29332         * class.c (mono_class_is_assignable_from): New function to implement
29333         the is_assignable_from logic. Used by mono_object_isinst, 
29334         Type::IsAssignableFrom () and the interpreter.
29336         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
29337         Object, even interfaces.
29338         
29339         * object.c (mono_object_isinst): Implement in terms of 
29340         is_assignable_from.
29342         * icall.c (ves_icall_type_is_assignable_from): New icall.
29344 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
29346         * domain.c (foreach_domain): fix compiler warning.
29348 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
29350         * image.c (load_metadata_ptrs): use g_strndup because strndup is
29351         not available on all plattforms
29353 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
29355         * image.h image.c: Store the metadata version string in MonoImage.
29356         * icall.c: New icall to retrieve the image version.
29357         * reflection.c (create_dynamic_image): Fill in the image version field
29358         * reflection.c (build_compressed_metadata): Use the image version
29359         from the image structure.
29361 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29363         * appdomain.c: modified comment.
29364         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
29365         That will be its last iteration when mono_gc_cleanup is called from
29366         mono_runtime_cleanup and before the domain is unloaded.
29368         Fixes bug #45962.
29370 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
29372         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
29373         attributes.
29375 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29377         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
29378         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
29379         Bernie Solomon <bernard@ugsolutions.com>.
29381 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
29383         * object.c, object.h: provide mono_object_new_fast() for faster
29384         allocation in some special cases.
29386 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
29388         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
29389         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
29391 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
29393         * threadpool.c: fix leaks.
29395 2003-07-01  Dick Porter  <dick@ximian.com>
29397         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
29398         using MonoGHashTables.  Fixes threadpool bug posted to list.
29400 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
29402         * image.h, image.c: added support to load an assembly from a byte array.
29403         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
29404         assembly bundle support.
29406 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
29408         * threadpool.c (mono_thread_pool_add): keep a reference to the
29409         AsyncResult to prevent GC
29411 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
29413         * class.c: leak fix.
29415 2003-06-25  Dick Porter  <dick@ximian.com>
29417         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
29418         for the async object, the WaitHandle object will close the handle.
29419         Fixes bug 45321.
29421 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
29423         * class.c: in mono_array_class_get (), lookup from the hash with the
29424         same type we insert: this works around a bug in
29425         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
29426         lluis. The real fix will have to wait for after the release.
29428 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
29430         * icall.c: fix memory leak when getting type members.
29432 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
29434         * reflection.c: added more pubtoken special cases.
29436 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
29438         * class.c: handle field offset correctly when class size
29439         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
29441 2003-06-20  Martin Baulig  <martin@ximian.com>
29443         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
29444         *image' field.
29446 2003-06-20  Martin Baulig  <martin@ximian.com>
29448         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
29450 2003-06-20  Martin Baulig  <martin@ximian.com>
29452         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
29453         just distinguish between variables in registers and variables at
29454         an offset relative to a register.
29456 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29458         * icall.c: #ifdef out latest changes until mcs is fixed.
29460 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29462         * icall.c: return members in metadata order.
29464 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
29466         * icall.c: avoid infinite loop in GetTimeZoneData.
29468 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
29470         * icall.c: added Marshal.Prelink/All icalls.
29472 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
29474         * object.c, object.h: fix warnings and do some overflow checking
29475         when creating arrays.
29477 2003-06-17  Dick Porter  <dick@ximian.com>
29479         * file-io.h:
29480         * file-io.c: File attributes need to be tweaked slightly when
29481         passed from the managed to the w32 world.
29483 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
29484         * profiler.h profiler-private.h profiler.c: Rework last patch
29485         based on suggestion by Paolo.
29486         
29487 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
29489         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
29490         instruction level coverage data collection.
29491         * profiler.h profiler.c (: Added new callback function which can be
29492         used by the profiler to limit which functions should have coverage
29493         instrumentation.
29494         * profiler.c (mono_profiler_load): Call g_module_build_path to
29495         generate the file name of the profiler library.
29497 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29499         * profiler.c, profiler.h, profiler-private.h: added basic block 
29500         coverage profiling API.
29502 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
29504         * reflection.c (mono_reflection_create_runtime_class): Add support
29505         for events in dynamically generated code.
29507         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
29508         not allocated.
29510 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
29512         * icall.c: when getting timezone info, return reasonable values if we
29513         can't get the actual data.
29515 2003-06-14  Dick Porter  <dick@ximian.com>
29517         * threads.c (start_wrapper): Remove the reference to the thread
29518         object in the TLS data, so the thread object can be finalized.
29519         This won't be reached if the thread threw an uncaught exception,
29520         so those thread handles will stay referenced :-( (This is due to
29521         missing support for scanning thread-specific data in the Boehm GC
29522         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
29524 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
29526         * reflection.c: ensure streams and tables are first allocated with
29527         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
29529 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29531         * icall.c: fixed GetElementType for byrefs (bug# 44792).
29533 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
29535         * reflection.c (mono_reflection_create_runtime_class): Add support for
29536         properties to dynamically created classes.
29537         * reflection.c: Fix a few places where non-MonoObjects were inserted
29538         into the tokens hashtable.
29540 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
29542         * object.c: some support to handle out of memory exceptions.
29544 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
29546         * marshal.c (mono_marshal_get_native_wrapper): support reference
29547         return types
29549 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
29551         * object.h, object.c: more portability stuff from Bernie Solomon.
29552         Unexport mono_object_allocate(). Added mono_object_unbox ().
29553         Set exitcode when an unhandled exception is thrown.
29555 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
29557         * marshal.c (mono_marshal_get_native_wrapper): use custom
29558         marshaler for return types.
29560 2003-06-10  Dick Porter  <dick@ximian.com>
29562         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
29563         ip_mreq is available
29565 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
29567         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
29568         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
29569         by Bernie Solomon <bernard@ugsolutions.com>.
29571 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
29573         * gc.c (mono_gc_init): Avoid error message on shutdown when
29574         GC_DONT_GC=1 is used.
29576         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
29577         New icall to return the GUID of a module.
29579 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
29581         * class.c: ensure instance size always includes the parent's size
29582         even whem class size is set explicitly (fixes bug#44294).
29584 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
29586         * profiler.h, profiler.c: made the simple profiler thread-safe,
29587         get more accurate timing info. Allow the loading of an
29588         externally-developed profiler module.
29590 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
29592         * marshal.c (mono_marshal_get_native_wrapper): improved
29593         class/byref arguments.
29594         (mono_marshal_get_native_wrapper): better string marshaling support.
29596 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
29598         * class.c: ensure .pack and .size are handled correctly and
29599         simplified layout of static fields.
29601 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
29603         * appdomain.c
29604         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
29606         * loader.c (mono_lookup_pinvoke_call): look for modules in the
29607         current directory (fix bug 44008)
29609 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
29611         * marshal.c (mono_marshal_get_native_wrapper): started support for
29612         custom marshalers.
29613         (mono_delegate_to_ftnptr): consider marshalling specifications
29615 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
29617         * reflection.c, reflection.h: emit custom marshal info.
29619 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29621         * object.c: free the GError.
29622         * icall.c: added CloseEvent_internal.
29623         * threads.[ch]:
29624         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
29625         call.
29627 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
29629         * loader.c (mono_method_get_signature): Add support for dynamic
29630         assemblies.
29632 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
29634         * reflection.c: fixed bug #43905.
29636 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
29638         * class.c, domain.c, icall.c, metadata.h, object.h: support for
29639         handling TypedReference and ArgIterator.
29640         * loader.c, loader.h: added function to get signature at call site.
29642 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
29644         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
29645         data readonly. Buglets and warning fixes. Some MethodSpec support.
29647 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
29649         * class.h, class.c, object.c: remove relative numbering support.
29651 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
29653         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
29654         free the string, until we get a chance to fix Gtk#
29656 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29658         * marshal.c: revert last patch.
29660 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
29662         * icall.c: updates for new mono_class_vtable() not calling
29663         the type constructor anymore.
29665 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
29667         * object.h, object.c: separate vtable creation from type
29668         initialization. Make running the .cctor thread safe.
29670 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
29672         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
29674 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
29676         * loader.c (mono_get_method): consider calling convention
29678 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
29680         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
29681         to return the invisible global type for a module.
29683         * reflection.c (mono_image_build_metadata): Emit global fields too.
29685 2003-05-20  Peter Williams  <peterw@ximian.com>
29687         * loader.c (mono_lookup_internal_call): Add a few newlines.
29689 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
29691         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
29692         literal strings.
29694         * appdomain.c (set_domain_search_path): Recalculate search path when
29695         AppDomainSetup.PrivateBinPath changes.
29697         * object.c (mono_class_compute_gc_descriptor): It turns out some
29698         parts of the class libs (like System.Thread) holds pointers to
29699         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
29700         to treat native int a pointer type here.
29701         
29702 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
29704         * appdomain.h, domain.c: add hashtable for jump target resolution.
29706 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
29708         * reflection.h reflection.c icall.c: Added new icalls 
29709         GetManifestResourceInfoInternal, GetModulesInternal and support
29710         infrastructure.
29712 2003-05-16  Dick Porter  <dick@ximian.com>
29714         * icall.c:
29715         * file-io.h:
29716         * file-io.c: Implement System.IO.MonoIO::GetTempPath
29718 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
29720         * object.c: mono_store_remote_field: little fix to previous patch.
29722 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29724         * class.c: add constructors to array classes.
29725         * icall.c: special case array construction for InternalInvoke (),
29727 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
29729         * class.h class.c reflection.c object.c: Added support for field
29730         defaults in dynamically generated classes.
29732 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
29734         * reflection.c: properly encode charset for ddlimport.
29736 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
29738         * threads.c: allow compiling without GC.
29740 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
29742         * appdomain.h, object.c, object.h, threads.c, threads.h: added
29743         handling of thread static data.
29745 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29747         * reflection.h, reflection.c: added mono_custom_attrs_free ().
29749 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
29751         * class.c (mono_array_class_get): always set the serializable flags
29752         (mono_array_class_get): always set the SEALED attribute for array types
29754 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
29756         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
29757         attributes (fix for bug 42021).
29759 2003-05-12  Dick Porter  <dick@ximian.com>
29761         * gc.c: Don't run finalizers when the finalizer thread is
29762         finishing up, because the default domain has already been
29763         destroyed.
29765 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
29767         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
29768         value is null, we should throw an exception.   This is slightly
29769         different than the other conventions used for the constructor.
29771 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29773         * socket-io.c: fixed windows build.
29775 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29777         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
29779 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
29781         * object.c (mono_string_new_wrapper): Compatibility fix for MS
29782         compilers.
29784 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
29786         * class.c (mono_class_layout_fields): Add experimental GC aware
29787         auto layout facility. Requires class library changes to work correctly.
29789         (mono_class_setup_vtable): Avoid overriding explicit interface
29790         method implementations. Fixes iface3.exe test.
29792         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
29793         object reference.
29794         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
29795         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
29797         * metadata.h: Add new type classification macro which determines
29798         whenever the type holds an object reference.
29800 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
29802         * marshal.c (mono_marshal_get_native_wrapper): cleanups
29804 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
29806         * gc.c (finalizer_thread): Work around a GC bug.
29808 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
29810         * marshal.c (emit_struct_conv): allow unions
29812         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
29814 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
29816         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
29818 2003-05-06  Martin Baulig  <martin@ximian.com>
29820         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
29822 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29824         * socket-io.c:
29825         (Select_internal): allow NULLs, don't create arrays if not needed.
29826         Coupled with Socket.cs changes.
29828         * threadpool.c:
29829         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
29830         register a finalizer for it that will close the semaphore handle. This
29831         fixes the leak and make Lupus' test run with > 4080 loops.
29833 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
29835         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
29836         Jerome Laban (bug #42287)
29838 2003-05-02  Martin Baulig  <martin@ximian.com>
29840         * debug-mono-symfile.h
29841         (MonoSymbolFile): Moved declaration into mono-debug.h.
29842         (MonoDebugMethodJitInfo): Likewise.
29843         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
29844         argument.
29845         (_mono_debug_address_from_il_offset): Take a
29846         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
29848         * mono-debug.h
29849         (MonoDebugDomainData): New struct.
29850         (mono_debug_get_domain_data): New function.
29851         (mono_debug_add_method): Take an additional `MonoDomain *'
29852         argument.
29853         (mono_debug_source_location_from_address): Likewise.
29854         (mono_debug_il_offset_from_address): Likewise.
29855         (mono_debug_address_from_il_offset): Likewise.
29857 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
29859         * reflection.c: one more check for null type in custom attrs.
29861 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29863         * reflection.c: avoid warning (comparison is always false due to limited
29864         range of data type).
29866 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29868         * icall.c: throw an exception in Type.GetField if the argument 'name'
29869         is NULL.
29871 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
29873         * reflection.c: fixed handling of enums in named arguments to custom
29874         attributes (bug #42123).
29876 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
29878         * reflection.c: use the right array element type and handle
29879         a null for a Type argument, too.
29881 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
29883         * reflection.c: handle arrays as arguments to custom attributes.
29885 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
29887         * reflection.c: handle a string value in a custom attr
29888         ctor that takes an object.
29890 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
29892         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
29893         (fix bug #42063)
29895 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
29897         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
29899 2003-04-27  Martin Baulig  <martin@ximian.com>
29901         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
29902         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
29903         MONO_DEBUGGER_EVENT_BREAKPOINT.
29904         (mono_breakpoint_trampoline_code): Removed.
29905         (mono_debugger_event_handler): The last argument is now a
29906         `guint32'.
29907         (mono_debugger_insert_breakpoint_full): Removed the
29908         `use_trampoline' argument.
29909         (mono_debugger_method_has_breakpoint): Likewise.
29910         (mono_debugger_trampoline_breakpoint_callback): Renamed to
29911         mono_debugger_breakpoint_callback(); take the method and
29912         breakpoint number as arguments.
29914 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
29916         * metadata.c: fix off by one when loading parameters attributes.
29918 2003-04-24  Martin Baulig  <martin@ximian.com>
29920         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
29922 2003-04-24  Martin Baulig  <martin@ximian.com>
29924         * mono-debug-debugger.c: Moved all code which interacts with the
29925         Mono Debugger here.
29927         * debug-mono-symfile.c: This code now just deals with the symbol
29928         file itself, the debugger code is now in mono-debug-debugger.c.
29930 2003-04-23  Martin Baulig  <martin@ximian.com>
29932         * mono-debug.c (mono_debug_source_location_from_il_offset):
29933         New method; like mono_debug_source_location_from_address(), but
29934         takes an IL offset instead of a machine address.
29936 2003-04-23  Martin Baulig  <martin@ximian.com>
29938         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
29939         `line' field; this is now computed by the debugger.
29941 2003-04-23  Martin Baulig  <martin@ximian.com>
29943         * mono-debug.[ch]: New files.  This is the new debugging interface.
29945         * mono-debug-debugger.[ch]: New files.  Moved all code which
29946         interacts with the Mono Debugger here.
29948 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
29950         * domain.c (mono_init): initialize mono_defaults.monitor_class
29952 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
29954         * reflection.c (method_encode_code): Add a spicy exception to help
29955         future compiler authors.
29957 2003-04-21  Martin Baulig  <martin@ximian.com>
29959         * icall.c
29960         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
29961         Make this work with relative pathnames; g_filename_to_uri() needs
29962         an absolute filename.
29964 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
29966         * icall.c: Track name changes in Object and ValueType.
29968 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
29970         * metadata.c (mono_type_stack_size): size should be a multiple of
29971         sizeof (gpointer)
29973 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29975         * gc.c:
29976         (internal_domain_finalize): moved into mono_domain_finalize. No need
29977         to create another thread because the finalizers will be run in the
29978         finalizer thread.
29979         
29980         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
29981         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
29982         to be run (MS does this too).
29984 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
29986         * object.c (mono_class_compute_gc_descriptor): Update comment.
29988         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
29990         * image.h: Add synchronized wrapper cache.
29992         * image.c (do_mono_image_open): Initialize cache.
29994         * reflection.c (create_dynamic_mono_image): Initialize cache.
29996 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29998         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
29999         ves_icall_System_Buffer_ByteLengthInternal.
30001 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
30003         * reflection.c: setup klass->nested_in earlier. Allow
30004         a dash in the assembly name.
30006 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
30008         * metadata.c (mono_type_to_unmanaged): dont access
30009         type->data.klass for MONO_TYPE_OBJECT
30010         (mono_type_to_unmanaged): consider System.Delegate class
30012 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
30014         * class.c: just setup supertypes in the proper place instead of
30015         initializing the full element class for arrays.
30017 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
30019         * class.c: ensure the element class of arrays is initialized.
30020         Setup the supertype info for array classes, too.
30022 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
30024         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
30026 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30028         * Makefile.am: re-added -m option when running cygpath. This way,
30029         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
30030         separator.
30031         * mono-config.c: same codepath for locating mono config file for WIN32
30032         and the rest.
30033         * assembly.c: if mono_assembly_setrootdir is called, don't override
30034         the value set.
30036 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30038         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
30039         MONO_ASSEMBLIES variable.
30041 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
30043         * icall.c: added Assembly::GetNamespaces() icall.
30045 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30047         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
30049 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
30051         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
30052         * object.c: fixed bug in the construction of vtable for proxies
30054 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
30056         * object.c (mono_array_new): Mark mono_array_new as an icall.
30058 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30060         * class.c: fixed test for public method when overriding interfaces.
30061         Closes bug #40970.
30063 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
30065         * appdomain.h, domain.c: added mono_domain_foreach() to
30066         be able to access the currently loaded appdomains.
30067         * object.c: make string interning work across sppdomains.
30068         Mark some functions for use as icalls.
30070 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
30072         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
30074         * reflection.h reflection.c: Allocate long living data using 
30075         GC_MALLOC_ATOMIC so the collector does not need to scan it.
30077         * reflection.c: Double the allocation size in streams instead of
30078         increasing it, to prevent unneccesary copying on large assemblies.
30079         
30080         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
30081         creation if the assembly does not have the Run flag set.
30083 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
30085         * class.h: avoid the C++ keywords in header files (Jerome Laban
30086         spotted and fixed this).
30088 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30090         * object.c:
30091         (mono_unhandled_exception): fill in the arguments for the
30092         UnhandledException event. Only trigger that event for the default
30093         domain (as MS does).
30095 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
30097         * object.c: Improve typed allocation stuff based on suggestions from
30098         Paolo. Also turn it on if the GC library supports it.
30100 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
30102         * object.c object.h class.h: Added experimental typed allocation
30103         facility using the interfaces in gc_gcj.h.
30105         * os/gc_wrapper.h: Added new include files.
30106         
30107 2003-04-03  Martin Baulig  <martin@ximian.com>
30109         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
30110         which is not yet enabled by default.
30112         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
30113         functions.
30114         (mono_gc_lock, mono_gc_unlock): New static functions.
30116         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
30117         functions; stop/start the world for the garbage collector.  This
30118         is using the windows API; we need to complete the SuspendThread()/
30119         ResumeThread() implementation in the io-layer to make this work on Unix.
30120         (mono_gc_push_all_stacks): New public function; tells the garbage
30121         collector about the stack pointers from all managed threads.
30123 2003-04-03  Martin Baulig  <martin@ximian.com>
30125         * object.h (MonoThread): Added `gpointer stack_ptr'.
30127         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
30129 2003-04-03  Martin Baulig  <martin@ximian.com>
30131         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
30133 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
30135         * reflection.c (typebuilder_setup_fields): Initialize field.first and
30136         field.last.
30138 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
30140         * loader.c (mono_lookup_internal_call): Report the corlib that is
30141         out of sync.
30143 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
30145         * icall.c (ves_icall_type_GetTypeCode): fixed check for
30146         System.DBNull (it's class not valuetype).
30148 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
30150         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
30151         if the array method was already assigned a token (fixes bug#40646).
30153 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
30155         * reflection.c (mono_reflection_get_type): Attempt type resolve even
30156         if no assembly is given.
30158 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
30160         * metadata.h: Added the new tables.
30162         * row-indexes.h: Added definitions for new tables.
30164         * metadata.c: Add schemas for new tables, and add support for
30165         computing the sizes of them.
30167         * class.c: Update for handling the new type cases.
30169 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
30171         * metadata.h (MONO_TYPE_IS_VOID): new macro
30173 2003-03-31  Martin Baulig  <martin@ximian.com>
30175         * threads.h (MonoThreadCallbacks): Added `thread_created'.
30177         * threads.c (mono_thread_new_init): Call `thread_created' in the
30178         mono_thread_callbacks.
30180 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
30182         * loader.h: added marshalbyrefobject_class to mono_defaults
30183         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
30184         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
30185           generation of output parameters.
30186           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
30187         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
30188           contextbound and the target object belongs to the context of the caller.
30189         * object.h: added context and unwrapped_server variables in MonoRealProxy.
30190         * object.c: Implemented support for interfaces and abstract classes
30191           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
30192           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
30194 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
30196         * class.h class.c (mono_class_is_subclass_of): New function.
30197         
30198         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
30199         routines for most common case (calls from ArrayList::ToArray).
30201         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
30202         routine so programs which call Environment::Exit() can be profiled.
30204         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
30205         Added MONO_ARCH_SAVE_REGS.
30207         * icall.c (ves_icall_type_is_subtype_of): Use new function.
30209 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
30211         * blob.h: Add a couple of new MonoType types definitions.
30213         * tabledefs.h: Add a couple of new call convs.
30215 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
30217         * reflection.h (MonoReflectionDynamicAssembly): track changes in
30218         the layout of the class.
30220         * reflection.c (alloc_table): double the size on overflow to avoid
30221         unnecessary copying.
30223         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
30224         avoid filling out metadata tables and blobs. Also set mb->ilgen to
30225         null so it can be garbage collected.
30226         
30227 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
30229         * reflection.c (mono_reflection_get_type): Return the resolved type
30230         only if it is in the assembly we searched.
30232         * reflection.c (ensure_runtime_vtable): Initialize method slots.
30234         * class.c (mono_class_setup_vtable): Set the slot of the overriding
30235         method.
30237 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30239         * appdomain.c:
30240         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
30241         the right one is 'file:///blah', but MS allows it.
30242         * assembly.c:
30243         (mono_assembly_open): allow 'file://blah'
30245         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
30247 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
30249         * socket-io.c: fixes bug #40310.
30251 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
30253         * reflection.c (mono_reflection_parse_type): handle deeply nested
30254         types correctly.
30256         * reflection.c (mono_image_create_token): Use unique token values
30257         since they will be put into a hash table.
30259         * class.c (mono_class_setup_vtable): If a method occurs in more than
30260         one place in the vtable, and it gets overriden, then change the
30261         other occurances too.
30263         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
30264         object as return type.
30266 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30268         * icall.c: Deleted "ToString" implementation for double and float
30269         because they are full implemented in managed code.
30271 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30273         * reflection.c, reflection.h: implemented and exported functions
30274         to retrieve info about custom attributes.
30276 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30278         * appdomain.c: moved Uri handling to assembly.c
30279         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
30280         work when using a file Uri in *nix and windows.
30282         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
30283         GetReferencedAssemblies.
30285 2003-03-18  Dick Porter  <dick@ximian.com>
30287         * icall.c: Rename a couple of internal calls
30289         * threads.c: Set the thread state to Stopped when a thread exits.
30290         Fixes bug 39377.
30292 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
30294         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
30295         New icall.
30297         * object.c (mono_class_vtable): fix warning.
30299 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
30301         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
30303         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
30304         memory.
30305         (method_encode_clauses): Create exception info structures in the right
30306         order.
30307         (mono_reflection_setup_internal_class): Initialize supertypes field.
30309         * class.c object.c: Handle interfaces which implement other interfaces 
30310         correctly.
30312         * class.h class.c: Move the supertypes array initialization code into 
30313         a separate function so it can be used for dynamic types too. Also call
30314         it earlier, in mono_class_init(), since it can be used before the
30315         type is initialized.
30317 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30319         * Makefile.am:
30320         * assembly.c:
30321         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
30323         * appdomain.c:
30324         * appdomain.h:
30325         * marshal.c:
30326         * object.c: remove warnings.
30328 2003-03-13  Martin Baulig  <martin@ximian.com>
30330         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
30331         (MonoDebugLexicalBlockEntry): New types.
30333         * debug-mono-symfile.c
30334         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
30336 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30338         * process.c: ret can be any non-zero value accroding to MS doc.
30340 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
30342         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
30343         fixing a warning for a miss-used prototype, would have cause
30344         random memory corruption.
30346 2003-03-07  Martin Baulig  <martin@ximian.com>
30348         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
30349         getting really annoying ....
30351 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
30353         * reflection.c (fixup_method): added support for array methods.
30355 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
30357         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
30358         (pointed out by Michael Adams).
30360 2003-03-04  Dick Porter  <dick@ximian.com>
30362         * icall.c: Temporarily reverted the Double and Single ToString()
30363         change, because it broke nunit.
30365 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
30367         * object.h, threads.h: make include files compatible with C++
30368         (patch by Jerome Laban <jlaban@wanadoo.fr>).
30370 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30372         * icall.c: Erased ToString helper functions for Double and Single.
30373         Now, that implementations ar all in managed code (Double and Single
30374         Formatters).
30376 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
30378         * appdomain.c: Added method for initializing the default context of
30379         a domain. Added internal call for getting the default context.
30380         * appdomain.h: Added context variable in MonoDomain struct.
30381         * domain.c: mono_domain_set also sets the default context of the domain
30382         * icall.c: Mapped internal method InternalGetDefaultContext.
30383         * object.c: mono_object_get_virtual_method returns always a remoting
30384         wrapper if the object is a transparent proxy.
30385         mono_runtime_invoke_array: when creating an object by calling the
30386         constructor, if the created object is a proxy, then the constructor should
30387         be called using the a remoting wrapper.
30389 2003-03-03  Dick Porter  <dick@ximian.com>
30391         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
30392         variable so it compiles on solaris.  Problem spotted by
30393         Christopher Taylor <ct@cs.clemson.edu>
30395 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30397         * appdomain.c:
30398         (get_info_from_assembly_name): don't leak value.
30400         * icall.c:
30401         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
30402         result.
30404 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
30406         * assembly.c: export mono_image_load_references ().
30407         * class.c: handle function pointers. mono_class_from_name() now
30408         supports nested type names directly.
30410 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
30412         * reflection.h reflection.c: Encode already created dynamic methods 
30413         and fields correctly as a DEF instead of a REF.
30415         * reflection.c: Get rid of the force_ref argument to 
30416         mono_image_typedef_or_ref since it was wrong in the first place.
30418         * string-icalls.c: add error checking to string constructors according
30419         to the MSDN docs.
30421         * reflection.c: Emit types in the order their TypeBuilders were 
30422         created. Previously, a new table index was assigned to each type before
30423         the tables were emitted. This was wrong because the signature blob
30424         might already refer to a type by its original table index.
30426 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
30428         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
30429         change.
30430         
30431 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30433         * Makefile.am: make assemblies dir have \ instead of / on windows.
30435 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
30437         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
30438         iterate over the NESTEDCLASS table using a linear search since the
30439         table is not guaranteed to be sorted by the secondary key.
30441         * class.c (mono_class_create_from_typedef): fixed up call to
30442         mono_metadata_nesting_typedef.
30443         
30444 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
30446         * marshal.c (mono_string_to_byvalstr): clear the memory as
30447         suggested by Jerome Laban <jlaban@wanadoo.fr>
30449 2003-02-26  Dick Porter  <dick@ximian.com>
30451         * process.c: Cope with padding in .rsrc blocks
30453 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
30455         * metadata.h: reverted the filter_len change, it breaks reflection
30456         
30457 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
30459         * metadata.h: added a new field to store the filter_len
30460         
30462 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
30464         * reflection.c: handle custom attributes for types and members
30465         created with Reflection.Emit (bug#38422).
30467 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
30469         * reflection.c: define RTSpecialName automatically for constructors for
30470         compatibility with MS.NET.
30472         * reflection.c (mono_reflection_create_runtime_class): initialize
30473         nested_in field of dynamically created classes.
30475 2003-02-22  Martin Baulig  <martin@ximian.com>
30477         * debug-mono-symfile.h: Incremented version number.
30479 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
30481         * object.h icall.c process.c: fix warnings.
30483 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
30485         * appdomain.h appdomain.c:
30486         (mono_domain_try_type_resolve): split the 
30487         name_or_tb argument into a name and a tb argument.
30488         (mono_domain_has_type_resolve): new function to check whenever the
30489         application has registered a TypeResolve event handler.
30490         
30491         * icall.c reflection.h reflection.c: move the type resolve logic into
30492         mono_reflection_get_type () so it will be invoked when 
30493         Assembly::GetType () is called.
30495         * reflection.c:
30496         (mono_reflection_get_type): renamed to get_type_internal.
30497         (mono_reflection_get_type): fixed type name generation so it works 
30498         for nested types too.
30499         (mono_reflection_get_type): call has_type_resolve () to avoid the 
30500         costly type name generation if there is no resolve event handler.
30502 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30504         * class.c, image.c: load exported types from file references.
30506 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
30508         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
30509           used to cache the managed methods used to create proxies and make 
30510           remote invocation of methods.
30511         * class.h: Added in MonoVTable a flag to indicate that a class needs 
30512           to be remotely created.
30513         * object.c: Modified the method mono_class_vtable(). It now initializes 
30514           the remote flag of the vtable. Modified mono_object_new_specific(), 
30515           so now it checks the remote flag.
30516         * icall.c: Added a couple of internal methods, one for enabling instance 
30517           creation interception for a type, and one for creating objects bypassing
30518           the remote check.
30520 2003-02-18  Martin Baulig  <martin@ximian.com>
30522         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
30523         New interncall to get a method's metadata token.
30525         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
30526         New interncall for the debugger.
30528 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
30530         * class.c (mono_class_setup_vtable): allocate supertype array
30532 2003-02-18  Martin Baulig  <martin@ximian.com>
30534         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
30536 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30538         * reflection.c:
30539         (assembly_name_to_aname): jump over unknown properties (i've found
30540         something like: 'type, assembly, version=xxx, custom=null, public...',
30541         so now will ignore custom=null and still get the rest of the values).
30543 2003-02-17  Dick Porter  <dick@ximian.com>
30545         * threads.c: Have Thread.Start() wait for a semaphore to signal
30546         that the thread has set up all its local data.  This fixes bug
30547         34323, where Abort() raced the new thread's TLS data.
30549         Also removes the handle_store() call from start_wrapper, because
30550         threads are now always created suspended and there is no longer a
30551         race between the parent and child threads to store the info.
30553 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
30555         * image.c: explain the #- heap issue in a message, hopefully
30556         avoiding FAQs on mono-list.
30558 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30560         * icall.c:
30561         (GetEntryAssembly): if the domain has not invoked
30562         AppDomain.ExecuteAssembly yet, return the assembly of the default
30563         AppDomain.
30565 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
30567         * class.c (mono_ldtoken): make it work in dynamic assemblies.
30569 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
30571         * metadata.c, reflection.c: simple speedup to type hash
30572         and equals code.
30574 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
30576         * image.c, image.h, class.c, assembly.c: move module loading
30577         to MonoImage. When loading metadata, consider alignemnet from
30578         the start of metadata, not from the metadata address in memory.
30580 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
30582         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
30583         AssemblyBuilder objects. Factored out custom attribute creation into
30584         a separate function.
30585         (create_custom_attr): new function to create custom attributes.
30587 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
30589         * Makefile.am: Got tired of typing the full pathname to pedump.
30590         Until there is another option, am installing this.
30592 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
30594         * class.c (class_compute_field_layout): always set field->parent 
30595         (mono_ldtoken): use mono_defaults.fieldhandle_class;
30597 2003-02-11  Dick Porter  <dick@ximian.com>
30599         * threads-types.h:
30600         * monitor.c: Rewrote Monitor, making lock much faster and
30601         Pulse/Wait work as specified.  Also uses much fewer handles, and only
30602         creates them as needed.
30604         * exception.c: Added SynchronizationLockException
30606         * threads.c: Deleted old Monitor implementation.  The new one is
30607         in a new file.
30609 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
30611         * class.c: handled TypedReference type code. Set the correct size for
30612         class data. Setup interface_offsets for interface classes, too.
30614 2003-02-09  Martin Baulig  <martin@ximian.com>
30616         * debug-mono-symfile.h: Reflect latest symbol writer changes.
30618 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
30620         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
30621         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
30622         * object.c: fixed mono_object_get_virtual_method () for interfaces.
30623         * verify.c: check for code that runs after the end of the method.
30625 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30627         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
30628         "System.Math::Round2".
30629         * sysmath.h: Added Floor, Round and Round2 definitions.
30630         * sysmath.c: Modified certain functions that were not 100% compliant
30631         with MS.NET (math precision) and added the implementation of Floor,
30632         Round and Round2.
30634 2003-02-07  Martin Baulig  <martin@ximian.com>
30636         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
30638 2003-02-07  Martin Baulig  <martin@ximian.com>
30640         * debug-mono-symfile.c: Reflected latest symwriter changes.
30641         (mono_debug_create_mono_symbol_file): Removed.
30642         (mono_debug_open_mono_symbol_file): Take an argument which
30643         specifies whether to create a dynamic symbol file.
30645 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
30647         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
30649 2003-02-05  Martin Baulig  <martin@ximian.com>
30651         * reflection.c (mono_image_build_metadata): Make this public,
30652         protect it against being called multiple times, don't create
30653         resources and don't build the compressed metadata here.
30654         (mono_image_create_pefile): Do this here.
30656         * icall.c
30657         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
30659 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30661         * socket-io.c: fixed bug #36322.
30663 2003-02-06  Piers Haken <piersh@friskit.com>
30665         * appdomain.[ch]:
30666         * class.h:
30667         * debug-mono-symfile.c:
30668         * icall.c:
30669         * loader.c:
30670         * mono-config.c:
30671         * monosn.c:
30672         * reflection.c:
30673         * socket-io.c: warning cleanups
30675 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
30677         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
30678         function. works like remoting invoke, but does a check for the Proxy first.
30680 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
30682         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
30684 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
30686         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
30687         array of pointers.
30688         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
30689         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
30691         * object.c (mono_store_remote_field_new): used by the new jit
30692         instead of mono_store_remote_field
30693         (mono_load_remote_field_new): used by the new jit
30694         instead of mono_load_remote_field
30696 2003-02-05  Patrik Torstensson
30698         * appdomain.c: changed unload to take the domain id instead
30699         of domain
30700         
30701         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
30704 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30706         * appdomain.c: don't look for assemblies in ApplicationBase if
30707         PrivateBinPathProbe is set.
30709 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30711         * object.c: make the first argument in main_args contain the absolute
30712         path to the assembly. Fixes bug #37511.
30714 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30716         * icall.c: get correct UTC offset for countries not using daylight
30717         time saving. Fixes bug #30030.
30719 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30721         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
30722         and 1 are the family).
30724 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
30726         * icall.c (ves_icall_InternalExecute): removed wrong assertion
30728         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
30730 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
30732         * reflection.c: added support for SignatureHelper tokens, which is
30733         needed by the Calli opcode.
30735         * reflection.h: track changes to SignatureHelper class.
30737         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
30739 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30741         * appdomain.c: fixed loading assemblies from PrivateBinPath.
30743 2003-02-03  Patrik Torstensson
30744         * appdomain.[c|h], domain.c : 
30745          - Added support for getting a domain via domain id
30746          - Support for setting and getting domain from System.AppDomain 
30747            (used in cross appdomain channel)
30748          - Added support for get/set for a MonoAppContext on a thread 
30749            (Context class in System.Runtime.Remoting.Contexts),
30750          - Removed hack in Get/SetData and ExecuteAssembly.
30751         
30752         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
30753         the managed world to get control when a proxy is created.
30755         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
30756         
30757 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
30759         * icall.c
30760         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
30761         Populate the codebase field as well.
30763 2003-02-02  Martin Baulig  <martin@ximian.com>
30765         * debug-mono-symfile.c
30766         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
30767         (mono_debug_symfile_add_method): Allow interncalls.
30769 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30771         * icall.c: throw parse exception if strtod fails or the string is empty.
30773 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
30775         * marshal.c: handle object type separately from defined
30776         class types.
30778 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
30780         * marshal.c: handle NATIVE_LPSTR for strings when it's
30781         explicitly specified.
30783 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
30785         * reflection.c, reflection.h, icall.c: setup the reflection
30786         handle cache for ModuleBuilders and AssemblyBuilders.
30788 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
30790         * reflection.c (reflection_methodbuilder_to_mono_method): set
30791         pinvoke flag
30793 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30795         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
30797 2003-01-29  Dick Porter  <dick@ximian.com>
30799         * threads.c: No need for the fake_thread kludge now that Thread
30800         doesn't run a class constructor
30801         
30802 2003-01-29  Dick Porter  <dick@ximian.com>
30804         * threads.c: Use g_direct_hash instead of the rather bogus
30805         g_int_hash
30807 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
30809         * marshal.c (mono_marshal_get_native_wrapper): add check for null
30810         (fix pinvoke12.exe)
30811         (mono_marshal_get_struct_to_ptr): generate valid IL code
30812         (mono_marshal_get_ptr_to_struct): generate valid IL code
30813         (*): correctly set sig->pinvoke, we need to memdup the signature
30814         to do that
30816 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30818         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
30819         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
30821 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
30823         * profiler.c: provide more callers information.
30825 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
30827         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
30829         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
30831         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
30833 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30835         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
30836         exception instead of going into an infinite loop on dates which it 
30837         can't yet handle.
30839         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
30840         out-of-range exception if needed.
30842         * class.c (mono_class_setup_vtable): allow a virtual method to provide
30843         an implementation for an interface method and to override an inherited
30844         method at the same time. 
30845         Imagine a scenario when a virtual method is used to override a
30846         virtual abstract method in a parent class, and this same method 
30847         provides an implementation for an method inherited from an interface. 
30848         In this case, the interface resolution code will set im->slot, which 
30849         means that the virtual method override pass will skip this method 
30850         which means a pointer to the abstract method inherited from the parent
30851         will remain in the vtable of this non-abstract class.
30853         * class.c: (mono_class_setup_vtable): continue search for a real 
30854         method if only an abstract method is found.     
30856 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
30858         * reflection.c: add size to encoding for ByValStr and ByValArray
30859         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
30861 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30863         * class.c (mono_class_setup_vtable): pass the override info as an
30864         argument.
30866         * class.c (mono_class_setup_vtable): set the slot of overriding methods
30867         correctly.
30868         
30869         * reflection.c (ensure_runtime_vtable); add support for method 
30870         overrides.
30871         
30872 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30874         * reflection.c (resolution_scope_from_image): Hack to work to work with
30875         dynamic assemblies.
30877         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
30878         added a 'force_ref' argument to force this function to allways return 
30879         a TypeRef. This is needed by mono_image_get_memberref_token ().
30880         
30881 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30883         * reflection.c (mono_image_get_type_info): interfaces really don't have
30884         a parent.
30886         * reflection.c (mono_image_basic_init): fill out missing fields of
30887         image structure.
30889         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
30890         dynamic assemblies. This is required so dynamic assemblies show up in
30891         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
30892         Type::GetType() etc. This is consistent with MS behaviour.
30894         * image.c image.h reflection.c: add newly created classes to the name 
30895         cache so mono_class_get () will find them.      
30897 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30899         First part of changes to get IKVM.NET running under mono.
30900         
30901         * appdomain.h, appdomain.c: added new function 
30902         mono_domain_try_type_resolve() which will emit TypeResolve events. 
30903         This function will call AppDomain::DoTypeResolve to do the actual work.
30905         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
30906         moved existing code dealing with dynamic tokens to a new function 
30907         called mono_reflection_lookup_dynamic_token (). This function will 
30908         raise TypeResolve events when appropriate. Since reflection.c is not 
30909         part of libmetadata, a new hook function called 
30910         mono_lookup_dynamic_token() is added to class.c which will call this.
30912         * assembly.h assembly.c: make the invoke_load_hook function public,
30913         so it can be called for dynamic assemblies.
30915         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
30917         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
30918         type isn't found.
30920         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
30921         MonoGHashTable, since it contains pointers to objects which the GC 
30922         needs to track.
30924         * assembly.c (search_loaded): remove unused variable.
30925         
30926 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
30928         * object.c: fixed issue exposed by gcc-generated IL programs
30929         that use RVA data for pointers.
30931 2003-01-25  Martin Baulig  <martin@ximian.com>
30933         * threads.c (start_wrapper): Moved the initialization of
30934         `start_func' above the mono_new_thread_init() call to which we
30935         pass it as argument.
30937 2003-01-24  Martin Baulig  <martin@ximian.com>
30939         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
30940         the MonoThread pointer.
30942 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
30944         * icall.c: Rename `PowImpl' to Pow.
30946 2003-01-23  Dick Porter  <dick@ximian.com>
30948         * threads.c (start_wrapper): Create a Thread object if needed, so
30949         the Main() thread can do the class initialisation in a subthread
30950         that has been set up to allow managed code execution.
30952         Pass the thread ID instead of the MonoThread pointer to the thread
30953         start and attach callbacks.  This change is required, because the
30954         jit thread start callback must be called _before_ the Thread
30955         object can be created.
30956         
30957         (mono_thread_init): Removed much object creation code that is no
30958         longer needed.  No managed code is called from here now.
30960         * object.c (mono_runtime_exec_managed_code): Create a subthread
30961         for Main, and call back to the runtime to use it.
30962         Set the exit code when Main exits.
30964         * gc.c: Make sure domain finalisation happens in a subthread.
30965         Re-enable threaded GC, fixing bug 31333 (again).
30967         * environment.c: System.Environment internall calls (so far just
30968         ExitCode is here, the others are still in icall.c)
30970         * appdomain.c (mono_runtime_cleanup): All threads running managed
30971         code should have finished before mono_runtime_cleanup() is
30972         reached, so no need to clean up threads.
30974 2003-01-22  Martin Baulig  <martin@ximian.com>
30976         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
30977         `gpointer func' arguments.      
30978         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
30979         but added `MonoThread *thread' argument.
30980         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
30982         * threads.c (mono_new_thread_init): Added `gpointer func' argument
30983         and pass it to the mono_thread_start_cb callback.
30984         (mono_install_thread_callbacks): New public function to install a
30985         set of callbacks which are set by the debugger.
30986         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
30988 2003-01-22  Martin Baulig  <martin@ximian.com>
30990         * Makefile.am: Install debug-mono-symfile.h.
30992 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
30994         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
30996 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
30998         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
30999         * class.c (mono_ptr_class_get): correctly set access levels of pointers
31000         (mono_array_class_get): correctly set access levels of arrays
31002 2003-01-20      Patrik Torstensson
31003         * image.h (MonoAssemblyName): changed major, minor, build, revision
31004         from signed to unsigned.
31006 2003-01-20  sean kasun <skasun@azstarnet.com>
31008         * reflection.c (load_cattr_value): Now this handles
31009         MONO_TYPE_SZARRAY.  Fixes bug #35629
31011 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
31013         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
31014         integer value
31016 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31018         * decimal.c: fixed bug #26056.
31020 2003-01-17  Martin Baulig  <martin@ximian.com>
31022         * gc.c: Raise an ExecutionEngineException instead of using g_error().
31024 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31026         * exception.[ch]:
31027         (mono_get_exception_type_initialization): new function.
31029         * object.c: throw a TypeInitializationException when an exception is
31030         thrown invoking the class constructor.
31032 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31034         * reflection.c: fixed attribute reading.
31036 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31038         * icall.c:
31039         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
31040         provided, look for the type in the calling assembly and then in
31041         mscorlib; if the assembly name is provided, only try that one.
31043 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
31045         * object.c: register the vtable before there is a chance it's
31046         queried again recursively.
31048 2003-01-13  Duncan Mak  <duncan@ximian.com>
31050         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
31051         gc-internal.h. 
31052         
31053 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
31055         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
31057 2003-01-11  Martin Baulig  <martin@ximian.com>
31059         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
31060         this to 20 for the release.
31062 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
31064         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
31066         * loader.c (mono_method_get_marshal_info): bug fix
31068         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
31069         structures with explicit layout
31071 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
31073         * profiler.c: made the output more readable (and sorted). 
31074         Added caller information for the allocation profiler.
31076 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
31078         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
31080 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31082         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
31083         to get value types.
31084         
31085 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
31087         * object.c, profiler.h, profiler.c, profiler-private.h:
31088         Added object allocation profiler.
31090 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
31092         * reflection.h, reflection.c: handle global methods.
31093         Compress blob entries.
31095 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
31097         * marshal.c: fix compilation.
31099 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
31101         * loader.c (mono_method_get_marshal_info): impl.
31103         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
31105 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31107         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
31108         for reference types.
31110 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
31112         * loader.c: fixed off by one error in loaded parameter names.
31114 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
31116         * marshal.c (mono_marshal_get_icall_wrapper): like
31117         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
31118         instead of a MonoMethod.
31120 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31122         * decimal.c: fixed bug #36537.
31124 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
31126         * marshal.c: throw a missing method exception if a
31127         P/Invoke method is not found.
31129 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
31131         * icall.c: allow a null this for constructors.
31133 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
31135         * icall.c: raise the proper exceptions if the arguments to the
31136         internal Invoke are incorrect.
31138 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
31140         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
31142 2003-01-03  Martin Baulig  <martin@ximian.com>
31144         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
31146 2002-12-31  Martin Baulig  <martin@ximian.com>
31148         * debug-mono-symfile.c: Completely rewrote the type section.
31149         Instead of using individual malloc()ed fields, we use one big
31150         continuous memory area and offsets into this area.
31151         See the comments in the source code for details.
31153 2002-12-30  Martin Baulig  <martin@ximian.com>
31155         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
31157 2002-12-30  Martin Baulig  <martin@ximian.com>
31159         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
31160         line number table in this data blob instead of using an external
31161         pointer.
31163 2002-12-28  Martin Baulig  <martin@ximian.com>
31165         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
31167 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
31169         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
31170         as a boxed return type.
31172 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
31174         * appdomain.c
31175         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
31176         g_build_filename to properly get separators on the filename created.
31178         * object.h: Small change, introduce MonoMarshalByRefObject to
31179         track the layout of that structure in the C# universe as we make
31180         changes there.
31182 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
31184         * object.c: removed assert to allow static fields on interfaces.
31185         * loader.c: a TypeSpec may be used for any type, not just arrays.
31187 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
31189         * class.c, class.h: added mono_class_array_element_size ().
31190         Ignore static methods in interfaces.
31192 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31194         * threads.c: fixed the build under cygwin.
31196 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
31198         * reflection.c: handle nullref constants. Allocate keys for
31199         reflection handles with the GC.
31201 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
31203         * threads.c, threads.h: added mono_thread_get_abort_signal()
31204         to get a suitable signal for thread abort.
31206 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
31208         * metadata.c: fix handling of ExportedType table.
31210 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31212         * icall.c: added WriteWindowsDebugString internal call.
31214 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31216         * reflection.h: added fields to match C# implementation.
31218 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31220         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
31222 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
31224         * gc.h, gc-internal.h: Rename header for GC internal calls to
31225         gc-internal.h from gc.h as to not clash with Boehm GC having its
31226         header installed as <gc.h> in outside include paths.
31227         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
31228         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
31230 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31232         * icall.c: assign minor, build and revision in FillName.
31234 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
31236         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
31237         Added support for running code generated by Reflection.Emit.
31239 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31241         * appdomain.c: check for NULL argument in LoadFrom.
31243 2002-12-10  Dick Porter  <dick@ximian.com>
31245         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
31247 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31249         * appdomain.c: fix buglet when building exe file name.  Handle full
31250         assembly name (needed after latest changes to AssemblyName).
31251         * image.c:
31252         (mono_image_close): free some hashtables.
31254 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
31256         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
31257         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
31258         on some systems (redhat 7.3) 
31260 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
31262         * threads.c: delete the critical section of a sync block,
31263         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
31265 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
31267         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
31269 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31271         * appdomain.[ch]: handle the assembly preload event to try loading the
31272         assemblies using the paths we have in the current domain.
31274         * assembly.[ch]: created an assembly preload hook that is called to try
31275         loading the assembly by other means that the ones provided here.
31277         * domain.c: initialize the domain search path.
31279         From now on, assemblies (TODO: except corlib and System) are loaded
31280         according to these rules when using mono_assembly_load ():
31282                 1. It tries to load the assembly from the ApplicationBase
31283                 of the current domain appending .dll and .exe (TODO: have to
31284                 try loading from name/name.dll and name/name.exe).
31286                 2. It tries the search path specified in PrivateBinPath for the
31287                 current domain (if any).
31289                 3. Previous behavior.
31291 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
31293         * icall.c: implemented GetInterfaceMap() related icall.
31294         * domain.c, loader.h: load MethodInfo in mono_defaults.
31296 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
31298         * gc.c: disable the finalizer thread for now, untill all the issues
31299         with it are resolved.
31301 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
31303         * string-icalls.c: handle embedded nulls in string ctor when the
31304         length is specified.
31306 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
31308         * class.c: look for explicit interface implementation in parent
31309         classes, too.
31311 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
31313         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
31315 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
31317         * gc.c: protect handles with a critical section.
31319 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31321         * icall.c:
31322         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
31323         parameters. If no assembly specified, try getting the type from all
31324         the assemblies in the current domain, else, load the assembly and get
31325         the type from it.
31327 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31329         * marshal.c: applied patch from Aleksey Demakov that fixes
31330         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
31332 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31334         * icall.c: fixed get_location.
31336 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
31338         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
31339         declarations to make it work with older gcc. 
31341         * loader.c (mono_get_method): set signature->pinvoke for native calls
31343 2002-11-20  Dick Porter  <dick@ximian.com>
31345         * threads.c (mono_thread_init): Set the main thread's handle
31347 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
31349         * gc.c: allow compilation without GC support. Changed to match the
31350         mono coding style.
31352 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
31354         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
31356 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
31358         * reflection.c: set a public key token on the core assemblies.
31360 2002-11-18  Dick Porter  <dick@ximian.com>
31362         * threads.c: Split out some thread initialisation so that other
31363         files can set the start callback function.
31365         * gc.c: Run finalisers in a separate thread, to avoid stack
31366         overflow.  Fixes bug 31333.
31368         * appdomain.c: Set up GC finalisation thread.
31370         * reflection.c: 
31371         * object.c: 
31372         * domain.c: Use gc.h macros for GC_malloc
31373         
31374 2002-11-15  Dick Porter  <dick@ximian.com>
31376         * threadpool.c: 
31377         * threads.c:
31378         * appdomain.c: Removed mono_runtime_init_with_attach(),
31379         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
31380         merging the extra parameter with the existing function.  Removed
31381         unneeded code in mono_thread_attach().
31383 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
31385         * image.c (mono_image_loaded_by_guid): a method to get loaded
31386         images by guid. 
31387         (load_metadata_ptrs): we store the guid as string.
31389 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
31391         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
31393         * metadata.c (mono_guid_to_string): imported method form Zoltan
31394         Varga (slightly modified)
31396         * assembly.c (mono_assembly_open): load precompiled code
31398         * loader.h (MonoMethod): we store the method token for use in the
31399         aot compiler. 
31401 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31403         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
31404         the hook function called when an assembly is loaded.
31405         
31406         * domain.c: Modified file.
31407         (mono_domain_assembly_load): removed hash table insertion of assemblies.
31409         Fixes bug #33196.
31411 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
31413         * reflection.c: Map PEFileKind to the value expected by the WinNT
31414         image loader. 
31416 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31418         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
31419         Read until the buffer is filled completely.
31421 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31423         * icall.c: implemented MonoType.InternalGetEvent ().
31425 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31427         * appdomain.c: implemented InitAppDomainSetup. Delayed
31428         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
31429         the entry_assembly.
31431         * assembly.c: base_dir is now an absolute path ending with
31432         G_DIR_SEPARATOR.
31434         * icall.c: modified get_location according to the above changes.
31436         * object.c: init AppDomain.SetupInformation for the default domain after
31437         we have the entry assembly.
31439         * domain.c: when unloading a domain, setup = NULL.
31441 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
31443         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
31445 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
31447         * object.h, object.c: introduced mono_object_get_virtual_method ()
31448         to lookup the method invoked on an object when a callvirt is done on
31449         a method.
31450         * icall.c: make MethodInfo::Invoke() always do a virtual call.
31452 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31454         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
31455         current domain when loaded an assembly and failed to load it.
31457         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
31459 2002-10-31  Dick Porter  <dick@ximian.com>
31461         * icall.c: 
31462         * file-io.h: 
31463         * file-io.c: Return the error status in a parameter, as the
31464         GetLastError() value has long since been blown away if we try and
31465         look it up in a subsequent internal call invocation.  Delete the
31466         GetLastError() internal call, because it's useless.
31468 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
31470         * class.[ch]: added cast_class to fix bug 29517
31472 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
31474         * marshal.c: create valid IL code in the filter clause:
31475         the new JIT is less forgiving:-)
31477 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31479         * icall.c: removed get_property internal call.
31481 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
31483         * appdomain.h domain.c: Added an ID to appdomains.
31484         
31485         * threads.c threads.h icall.c: Implement icall
31486         Thread:GetDomainID(), and remove unused icall 
31487         CurrentThreadDomain_internal.
31489 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31491         * icall.c: Don't recurse through the base types in GetConstructor.
31492         Fixes bug #32063. 
31494 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
31496         * mempool.h, mempool.c: added mono_mempool_empty() and
31497         mono_mempool_stats().
31499 2002-10-23  Dick Porter  <dick@ximian.com>
31501         * file-io.c: 
31502         * file-io.h: 
31503         * icall.c: Added MonoIO.GetFileType internal call
31505 2002-10-17  Dick Porter  <dick@ximian.com>
31507         * appdomain.c (mono_runtime_cleanup): Don't signal the async
31508         delegate semaphore before waiting for all threads to finish,
31509         because new threads can also call async delegates.  Fixes bug
31510         32004.
31512         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
31513         of 3 seconds, in case another async job is queued.  (This part is
31514         needed because the bug fix reintroduced the 3s exit lag.)  This
31515         makes the mono_runtime_shutdown flag superfluous.
31517 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
31519         * reflection.c: include ehader size in method section headers.
31520         Really check for suplicated modules entries.
31522 2002-10-17  Martin Baulig  <martin@gnome.org>
31524         * debug-mono-symfile.c: Added back support for locals.
31526 2002-10-14  Martin Baulig  <martin@gnome.org>
31528         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
31529         MONO_TYPE_VOID.
31531 2002-10-14  Martin Baulig  <martin@gnome.org>
31533         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
31534         mono_class_get() instead of looking in the class cache. 
31536 2002-10-13  Martin Baulig  <martin@gnome.org>
31538         * debug-mono-symfile.c: Set version number to 28, include the
31539         signature in method names.
31541 2002-10-13  Martin Baulig  <martin@gnome.org>
31543         * debug-mono-symfile.h: Set version number to 27.
31545 2002-10-11  Martin Baulig  <martin@gnome.org>
31547         * gc.c: Don't register/unregister NULL pointers as disappearing links.
31549 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31551         * metadata.c, metadata.h: added helper function to allocate signatures.
31553 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31555         * icall.c: added internal call to get the location of machine.config.
31557 2002-10-08  Martin Baulig  <martin@gnome.org>
31559         * debug-mono-symfile.c: Ignore classes with a pending init for the
31560         moment.
31562 2002-10-03  Dick Porter  <dick@ximian.com>
31564         * threads.c: Freebsd pthread_t is a pointer
31566 2002-10-03  Dick Porter  <dick@ximian.com>
31568         * socket-io.c: Implemented GetHostName_internal
31570 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31572         * mono-config.c:
31573         (mono_config_parse_file): don't leak the text.
31575 2002-10-02  Martin Baulig  <martin@gnome.org>
31577         * debug-mono-symfile.c: Added support for methods.
31579 2002-10-01  Martin Baulig  <martin@gnome.org>
31581         * debug-mono-symfile.c: Don't emit methods and line numbers for
31582         the dynamic symbol file, just write the type table.  We can easily
31583         have an external helper program which creates a symbol file for an
31584         IL file.        
31586 2002-10-01  Dick Porter  <dick@ximian.com>
31588         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
31589         Only add the handle to the cleanup array when we're about to
31590         launch the thread.  Bug 31425 deadlocked when the test was run on
31591         mono under w32.
31593 2002-10-01  Martin Baulig  <martin@gnome.org>
31595         * debug-mono-symfile.c: Added support for properties.
31597 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31599         * reflection.c: unaligned store fix from Mark Crichton
31600         <crichton@gimp.org>.
31602 2002-09-27  Martin Baulig  <martin@gnome.org>
31604         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
31605         New interncall.
31607 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
31609         * assembly.h, assembly.c: use a sane API to hook into the assembly
31610         loading process instead of a useless special-purpouse hack
31611         (ngen needs a hook, too, for example).
31613 2002-09-27  Dick Porter  <dick@ximian.com>
31615         * threads.c (mono_thread_init): Call GetCurrentProcess() so
31616         io-layer can set up some process handle info.  Not needed on w32,
31617         but doesn't hurt either.
31619         * process.c: Pass the program name in the second parameter to
31620         CreateProcess, so the path is searched.  Include the working
31621         directory. Implemented process name, process enumeration, and some
31622         process detail internal calls.
31623         
31624         * icall.c: Added internal calls for process lookup, and some
31625         process details
31627 2002-09-26  Martin Baulig  <martin@gnome.org>
31629         * assembly.c (mono_install_open_assembly_hook): New global
31630         function to install a function to be invoked each time a new
31631         assembly is loaded.
31632         (mono_assembly_open): Run this callback function if set.
31634         * debug-mono-symfile.c: Put back line numbers for the dynamic
31635         symbol file and also record the .il file as source file.  This
31636         allows us to install the temporary symbol file as `file.dbg' just
31637         like a compiler-generated one.
31639 2002-09-26  Nick Zigarovich <nick@chemlab.org>
31641         * Corrected typo in gc.c (BOHEM vs BOEHM).
31643 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31645         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
31646         GetProperties. Also avoid calling g_slist_length in GetProperties and
31647         GetMethods.
31649 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
31651         * reflection.c: avoid unaligned stores (bug spotted by
31652         Mark Crichton  <crichton@gimp.org>).
31654 2002-09-25  Martin Baulig  <martin@gnome.org>
31656         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
31657         instead of guint64 for addresses and added prologue/epilogue info.
31659 2002-09-25  Martin Baulig  <martin@gnome.org>
31661         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
31662         store line number info.  For the dynamic symbol file, we only need
31663         to provide the JIT generated dynamic line number info for the dynamic
31664         symbol file.
31666 2002-09-25  Martin Baulig  <martin@gnome.org>
31668         * debug-mono-symfile.h: Incremented version number.
31670 2002-09-24  Martin Baulig  <martin@gnome.org>
31672         * class.c (mono_debugger_class_init_func): New global function
31673         pointer variable.
31674         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
31675         call it.
31677         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
31678         function.  This is called via the mono_debugger_class_init_func
31679         hook to add all types to the dynamic type table.
31680         (ves_icall_MonoDebugger_GetType): New interncall to get a class
31681         from its metadata token.
31683         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
31684         New interncall for the debugger.
31686 2002-09-24  Nick Drochak <ndrochak@gol.com>
31688         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
31689         before using it in case it is null.
31690         
31691 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31693         * metadata.c: allow custom modifiers in local var signatures
31694         (bug spotted by Zoltan Varga).
31696 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
31698         * class.c: deal with the <Module> class that may have a NULL vtable.
31699         Eliminate warnings.
31701 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31703         * image.c, image.h: more strong name helpers.
31704         * monosn.c: more work: convert pem keys to cryptoapi format.
31706 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
31708         * string-icalls.c: speedup IndexOf.
31710 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31712         * icall.c: updates from Zoltan.2.Varga@nokia.com.
31714 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
31716         * icall.c: cleanup: use mono_object_domain ().
31718 2002-09-23  Martin Baulig  <martin@gnome.org>
31720         * debug-mono-symfile.c: Improved type support.
31722 2002-09-22  Martin Baulig  <martin@gnome.org>
31724         * debug-mono-symfile.c: Added support for reference types and strings.
31726 2002-09-22  Martin Baulig  <martin@gnome.org>
31728         * debug-mono-symfile.c: Started to work on the type table.
31730 2002-09-21  Martin Baulig  <martin@gnome.org>
31732         * debug-mono-symfile.c: Largely reworked the symbol table format.
31733         The symbol table is now incrementally updated each time a new
31734         method is added.  We're now also using our own magic and version
31735         so that you don't need to recompile all your classes if the
31736         dynamic table changes.
31737         (mono_debug_update_mono_symbol_file): Removed.
31738         (mono_debug_symfile_add_method): New function to add a method.
31740 2002-09-21  Martin Baulig  <martin@gnome.org>
31742         * icall.c
31743         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
31744         New interncall.
31746         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
31747         New interncall to get a method from its metadata token.
31749 2002-09-21  Martin Baulig  <martin@gnome.org>
31751         * debug-mono-symfile.c: Create type table.
31753 2002-09-20  Martin Baulig  <martin@gnome.org>
31755         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
31757 2002-09-20  Martin Baulig  <martin@gnome.org>
31759         * debug-mono-symfile.c: Provide information about params and locals.
31761 2002-09-20  Martin Baulig  <martin@gnome.org>
31763         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
31764         New interncall.
31766         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
31767         interncall to get a method from its metadata token.
31769 2002-09-20  Martin Baulig  <martin@gnome.org>
31771         * debug-mono-symfile.c: Added a few checks for method->header
31772         being non-NULL.  This should never happen, but for the moment
31773         let's use a g_warning() rather than a g_assert().
31775 2002-09-19  Mark Crichton  <crichton@gimp.org>
31777         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
31778         even if support for it isn't present.  Added an #ifdef to fix this.
31780         * socket-io.c: Added checks back for Solaris support.
31782 2002-09-19  Martin Baulig  <martin@gnome.org>
31784         * debug-mono-symfile.c (read_string, write_string): Reflect latest
31785         changes in the symbol file format.
31787 2002-09-18  Martin Baulig  <martin@gnome.org>
31789         * debug-mono-symfile.c: Set version number to 21.
31791 2002-09-18  Dick Porter  <dick@ximian.com>
31793         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
31794         on netbsd.  Fixes bug 30051.
31796 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31798         * reflection.c:
31799         (set_version_from_string): little fix.
31801 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31803         * monosn.c, Makefile.am: added strong name utility.
31804         * reflection.h, reflection.c: implemented delayed signing,
31805         locale, version and hash id assembly attributes.
31807 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
31809         * loader.c, metadata.c: load param attributes in signatures.
31811 2002-09-16  Martin Baulig  <martin@gnome.org>
31813         * debug-mono-symfile.c: Added string table with all method names.
31815 2002-09-14  Martin Baulig  <martin@gnome.org>
31817         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
31818         fast method lookup.
31820 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31822         * reflection.c: record the public key token of referenced assemblies.
31824 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31826         * image.c, image.h: added functions to get the strong name and the
31827         public key of an assembly.
31828         * pedump.c: use them.
31830 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
31832         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
31834 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
31836         * marshal.c (mono_marshal_get_managed_wrapper): Added
31837         MONO_TYPE_BOOLEAN 
31839 2002-09-11  Martin Baulig  <martin@gnome.org>
31841         * gc.c: Call GC_unregister_disappearing_link() on all links when
31842         finalizing them, this is necessary to aviod a crash in boehm's
31843         finalize handler.
31845 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31847         * gc.c: handle GetTarget for finalized objects spotted and fixed by
31848         nick@chemlab.org.
31850 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
31852         * icall.c: implemented MonoType::Module.
31853         * reflection.c, reflection.h: mono_module_get_object () from
31854         Tomi Pakarinen <tomi.pakarinen@welho.com>.
31856 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
31858         * icall.c: ignore overridden methods in GetMethods ().
31859         Fix for FieldInfo::SetValue().
31860         * object.c: handle float/double in runtime invoke.
31862 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
31864         * object.c: allow a constructor to be called again on an object.
31866 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31868         * class.h, class.c: move field layout code to it's own function and
31869         export it. Get an interface id earlier. Move fields in MonoClass
31870         so they are more cache friendly and align the bitfields.
31871         * loader.c: temporary handle get_param_names() for a runtime method.
31872         * reflection.c, reflection.h: more code to handle runtime creation of
31873         types.
31875 2002-09-09  Martin Baulig  <martin@gnome.org>
31877         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
31878         signature with the pinvoke field being set for the actual call.
31880 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31882         * icall.c: removed some unused icalls. Start of map of glib charsets
31883         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
31885 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
31887         * debug-helpers.c: break infinite loop (found and fixed by
31888         Holger Arnold <harnold@gmx.de>).
31890 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31892         * icall.c: target may be null in create_delegate.
31894 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31896         * marshal.c: handle a boolean return type.
31898 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31900         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
31902 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
31904         * gc.c: fix weakreferences.
31906 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
31908         * icall.c: added icall to get default codepage.
31910 2002-09-03  Dick Porter  <dick@ximian.com>
31912         * threads.h: 
31913         * threads.c: Use MonoThread instead of MonoObject where
31914         apropriate.
31916         Store running thread objects in a hash table, so that we have all
31917         the info to hand when waiting for them to finish
31918         (means we don't need OpenThread() any more, so mingw builds should
31919         be fully functional again.)
31921         * verify.c:
31922         * object.h: Added thread ID to MonoThread
31924 2002-09-03  Martin Baulig  <martin@gnome.org>
31926         * icall.c (System.Reflection.Assembly::get_location): New interncall.
31928 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31930         * icall.c: fixed leak in get_temp_path. Thanks lupus.
31932 2002-09-03  Martin Baulig  <martin@gnome.org>
31934         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
31935         argument to store the end address of the disassembled instruction.
31937         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
31938         here from debug-symfile.h.
31939         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
31940         JIT into this struct.
31941         (MonoSymbolFile): Added `char *image_file' field.
31942         (MonoDebugGetMethodFunc): Removed.
31943         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
31944         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
31945         (mono_debug_find_method): New method.
31947         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
31948         create a full symbol file.
31949         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
31950         and static symbol files.
31951         (mono_debug_find_method): The symbol file keeps an internal method hash,
31952         call this to get a MonoDebugMethodInfo from a MonoMethod.
31954         * debug-symfile.[ch]: Removed.
31956 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
31958         * image.c (do_mono_image_open): Remove linker version check.
31960 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
31962         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
31963         wrappers for instance methods.
31964         
31965 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31967         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
31969 2002-08-28  Dick Porter  <dick@ximian.com>
31971         * Makefile.am: Export HOST_CC for w32 builds
31973 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31975         * file-io.c process.c: MonoString are null terminated, no
31976         need for mono_string_to_utf16() anymore.
31978 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31980         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
31982 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
31984         * icall.c, reflection.h: speedup System.MonoType.
31986 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31988         * reflection.c: allow null as the value of a string argument in
31989         custom attributes constructors.
31991 2002-08-27  Martin Baulig  <martin@gnome.org>
31993         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
31994         `trampoline_address' field.
31996 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
31998         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
31999         check (fixes bug #29486) 
32001 2002-08-27  Martin Baulig  <martin@gnome.org>
32003         * debug-mono-symfile.c: Changed the file format in a way that allows us
32004         open it read-only and to use a specially malloced area for all the
32005         dynamic data.  We can now also generate a symbol file on-the-fly if we're
32006         debugging IL code and there is no MCS generated symbol file for it.
32008 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32010         * object.c: added a define for a good string and array
32011         creation speedup (not enabled by default because we need to deal with
32012         the synch stuff).
32014 2002-08-26  Martin Baulig  <martin@gnome.org>
32016         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
32017         function to create a dynamic symbol file.  This is used by the
32018         debugger to create a symbol file for IL code on-the-fly.
32020 2002-08-26  Martin Baulig  <martin@gnome.org>
32022         * loader.c (mono_lookup_pinvoke_call): Include the error message
32023         from g_module_error() in the error message.
32025 2002-08-24  Martin Baulig  <martin@gnome.org>
32027         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
32028         function to update the symbol file.  The symbol file is mmap()ed
32029         writable, but private.  This allows us to install the symbol file
32030         together with the assembly.
32032 2002-08-24  Martin Baulig  <martin@gnome.org>
32034         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
32035         but they can read the new symbol file format which mcs is now creating.
32037         * debug-symfile.c (mono_debug_find_source_location): Moved to
32038         debug-mono-symfile.c; this is now operating on the new symbol file.
32040 2002-08-23  Martin Baulig  <martin@gnome.org>
32042         * debug-helpers.c (mono_method_desc_from_method): New function to get
32043         a MonoMethodDesc from a MonoMethod.
32045 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
32047         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
32048         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
32050 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
32052         * string-icalls.[ch]: make helper methods static.
32054 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32056         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
32057         types to it and to SetValueInternal.
32059         * object.c: Moved handle_enum label to its proper place. This was the
32060         f... bug! ;-)
32062         This time i compiled mcs and gtk-sharp and they both work.
32064 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32066         * icall.c: reverted partially my previous patch until 
32067         object.c:set_value handles enums correcly.
32069 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32071         * icall.c:
32072         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
32073         (ves_icall_System_Environment_get_MachineName): removed warning when
32074         compiling under cygwin.
32076 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32078         * object.c: fixed field_get_value() for reference types.
32080 2002-08-22  Dick Porter  <dick@ximian.com>
32082         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
32083         Don't free a buffer while it's still needed.  Patch from Jonathan
32084         Liger <Jonathan.liger@wanadoo.fr>
32086 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
32088         * icall.c (ves_icall_System_Environment_get_Platform): Add new
32089         internal call.
32091 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
32093         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
32094         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
32096         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
32097         we call unmanaged code which throws exceptions.
32099 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32101         * appdomain.h: added per-domain entry_assembly.
32102         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
32103         arguments.
32104         * icall.c: Assembly::GetEntryAssembly icall.
32105         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
32106         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
32108 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32110         * appdomain.h, gc.c: added mono_domain_finalize ().
32112 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32114         * object.c:
32115         (mono_print_unhandled_exception): changed g_warning by g_printerr
32116         because g_log has a 1024 characters limit (yeah, i got a big stack
32117         trace). Don't print exception name, that should be in ToString 
32118         returned string.
32120 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32122         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
32123         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
32125 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32127         * object.c:
32128         (mono_print_unhandled_exception): after previous commit, i realized
32129         that MS calls ToString on the exception. I changed this function to
32130         do that. This way we get stack_trace for free.
32132 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32134         * object.c:
32135         (mono_print_unhandled_exception): invoke Message property instead of
32136         getting 'message' field from Exception. Don't allocate memory for
32137         'trace' and 'message' if not needed.
32139 2002-08-18  Dick Porter  <dick@ximian.com>
32141         * unicode.c: Fix asserts to match Encoder.cs checks
32143 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32145         * marshal.c: fix unaligned store issue and a few wrong
32146         opcode argument types.
32148 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32150         * icall.c: added GetUninitializedObjectInternal internal call.
32152 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
32154         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
32155         to the right domain.
32157 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
32159         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
32161         * class.c (class_compute_field_layout): set blittable to false for Strings
32163         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
32165 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32167         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
32168         first chunk of code to create types at runtime. Code to
32169         handle ReflectedType/DeclaringType. Make reflection handles
32170         domain specific.
32172 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
32174         * class.c: set correct name in arrays.
32176 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
32178         * appdomain.c (mono_domain_transfer_object): make it work with
32179         valuetypes. bug fixes.
32181 2002-08-12  Dick Porter  <dick@ximian.com>
32183         * object.h: Rename some parameters to avoid c++ keywords (Patch
32184         from Joseph Wenninger <kde@jowenn.at>)
32186 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
32188         * icall.c: added icall to implement Assembly.GetFile*.
32190 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32192         * reflection.h, reflection.c: code to embed managed resources.
32194 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
32196         * class.c: move all the type size stuff into
32197         class_compute_field_layout().
32199 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32201         * class.c: ensure enums have always the correct instance size.
32202         * unicode.c: remove wrong assert.
32204 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32206         * assembly.c: fix mem corruption issue.
32207         * image.h, image.c: added mono_image_get_resource () to access
32208         managed resources.
32209         * icall.c: implemented Assembly.EntryPoint property and some
32210         Managed Resources related internalcalls.
32213 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32215         * image.c, image.h: impemented mono_image_get_entry_point ().
32216         * appdomain.c: use mono_image_get_entry_point.
32218 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32220         * reflection.c: support the object type argument when loading
32221         custom attributes.
32223 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
32225         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
32226         String as return type.
32228 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
32230         * reflection.c: fix encoding of named args for custom attrs to match
32231         the ms implementation. Read them back when instantiating custom
32232         attributes.
32234 2002-08-02  Radek Doulik  <rodo@ximian.com>
32236         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
32237         by Dietmar as quick fix
32238         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
32239         16 as stack size, used on more places as quick fix before Dietmar
32240         will fix it properly
32242 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32244         * object.h, object.c: added accessors for fields and properties.
32246 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32248         * class.c, class.h: made mono_class_get_field_from_name ()
32249         loop on parent types.
32250         Added mono_class_get_property_from_name ().
32252 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32254         * class.c, class.h: move the code to setup the type vtable in its own
32255         function so that it can be reused also for types created at runtime.
32256         Eliminate the "class" identifier from the header file.
32257         * reflection.c: setup the vtable for enums so that we can create
32258         objects for use in SetConstant ().
32260 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
32262         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
32263         instead of the delegate itself as this pointer (bug #28383)
32265 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
32267         * marshal.c (mono_marshal_get_managed_wrapper): added return type
32268         conversions.
32270 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32272         * loader.c: don't set the pinvoke bit on icalls.
32274 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
32276         * debug-helpers.c (mono_method_full_name): only print a number to
32277         indicate wrapper type (so that the output is more readable in traces).
32279 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
32281         * class.c (mono_class_init): include method override patch from Paolo
32283 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
32285         * icall.c: fixed GetTypeCode().
32287 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
32289         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
32290         use real delegate invoke function to make it work with multicast
32291         delegates (fix bug# 28291).
32293 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32295         * object.c: load constant strings.
32297 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32299         * reflection.c: no magic numbers.
32300         * tabledefs.h: security action enum.
32302 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32304         * assembly.c: fix possible memory corruption.
32306 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32308         * reflection.h, reflection.c: added support for linking resources.
32309         * verify.c: check we have an updated corlib.
32311 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
32313         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
32314         string arrays.
32315         (mono_marshal_string_array): null terminate unmanaged string arrays.
32316         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
32318 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32320         * icall.c: Type.GetType () can now return also types from the
32321         calling assembly.
32323 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
32325         * loader.h, loader.c: stack walking support.
32326         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
32327         GetCallingAssembly.
32329 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
32331         * marshal.c: added optimisations for blittable types 
32333         * class.c (mono_array_class_get): do not set blittable attribute on arrays
32334         (mono_class_setup_mono_type): set blittable attribute for single
32335         and double.
32337         * marshal.c (mono_string_utf8_to_builder): impl.
32338         (mono_string_builder_to_utf8): impl.
32339         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
32341 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
32343         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
32344         (mono_marshal_get_managed_wrapper): impl. byref types
32346 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32348         * icall.c:
32349         (search_method): don't display debug message. 
32351 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
32353         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
32355 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
32357         * appdomain.c: set the missing filename when throwing exception.
32359 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
32361         * metadata.c (mono_type_size): code cleanup
32362         (mono_type_stack_size): removed some test code
32364 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
32366         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
32367         mono_get_exception_file_not_found now.
32369         * exception.c (mono_exception_from_name_two_strings): New version
32370         that will call a constructor with two string arguments. 
32371         (mono_get_exception_file_not_found): New helper routine, used to
32372         report file-not-found errors.
32374 2002-07-20  Dick Porter  <dick@ximian.com>
32376         * process.h:
32377         * process.c: Pass file handles to CreateProcess
32378         
32379         * icall.c:
32380         * file-io.h:
32381         * file-io.c: Implemented CreatePipe
32383 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
32385         * metadata.c (mono_get_param_info): set alignment for value types
32387 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32389         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
32390         Constify mono_domain_assembly_open().
32391         * loader.c: handle null namespace in icalls.
32393 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
32395         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
32396         (emit_str_to_ptr_conv): marshal object as structs
32398         * metadata.c (mono_type_to_unmanaged): marshal object as structs
32400         * marshal.c (mono_marshal_get_runtime_invoke): support value types
32402 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
32404         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
32405         (mono_marshal_get_native_wrapper): we an now return value types
32407 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32409         * verify.c: more checks implemented.
32411 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
32413         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
32414         (fix bug #27695)
32415         (mono_marshal_get_native_wrapper): allow byref arguments
32416         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
32417         impl. PtrToStringXXX methods
32418         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
32419         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
32420         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
32421         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
32422         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
32424 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32426         * reflection.c: fix buglet in parsing an assembly name.
32428 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
32430         * marshal.c (emit_ptr_to_str_conv): first impl.
32432 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32434         * object.c, class.h: cache the vtable in the class as suggested by
32435         vargaz@freemail.hu (Zoltan Varga).
32437 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32439         * class.h, loader.c: added mono_field_from_token().
32440         * verify.c: first cut of type checking code.
32442 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
32444         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
32446 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
32448         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
32449         (fix bug #27782)
32450         (mono_marshal_get_remoting_invoke): impl.
32451         (mono_delegate_begin_invoke): impl.
32452         (mono_mb_emit_save_args): impl.
32453         (mono_delegate_end_invoke): impl.
32454         (mono_marshal_get_delegate_begin_invoke):
32455         (mono_marshal_get_delegate_end_invoke):
32456         (mono_marshal_get_delegate_invoke): generate a special name for
32457         those methods (including the signature) and associate them whith
32458         the delegate class. 
32460 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
32462         * reflection.[ch]: 
32463         (mono_reflection_type_from_name): now it has a MonoImage parameter
32464         which is used as the default image to search the type in. If the image
32465         is NULL or getting the type from it fails, it defaults to corlib.
32467         * icall.c: changed 1 call to mono_reflection_type_from_name to match
32468         new parameter.
32470 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32472         * reflection.c: update the parameter table index.
32474 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32476         * domain.c: don't include the mark byte in the string hash.
32478 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32480         * icall.cs: icall for Type.GetTypeCode ().
32481         * verify: a couple of fixes and disabled local initialization checks.
32483 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
32485         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
32487         * debug-helpers.c (mono_method_full_name): print the type of the
32488         runtime wrapper
32490         * metadata.c (mono_signature_hash): a hash function for signatures
32491         (mono_signature_hash): better hash algorithm
32493         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
32495         * debug-helpers.c (mono_method_full_name): this can now generate
32496         method names with signatures
32498         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
32499         method dont have this pointers.
32501 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32503         * reflection.c: fixup typebuilder tokens.
32504         * image.c: fix buglet.
32505         * marshal.h: remove whitespace.
32506         * metadata.h, metadata.c: reinstate code that was removed.
32507         * verify.c: handle catch directives and fix another couple of bugs.
32509 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
32511         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
32512         (mono_marshal_get_native_wrapper): make it comp. with the old code
32513         (mono_marshal_get_native_wrapper): support boolean
32514         (mono_marshal_get_managed_wrapper): support more types
32516 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
32518         * class.c (class_compute_field_layout): compute class->blittable attribute.
32520 2002-07-09  Dick Porter  <dick@ximian.com>
32522         * threads.c: Make the thread cleaning up cope with threads that
32523         call ExitThread()
32525 2002-07-08  Radek Doulik  <rodo@ximian.com>
32527         * reflection.c (method_encode_code): use non-translated values to
32528         compute finally_start, this fixes exception handling on ppc, yay!
32530         * decimal.h (struct signscale): fix endianess
32532 2002-07-07  Radek Doulik  <rodo@ximian.com>
32534         * reflection.c: swap box_val and not val
32536 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
32538         * reflection.c, reflection.h: handle full assembly info in type name.
32539         Handle Type arguments when loading custom attributes.
32540         * icall.c: updated to use new mono_reflection_type_from_name () method.
32542 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32544         * loader.c:
32545         (method_from_memberref): also print assembly name when method not found.
32547 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32549         * icall.c:
32550         (ves_icall_TypeGetProperties): fixed bug #27473. 
32552 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32554         * reflection.c: display image name and token when cannot find the
32555         .ctor for an attribute.
32557 2002-07-05  Martin Baulig  <martin@gnome.org>
32559         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
32561 2002-07-04  Dick Porter  <dick@ximian.com>
32563         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
32564         compile on mingw.  This will cause mingw builds to not wait for
32565         subthreads to terminate after the main thread does.  I've lodged a
32566         bug with the mingw developers for them to wrap OpenThread().
32568 2002-07-03  Dick Porter  <dick@ximian.com>
32570         * threads.c: Store thread IDs instead of handles, because
32571         GetCurrentThread() returns a pseudohandle and therefore stores
32572         useless values.  mono_thread_cleanup() continues checking the
32573         array of threads until it is empty, to cope with subthreads
32574         spawning new threads after the main thread has finished.
32576         * profiler.h:
32577         * profiler.c:
32578         * profiler-private.h: Pass the thread ID to thread profiler
32579         functions, instead of a handle
32581 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32583         * verify.c: fixes to make it more usable.
32584         * pedump.c: added --verify code to verify IL code in an assembly.
32586 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32588         * reflection.c: turn errors into warnings to allow compiling corlib.
32590 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
32592         * reflection.c: add special cases to compile corlib.
32594 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32596         * reflection.c: handle properties with only a set method.
32598 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32600         * opcodes.h: add enum with opcodes in opval order.
32602 2002-07-01  Dick Porter  <dick@ximian.com>
32603         
32604         * object.h:
32605         * object.c (mono_runtime_run_main): Removed unneeded argument
32607 2002-06-28  Martin Baulig  <martin@gnome.org>
32609         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
32611 2002-06-27  Dick Porter  <dick@ximian.com>
32613         * threads.c: Store the handle in both the parent thread and in the
32614         subthread, to minimise the time between starting a new thread and
32615         storing its ID.
32617 2002-06-26  Dick Porter  <dick@ximian.com>
32619         * appdomain.c (mono_runtime_cleanup): Close the socket library
32620         after all the threads have finished, not before
32622 2002-06-26  Martin Baulig  <martin@gnome.org>
32624         * debug-symfile.c (mono_debug_find_source_location): Added
32625         `guint32 *line_number' argument.  If it's not NULL, store the line number
32626         there and return the file name without the line number.
32628 2002-06-25  Dick Porter  <dick@ximian.com>
32630         * icall.c:
32631         * process.h:
32632         * process.c: Process forking and other support functions
32634 2002-06-25  Dick Porter  <dick@ximian.com>
32636         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
32637         things dont happen when the image is closed.
32638         (mono_image_lookup_resource): Walk the resource section looking
32639         for a particular entry
32641         * cil-coff.h: PE resource section decoding
32643 2002-06-25  Dick Porter  <dick@ximian.com>
32644         
32645         * assembly.h:
32646         * assembly.c: 
32647         (mono_assembly_foreach): Accessor functions to walk the list of
32648         loaded assemblies
32649         (mono_assembly_set_main):
32650         (mono_assembly_get_main): Process methods need to know which
32651         assembly is the "main" one
32653         * object.c (mono_runtime_run_main): Record the main assembly
32655         * debug-helpers.c: Fix typo
32657 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
32659         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
32660         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
32662 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
32664         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
32666 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
32668         * image.c (do_mono_image_open): Initialize reference count,
32669         otherwise we leak the MonoImage.
32671 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
32673         * reflection.c: small tweak to handle self-hosting.
32675 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
32677         * reflection.c: fix type name parse code.
32679 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32681         * reflection.c: break out of the loop.
32682         * image.c: special case corlib.
32684 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32686         * reflection.c: add all the custom attrs at the end to ensure the
32687         ctors have been properly initialized when the attributes are defined
32688         in the current assembly.
32690 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32692         * reflection.c: handle correctly multiple-nested types.
32694 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
32696         * row-indexes.h: fix typos.
32697         * reflection.c: adjust for typos and fix method_def_or_ref
32698         encoding in MethodImpl table.
32700 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32702         * reflection.c: fix entry point patching (thanks Serge!).
32704 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
32706         * verify.c: add check for System.Exception
32708 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32710         * image.c, class.c: minifix for code just c&p'ed.
32711         * reflection.c: warning fix.
32712         * object.h, loader.h, domain.c: load also StringBuilder.
32714 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32716         * marshal.h, marshal.c: some support code to handle complex marshaling.
32718 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32720         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
32721         Better signatures with vtable error dump.
32723 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
32725         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
32727 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
32729         * icall.c (ves_icall_Type_GetField): impl.
32731 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32733         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
32734         to retrieve a marshal description blob for a field or param.
32736 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32738         * reflection.h, reflection.c: change order of nested type emission
32739         to avoid table corruption. The NestedTypes table is sorted.
32740         * icall.c: change order of GetConstructor results to workaround mcs bug.
32742 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32744         * reflection.h, reflection.c: handle field and param marshal
32745         information.
32747 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32749         * icall.c, marshal.c marshal.h: more Marshal class implementation.
32751 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32753         * reflection.c: fix call convention.
32755 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32757         * reflection.h, reflection.c: mono_image_get_memberref_token()
32758         takes a type instead of a class, now. Added
32759         mono_image_get_array_token() to create tokens for the special
32760         multi-dim array methods.
32762 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
32764         * assembly.c: handle modules (no assembly table). Split
32765         loading references in its own function.
32766         * class.c: handle moduleref resolution scope.
32767         * image.c, image.h: cache module name in image.
32769 2002-06-07  Martin Baulig  <martin@gnome.org>
32771         * reflection.c (mono_image_get_type_info): Only add a class layout entry
32772         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
32774 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
32776         * icall.c: more signature fixes that used uint instead of int.
32778 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32780         * reflection.c: fixed signature of field refs.
32782 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32784         * class.c, reflection.c: handle typerefs of nested types
32785         (both on read and when writing files).
32787 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
32789         * icall.c: fix method signatures that tried to workaround the previous
32790         typo, d'oh!
32792 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32794         * debug-helpers.c: fix typo.
32796 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32798         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
32799         rewrote the PE/COFF writing code (our programs are understood by the
32800         ms runtime, now).
32802 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
32804         * gc.c, gc.h, icall.c: weakreference support.
32806 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32808         * Makefile.am, mono-config.c: use $(sysconfdir).
32810 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32812         * icall.c: changed default precision of Double.ToString() to 15.
32813         Fixed memory leak. Unified with Single.ToString.
32815 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
32817         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
32819 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
32821         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
32822         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
32823         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
32824         and myself.
32826 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32828         * debug-symfile.c, sysmath.c: yet more compilation fixes.
32830 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32832         * reflection.c, socket-io.c: more compilation fixes.
32834 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32836         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
32837         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
32838         unicode.c: warning and compiler compatibility fixes.
32840 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32842         * class.h, metadata.c: fixed warnings/compilation errors.
32844 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
32846         * Makefile.am, mono-config.c, mono-config.h: configuration file
32847         support routines.
32848         * loader.c, loader.h: make Dll mapping configurable at runtime in the
32849         config file. Export methods to insert and lookup mappings.
32851 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32853         * reflection.c: handle types and boxed objects in custom attr
32854         constructors.
32856 2002-05-30  Martin Baulig  <martin@gnome.org>
32858         * debug-symfile.c
32859         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
32861 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
32863         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
32864         to lookup the implmap row for a P/Invoke method.
32865         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
32866         P/Invoke method from the runtime on an as needed basis.
32868 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
32870         * metadata.c (mono_metadata_parse_signature): impl.
32872 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32874         * class.c: handle .pack directive.
32876 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32878         * object.c: initialize static fields with RVA data.
32880 2002-05-25  Martin Baulig  <martin@gnome.org>
32882         * debug-symfile.c
32883         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
32885 2002-05-24  Martin Baulig  <martin@gnome.org>
32887         * debug-symfile.c
32888         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
32889         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
32890         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
32892 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32894         * object.c: special case string ctros in invoke.
32895         * gc.c: silly whitespace changes.
32897 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
32899         * threadpool.[ch]: impl. a threadpool that can
32900         be used by mint and mono.
32902 2002-05-22  Martin Baulig  <martin@gnome.org>
32904         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
32905         The first argument is now a `MonoReflectionModuleBuilder *', the return
32906         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
32907         `methods' field to get the method builder.  The `token' argument is the
32908         unfixed token.
32910         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
32911         invalid characters instead of g_assert_not_reached()ing.  This seems
32912         to be the behaviour of mscorlib.
32914 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
32916         * object.c (mono_runtime_invoke_array): applied patch from Rachel
32917         Hestilow to fix bug #25104
32919 2002-05-21  Martin Baulig  <martin@gnome.org>
32921         * debug-symfile.c (mono_debug_find_source_location): New function.
32922         Looks up an IL offset in the line number table and returns the source
32923         location as a string.
32925 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32927         * icall.c:
32928         (mono_double_ToStringImpl): changed %f by %g until we have something
32929         better.
32931 2002-05-21  Nick Drochak  <ndrochak@gol.com>
32933         * icall.c : Use different name for Math.Pow's icall.  Needed to check
32934         parameters first in C#.
32936 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32938         * icall.c, reflection.h: added icall to get info about an event.
32940 2002-05-20  Radek Doulik  <rodo@ximian.com>
32942         * object.c (mono_value_box): don't use memcpy for boxing on BIG
32943         endian
32944         (mono_value_box): don't use memcpy for small sizes on
32945         architectures with unaligned access
32947 2002-05-20  Martin Baulig  <martin@gnome.org>
32949         * reflection.c (mono_reflection_setup_internal_class): Don't crash
32950         if `tb->parent == NULL'.
32951         (mono_reflection_create_internal_class): New function.  This is
32952         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
32953         for enum types.
32955         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
32956         New interncall.
32958 2002-05-19  Martin Baulig  <martin@gnome.org>
32960         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
32961         argument to get the length, don't default to the array length.
32963 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
32965         * assembly.c (mono_assembly_setrootdir): New function used to
32966         override the MONO_ASSEMBLIES directory.
32968 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32970         * icall.c: ValueType_GetHashCode() initialize local var.
32972 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32974         * reflection.c: sort custom attributes table.
32976 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32978         * reflection.c: support named args in custom attributes (write support).
32980 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
32982         * reflection.c: fix finally position calculation.
32984 2002-05-15  Radek Doulik  <rodo@ximian.com>
32986         * reflection.c: fixed endianess at many places
32988         * icall.c (ves_icall_InitializeArray): comment out debug msg
32990 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
32992         * object.c (mono_unhandled_exception): new function to handle
32993         unhandled exceptions.
32994         (mono_unhandled_exception): call the UnhandledException event.
32995         (mono_runtime_delegate_invoke): impl.
32997 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
32999         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
33000         returns the RVA, not the direct pointer to the data. Handle the case
33001         when the class size is fixed.
33003 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33005         * reflection.c: fix some endianess issues.
33007 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
33009         * object.c (mono_runtime_invoke): is now able to catch exceptions.
33011         * threads.c (mono_thread_init): added a callback which is invoked
33012         at thread start.
33014 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
33015         
33016         * icall.c: make GetHashCode return non-negative values.
33018 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
33020         * object.c, icall.c, gc.c: revert to address-based hashcode.
33022 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
33024         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
33026 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33028         * icall.c, class.c: special case <Module>.
33030 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
33032         * icall.c: fix bug in GetNow().
33034 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
33036         * object.c (mono_runtime_class_init): make sure that we call all
33037         static class constructors.
33039 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33041         * reflection.c: sort methodsemantics table.
33043 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33045         * reflection.h, reflection.c: honour init locals setting.
33047 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
33049         * icall.c: copied Double ToStringImpl for Single ToStringImpl
33051 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33053         * reflection.c: support ContructorBuilders in attribute blob creation.
33055 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33057         * reflection.c: some changes to build a binary that can be run
33058         directly in windows.
33060 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
33062         * loader.c: print a big message when an icall can't be found.
33064 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33066         * string-icalls.c: fix bug 24248.
33068 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
33070         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
33071         icall.c, reflection.h: separate assembly loading by pathname and by
33072         assembly name. Use the MONO_PATH env var to search for assemblies.
33074 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33076         * assembly.c, image.h: add some support for assemblies
33077         with multiple modules.
33078         * class.c, class.h: export mono_class_from_typeref().
33079         * loader.c: remove duplicated code and use mono_class_from_typeref(),
33080         instead.
33082 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33084         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
33085         documentation says (the ECMA one is correct).
33087 2002-05-02  Dick Porter  <dick@ximian.com>
33089         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
33090         Don't name the synchronisation mutex.
33092 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
33094         * rand.c
33095         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
33096         Make the prototypes match.
33097         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
33098         Same.
33100         * icall.c
33101         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
33102         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
33103         all systems have tm.tm_zone, so use strftime() with %Z to print
33104         the timezone abreviation into a temp string.
33106         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
33107         rather than mono_array_addr() on a MonoString on Big Endian
33108         machines.
33110 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
33112         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
33113         fix bug 24041
33115 2002-04-30  Dick Porter  <dick@ximian.com>
33117         * socket-io.c: Cope with SOCKET being an integer rather than a
33118         pointer now.
33120         * threads.c: Added Thread_free_internal, to deal with thread
33121         handle cleanup.  Moved calls to handle_store() and handle_remove()
33122         to start_wrapper(), so each can only be called once.  Allocate
33123         synchronisation blocks with GC_malloc(), and use GC finalisation
33124         to close the handles.
33126         * icall.c: added System.Threading.Thread::Thread_free_internal
33128 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33130         * icall.c: support Environment.Exit, CommandLineArgs().
33132 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33134         * object.c, object.h: added mono_runtime_run_main () and
33135         mono_runtime_get_main_args () for use in System.Environment.
33137 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33139         * gc.c: fix thinko, enable actual finalization since the jit is now
33140         fixed.
33142 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33144         * gc.c, object.c: take into account that an object may be offset wrt the address
33145         returned by GC_malloc().
33147 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
33149         * image.c: handle files without entries in the assembly table (modules).
33151 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
33153         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
33154         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
33155         allowed to be null when it's System.Object class setup.
33157 2002-04-27  Martin Baulig  <martin@gnome.org>
33159         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
33160         if `tb->parent == NULL' rather than crashing.
33162 2002-04-28  Nick Drochak  <ndrochak@gol.com>
33164         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
33165         calling acos() where asin() should have been called.
33167 2002-04-26  Martin Baulig  <martin@gnome.org>
33169         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
33170         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
33171         there's a subdirectory called `System', but we don't want to read that
33172         subdirectory as an assembly.
33174 2002-04-25  Martin Baulig  <martin@gnome.org>
33176         * debug-symfile.c: Reflect latest MonoString changes.
33178 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33180         * rand.c, rand.h: instance method icalls need to have an explicit
33181         this pointer as first argument in the C implementation.
33183 2002-04-25  Nick Drochak <ndrochak@gol.com>
33185         * icall.c: Fix typo in map for GetNonZeroBytes
33187 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33189         * string-icalls.c : String does now passes unit tests without any 
33190         errors, the following changes has been made:
33191         
33192         Implemented replace methods.
33193         Renaming of methods to (try) follow the standard.
33194         Fixed compare ordinal
33195         Made all memory allocated directly to function instead of via icall function.
33196         Small performance fix in is_in_array function
33197                         
33198  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
33200         c (mono_string_Internal_ctor_charp_int_int):
33201         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
33202         sindex < 0, throw ArgumentOutOfRangeException instead of
33203         ArgumentNullException.
33205         Added new check for length == 0, however
33206         I need to make it return String.Empty from the C code.
33207         
33208         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
33209         that calculate the length for us here.
33210         
33211         (mono_string_Internal_ctor_sbytep_int_int): Replaced
33212         mono_string_new_utf16 with mono_string_new, since value is utf8.
33214 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33216         * object.c: register the object for finalization if needed.
33217         Allocate one more char in the string for the terminating 0 char.
33219 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33221         * class.c, class.h, image.c: check if a type implemenst a destructor.
33222         Use the proper key for array class lookups.
33223         * icall.c: register the icalls in the System.GC class.
33224         * gc.c, gc.h: GC-related functions and icalls.
33226 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33228         * icall.c:
33229         * socket-io.c:
33230         * unicode.c: free some strings gotten from mono_string_to_utf8 and
33231         changed a couple of free () by g_free ().
33233         * decimal.c: one-liner in the comments for decimal2string ().
33235 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33237         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
33239 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33241         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
33242         * object.c (mono_runtime_invoke_array) : handle null in params
33244 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33246         * string-icalls.c: fixed bug in split (one off bug)
33248 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33250         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
33251         * icalls.c: added String::Equals as internal method
33253 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33255         * threads.c: fixed bug in the double interlocked functions
33257 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
33259         * threads.c: implemented all of the new interlocked icalls.
33260         * string-icalls.c: fix a bug in insert.
33261         * icalls.c: added the icalls for interlocked, removed old string functions.
33262         
33263 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33265         * loader.c: fix off-by-one error when reading argument names.
33267 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33269         * profiler.c: win32 counter implementation (untested).
33270         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
33271         (the latter needs testing and more complete impl. from win32 folks).
33273 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
33275         * object.c: mono_array_new_full workaround mono_array_class_get
33276         problem.
33278 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33280         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
33281         * object.h (mono_string_chars): Changed casting type.
33283 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33285         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
33286                            method signatures to use gunichar2 instead of gint16.
33288 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
33290         * object.h, object.c: domain-specific versions of mono_object_new and
33291         mono_array_new.
33293 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
33295         * object.c: changed String layout
33297         * string-icalls.c (mono_string_Internal_ctor_chara): added
33298         internal string constructors.
33300 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
33302         * threads.c: pass 'this' to the thread start routine.
33304 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33306         * string-icalls.c: fix IndexOf and LastIndexOf. Now
33307         InternalCompareStr don't call twice mono_string_cmp_char for the last
33308         character. Improved performance in mono_string_cmp_char.
33310 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33312         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
33313         code into its own library: libmonoruntime.
33315 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
33317         * object.h, object.c: changed array format so that szarrays do not
33318         require a bounds structure.
33319         * icall.c, appdomain.c: support for new szarray format.
33321 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
33323         * metadata.c: compare also the retuns type when comparing signatures:
33324         we didn't do this as an optimization since really overloaded methods
33325         must differ also in the arguments, but this doesn't work with
33326         low-level IL code (or when using explicit conversion operators: see
33327         bug#23498 for an example).
33329 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33331         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
33333 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33335         * icall.c: make MonoType::GetElementType its own icall.
33337 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33339         * icall.c: remove MonoMethod_get_Name().
33340         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
33341         object.
33343 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33345         * string-icalls.c: optimized a few methods.
33347 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33349         * icall.c: added all new string internal calls
33350         * string-icalls.c: added, new string internal call implementation.
33351         * object.c: added mono_string_new_size for allocating a string a size
33353 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
33355         * object.c (mono_object_isinst): use the same code as in the
33356         optimized x86 version.
33358 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33360         * profiler.c: TSC-based timer code (faster and more accurate).
33361         Not hooked up in configure, yet (set USE_X86TSC to 1).
33363 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
33365         * profiler.c, profiler.h: track time spent compiling methods.
33366         * threads.c: track thread creation/destruction.
33368 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
33370         * profiler.c, profiler.h, profiler-private.h: profiling interface
33371         and sample implementation. Moved here so that it can be used also by
33372         the jit.
33374 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
33376         * reflection.c, reflection.h: keep types and other handles separate in
33377         the hash tables for referred tokens. Add guid for modules.
33379 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33381         * assembly.c: fix bugs found with valgrind.
33382         * metadata.h, metadata.c: added mono_metadata_guid_heap().
33384 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
33386         * threads: added icall support for getting current domain for
33387                    the thread.
33389 2002-04-13  Martin Baulig  <martin@gnome.org>
33391         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
33392         (MonoDebugVarInfo): Added `index' field for register based addresses.
33393         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
33394         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
33395         `MonoDebugVarInfo *params' and `guint32 this_offset' with
33396         `MonoDebugVarInfo *this_var'.
33398         * debug-symfile.c (relocate_variable): New static function to write
33399         a location description for a local variable or method parameter.
33401 2002-04-12  Martin Baulig  <martin@gnome.org>
33403         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
33404         stack offset and begin/end scope address of a local variable.
33405         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
33406         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
33407         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
33409         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
33410         Added new relocation types for start/end scope of a local variable.
33412 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33414         * object.h: add mono_object_domain() macro.
33415         * reflection.c: handle typespecs.
33416         * icall.c: MonoMethod::get_Name() implementation.
33418 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33420         * icall.c: String::GetHashCode() icall implementation.
33422 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33424         * icall.c: String::IndexOfAny icall.
33425         * object.c, object.h: make array->max_length more useful.
33426         Intrduced mono_object_class() and mono_string_length() macros.
33428 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33430         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
33431         instead of g_unichar_isdigit.
33433 2002-04-11  Nick Drochak  <ndrochak@gol.com>
33435         * icall.c: Implement a simple Double.ToString().
33437 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33439         * appdomain.h: only io-layer.h is supposed to be included.
33440         * icall.c: explicitly import environ. Fix warning.
33442 2002-04-10  Nick Drochak  <ndrochak@gol.com>
33444         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
33445                 return true even if it's not Daylight Savings time.
33446                 Only return false for the case where the function isn't
33447                 implemented for a plaform (read Windows).
33449 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33451         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
33452         data with a mutex.
33454 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
33456         * mempool.c (mono_mempool_alloc): only use g_malloc when
33457         absolutely necessary.
33459 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
33461         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
33463         * class.c (mono_class_vtable): use domain mempool to allocate vtable
33464         (mono_class_proxy_vtable): use domain mempool
33466 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33468         * appdomain.h, appdomain.c: split initialization that requires the
33469         execution engine support into mono_runtime_init().
33471 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
33473         * class.c (mono_class_init): don't include vtable inside MonoClass
33474         to save some memory, gather some statistics.
33475         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
33477 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33479         * icall.c: internalcall implementation for ValueType.Equals().
33481 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
33483         * object.c (mono_message_init): moved 
33484         (mono_runtime_exec_main): new arch. independent impl.
33485         (mono_runtime_invoke_array): new method - like
33486         mono_runtime_invoke, but you can pass an array of objects.
33487         (mono_remoting_invoke): new arch. independent impl.
33488         (mono_message_invoke): new arch. independent impl.
33489         (mono_runtime_class_init): new arch. independent impl.
33490         (mono_runtime_object_init): new arch. independent impl.
33492 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33494         * metadata.c, object.c, reflection.c: documented the exported
33495         functions.
33497 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
33499         * icall.c: simpler code to pass the assembly builder data to corlib.
33500         Implement GetNestedTypes() internalcall.
33502 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33504         * class.c: warn if a type can't be loaded.
33506 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
33508         * image.h: typedef MonoImageOpenStatus
33509         * types.h: removed unused file
33510         
33511 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
33513         * icall.c: Enum_ToObject accepts enum value arguments.
33515 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33517         * class.c: move initialization of properties, events and nested
33518         classes, so that they happen for interfaces, too.
33520 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33522         * icall.c: cleanup some ugly casts in Array_SetValue*.
33524 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33526         * icall.c: the values array fro enums is of the correct type, now.
33527         Implement (correctly) getFullName instead of assQualifiedName for
33528         MonoType.
33529         * reflection.h, reflection.c: added mono_type_get_name ().
33531 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33533         * assembly.c, image.h: for each MonoImage, record from wich assembly
33534         it was loaded.
33535         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
33536         Make Type.Assembly work.
33538 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
33540         * debug-symfile.h: use char* instead of gpointer to avoid
33541         unnecessary casts.
33543         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
33545         * icall.c (ves_icall_InternalExecute): impl. FielSetter
33546         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
33548 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
33550         * icall.c (mono_message_init): impl. (code cleanup)
33551         (ves_icall_InternalExecute): impl. FieldGetter
33553         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
33554         defined we call all (non-static)methods through the vtable. 
33556 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
33558         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
33559         finalizer even though the memory is still referenced (and the chunk of
33560         memory is not freed).
33562 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
33564         * assembly.c: fix brokeness.
33566 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
33568         * class.c: kill some warnings. Check explicit interface method
33569         implementation also without considering the namespace.
33570         Load also literal strings in static class data.
33572 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
33574         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
33575         (default_assembly_name_resolver): Make the resolver take the
33576         "base" directory where the assembly was originally defined, so we
33577         can load DLLs that are in the same directory as the assembly that
33578         is being referenced.
33580 2002-03-28  Dick Porter  <dick@ximian.com>
33582         * file-io.h: 
33583         * file-io.c:
33584         * socket-io.c: 
33585         * unicode.h: 
33586         * unicode.c: Warning cleanups
33588 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
33590         * object.h, reflection.h: use the correct type instead of MonoObject.
33592 2002-03-28  Martin Baulig  <martin@gnome.org>
33594         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
33595         (mono_debug_update_symbol_file): Initialize classes if necessary.
33597 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
33599         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
33600         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
33602 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
33604         * assembly.h: fix function prototype.
33605         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
33606         * mono-endian.h: use const cast.
33608 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
33610         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
33612 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
33614         * loader.c: don't assert when a typeref can't be loaded, give
33615         a chance to the runtime to trow an exception instead.
33616         * loader.h: fix warning.
33618 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
33620         * class.c (mono_class_proxy_vtable): added proxy support
33622 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
33624         * icall.c: removed last of PAL calls, added System.Environment
33625         * file-io.h, file-io.c: MonoIO implementation
33626         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
33628 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
33630         * appdomain.c: do not use the byte marker in ldstr table lookup.
33631         * debug-helpers.c: allow two ':' to separate class and method name.
33632         * object.c: allocate arrays bounds with the GC, too.
33633         * verify: add a few more checks.
33635 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
33637         * reflection.c: output also literal strings. Allocate parameter data
33638         with GC_malloc() (thanks, Martin, for catching this!).
33640 2002-03-26  Martin Baulig  <martin@gnome.org>
33642         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
33643         include the `this' offset in the `param_offsets'.
33645 2002-03-25  Martin Baulig  <martin@gnome.org>
33647         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
33648         mono_debug_get_class() function to get the classes. Added new
33649         relocation types for arrays and strings.
33650         (mono_debug_get_class): New static function to search in all
33651         referenced assemblies for a metadata token.
33653         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
33655 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
33657         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
33658         hold gc-allocated objects. Make the string heap a stream like the
33659         others. Removed duplicated code when writing stream info.
33660         Added asserts to catch possible buffer overflows. Set the sorted map
33661         for tables that need sorting. Added some documentation.
33663 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
33665         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
33666         for interned strings and vtables.
33668 2002-03-24  Martin Baulig  <martin@gnome.org>
33670         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
33671         it in the array since it was created with g_slist_prepend().
33673 2002-03-24  Martin Baulig  <martin@gnome.org>
33675         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
33676         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
33677         (mono_debug_method_from_token): Renamed to
33678         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
33679         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
33681         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
33682         relocation types.
33684         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
33686 2002-03-24  Martin Baulig  <martin@gnome.org>
33688         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
33689         (mono_debug_method_from_token): New func.
33691         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
33692         New interncall, calls mono_debug_local_type_from_signature().
33693         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
33694         calls mono_debug_method_from_token().
33696 2002-03-23  Martin Baulig  <martin@gnome.org>
33698         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
33699         specifies the number of bytes to be converted, not the array size.
33700         Return the number of chars, not the number of bytes.
33701         (ves_icall_iconv_get_chars): The `byteCount' argument
33702         specifies the number of bytes to be converted, not the array size.
33704 2002-03-23  Martin Baulig  <martin@gnome.org>
33706         * reflection.h (MonoReflectionSigHelper): New type.
33708         * reflection.c (mono_reflection_sighelper_get_signature_local),
33709         (mono_reflection_sighelper_get_signature_local): New functions.
33711         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
33712         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
33713         interncalls.
33715 2002-03-23  Martin Baulig  <martin@gnome.org>
33717         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
33718         is_writeable is set.
33719         (mono_raw_buffer_update): New function to write the modified map
33720         back to disk.
33722         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
33724         * debug-symfile.c (mono_debug_update_symbol_file): Call
33725         mono_raw_buffer_update() when done writing.
33727 2002-03-23  Martin Baulig  <martin@gnome.org>
33729         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
33731         * debug-symfile.c: Added support for arguments and local variables.
33733 2002-03-23  Dick Porter  <dick@ximian.com>
33735         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
33736         protected by ifdefs, hence breaking the w32 build.
33738 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33740         * object.c: implement is_interned() the right way.
33742 2002-03-21  Martin Baulig  <martin@gnome.org>
33744         * debug-symfile.[ch]: New files to handle debugging information
33745         files. There's also support to dynamically update these symbol
33746         files to include machine dependent information.
33748 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
33750         * threads.c (mono_thread_create): new function to create thread
33751         from C
33753 2002-03-20  Martin Baulig  <martin@gnome.org>
33755         * icall.c (ves_icall_InternalInvoke): Create a new object if the
33756         method is a constructor.
33757         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
33758         points to ves_icall_InternalInvoke().
33760 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
33762         * file-io.c: Flush shouldn't throw exceptions.
33764 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
33766         * file-io.c: FileStream flush support; FileSetLength now
33767         restores file pointer.
33769 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
33771         * class.c: set image for pointer classes.
33773 2002/03/19  Nick Drochak <ndrochak@gol.com>
33775         * sysmath.c: Forgot one.
33777 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
33779         * sysmath.c: Avoid redefining existing names.
33781 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
33783         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
33784         handled by runtime as icall rather than dllimport from libm.so
33785         * file-io.c, file-io.h: fixed handle argument type.
33787 2002-03-18  Dick Porter  <dick@ximian.com>
33789         * reflection.c (mono_image_get_type_info): rename interface to
33790         iface, because of "#define interface struct" on windows.
33792 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
33794         * class.c, class.h: rename and export mono_ptr_class_get().
33795         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
33796         * reflection.c, reflection.h, icall.c: better/saner type name
33797         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
33798         method signatures.
33800 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
33802         * class.c (mono_class_init): removed hardcoded GHC_SLOT
33804         * icall.c (ves_icall_InternalInvoke): impl.
33806 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
33808         * reflection.c: output the interface map table, too.
33810 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
33812         * class.c (class_compute_field_layout): separate computation of 
33813         static field layout
33815 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
33817         * icall.c: added System.Buffer support.
33818         * file-io.c: moved file icalls from PAL to FileStream.
33820 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
33822         * icall.c (ves_icall_System_Object_GetHashCode): impl.
33824 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
33826         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
33828 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
33830         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
33832 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
33834         * debug-helpers.{c,h}: moved here from monograph some useful functions
33835         to locate a method by name/signature in a class or image. Included
33836         also a small and flexible IL disassembler.
33838 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
33840         * reflection.c: fixup tokens in methods with small header size, too.
33842 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
33844         * object.c (mono_string_to_utf8): remove assert(!error), instead
33845         print a warning. 
33847 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
33849         * icall.c: update to the new mono_Array_class_get interface.
33851 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
33853         * appdomain.c, object.c: Boehm-GC enable.
33854         * icall.c: make get_data_chunk() support split data requests.
33855         Ensure a class is initialized in more cases. Return only the first
33856         property found in GetProperties() or the compiler gets confused. 
33857         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
33858         * reflection.h, reflection.c: add fixup mechanism for field and method
33859         tokens. Initialize assembly->typeref in a single place. Output
33860         properties after events. Support custom attributes for events, too.
33861         Typo fix for paramter custom attrs.
33863 2002-03-07  Martin Baulig  <martin@gnome.org>
33865         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
33867 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
33869         * class.c (mono_array_class_get): fix. for multi. dim. arrays
33871 2002-03-06  Martin Baulig  <martin@gnome.org>
33873         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
33874         non-zero lower bounds. See testcases #F10-#F13.
33876 2002-03-05  Martin Baulig  <martin@gnome.org>
33878         * exception.c (mono_get_exception_argument_out_of_range): New exception.
33880         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
33881         ves_icall_System_Array_GetValue(), only calculate the absolute array position
33882         here.
33883         (ves_icall_System_Array_SetValue): Likewise.
33884         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
33885         as argument and does the actual work. This function is used when copying a
33886         multi-dimensional array.
33887         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
33888         now do all the widening conversions of value types.
33889         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
33891 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33893         * class.c: remove some magic numbers and use the smbolic names,
33894         instead. Added init_events() to load event info at class init time.
33895         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
33896         and mono_metadata_methods_from_event().
33897         * reflection.h, reflection.c: added support for writing out the evnets
33898         related information.
33900 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
33902         * reflection.h, icall.c: use a different method (GetInterfaces)
33903         to gather interface info and add isbyref, isprimitive and
33904         ispointer to the ves_icall_get_type_info() return value.
33906 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
33908         * class.h: stared adding support for events.
33909         * icall.c: split find_members implementation. Added debug icall to get
33910         the address of an object.
33911         * reflection.c: handle TypeBuilders in mono_type_get_object().
33913 2002-03-01  Martin Baulig  <martin@gnome.org>
33915         * icall.c (ves_icall_System_Array_GetLength): This must throw an
33916         ArgumentOutOfRangeException(), not an ArgumentException().
33917         (ves_icall_System_Array_GetLowerBound): Likewise.
33918         (ves_icall_System_Array_GetValue): Improved argument checking.
33919         (ves_icall_System_Array_SetValue): Improved argument checking.
33921 2002-03-01  Martin Baulig  <martin@gnome.org>
33923         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
33924         called with invalid arguments rather than just dying with g_assert().
33925         (ves_icall_System_Array_SetValue): Likewise.
33926         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
33927         raise a NotImplementedException instead.
33928         (ves_icall_System_Array_GetLength): Added argument checking.
33929         (ves_icall_System_Array_GetLowerBound): Added argument checking.
33931 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
33933         * object.h (mono_assert): new macros mono_assert and
33934         mono_assert_not_reached
33936 2002-02-28  Martin Baulig  <martin@gnome.org>
33938         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
33939         and "System::String::IsInterned" to "System::String::_IsInterned".
33941 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
33943         * icall.c: remove hacks for typebuilder. Added icall to create a
33944         modified type from a tybebuilder.
33945         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
33946         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
33947         to create a backing MonoClass for a TypeBuilder.
33949 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33951         * class.c, class.h: more refactoring of class init.
33952         Export mono_class_setup_mono_type() and mono_class_setup_parent().
33954 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
33956         * marshal.c, marshal.h: start of marshaling interface.
33958 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
33960         * icall.c: fix order in assembly qualified name icall.
33962 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
33964         * class.c: do not free str, since we store it in the hash table.
33965         * reflection.h: add label field to MonoILExceptionInfo.
33966         * reflection.c: handle references to more than one assembly. Handle
33967         case when there isn't a module created in the assembly.
33969 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
33971         * class.c: Fix typo. Start refactoring of class init code.
33973 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
33975         * appdomain.c: exit with 1 on error.
33976         * class.c: we already have the name in MonoClassField.
33977         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
33978         MonoStreamHeader instead of an offset of image->raw_metadata.
33980 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
33982         * appdomain.c (mono_init): Be even more descriptive about the error.
33984 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
33986         * appdomain.c: give the user an informative message when corlib can't
33987         be loaded.
33989 2002-02-26  Martin Baulig  <martin@gnome.org>
33991         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
33992         New icall to get the time zone data.
33994 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33996         * reflection.c: set virtual and raw size of section correctly.
33997         * threads.c: transfer domain information to newly created threads.
33999 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
34001         * class.c: when instancing a class in a domain, load the default
34002         vaules for static fields from the constant table. Fix System.Enum to
34003         not be an enum.
34004         * icall.c: implement Object::GetType() internalcall. Implemented
34005         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
34006         Fixed checking of binding flags in find_members().
34007         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
34008         * reflection.c: handle enumerations when writing to the constant
34009         table. Use a different object cache for types.
34012 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
34014         * object.c (mono_object_isinst): fix for arrays
34016         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
34018 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
34020         * object.c: don't use mprotect ()  and fix intern pool hash table
34021         lookup for big endian systems.
34023 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34025         * icall.c: change type_is_subtype_of () signature.
34027 2002-02-21  Mark Crichton  <crichton@gimp.org>
34029         * rand.c, rand.h: Added random number generator for
34030         System.Security.Cryptography classes.
34032         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
34034         * icall.c: Added System.Security.Cryptography calls.
34036 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
34038         * class.c, icall.c, metadata.c: better support for pointer types.
34039         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
34040         * reflection.c: Add support for getting custom attrs for properties
34041         and simplify some code.
34043 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34045         * icall.c: change getToken () and add custom attribute GetBlob()helper
34046         method.
34047         * reflection.h: add custom attrs array to the reflection builder structures.
34048         * reflection.c: encode and emit custom attributes for all the relevant
34049         reflection objects. Cache fieldref and methodref tokens. Change
34050         mono_image_create_token() interface to take a MonoDynamicAssembly.
34051         More complete custom attributes decoder. Load custom attributes for
34052         Assembly, Field, Method and Constructor objects, too. Make the
34053         returned array an Attribute[] one, not object[]. Added
34054         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
34055         custom attribute constructor.
34057 2002-02-20  Dick Porter  <dick@ximian.com>
34059         * icall.c:
34060         * rawbuffer.c:
34061         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
34062         problem code out for now).
34064 2002-02-19  Radek Doulik  <rodo@ximian.com>
34066         * object.c (mono_ldstr): use hash table to avoid multiple swapping
34068 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
34070         * icall.c: register the GetCustomAttributes method.
34071         * object.c, object.h: add mono_string_new_len ().
34072         * reflection.h, reflection.c: added mono_runtime_invoke(),
34073         mono_install_runtime_invoke(). Added
34074         mono_reflection_get_custom_attrs () to load custom attributes and
34075         create the attribute objects.
34077 2002-02-19  Dick Porter  <dick@ximian.com>
34078         * threads-dummy-types.c:
34079         * threads-dummy-types.h:
34080         * threads-dummy.c:
34081         * threads-dummy.h:
34082         * threads-pthread-types.c:
34083         * threads-pthread-types.h:
34084         * threads-pthread.c:
34085         * threads-pthread.h:  Deleted obsolete files
34087 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
34089         * class.c (mono_class_vtable): runtime init the class when we
34090         allocate static class data.
34092         * icall.c (ves_icall_System_Array_SetValue): check for null values.
34094         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
34095         and String - but we will need generic marshalling support in the
34096         future. 
34097         (mono_init): set the domain name in a ms compatible way
34099         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
34100         String[].
34102 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
34104         * object.c (mono_array_clone): use alloca() instead of g_malloc  
34105         for sizes
34107         * appdomain.c (mono_domain_unload): impl.
34109 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
34111         * appdomain.c, object.c: fix intern pool implementation.
34112         * class.c: fix alignment code.
34114 2002-02-16  Radek Doulik  <rodo@ximian.com>
34116         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
34117         and s2 > s1, just copy lower bytes to be compatible with little
34118         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
34119         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
34121         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
34122         force big_endian to be 1 for big endian machines 
34123         (ves_icall_iconv_new_decoder): ditto
34125 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
34127         * socket-io.c (convert_sockopt_level_and_name): If the system
34128         doesn't define SOL_IP or SOL_TCP, get them by hand using
34129         getprotobyname() and caching the values (because this could be a
34130         slow operation).
34131         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
34132         Use the appropriate struct when the system does support it. Ie,
34133         not all systems have struct ip_mreqn so use struct ip_mreq when
34134         appropriate.
34136 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
34138         * reflection.c: handle finally clauses.
34140 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
34142         * socket-io.c: use g_snprintf() instead of snprintf.
34144 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
34146         * reflection.c (mono_param_get_objects): Cast second argument to
34147         mono_method_get_param_names to a const char** to silence the
34148         compiler warning.
34150         * appdomain.c (mono_domain_assembly_open): Put parens around the
34151         truth statement in the for-loop.
34153         * unicode.c (iconv_convert): Got rid of a compiler warning about
34154         int i being unused when the system has a new iconv.
34155         (iconv_get_length): Same.
34157         * image.c (load_class_names): Cast the second argument to
34158         g_hash_table_insert() to char* to hush compiler warnings about the
34159         arg being a const.
34160         (mono_image_open): Same here.
34162         * socket-io.c: Don't conditionally include sys/filio.h or
34163         sys/sockio.h here anymore since we now get them from
34164         io-layer/io-layer.h
34165         (inet_pton): If the system doesn't support inet_aton, implement
34166         using inet_addr and also #define INADDR_NONE if it isn't defined
34167         by the system.
34169 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
34171         * metadata.c, metadata.h: added function to get packing and size info
34172         of a typedef.
34173         * reflection.h, reflection.c: handle field RVA data. Save info about
34174         the table layout if needed. Assign typedef indexes to all the types
34175         before dumping the info about them to avoid forward reference problems.
34177 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
34179         * socket-io.c (convert_sockopt_level_and_name): ifdef
34180         SO_ACCEPTCONN because it is not defined on my system (old debian)
34182 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
34184         * opcode.c: use stddef.h to get NULL.
34186 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
34188         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
34189         for FIONBIO, FIONREAD and SIOCATMARK.
34190         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
34191         define INADDR_NONE and besides, inet_addr() is deprecated and
34192         should not be used. Use inet_pton() instead - it also has the
34193         added bonus that it can easily handle IPv6 addresses as well.
34194         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
34196 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
34198         * decimal.c: remove _MSC_VER conditional.
34200 2002-02-13  Dick Porter  <dick@ximian.com>
34202         * socket-io.c: 
34203         * icall.c: Internal calls for Blocking, Select, Shutdown,
34204         GetSocketOption and SetSocketOption
34206 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34208         * assembly.cs: better resolver: use it instead of some kludgy
34209         code.
34211 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
34213         * reflection.c: the best way to speed-up the compiler is to avoid
34214         infinite loops.
34216 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
34218         * class.c (mono_class_vtable): changed the object layout
34219         (obj->vtable->class). 
34220         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
34222 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34224         * assembly.c: look for assemblies in the assembly dir, too.
34226 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34228         * class.c: fix thinko in mono_class_from_type().
34230 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
34232         * exception.h, exception.c: added TypeLoadException.
34233         * object.h, object.c: added mono_array_clone ().
34234         * icall.c: handle throwOnError in AssemblyGetType().
34235         Added Array.Clone().
34236         * opcode.h, opcode.c: use a single value for the opcode val.
34237         Compile fix for non-gcc compilers.
34239 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
34241         * opcodes.c, opcodes.h: export interesting info about opcodes.
34243 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
34245         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
34246         icalls. 
34248         * class.c (class_compute_field_layout): set element_class for enums
34249         (mono_class_create_from_typedef): set element_class for normal classes
34251         * icall.c (ves_icall_System_Enum_get_value): impl.
34253         * class.c (mono_class_create_from_typedef): do not set valuetype
34254         flag for System.ValueType and System.Enum
34256 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
34258         * unicode.c (iconv_convert): fix big endian problem.
34260 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
34262         * class.c: add asserts if we are ever going to scribble over memory.
34263         * socket-io.c: not all systems have AF_IRDA defined.
34265 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
34267         * class.c (class_compute_field_layout): do not consider static
34268         fields to compute alignment
34270 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
34272         * appdomain.c (mono_appdomain_get): impl.
34273         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
34275 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
34277         * icall.c: ignore "file://" prefix when loading an assembly.
34279 2002-01-23  Dick Porter  <dick@ximian.com>
34281         * socket-io.c:
34282         * icall.c:
34283         * Makefile.am: Added socket support
34285 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
34287         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
34288         code back.  This should return the assemblies that are loaded by
34289         the runtime on behalf of an application domain. 
34291         The current implementation is still broken, it just returns every
34292         assembly loaded, but until we get real applications domain this
34293         will do.
34295 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
34297         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
34298         AppDomain object.
34300 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
34302         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
34303         the mono_class_from_name lookup.
34304         (ves_icall_get_parameter_info): ditto.
34305         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
34306         method.
34307         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
34309 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
34311         * class.c: load also nested classes on class init.
34312         System.ValueType instance methods gets passed boxed
34313         values, unless methods in derived classed that get a pointer to the
34314         data.
34315         * icall.c: use better name parsing code in GetType().
34316         * image.c, image.h: add mono_image_loaded ().
34317         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
34318         * reflection.c, reflection.h: added mono_reflection_parse_type().
34320 2002-01-22  Veronica De Santis <veron78@interfree.it>
34322         * icall.c : Added mapping of internal calls for Manual and Auto reset events
34323         * threads.c : Added the implementation of internal calls for events
34324         * threads.h : Added prototypes of internal calls for events
34325         
34326 2002-01-21  Radek Doulik  <rodo@ximian.com>
34328         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
34330 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
34332         * class.c (mono_class_init): set min_align to 1 (instead of 0)
34333         (mono_class_value_size): use min_align
34335 2002-01-20  Dick Porter  <dick@ximian.com>
34337         * threads.h:
34338         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
34339         so it compiles on w32.
34341 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
34343         * metadata.c (mono_type_stack_size): impl.
34345         * class.c (mono_class_get_field): impl. memberref token
34347 2002-01-16 Veronica De Santis <veron78@@interfree.it>
34349         * icall.h : Added the internal calls mapping for CreateMutex_internal
34350                     and ReleaseMutex_internal.
34351         * threads.h : Added the prototype of mutexes internal calls.
34352         * threads.c : Added the implementations of mutexes internal calls.
34354 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
34356         * metaparse.h: removed unused file.
34357         * reflection.c, reflection.h: added stream_data_align () function 
34358         to align data in streams and keep stream aligned. Add support for
34359         exception support in method headers.
34361 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
34363         * unicode.c: make iconv_convert () return the number of bytess written
34364         in the output buffer.
34366 2002-01-15  Dick Porter  <dick@ximian.com>
34367         * threads.c: Make the runtime's idea of infinite timeouts coincide
34368         with the class library's
34370         Fix a particularly egregious bug in mono_thread_cleanup(). That
34371         code was so utterly bogus it must have been written on a Monday.
34373 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
34375         * reflection.h: add subtypes field to TypeBuilder.
34376         * reflection.c: encode constants for literal fields.
34377         Handle subtypes. Fix user string token (and add a zero byte)
34378         at the end.
34379         
34380 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
34382         * class.c (mono_class_init): bug fix: assign slot numbers for
34383         abstract methods.
34385 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34387         * reflection.c: don't try to output a code RVA for abstract methods.
34388         Small fixes for method header format. Output parameter info to the
34389         ParamDef table. Save method overriding info to MethodImpl table.
34390         Fix property support. Allow typedef.extends to be a type in the
34391         building assembly.
34392         * verify.c: fix off-by-one error.
34394 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
34396         * class.c: fix mono_class_from_mono_type () for szarray types.
34397         Remove unused cache check in mono_class_from_type_spec().
34398         * icall.c: *type_from_name () functions handle simple arrays and byref.
34399         * reflection.c: handle byref and szarray types. Handle methods without
34400         body (gets P/Invoke compilation working). Handle types and fields in
34401         get_token ().
34402         * reflection.h: add rank to MonoTypeInfo.
34404 2002-01-10  Dick Porter  <dick@ximian.com>
34406         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
34407         internal calls
34409 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
34411         * icall.c: initialize class in type_from_handle ().
34412         Loop also in parent classes for get_method ().
34413         * reflection.c: properly encode class and valuetype types.
34414         Start on encoding TypeBuilder types. Handle fieldrefs.
34415         Use correct length when registering a user string.
34416         Handle ConstructorBuilder and MonoMethod in get_token ().
34417         Make mono_type_get_object () aware of cached types.
34418         * object.c: back out change to mono_string_new ().
34420 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
34421         * object.c: mono_string_new should return a NULL when the string 
34422         passed in is NULL -- not try to deference it.
34423         
34424 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
34426         * icall.c: hack to make IsSubType work for TypeBuilders.
34427         * reflection.c: emit constructors before methods.
34428         Retrieve param names in mono_param_get_objects().
34430 2002/01/05  Nick Drochak  <ndrochak@gol.com>
34432         * Makefile.am: fix list of headers and sources so automake 1.5
34433         doesn't complain. Removed \# at end of list.
34435 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
34437         * reflection.c: get token for a method ref. Set return type of
34438         constructor to void.
34439         * loader.c: debug message.
34440         * class.c: typo fix.
34442 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
34444         * icall.c: fix array init with rank > 1. FindMembers
34445         loops in parent class as well.
34446         * image.c: do not insert nested types in name cache.
34447         * reflection.c: warning fix.
34448         * reflection.h: add override method (for interface impl).
34450 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
34452         * metadata.c: fix customattr decoding.
34454 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
34456         * rawbuffer.cs: Added native Win32 implementation, avoids using
34457         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
34459 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
34461         * class.c: make the low-level routines handle the cache.
34463 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
34465         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
34467 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
34469         * class.c: fix mono_array_element_size() for objects.
34470         * class.h, class.c: add properties to MonoClass and load them
34471         at init time.
34472         * icall.c: check with isinst() when assigning a value to an array
34473         instead of requiring the classes to match exactly.
34474         Implemented icall for System.Type::GetType().
34475         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
34476         enums. Handle bindingflags when looking for methods and fields.
34477         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
34478         and mono_metadata_methods_from_property().
34479         * reflection.h, reflection.c: added structures for propreties,
34480         parameters and enums. Implemented mono_property_get_object() and
34481         mono_param_get_objects().
34483 2001-12-18  Dick Porter  <dick@ximian.com>
34485         * file-io.c: Use mono_string_to_utf16() instead of
34486         mono_string_chars()
34488         * object.c: Added mono_string_to_utf16(), which copies the non
34489         NULL-terminated MonoString into a new double-null-terminated
34490         buffer.
34492 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
34494         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
34496 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
34498         * file-io.c: raise exceptions if handle is invalid.
34500 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
34502         * assembly.c: yet another check for mscorlib.
34503         * class.c, class.h: load nesting info for classes.
34504         * icall.c: many new functions to support the Reflection classes.
34505         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
34506         * reflection.h, reflection.c: mono_image_create_token(),
34507         mono_assembly_get_object(), mono_type_get_object(),
34508         mono_method_get_object(), mono_field_get_object(): methods to return
34509         objects that parallel the C representation of assemblies, types,
34510         methods, fields.
34512 2001-12-11  Dick Porter  <dick@ximian.com>
34514         * icall.c:
34515         * file-io.c: Internal calls for file IO.
34517 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
34519         * tabledefs.h: missing FileAttributes.
34520         * verify.h, verify.c: use is_valid_string () to simplify and check for
34521         valid strings more correctly. Fix warnings and speeling.
34522         Check more tables: Filed, File, ModuleRef, StandAloneSig.
34523         Check code: branches, maxstack, method calls.
34525 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
34527         * object.c (mono_object_allocate): removed static, so that the jit
34528         can allocate value types.
34530         * icall.c (ves_icall_System_DateTime_GetNow): impl.
34532 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34534         * class.c: init enum types right away and register the
34535         token->MonoClass map in mono_class_create_from_typedef ().
34536         * verify.h, verify.c: first cut of the verifier.
34537         * pedump.c: add --verify switch to verify metadata tables.
34538         * tabledefs.h: add some missing enums.
34540 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
34542         * class.c (mono_install_runtime_class_init): impl.
34543         (mono_class_init): renamed mono_class_metadata_init to
34544         mono_class_init, also removed the metadata_inited flag
34546         * object.c (mono_object_isinst): use faster algorithm
34548 2001-11-30  Radek Doulik  <rodo@ximian.com>
34550         * mono-endian.h: reverted last change
34551         added function prototypes
34553         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
34554         add mono-endian.c back
34556         * mono-endian.c: returned back, as Paolo pointed out, it's needed
34557         for unaligned access, I've mistaked it with endianess. I am
34558         sorry.
34559         (mono_read16): fix reverted endianess
34560         (mono_read64): ditto
34561         (mono_read32): ditto
34563 2001-11-30  Dick Porter  <dick@ximian.com>
34565         * exception.c: Implement mono_exception_from_name()
34567 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
34569         * metadata.h, metadata.c: remove params_size and locals_size and their
34570         calculation from the metadata code: they are only usefult to the
34571         interp.
34573 2001-11-29  Radek Doulik  <rodo@ximian.com>
34575         * object.c (mono_ldstr): swap bytes here, it's probably not the
34576         best place, but works for me now, I'll redo it once I know mono
34577         better, also note that I add PROT_WRITE and don't reset back, also
34578         note that it's only affects big endians, so x86 should be OK
34580         * mono-endian.h (read16): use just glib macros for both endians
34582         * mono-endian.c: removed as glib macros are used in in
34583         mono-endian.h so we don't need to care about endianess for read
34584         macros as glib does that for us already
34586 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
34588         * class.h, class.h: take minimum alignment into consideration so
34589         that the fields of a class remain aligned also when in an array.
34591 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34593         * loader.h, loader.c: add mono_method_get_param_names().
34594         * class.c: 0-init class fields.
34596 2001-11-26  Dick Porter  <dick@ximian.com>
34598         * icall.c:
34599         * threads-types.h:
34600         * threads.c: New file that handles System.Threading on all platforms
34602         * object.c: 
34603         * object.h: Remove the synchronisation struct from MonoObject,
34604         replace it with a pointer that gets initialised on demand
34606         * Makefile.am: Replace all the system-specific threading code with
34607         a single file that uses the new wrapper library
34609 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
34611         * class.c, class.h: add mono_install_trampoline() so that the runtime
34612         can register a function to create a trampoline: removes the ugly
34613         requirement that a runtime needed to export arch_create_jit_trampoline.
34614         * object.h, object.c: added mono_install_handler() so that the runtime
34615         can install an handler for exceptions generated in C code (with
34616         mono_raise_exception()). Added C struct for System.Delegate.
34617         * pedump.c: removed arch_create_jit_trampoline.
34618         * reflection.c: some cleanups to allow registering user strings and
34619         later getting a token for methodrefs and fieldrefs before the assembly
34620         is built.
34621         * row-indexes.h: updates and fixes from the new ECMA specs.
34623 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
34625         * class.h, class.c: add enum_basetype field to MonoClass.
34626         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
34627         to get index in the constant table reated to a field, param or
34628         property.
34629         * reflection.h, reflection.c: handle constructors. Set public-key and
34630         version number of the built assembly to 0.
34631         * row-indexes.h: update from new ECMA spec.
34633 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
34635         * class.h, class.c: add a max_interface_id to MonoClass.
34636         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
34637         since it's used to do that. Added mono_type_type_from_obj().
34638         Make GetType() return NULL instead of segfaulting if the type was not
34639         found. Handle simple arrays in assQualifiedName.
34640         * object.h: add a struct to represent an Exception.
34641         * reflection.c: output call convention in method signature.
34642         Add code to support P/Invoke methods and fixed offsets for fields.
34644 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
34646         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
34647         the value.
34648         * icall.c: use mono_array_addr instead of array->vector: fixes the
34649         reflection image writing.
34650         * reflection.c: init call convention byte to 0 in method signature.
34651         Encode the property signature. Don't output property-related methods
34652         twice. Really process the properties for a type (don't cast a field to
34653         a property, my mom always told me that).
34654         Fix 64 bit issues in pointer alignment in a different and more
34655         readable way.
34657 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
34659         * loader.h: Removed type class from MonoDefaults, added monotype
34661         * loader.c: Loaded MonoType, removed loading of Type
34663         * icall.c (my_mono_new_object): Now returns a System.MonoType,
34664         and fills in System.Type._impl with a RuntimeTypeHandle rather
34665         than the actual MonoClass *
34667         (ves_icall_type_from_handle): change from type_class to
34668         monotype_class
34670         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
34671         implemented
34673         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
34674         implemented
34676         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
34678         (ves_icall_System_Reflection_Assembly_GetType): implemented
34680         (ves_icall_System_MonoType_assQualifiedName): implemented
34682         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
34684 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
34686         * assembly.c (mono_assembly_open): Implement a cache for the
34687         assemblies. 
34689         (mono_assembly_close): only destroy the assembly when the last
34690         reference is gone.
34691         
34692 2001-11-09  Dick Porter  <dick@ximian.com>
34694         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
34696 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
34698         * class.c (mono_class_metadata_init): bug fix: compute the right slot
34700 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
34702         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
34703         from Martin Weindel.
34704         * object.h: add mono_string_chars ().
34706 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
34708         * reflection.c (build_compressed_metadata): Eliminates warnings
34709         and uses 64-bit clean code.
34711         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
34712         (mono_type_equal): Change signature to eliminate warnings.
34714 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34716         * icall.c, loader.c: remove the internalcall array constructors.
34717         Changes to match the new MonoArray structure.
34718         * object.h, object.c: an array object doesn't allocate an extra
34719         vector. Add mono_array_new_full () to create jagged arrays easily.
34721 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
34723         * metadata.h, metadata.c: add mono_metadata_field_info () to
34724         retreive all the info about a field from vairous tables.
34725         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
34726         * class.h, class.c: augment MonoClassField with more info.
34727         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
34728         policy and load a field's RVA if needed.
34730 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
34732         * class.c (mono_class_metadata_init): create a trampoline for all
34733         virtual functions instead of actually compiling them.
34735 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
34737         * class.h, class.c: include name in MonoClassField.
34738         * class.c: fix fundamental type of System.Object and System.String.
34739         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
34740         tokens in ldtoken.
34741         * icall.c: remove internalcalls for the Reflection stuff that is now
34742         done in C# code.
34743         * loader.c: mono_field_from_memberref () implementation.
34744         * mono-endian.c: thinko (s/struct/union/g).
34745         * object.c, object.h: make the mono_string_* prototypes actually use
34746         MonoString instead of MonoObject.
34747         * reflection.c, reflection.h: updates for changes in the reflection
34748         code in corlib: we use C structures that map to the actual C# classes.
34749         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
34750         fat method header if needed and use the info from the ILGenerator for
34751         methods. Handle fields in types. Misc fixes.
34753 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
34755         * class.c (mono_class_metadata_init): bug fix: always allocate
34756         space for static class data
34758 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
34760         * class.c (mono_compute_relative_numbering): use relative
34761         numbering to support fast runtime type checks.
34763 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
34765         * class.c (mono_class_create_from_typeref): added debugging output
34766         to print class name when MonoDummy is returned instead of real class
34768 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
34770         * class.c (mono_class_metadata_init): interface offset table now
34771         contains pointers into the vtable - this is more efficient for the jit
34773 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
34775         * class.c (mono_class_metadata_init): use a temporary vtable (the
34776         old algorithm only worked for the interpreter, but not for the jit)
34778 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
34780         * loader.c (method_from_memberref): use mono_class_get to get the
34781         class of an array instead of using System.Array directly.
34782         (mono_get_method): also add MEMBERREF methods to the method cache
34783         which usefull for arrays.
34785 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
34787         * pedump.c (arch_compile_method): added to compute vtable entry
34789         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
34790         number of interfaces.
34791         
34792         * class.h: merged MonoArrayClass into MonoClass
34794         * class.c (mono_class_create_from_typedef): compute the vtable size and
34795         allocate space to include the vtable inside MonoClass
34796         (mono_class_metadata_init): initialize the vtable
34798 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
34800         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
34801         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
34802         * image.c: endian fixes by Laurent Rioux.
34803         * object.h, object.c: rename MonoStringObject to MonoString and
34804         MonoArrayObject to MonoArray. Change some function names to conform to
34805         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
34806         guint16* as first argument, so don't use char*.
34807         Provide macros to do the interesting things on arrays in a portable way.
34808         * threads-pthread.c: updates for the API changes and #include <sched.h>
34809         (required for sched_yield()).
34810         * icall.c: updates for the API changes above.
34811         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
34812         platforms that need them.
34814 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
34816         * class.c: set the correct type for all the fundamental
34817         type when loading the class.
34819 2001-10-05  Dick Porter  <dick@ximian.com>
34821         * threads-pthread.c (pthread_mutex_timedlock): Simple
34822         compatibility version for C libraries that lack this call.
34824 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34826         * class.c: MonoTypes stored in MonoClass are stored as
34827         fundamental MonoTypes when the class represents a
34828         fundamental type (System.Int32, ...).
34829         The TypeHandle return by ldtoken is a MonoType*.
34830         * icall.c: ves_icall_get_data_chunk () write out all the
34831         PE/COFF stuff. Implement ves_icall_define_method (),
34832         ves_icall_set_method_body (), ves_icall_type_from_handle ().
34833         * image.c: properly skip unknown streams.
34834         * loader.h, loader.c: add type_class to mono_defaults.
34835         * metadata.c, metadata.h: export compute_size () as
34836         mono_metadata_compute_size () with a better interface.
34837         Typo and C&P fixes.
34838         * pedump.c: don't try to print the entry point RVA if there is no entry point.
34839         * reflection.c, reflection.h: many cleanups, fixes, output method
34840         signatures and headers, typedef and typeref info, compress the metadata
34841         tables, output all the heap streams, cli header etc.
34842         * row-indexes.h: typo fixes.
34844 2001-10-04  Dick Porter  <dick@ximian.com>
34846         * object.h: Add a synchronisation mutex struct to MonoObject
34848         * object.c (mono_new_object): Initialise the object
34849         synchronisation mutexes
34851         * icall.c: System.Threading.Monitor internal calls
34852         
34853         * threads-pthread.h:
34854         * threads-pthread.c: System.Threading.Monitor internal calls
34856         * threads-types.h: New file, includes the system-specific thread
34857         structures
34858         
34859         * threads-pthread-types.h:
34860         * threads-pthread-types.c: New files, handle pthread-specific
34861         synchronisation types
34863         * threads-dummy-types.h: 
34864         * threads-dummy-types.c: New files of dummy support for
34865         thread-specific types
34867         * metadata.c:
34868         * image.c:
34869         * pedump.c: include mono-endian.h not endian.h
34870         
34871         * Makefile.am: More threads files.
34872         Name mono-endian.h not endian.h
34874 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
34876         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
34877         stuff and implement a few more bits.
34878         * icall.c: a field needs to be dereferenced twice. Do not use the same
34879         name for two variables in the same scope.
34880         * image.c, image.h: cleanups.
34882 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
34884         * class.c (mono_class_metadata_init): bug fix: compute the right size
34886 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
34888         * icall.c: implemented some of the Reflection internalcalls.
34889         * image.c, image.h: start writing out the PE/COFF image.
34890         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
34891         that does the reverse than decode_blob_size ().
34892         * object.c: use mono_metadata_encode_value (). Move here
34893         temporary implementation of mono_string_to_utf8 ().
34894         * rawbuffer.c: make malloc_map static.
34896 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34898         * metadata.c: fix type comparison for arrays.
34899         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
34900         Added a couple of new classes to monodefaults.
34901         * icall.c: added a couple of Reflection-related internalcalls.
34902         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
34903         Added a byval_arg MonoType to MonoClass.
34905 2001-09-28  Dick Porter  <dick@ximian.com>
34907         * icall.c:
34908         * threads-pthread.h: 
34909         * threads-pthread.c: Implemented internal calls for
34910         LocalDataStoreSlot operations.  Applied mutexes around all shared
34911         data.  Reworked the thread creation and Start() operations to
34912         avoid a race condition.
34913         
34914         * threads-dummy.h:
34915         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
34917 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
34919         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
34921 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
34923         * class.c, loader.c: warn and return NULL instead of erroring out.
34924         * icall.c: added System.AppDomain::getCurDomain().
34925         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
34927 2001-09-25  Dick Porter  <dick@ximian.com>
34929         * threads-pthread.h:
34930         * threads-pthread.c: Implemented timed thread joining and added
34931         System.Threading.Thread::Join_internal internal call
34933         * icall.c: Added System.Threading.Thread::Join_internal internal call
34935         * threads-dummy.h:
34936         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
34938 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
34940         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
34941         mono_string_intern () to implement the semantics of the ldstr opcode
34942         and the interning of System.Strings.
34943         * icall.c: provide hooks to make String::IsIntern and String::Intern
34944         internalcalls.
34946 2001-09-23  Dick Porter  <dick@ximian.com>
34948         * threads-dummy.c: 
34949         * threads-dummy.h: New files of dummy threading routines
34951         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
34952         support code based on system specifics
34954         Rename PTHREAD_LIBS to THREAD_LIBS
34955         
34956 2001-09-23  Dick Porter  <dick@ximian.com>
34958         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
34959         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
34960         internal calls.
34961         (mono_thread_init): Set up a Thread object instance to return when
34962         the main thread calls Thread.CurrentThread
34963         (mono_thread_cleanup): Wait for all subthreads to exit
34965         * icall.c: New internal calls for System.Threading.Thread::Sleep
34966         (including Schedule) and CurrentThread
34968         * threads.h: New file, to insulate thread-specific stuff from the
34969         rest of the code
34971 2001-09-21  Dick Porter  <dick@ximian.com>
34973         * threads-pthread.h: 
34974         * threads-pthread.c: New file, for handling pthreads-style
34975         threading support.  Start() now starts a new thread and executes
34976         the ThreadStart delegate instance.
34978         * icall.c: Added the internalcall for
34979         System.Threading.Thread::Start_internal
34981         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
34983 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
34985         * loader.c: work around the different signatures for delegates
34986         constructors csc generates in compiled code vs the ones compiled in mscorlib.
34988 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
34990         * class.h, class.c: add mono_class_get_field_from_name ().
34991         * *: Fix C comments and other ANSI C issues.
34993 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
34995         * endian.h, assembly.c: fix some endianness issues.
34997 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
34999         * loader.h, load.c: add delegate_class to mono_defaults.
35000         Handle runtime provided methods in mono_get_method ().
35002 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
35004         * loader.c (mono_get_method): use pinvoke for internal call
35006         * icall.c: use pinvoke for internal call
35008         * loader.c (method_from_memberref): set the method name
35010 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
35012         * metadata.c: help the compiler generate better code for
35013         mono_class_from_mono_type ().
35015 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
35017         * class.c (mono_class_metadata_init): delayed computing of the
35018         class size to mono_class_metadata_init ()
35020 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
35022         * class.c, class.h: add an interfaces member to MonoClass.
35023         * image.c, image.h: add assembly_name field to MonoImage
35024         from the assembly table.
35025         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
35027 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
35029         * class.c: Handle Array in mono_class_from_mono_type ().
35030         * metadata.c, pedump.c: some endian fixes.
35032 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
35034         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
35035         * metadata.c: fix small problem introduced with the latest commit.
35037 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
35039         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
35040         We don't need a MonoMetadata pointer anymore to compare signatures in
35041         mono_metadata_signature_equal (), update callers.
35042         Reduced memory usage an number of allocations for MonoMethodHeader and
35043         MonoMethodSignature.
35045 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
35047         * metadata.c: added compare for szarray.
35049 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
35051         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
35052         and add a couple more types to it and mono_defaults. Give an hint on
35053         classes that need implementing in our corlib and are referenced
35054         in mscorlib.
35056 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
35058         * class.h, class.c: keep track if a class is also an Enum.
35059         * loader.c: Implement a couple more types for use in libffi
35060         marshalling. Gives better diagnostics when failing to dlopen
35061         a library. Set method->klass for P/Invoke methods, too.
35063 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
35065         * class.c, class.h: add a MonoType this_arg to MonoClass that
35066         represents a pointer to an object of the class' type that
35067         can be used by the interpreter and later the type cache.
35068         Add best guess alignment info for valuetype objects.
35070 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
35072         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
35073         into MonoType: one less level of indirection and allocation and
35074         simplifies quite a bit of code. Added cache for MonoTypes that are
35075         used frequently, so that we don't need to allocate them all the time.
35077 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
35079         * class.c (mono_class_create_from_typedef): System.Enum is also a
35080         value type, although it does not derive from System.ValueType
35081         (maybe a bug in the ms compiler?)
35083         * metadata.c (mono_type_size): return the right size for value types
35085         * loader.c (mono_get_method): only initialize method header if not abstract
35087         * class.c (mono_class_from_mono_type): use mono_default values. 
35089 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
35091         * *: use MonoClass pointers instead of <type_tokens>
35092         
35093         * class.h: new flag: metadata_inited.
35095         * class.c (mono_class_metadata_init): impl.
35096         (mono_class_instance_size): impl.
35097         (mono_class_data_size): impl.
35099 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
35101         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
35102         MonoClass now has the name and name_space fields. 
35103         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
35104         mono_get_method () takes and optional MonoClass as argument.
35105         Removed mono_typedef_from_name() and added mono_class_token_from_name()
35106         instead that takes advantage of a map from class names to typedef
35107         tokens in MonoImage.
35109 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
35111         * metadata.c: zero is not a valid alignment boundary.
35112         Merge MONO_TYPE_VOID in default decoding code.
35114 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
35116         * image.h: merged MonoMetadata into MonoImage
35118         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
35119         identify the type of elements.
35121 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
35123         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
35124         * cil-coff.h: split MonoMSDOSHeader and add size info.
35125         * image.c: add some consistency checks.
35126         * metadata.c: fix row size computation: one programmer
35127         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
35128         add explanation for the locator routine.
35129         Fix decoding of size in method header.
35130         
35131 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
35133         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
35134         (g_concat_dir_and_file): Bring g_concat_dir_and_file
35135         function from gnome-libs.  This uses the right path separator
35136         based on the OS, and also works around a bug in some systems where
35137         a double slash is not allowed. 
35138         (default_assembly_name_resolver): Use g_concat_dir_and_file
35139         (mono_assembly_open): ditto.
35141 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
35143         * metadata.c (mono_metadata_signature_equal): impl.
35145         * *: void is now a realy MonoType (instead of using NULL)
35146         
35147         * metadata.c (do_mono_metadata_parse_type): use
35148         mono_metadata_parse_type to parse void value.
35150 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
35152         * metadata.c, metadata.h: in the signature and method header store
35153         only the space required for holding the loca vars and incoming arguments.
35155 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
35157         * metadata.c (do_mono_metadata_parse_type): treat void like any
35158         other type (instead of assigning NULL);
35160 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
35162         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
35164 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
35166         * image.c (do_mono_image_open): added a cache for arrays.
35168 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
35170         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
35171         decode a single column from a row in a metadata table and changes
35172         to take advantage of it in the typedef locator (gives a nice speed up).
35173         Store offset info for function params.
35175 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
35177         * image.h (MONO_IMAGE_IS_CORLIB): removed 
35179 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
35181         * assembly.c: how could mono_assembly_close () had ever worked?
35182         * metadata.c, metadata.h: provide offset info for local vars.
35183         Implement mono_type_size () to take care of alignment as well
35184         as size (it was mono_field_type_size in cli/class.c before).
35186 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
35188         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
35190         * assembly.h (CORLIB_NAME): set to corlib.dll
35192         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
35194 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
35196         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
35197         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
35198         tokentype.h: massive namespace cleanup.
35200 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
35202         * metadata.h, metadata.c: decode exception clauses when parsing method header.
35204 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
35206         * metadata.c (mono_metadata_free_type): added check for type !=
35207         NULL (void) before calling mono_metadata_free_type()
35209 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
35211         * metadata.h, row_indexes.h: added header with enumerations to use
35212         to index in the columns from tables in metadata and to decode coded
35213         tokens: we should start using this instead of embedding magic numbers
35214         all over the code.
35216 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
35218         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
35219         Move metadata_t info from cli_image_info_t to MonoImage, where
35220         it's easily accessible. Changed all the uses accordingly.
35221         Added the method and class caches to MonoImage.
35222         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
35223         and mono_metadata_decode_value () signature to be more consistent
35224         with the other parse functions (and simplify code). Taken advantage
35225         of zero-length array allocation with GCC. Removed reduntant (and
35226         wrong) MonoFieldType struct and use MonoParam instead. Changed
35227         mono_metadata_parse_field_type () to use common code for parsing.
35228         Added mono_metadata_typedef_from_field () and
35229         mono_metadata_typedef_from_method () to lookup a typedef index from a
35230         field or method token.
35231         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
35233 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
35235         * metadata.c (mono_metadata_parse_field_type): Implement. 
35236         (do_mono_metadata_parse_type): Split engine from
35237         mono_metadata_parse_type, so that we can create smaller structures
35238         for things that just have one pointer to the MonoType (look at
35239         the MonoFieldType)
35241 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
35243         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
35244         as Jan Gray found out, it is incorrect. 
35246 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
35248         * assembly.c: Implement asssembly loading.  This loads an image
35249         and loads all the referenced assemblies.  Come to think of it, we
35250         could always do lazy loading of the assemblies. 
35252         * image.c (mono_image_open): Keep loaded images in a hashtable.
35254         * image.h (MonoImage): Add reference count.
35256 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
35258         * assembly.c (mono_assembly_open): Keep track of the file name in
35259         case the assembly has no ASSEMBLY table.
35261         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
35262         from get.c here.
35264 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
35266         * metadata.c, metadata.h: decode local vars in method header
35267         parse function. Change callers accordingly.
35269 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
35271         * metadata.h, cil-coff.h: protect against multiple inclusion.
35272         Added some new structures to hold information decoded from metadata:
35273         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
35274         and relevant decoding/free functions.
35275         * metadata.c: implement decoding functions. Add warning for out of bounds
35276         index in mono_metadata_locate(). Implement mono_get_method () to retreive
35277         all the info about a method signature and invocation. Remove check on
35278         uninitialized local var in parse_mh() and fix memory leak.
35280 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
35282         * metadata.h: More macros.
35284         * tokentype.h: New file.
35286 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
35288         * assembly.c: added a consistency check and initialize
35289         some structures with g_new0().
35290         * metadata.c: fixed a couple more bugs in table size computation
35291         and add other checks for out-of bound access to metadata.
35293 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
35295         * metatada.c: fix bugs computing table sizes. Spew a
35296         warning when index in string heap is out of bounds.
35298 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
35300         * metadata.h: Add a couple of macros to manipulate tokens. 
35302 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
35304         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
35305         cli_section_tables).
35307 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
35309         * metadata.c (mono_metadata_user_string): New function, provides
35310         access to the UserString heap. 
35312 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
35314         * metadata.c: Add inline documentation.
35316 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
35318         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
35319         files. 
35321 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
35323         * typeattr.h: New file, TypeAttribute flags. 
35325 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
35327         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
35328         mono_assembly_ensure_section): Section loading code.
35329         (load_section_tables): Load the sections.
35331         * mono/metadata/metadata.c (mono_metadata_locate_token,
35332         mono_metadata_locate): Functions to locate the information
35333         definition given a token or a table and an index.
35334         (mono_metadata_compute_table_bases): New.
35335         (compute_size): New function to compute the sizes of the various
35336         tables.
35338         * mono/metadata/metadata.h: Finish listing the different index
35339         types. 
35341         * mono/metadata/pedump.c: Improve to dump new information.
35343 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
35345         * mono/metadata/metadata.c: Entered all the tables matching
35346         Beta2. 
35348         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2